CMSIS-DSP: Improvements to test framework

pull/19/head
Christophe Favergeon 6 years ago
parent abdc8aa89f
commit aec1512af9

@ -217,6 +217,10 @@ target_sources(TestingLib PRIVATE ${TESTSRC})
target_sources(TestingLib PRIVATE testmain.cpp)
target_sources(TestingLib PRIVATE GeneratedSource/TestDesc.cpp)
if (BENCHMARK)
target_compile_definitions(TestingLib PUBLIC BENCHMARK)
endif()
target_sources(FrameworkLib PRIVATE ${FRAMEWORKSRC})

@ -7,6 +7,8 @@ import math
# Those patterns are used for tests and benchmarks.
# For tests, there is the need to add tests for saturation
# For benchmarks
NBSAMPLES=256
def writeTests(config,format):
@ -35,6 +37,12 @@ def writeTests(config,format):
config.writeReference(1, refsin,"Sin")
config.writeReference(1, sqrtvals,"Sqrt")
# For benchmarks
samples=np.random.randn(NBSAMPLES)
samples = np.abs(Tools.normalize(samples))
config.writeInput(1, samples,"Samples")
def writeTestsF32(config,format):
writeTests(config,format)
@ -53,6 +61,11 @@ def writeTestsF32(config,format):
v = np.exp(samples)
config.writeReference(1, v,"Exp")
# For benchmarks
samples=np.random.randn(NBSAMPLES)
samples = np.abs(Tools.normalize(samples))
config.writeInput(1, samples,"Samples")
def generatePatterns():
PATTERNDIR = os.path.join("Patterns","DSP","FastMath","FastMath")

@ -0,0 +1,514 @@
W
256
// 0.229346
0x3e6ad9c5
// 0.317871
0x3ea2c005
// 0.539515
0x3f0a1da7
// 0.515471
0x3f03f5ed
// 0.072483
0x3d947215
// 0.470191
0x3ef0bce0
// 0.125158
0x3e002976
// 0.152451
0x3e1c1c01
// 0.046505
0x3d3e7c0a
// 0.237037
0x3e72b9e1
// 0.351340
0x3eb3e2d4
// 0.021096
0x3cacd151
// 0.281335
0x3e900b24
// 0.421194
0x3ed7a6b7
// 0.295585
0x3e9756f5
// 0.116247
0x3dee1314
// 0.244595
0x3e7a7706
// 0.046466
0x3d3e5333
// 0.005163
0x3ba93018
// 0.270340
0x3e8a69f9
// 0.587708
0x3f167401
// 0.128616
0x3e03b3fc
// 0.263257
0x3e86c999
// 0.161139
0x3e250190
// 0.865254
0x3f5d8142
// 0.522318
0x3f05b69e
// 0.063564
0x3d822df4
// 0.231906
0x3e6d78ae
// 0.336115
0x3eac174f
// 0.787331
0x3f498e83
// 0.008095
0x3c049f8e
// 0.281524
0x3e9023ea
// 0.433306
0x3eddda53
// 0.121467
0x3df8c394
// 0.155060
0x3e1ec7ee
// 0.015555
0x3c7eda7d
// 0.540531
0x3f0a603a
// 0.240460
0x3e763b3b
// 0.390759
0x3ec8119d
// 0.109859
0x3de0fdd2
// 0.065409
0x3d85f53f
// 0.042729
0x3d2f04a5
// 0.267536
0x3e88fa6d
// 0.208468
0x3e55788a
// 0.090933
0x3dba3b00
// 0.416005
0x3ed4fea1
// 0.208062
0x3e550e29
// 0.334734
0x3eab6251
// 0.542418
0x3f0adbe9
// 0.339493
0x3eadd213
// 0.481016
0x3ef647bf
// 0.210925
0x3e57fcd2
// 0.072399
0x3d9445af
// 0.026656
0x3cda5e6e
// 0.456143
0x3ee98b90
// 0.421862
0x3ed7fe54
// 0.469191
0x3ef039d1
// 0.051290
0x3d52150c
// 0.206016
0x3e52f5f9
// 0.341917
0x3eaf0fc8
// 0.417111
0x3ed58f8c
// 0.208117
0x3e551c8b
// 0.051169
0x3d519694
// 0.090709
0x3db9c585
// 0.501386
0x3f005ad0
// 0.565912
0x3f10dfa1
// 0.450470
0x3ee6a3f8
// 0.148031
0x3e179554
// 0.157364
0x3e212428
// 0.155745
0x3e1f7bb1
// 0.791889
0x3f4ab942
// 0.115439
0x3dec6b6f
// 0.033406
0x3d08d4fe
// 0.385502
0x3ec5607d
// 0.203863
0x3e50c16b
// 0.182643
0x3e3b06d2
// 0.287897
0x3e93674b
// 0.137477
0x3e0cc6c7
// 0.399594
0x3ecc978f
// 0.320140
0x3ea3e971
// 0.475389
0x3ef36633
// 0.389674
0x3ec7835b
// 0.194308
0x3e46f8b0
// 0.153794
0x3e1d7c2b
// 0.161853
0x3e25bcca
// 0.022995
0x3cbc5f53
// 0.051906
0x3d549b71
// 0.403706
0x3eceb283
// 0.083056
0x3daa1944
// 0.223973
0x3e655941
// 0.341773
0x3eaefce1
// 0.199292
0x3e4c131e
// 0.018539
0x3c97df09
// 0.251224
0x3e80a068
// 0.118704
0x3df31b2c
// 0.011826
0x3c41c2fb
// 0.288942
0x3e93f03e
// 0.549010
0x3f0c8be8
// 0.458534
0x3eeac4f5
// 0.758406
0x3f4226e3
// 0.233091
0x3e6eaf49
// 0.013495
0x3c5d18d5
// 0.241441
0x3e773c34
// 0.064284
0x3d83a763
// 0.080815
0x3da58237
// 0.023348
0x3cbf443f
// 0.195072
0x3e47c0e7
// 0.395185
0x3eca55bc
// 0.626161
0x3f204c11
// 0.161876
0x3e25c2c8
// 0.100401
0x3dcd9ecf
// 0.073296
0x3d961c42
// 0.378244
0x3ec1a93b
// 0.548785
0x3f0c7d26
// 0.121509
0x3df8d9f2
// 0.213695
0x3e5ad2fa
// 0.100762
0x3dce5c17
// 0.211049
0x3e581d43
// 0.552555
0x3f0d7445
// 0.222451
0x3e63ca38
// 0.463790
0x3eed75dd
// 0.297244
0x3e983051
// 0.471399
0x3ef15b3c
// 0.270163
0x3e8a52bf
// 0.535461
0x3f0913fa
// 0.029032
0x3cedd3ab
// 0.124952
0x3dffe6d7
// 0.630132
0x3f215050
// 0.134555
0x3e09c8c0
// 0.055561
0x3d63944a
// 0.086077
0x3db048f1
// 0.566396
0x3f10ff4e
// 0.239414
0x3e752909
// 0.554531
0x3f0df5c2
// 0.375557
0x3ec04910
// 0.537672
0x3f09a4de
// 0.258006
0x3e841955
// 0.820482
0x3f520b20
// 0.437760
0x3ee0220d
// 0.170851
0x3e2ef38a
// 0.162432
0x3e265496
// 0.031173
0x3cff5f03
// 0.210317
0x3e575d4f
// 0.174746
0x3e32f0a3
// 0.265009
0x3e87af42
// 0.009065
0x3c148742
// 0.568402
0x3f1182c7
// 0.078607
0x3da0fc88
// 0.456062
0x3ee98100
// 1.000000
0x3f800000
// 0.596854
0x3f18cb65
// 0.327206
0x3ea7878f
// 0.097829
0x3dc85a8e
// 0.088605
0x3db57657
// 0.539930
0x3f0a38db
// 0.252438
0x3e813f97
// 0.043505
0x3d32320a
// 0.135316
0x3e0a903b
// 0.159938
0x3e23c6de
// 0.248616
0x3e7e951f
// 0.179684
0x3e37fefa
// 0.022639
0x3cb97513
// 0.461206
0x3eec2324
// 0.183896
0x3e3c4f1f
// 0.595100
0x3f185872
// 0.323411
0x3ea59631
// 0.154443
0x3e1e2665
// 0.238524
0x3e743f8e
// 0.140939
0x3e10524a
// 0.374671
0x3ebfd4d6
// 0.440332
0x3ee1732c
// 0.153500
0x3e1d2f0b
// 0.072764
0x3d950581
// 0.103979
0x3dd4f311
// 0.160203
0x3e240c41
// 0.665157
0x3f2a47b8
// 0.394419
0x3ec9f151
// 0.171461
0x3e2f936d
// 0.383816
0x3ec48392
// 0.183939
0x3e3c5a7c
// 0.044352
0x3d35aa16
// 0.029867
0x3cf4abe8
// 0.061912
0x3d7d96ee
// 0.042295
0x3d2d3e08
// 0.642930
0x3f24970f
// 0.601112
0x3f19e27b
// 0.236431
0x3e721b15
// 0.247909
0x3e7ddbc7
// 0.113277
0x3de7fdda
// 0.789180
0x3f4a07b0
// 0.054229
0x3d5e1eb7
// 0.178625
0x3e36e998
// 0.539971
0x3f0a3b82
// 0.278242
0x3e8e75b9
// 0.322622
0x3ea52ec6
// 0.201152
0x3e4dfac6
// 0.204389
0x3e514b72
// 0.078587
0x3da0f26e
// 0.398954
0x3ecc43ad
// 0.552490
0x3f0d6ffa
// 0.202093
0x3e4ef187
// 0.294667
0x3e96de9c
// 0.193027
0x3e45a8ce
// 0.220173
0x3e61750c
// 0.158661
0x3e227807
// 0.379319
0x3ec23614
// 0.156683
0x3e207193
// 0.285534
0x3e92318a
// 0.306969
0x3e9d2b12
// 0.215863
0x3e5d0b33
// 0.505708
0x3f017610
// 0.756081
0x3f418e84
// 0.489898
0x3efad3ee
// 0.016400
0x3c86584d
// 0.090787
0x3db9eea9
// 0.190761
0x3e4356eb
// 0.039224
0x3d20a9dd
// 0.040887
0x3d277991
// 0.101222
0x3dcf4d69
// 0.065349
0x3d85d5a4
// 0.030954
0x3cfd9275
// 0.530377
0x3f07c6c3
// 0.605336
0x3f1af74f
// 0.047432
0x3d42483d
// 0.184160
0x3e3c946e
// 0.114213
0x3de9e87b
// 0.468089
0x3eefa968
// 0.765889
0x3f441154
// 0.543042
0x3f0b04c9
// 0.125136
0x3e0023b1
// 0.778824
0x3f476100
// 0.015917
0x3c8264a7
// 0.426376
0x3eda4df4
// 0.339040
0x3ead9699
// 0.301797
0x3e9a851a
// 0.136213
0x3e0b7b61
// 0.395489
0x3eca7d94
// 0.106491
0x3dda182a
// 0.581633
0x3f14e5e5
// 0.022355
0x3cb72233
// 0.330466
0x3ea932db
// 0.156320
0x3e201249
// 0.410808
0x3ed2556b
// 0.167981
0x3e2c034d
// 0.187416
0x3e3fe9fd
// 0.216126
0x3e5d501f
// 0.734083
0x3f3becdf
// 0.003676
0x3b70ed55
// 0.470462
0x3ef0e06e
// 0.167474
0x3e2b7e3b
// 0.261879
0x3e861505
// 0.381913
0x3ec38a14
// 0.049370
0x3d4a37d5
// 0.244249
0x3e7a1c7d
// 0.502700
0x3f00b0f7
// 0.095549
0x3dc3af6b

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -986,9 +986,9 @@ group Root {
Formula "NB"
}
Pattern SAMPLES_Q31_ID : Samples1_q31.txt
Pattern SAMPLES_Q31_ID : Samples4_q31.txt
Pattern SAMPLES_Q15_ID : Samples3_q15.txt
Pattern SAMPLES_Q7_ID : Samples4_q7.txt
Pattern SAMPLES_Q7_ID : Samples5_q7.txt
Output OUT_SAMPLES_Q31_ID : Output
Params PARAM1_ID = {
@ -1014,9 +1014,9 @@ group Root {
Formula "NB"
}
Pattern SAMPLES_Q15_ID : Samples1_q15.txt
Pattern SAMPLES_Q31_ID : Samples3_q31.txt
Pattern SAMPLES_Q7_ID : Samples4_q7.txt
Pattern SAMPLES_Q15_ID : Samples3_q15.txt
Pattern SAMPLES_Q31_ID : Samples4_q31.txt
Pattern SAMPLES_Q7_ID : Samples5_q7.txt
Output OUT_SAMPLES_Q15_ID : Output
Params PARAM1_ID = {
@ -1042,9 +1042,9 @@ group Root {
Formula "NB"
}
Pattern SAMPLES_Q7_ID : Samples1_q7.txt
Pattern SAMPLES_Q31_ID : Samples3_q31.txt
Pattern SAMPLES_Q15_ID : Samples4_q15.txt
Pattern SAMPLES_Q7_ID : Samples5_q7.txt
Pattern SAMPLES_Q31_ID : Samples4_q31.txt
Pattern SAMPLES_Q15_ID : Samples3_q15.txt
Output OUT_SAMPLES_Q7_ID : Output
Params PARAM1_ID = {

@ -139,6 +139,7 @@ class HTMLFormatter:
print("<td>Name</td>")
print("<td>ID</td>")
print("<td>Status</td>")
print("<td>Params</td>")
print("<td>Cycles</td>")
print("</tr>")
self.nb = self.nb + 1
@ -155,10 +156,13 @@ class HTMLFormatter:
print("<td><pre>%s</pre></td>" % message)
print("<td>%d</td>" % theId)
print("<td>%s</td>" % p)
if params:
print("<td>%s</td>\n" % (params))
else:
print("<td></td>\n")
print("<td>%d</td>" % cycles)
print("</tr>")
#if params:
# print("%s %s" % (ident,params))
if passed != 1:
print("<tr><td colspan=4><font color=\"red\">%s at line %d</font></td></tr>" % (errorStr(theError), theLine))

@ -9,7 +9,11 @@
#include <stdlib.h>
using namespace std;
#ifdef BENCHMARK
#define MEMSIZE 300000
#else
#define MEMSIZE 230000
#endif
// Dummy (will be generated by python scripts)
// char* array describing the tests and the input patterns.

Loading…
Cancel
Save