0%

nuclei riscv isa 测试

nuclei sdk

目录结构

1
2
3
4
5
6
7
8
9
10
11
nuclei-sdk
├── Build #build 生成目录
├── Components # 空目录
├── NMSIS # dsp nn的静态库和头文件
├── OS # FreeRTOS RTThread ucosii 头文件及源码目录
├── SoC # demosoc gd32vf103 bsp 头文件及源码目录
├── application # baremental FreeRTOS RTThread ucosii 下跑的app 源码
├── doc # 文档
├── logs # 测试框架生成目录
├── test # riscv 指令集 中断 fpu pmp timer 等相关测试项, 在baremental下的测试
└── tools # 测试框架脚本

编译baremental app

例子

1
make PROGRAM=application/baremetal/helloworld SOC=demosoc BOARD=nuclei_fpga_eval all

运行baremental app

例子

1
nuclei_qemu/bin/qemu-system-riscv64  -M nuclei_n -cpu nuclei-ux600 -nodefaults -nographic -serial stdio -kernel application/baremetal/helloworld/helloworld.elf

riscv isa 测试框架

指test下的对riscv isa的测试

主要的文件在 test/core/* 下.
编译时根据 指定的 SOC 指定使用的bsp的代码
如SOC 指定 demosoc
使用的 SoC/demosoc/Common/ 下的源文件
BOARD指定为nuclei_fpga_eval
引用的头文件 SoC/demosoc/Board/nuclei_fpga_eval

1
2
3
4
5
"-I/home/liguang/work_space/nuclei-sdk/test/core",
"-I/home/liguang/work_space/nuclei-sdk/test",
"-I/home/liguang/work_space/nuclei-sdk/NMSIS/Core/Include",
"-I/home/liguang/work_space/nuclei-sdk/SoC/demosoc/Board/nuclei_fpga_eval/Include",
"-I/home/liguang/work_space/nuclei-sdk/SoC/demosoc/Common/Include"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
SoC/demosoc/Common/Source/GCC/intexc_demosoc.S, # 中断 trap 上下文切换 相关
SoC/demosoc/Common/Source/GCC/startup_demosoc.S, #bsp 初始启动相关源码
SoC/demosoc/Common/Source/Drivers/demosoc_gpio.c, # gpio
SoC/demosoc/Common/Source/Drivers/demosoc_uart.c, # uart
SoC/demosoc/Common/Source/Stubs/newlib/clock_getres.c, #clock time
SoC/demosoc/Common/Source/Stubs/newlib/clock_gettime.c,
SoC/demosoc/Common/Source/Stubs/newlib/clock_settime.c,
SoC/demosoc/Common/Source/Stubs/newlib/close.c, #文件相关, 大部分是空的桩函数
SoC/demosoc/Common/Source/Stubs/newlib/execve.c,
SoC/demosoc/Common/Source/Stubs/newlib/exit.c,
SoC/demosoc/Common/Source/Stubs/newlib/fork.c,
SoC/demosoc/Common/Source/Stubs/newlib/fstat.c,
SoC/demosoc/Common/Source/Stubs/newlib/getpid.c,
SoC/demosoc/Common/Source/Stubs/newlib/gettimeofday.c,
SoC/demosoc/Common/Source/Stubs/newlib/isatty.c,
SoC/demosoc/Common/Source/Stubs/newlib/kill.c,
SoC/demosoc/Common/Source/Stubs/newlib/link.c,
SoC/demosoc/Common/Source/Stubs/newlib/lseek.c,
SoC/demosoc/Common/Source/Stubs/newlib/open.c,
SoC/demosoc/Common/Source/Stubs/newlib/read.c,
SoC/demosoc/Common/Source/Stubs/newlib/sbrk.c,
SoC/demosoc/Common/Source/Stubs/newlib/stat.c,
SoC/demosoc/Common/Source/Stubs/newlib/times.c,
SoC/demosoc/Common/Source/Stubs/newlib/unlink.c,
SoC/demosoc/Common/Source/Stubs/newlib/wait.c,
SoC/demosoc/Common/Source/Stubs/newlib/write.c,
SoC/demosoc/Common/Source/demosoc_common.c, # delay_1ms get_cpu_freq measure_cpu_freq
# 大部分为startup.S 中的c 函数实现 SystemInit system_default_exception_handler _premain_init _postmain_fini 等
SoC/demosoc/Common/Source/system_demosoc.c,
test/core/main.c,
test/core/test_atomic.c,
test/core/test_compiler.c,
test/core/test_csr.c,
test/core/test_eclic.c,
test/core/test_fpu.c,
test/core/test_pmp.c,
test/core/test_timer.c

执行原理

ctest_main
从 .data.ctest 内存开始的地方进行扫描, 扫描 magic 为 CTEST_IMPL_MAGIC 的 struct ctest 数据
执行其 run 方法.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
                    if (test->setup && *test->setup) (*test->setup)(test->data);
if (test->data)
test->run(test->data);
else
test->run();

#define CTEST(sname, tname) CTEST_IMPL_CTEST(sname, tname, 0)
#define CTEST_IMPL_CTEST(sname, tname, tskip) \
static void CTEST_IMPL_FNAME(sname, tname)(void); \
CTEST_IMPL_STRUCT(sname, tname, tskip, NULL, NULL, NULL); \
static void CTEST_IMPL_FNAME(sname, tname)(void)

#define CTEST_IMPL_SECTION __attribute__ ((used, section (".data.ctest"), aligned(1)))

#define CTEST_IMPL_STRUCT(sname, tname, tskip, tdata, tsetup, tteardown) \
static struct ctest CTEST_IMPL_TNAME(sname, tname) CTEST_IMPL_SECTION = { \
.ssname=#sname, \
.ttname=#tname, \
.run = CTEST_IMPL_FNAME(sname, tname), \
.data = tdata, \
.setup = (ctest_setup_func*) tsetup, \
.teardown = (ctest_teardown_func*) tteardown, \
.skip = tskip, \
.magic = CTEST_IMPL_MAGIC }
ex:
CTEST(pmp, pmpreg)
run = ctest_pmp_pmpreg_run

跑测

芯来自动测试框架

ci 构建
.gitlab-ci.yml

tools/script 下封装了大量跑测全部工程的脚本.
待了解, 不是本次调研的重点.

如根据 appcfg hwcfg 选择指定的SOC/BOARD/CORE 跑测对应的 application

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"run_config": {
"target" : "qemu",
"hardware" : {
"baudrate": 115200,
"timeout": 60
},
"qemu" : {
"timeout": 60
}
},
"build_target": "clean all",
"build_config": {
"SOC": "demosoc",
"BOARD": "nuclei_fpga_eval",
"CORE": "ux600",
"DOWNLOAD": "ilm",
"ARCH_EXT": ""
},
1
2
3
4
# build 构建脚本
python3 tools/scripts/nsdk_cli/nsdk_bench.py --appcfg tools/scripts/nsdk_cli/configs/application.json --hwcfg tools/scripts/nsdk_cli/configs/nuclei_fpga_eval_qemu.json --parallel="-j" --logdir logs/nuclei_fpga_eval_ci
# 跑测脚本
python3 tools/scripts/nsdk_cli/nsdk_bench.py --appcfg tools/scripts/nsdk_cli/configs/application.json --hwcfg tools/scripts/nsdk_cli/configs/nuclei_fpga_eval_qemu.json --parallel="-j" --logdir logs/nuclei_fpga_eval_ci --run

上述跑测是用qemu测的

生成的报告

部分报告
report.md

xlspike 跑测

1
2
3
4
5
6
7
tools/scripts/misc/dobench/run.sh

...
Build command: make -C application/baremetal/benchmark/coremark SOC=demosoc BOARD=nuclei_fpga_eval DOWNLOAD=ilm CPU_SERIES=200 SIMULATION=1 SIMU=xlspike CORE=n203e showflags

Run application on xlspike
...

这个脚本也是用 nsdk_bench.py 跑的, 只是模拟器换成了 xlspike

1
2
3
4
python3 $NSDK_BENCH_PY --appcfg $appcfg --hwcfg $hwcfg --parallel=-j --logdir $logdir --make_options \"$SIMU_OPTS 
$mkopts\" $RUN_OPTS

python3 /home/liguang/work_space/nuclei-sdk/tools/scripts/nsdk_cli/nsdk_bench.py --appcfg /home/liguang/work_space/nuclei-sdk/tools/scripts/misc/dobench/app.json --hwcfg /home/liguang/work_space/nuclei-sdk/tools/scripts/misc/dobench/bench_nx600.json --parallel=-j --logdir /home/liguang/work_space/nuclei-sdk/tools/scripts/misc/dobench/gen/0.3.8-1-g9cfda9b1fa-dirty/dobench//barebench/nx600 --make_options "SIMULATION=1 SIMU=xlspike " --run --run_target xlspike

总共为 n200/n300/n600/n900/nx600/nx900 的 application/baremetal/benchmark下的 coremark dhrystone whetstone
编译了json 配置的 指令集的elf, 并用nuclei的 xl_spike 进行跑测.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"rv32emc": {"CORE":"n203e"},
"rv32imac": {"CORE":"n203"},
"rv32imacb": {"CORE":"n203", "ARCH_EXT":"b"}
...
"rv32imac": {"CORE":"n300"},
"rv32imacb": {"CORE":"n300", "ARCH_EXT":"b"},
"rv32imacbp": {"CORE":"n300", "ARCH_EXT":"bp"},
"rv32imafc": {"CORE":"n300f", "ARCH_EXT":""},
"rv32imafcb": {"CORE":"n300f", "ARCH_EXT":"b"},
"rv32imafcp": {"CORE":"n300f", "ARCH_EXT":"p"},
"rv32imafcbp": {"CORE":"n300f", "ARCH_EXT":"bp"},
"rv32imafdc": {"CORE":"n300fd", "ARCH_EXT":""},
"rv32imafdcb": {"CORE":"n300fd", "ARCH_EXT":"b"},
"rv32imafdcp": {"CORE":"n300fd", "ARCH_EXT":"p"},
"rv32imafdcbp": {"CORE":"n300fd", "ARCH_EXT":"bp"}
...
"rv64imac": {"CORE":"nx600"},
"rv64imacb": {"CORE":"nx600", "ARCH_EXT":"b"},
"rv64imacbp": {"CORE":"nx600", "ARCH_EXT":"bp"},
"rv64imafc": {"CORE":"nx600f", "ARCH_EXT":""},
"rv64imafcb": {"CORE":"nx600f", "ARCH_EXT":"b"},
"rv64imafcp": {"CORE":"nx600f", "ARCH_EXT":"p"},
"rv64imafcbp": {"CORE":"nx600f", "ARCH_EXT":"bp"},
"rv64imafdc": {"CORE":"nx600fd", "ARCH_EXT":""},
"rv64imafdcb": {"CORE":"nx600fd", "ARCH_EXT":"b"},
"rv64imafdcp": {"CORE":"nx600fd", "ARCH_EXT":"p"},
"rv64imafdcbp": {"CORE":"nx600fd", "ARCH_EXT":"bp"}

其中的一条指令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Build application application/baremetal/benchmark/dhrystone, with target: clean
Build command: make -j -C application/baremetal/benchmark/dhrystone SOC=demosoc BOARD=nuclei_fpga_eval DOWNLOAD=ilm CPU_SERIES=600 SIMULATION=1 SIMU=xlspike DHRY_MODE=inline CORE=nx600fd ARCH_EXT=bp clean
Build command return value: 0
Build application application/baremetal/benchmark/dhrystone, with target: dasm
Build command: make -j -C application/baremetal/benchmark/dhrystone SOC=demosoc BOARD=nuclei_fpga_eval DOWNLOAD=ilm CPU_SERIES=600 SIMULATION=1 SIMU=xlspike DHRY_MODE=inline CORE=nx600fd ARCH_EXT=bp dasm
Build command return value: 0
Build application application/baremetal/benchmark/dhrystone, with target: showtoolver
Build command: make -C application/baremetal/benchmark/dhrystone SOC=demosoc BOARD=nuclei_fpga_eval DOWNLOAD=ilm CPU_SERIES=600 SIMULATION=1 SIMU=xlspike DHRY_MODE=inline CORE=nx600fd ARCH_EXT=bp showtoolver
Build command return value: 0
Build application application/baremetal/benchmark/dhrystone, with target: showflags
Build command: make -C application/baremetal/benchmark/dhrystone SOC=demosoc BOARD=nuclei_fpga_eval DOWNLOAD=ilm CPU_SERIES=600 SIMULATION=1 SIMU=xlspike DHRY_MODE=inline CORE=nx600fd ARCH_EXT=bp showflags
Build command return value: 0
Build application application/baremetal/benchmark/dhrystone, time cost 0.73 seconds, passed: True
Run application on xlspike
xl_spike doesn't exist in PATH, please check!

   * - dasm

     - build and dissemble application with selected configuration
  - add ``showflags`` target to show compiling information and flags
- add ``showtoolver`` target to show tool version used
     

总共生成的文件列表:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
├── allcfg.json
├── allrst.json
├── app_failed.txt
├── app_passed.txt
├── n200
│   ├── app_failed.txt
│   ├── app_passed.txt
│   ├── appcfg.json
│   ├── application
│   │   └── baremetal
│   │   └── benchmark
│   │   ├── coremark
│   │   │   ├── rv32emc
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imac
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   └── rv32imacb
│   │   │   ├── build.log
│   │   │   ├── coremark.dasm
│   │   │   ├── coremark.elf
│   │   │   ├── coremark.map
│   │   │   └── coremark.verilog
│   │   ├── dhrystone
│   │   │   ├── rv32emc
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imac
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   └── rv32imacb
│   │   │   ├── build.log
│   │   │   ├── dhrystone.dasm
│   │   │   ├── dhrystone.elf
│   │   │   ├── dhrystone.map
│   │   │   └── dhrystone.verilog
│   │   └── whetstone
│   │   ├── rv32emc
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imac
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   └── rv32imacb
│   │   ├── build.log
│   │   ├── whetstone.dasm
│   │   ├── whetstone.elf
│   │   ├── whetstone.map
│   │   └── whetstone.verilog
│   ├── hwcfg.json
│   ├── mergedcfg.json
│   ├── report.html
│   ├── report.md
│   ├── result.csv
│   ├── result.json
│   ├── runresult.json
│   ├── runresult.xlsx
│   ├── runresult.xlsx.csvdict.json
│   └── runresult.xlsx.csvtable.json
├── n300
│   ├── app_failed.txt
│   ├── app_passed.txt
│   ├── appcfg.json
│   ├── application
│   │   └── baremetal
│   │   └── benchmark
│   │   ├── coremark
│   │   │   ├── rv32imac
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imacb
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imacbp
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imafc
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imafcb
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imafcbp
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imafcp
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imafdc
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imafdcb
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imafdcbp
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   └── rv32imafdcp
│   │   │   ├── build.log
│   │   │   ├── coremark.dasm
│   │   │   ├── coremark.elf
│   │   │   ├── coremark.map
│   │   │   └── coremark.verilog
│   │   ├── dhrystone
│   │   │   ├── rv32imac
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imacb
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imacbp
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imafc
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imafcb
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imafcbp
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imafcp
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imafdc
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imafdcb
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imafdcbp
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   └── rv32imafdcp
│   │   │   ├── build.log
│   │   │   ├── dhrystone.dasm
│   │   │   ├── dhrystone.elf
│   │   │   ├── dhrystone.map
│   │   │   └── dhrystone.verilog
│   │   └── whetstone
│   │   ├── rv32imac
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imacb
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imacbp
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imafc
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imafcb
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imafcbp
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imafcp
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imafdc
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imafdcb
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imafdcbp
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   └── rv32imafdcp
│   │   ├── build.log
│   │   ├── whetstone.dasm
│   │   ├── whetstone.elf
│   │   ├── whetstone.map
│   │   └── whetstone.verilog
│   ├── hwcfg.json
│   ├── mergedcfg.json
│   ├── report.html
│   ├── report.md
│   ├── result.csv
│   ├── result.json
│   ├── runresult.json
│   ├── runresult.xlsx
│   ├── runresult.xlsx.csvdict.json
│   └── runresult.xlsx.csvtable.json
├── n600
│   ├── app_failed.txt
│   ├── app_passed.txt
│   ├── appcfg.json
│   ├── application
│   │   └── baremetal
│   │   └── benchmark
│   │   ├── coremark
│   │   │   ├── rv32imac
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imacb
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imacbp
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imafc
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imafcb
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imafcbp
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imafcp
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imafdc
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imafdcb
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imafdcbp
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   └── rv32imafdcp
│   │   │   ├── build.log
│   │   │   ├── coremark.dasm
│   │   │   ├── coremark.elf
│   │   │   ├── coremark.map
│   │   │   └── coremark.verilog
│   │   ├── dhrystone
│   │   │   ├── rv32imac
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imacb
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imacbp
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imafc
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imafcb
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imafcbp
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imafcp
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imafdc
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imafdcb
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imafdcbp
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   └── rv32imafdcp
│   │   │   ├── build.log
│   │   │   ├── dhrystone.dasm
│   │   │   ├── dhrystone.elf
│   │   │   ├── dhrystone.map
│   │   │   └── dhrystone.verilog
│   │   └── whetstone
│   │   ├── rv32imac
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imacb
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imacbp
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imafc
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imafcb
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imafcbp
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imafcp
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imafdc
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imafdcb
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imafdcbp
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   └── rv32imafdcp
│   │   ├── build.log
│   │   ├── whetstone.dasm
│   │   ├── whetstone.elf
│   │   ├── whetstone.map
│   │   └── whetstone.verilog
│   ├── hwcfg.json
│   ├── mergedcfg.json
│   ├── report.html
│   ├── report.md
│   ├── result.csv
│   ├── result.json
│   ├── runresult.json
│   ├── runresult.xlsx
│   ├── runresult.xlsx.csvdict.json
│   └── runresult.xlsx.csvtable.json
├── n900
│   ├── app_failed.txt
│   ├── app_passed.txt
│   ├── appcfg.json
│   ├── application
│   │   └── baremetal
│   │   └── benchmark
│   │   ├── coremark
│   │   │   ├── rv32imac
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imacb
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imacbp
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imafc
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imafcb
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imafcbp
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imafcp
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imafdc
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imafdcb
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv32imafdcbp
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   └── rv32imafdcp
│   │   │   ├── build.log
│   │   │   ├── coremark.dasm
│   │   │   ├── coremark.elf
│   │   │   ├── coremark.map
│   │   │   └── coremark.verilog
│   │   ├── dhrystone
│   │   │   ├── rv32imac
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imacb
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imacbp
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imafc
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imafcb
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imafcbp
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imafcp
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imafdc
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imafdcb
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv32imafdcbp
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   └── rv32imafdcp
│   │   │   ├── build.log
│   │   │   ├── dhrystone.dasm
│   │   │   ├── dhrystone.elf
│   │   │   ├── dhrystone.map
│   │   │   └── dhrystone.verilog
│   │   └── whetstone
│   │   ├── rv32imac
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imacb
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imacbp
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imafc
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imafcb
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imafcbp
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imafcp
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imafdc
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imafdcb
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv32imafdcbp
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   └── rv32imafdcp
│   │   ├── build.log
│   │   ├── whetstone.dasm
│   │   ├── whetstone.elf
│   │   ├── whetstone.map
│   │   └── whetstone.verilog
│   ├── hwcfg.json
│   ├── mergedcfg.json
│   ├── report.html
│   ├── report.md
│   ├── result.csv
│   ├── result.json
│   ├── runresult.json
│   ├── runresult.xlsx
│   ├── runresult.xlsx.csvdict.json
│   └── runresult.xlsx.csvtable.json
├── nx600
│   ├── app_failed.txt
│   ├── app_passed.txt
│   ├── appcfg.json
│   ├── application
│   │   └── baremetal
│   │   └── benchmark
│   │   ├── coremark
│   │   │   ├── rv64imac
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv64imacb
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv64imacbp
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv64imafc
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv64imafcb
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv64imafcbp
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv64imafcp
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv64imafdc
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv64imafdcb
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv64imafdcbp
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   └── rv64imafdcp
│   │   │   ├── build.log
│   │   │   ├── coremark.dasm
│   │   │   ├── coremark.elf
│   │   │   ├── coremark.map
│   │   │   └── coremark.verilog
│   │   ├── dhrystone
│   │   │   ├── rv64imac
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv64imacb
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv64imacbp
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv64imafc
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv64imafcb
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv64imafcbp
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv64imafcp
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv64imafdc
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv64imafdcb
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv64imafdcbp
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   └── rv64imafdcp
│   │   │   ├── build.log
│   │   │   ├── dhrystone.dasm
│   │   │   ├── dhrystone.elf
│   │   │   ├── dhrystone.map
│   │   │   └── dhrystone.verilog
│   │   └── whetstone
│   │   ├── rv64imac
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv64imacb
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv64imacbp
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv64imafc
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv64imafcb
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv64imafcbp
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv64imafcp
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv64imafdc
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv64imafdcb
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv64imafdcbp
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   └── rv64imafdcp
│   │   ├── build.log
│   │   ├── whetstone.dasm
│   │   ├── whetstone.elf
│   │   ├── whetstone.map
│   │   └── whetstone.verilog
│   ├── hwcfg.json
│   ├── mergedcfg.json
│   ├── report.html
│   ├── report.md
│   ├── result.csv
│   ├── result.json
│   ├── runresult.json
│   ├── runresult.xlsx
│   ├── runresult.xlsx.csvdict.json
│   └── runresult.xlsx.csvtable.json
├── nx900
│   ├── app_failed.txt
│   ├── app_passed.txt
│   ├── appcfg.json
│   ├── application
│   │   └── baremetal
│   │   └── benchmark
│   │   ├── coremark
│   │   │   ├── rv64imac
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv64imacb
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv64imacbp
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv64imafc
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv64imafcb
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv64imafcbp
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv64imafcp
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv64imafdc
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv64imafdcb
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   ├── rv64imafdcbp
│   │   │   │   ├── build.log
│   │   │   │   ├── coremark.dasm
│   │   │   │   ├── coremark.elf
│   │   │   │   ├── coremark.map
│   │   │   │   └── coremark.verilog
│   │   │   └── rv64imafdcp
│   │   │   ├── build.log
│   │   │   ├── coremark.dasm
│   │   │   ├── coremark.elf
│   │   │   ├── coremark.map
│   │   │   └── coremark.verilog
│   │   ├── dhrystone
│   │   │   ├── rv64imac
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv64imacb
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv64imacbp
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv64imafc
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv64imafcb
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv64imafcbp
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv64imafcp
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv64imafdc
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv64imafdcb
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   ├── rv64imafdcbp
│   │   │   │   ├── build.log
│   │   │   │   ├── dhrystone.dasm
│   │   │   │   ├── dhrystone.elf
│   │   │   │   ├── dhrystone.map
│   │   │   │   └── dhrystone.verilog
│   │   │   └── rv64imafdcp
│   │   │   ├── build.log
│   │   │   ├── dhrystone.dasm
│   │   │   ├── dhrystone.elf
│   │   │   ├── dhrystone.map
│   │   │   └── dhrystone.verilog
│   │   └── whetstone
│   │   ├── rv64imac
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv64imacb
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv64imacbp
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv64imafc
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv64imafcb
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv64imafcbp
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv64imafcp
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv64imafdc
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv64imafdcb
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   ├── rv64imafdcbp
│   │   │   ├── build.log
│   │   │   ├── whetstone.dasm
│   │   │   ├── whetstone.elf
│   │   │   ├── whetstone.map
│   │   │   └── whetstone.verilog
│   │   └── rv64imafdcp
│   │   ├── build.log
│   │   ├── whetstone.dasm
│   │   ├── whetstone.elf
│   │   ├── whetstone.map
│   │   └── whetstone.verilog
│   ├── hwcfg.json
│   ├── mergedcfg.json
│   ├── report.html
│   ├── report.md
│   ├── result.csv
│   ├── result.json
│   ├── runresult.json
│   ├── runresult.xlsx
│   ├── runresult.xlsx.csvdict.json
│   └── runresult.xlsx.csvtable.json
├── report.html
├── report.md
├── result.csv
├── runresult.json
├── runresult.xlsx
├── runresult.xlsx.csvdict.json
└── runresult.xlsx.csvtable.json

riscv-tests

https://github.com/riscv-software-src/riscv-tests

目录结构

1
2
3
4
5
6
├── benchmarks # benchmarks 
├── debug # cpu gdb 测试环境
├── env #python env 环境
├── isa # 指令集测试
├── mt # 矩阵乘法测试
└── target # 生成目录

gdb 测试环境

debug 下的测试主要是针对cpu本身的测试, cpu 设置好初始环境后进行loop, 然后通过gdb 执行对应的汇编指令跑测, 判断测试结构是否符合预期.

这部分主要包含两个部分:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
targets
├── RISC-V
│ ├── __pycache__
│ │ ├── spike32.cpython-39.pyc
│ │ └── spike64.cpython-39.pyc
│ ├── spike-1.cfg
│ ├── spike-2-hwthread.cfg
│ ├── spike-2.cfg
│ ├── spike-multi.cfg
│ ├── spike-multi.py
│ ├── spike32-2-hwthread.py
│ ├── spike32-2.py
│ ├── spike32.lds
│ ├── spike32.py
│ ├── spike64-2-hwthread.py
│ ├── spike64-2-rtos.py
│ ├── spike64-2.py
│ ├── spike64.lds
│ └── spike64.py
└── SiFive
├── Freedom
│ ├── E300.py
│ ├── Freedom.cfg
│ ├── Freedom.lds
│ ├── U500.py
│ └── U500Sim.py
├── HiFive1-flash.lds
├── HiFive1-flash.py
├── HiFive1.cfg
├── HiFive1.lds
├── HiFive1.py
├── HiFiveUnleashed-flash.lds
├── HiFiveUnleashed-flash.py
├── HiFiveUnleashed.cfg
├── HiFiveUnleashed.lds
├── HiFiveUnleashed.py
└── HiFiveUnleashed_setup.bin

模拟运行:

通过openocd + spike 测试

https://github.com/riscv-software-src/riscv-isa-sim

1
2
3
4
5
6
7
8
9
10
$ spike --rbb-port=9824 -m0x10100000:0x20000 rot13-64
Listening for remote bitbang connection on port 9824.

$ openocd -f spike.cfg
Open On-Chip Debugger 0.10.0-dev-00002-gc3b344d (2017-06-08-12:14)
...
riscv.cpu: target state: halted

$ riscv64-unknown-elf-gdb
target remote localhost:3333

有条件下厂商需要定制 riscv 公版的spike, 如芯来的为 xl_spike, 没找到源码

跑测例子

1
2
3
4
5
6
./gdbserver.py ./targets/RISC-V/spike64.py MemTest8
Using $misa from hart definition: 0x8000000000141125
[MemTest8] Starting > logs/20230226-170843-spike64-MemTest8.log
[MemTest8] pass in 2.26s
::::::::::::::::::::::::::::[ ran 1 tests in 2s ]:::::::::::::::::::::::::::::
1 tests returned pass

解析:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class SimpleMemoryTest(GdbTest):
def access_test(self, size, data_type):
assertEqual(self.gdb.p(f"sizeof({data_type})"), size)
a = 0x86753095555aaaa & ((1<<(size*8))-1)
b = 0xdeadbeef12345678 & ((1<<(size*8))-1)
addrA = self.hart.ram
addrB = self.hart.ram + self.hart.ram_size - size
self.gdb.p(f"*(({data_type}*)0x{addrA:x}) = 0x{a:x}") # 设置 *addrA = a
self.gdb.p(f"*(({data_type}*)0x{addrB:x}) = 0x{b:x}") # 设置 *addrB = b
assertEqual(self.gdb.p(f"*(({data_type}*)0x{addrA:x})"), a) # 判断 *ddrA 是否=a
assertEqual(self.gdb.p(f"*(({data_type}*)0x{addrB:x})"), b) # 判断 *ddrB 是否=b

class MemTest8(SimpleMemoryTest):
def test(self):
self.access_test(1, 'char')

拆解下这个测试干了哪些事情:

编译

最终生成的 elf 文件为 spike64_checksum-8000000000141125

1
riscv64-unknown-elf-gcc -g programs/checksum.c programs/tiny-malloc.c programs/infinite_loop.S -DDEFINE_MALLOC -DDEFINE_FREE programs/entry.S programs/init.c -DNHARTS=1 -I ../env -T targets/RISC-V/spike64.lds -nostartfiles -mcmodel=medany -DXLEN=64 -o spike64_checksum-8000000000141125 -march=rv64imafc -mabi=lp64

spike 运行

1
spike -p1 --isa RV64IMAFC --dm-auth --dm-progsize 0 --dm-sba 64 --dm-abstract-rti 30 -m0x1212340000:0x10000000 --rbb-port 0 spike64_checksum-8000000000141125

openocd

1
REMOTE_BITBANG_HOST=localhost REMOTE_BITBANG_PORT=34113 WORK_AREA=0x1212340000 USE_FREERTOS=0 openocd --command 'gdb_port 0' --command 'tcl_port disabled' --command 'telnet_port disabled' -f targets/RISC-V/spike-1.cfg

gdb执行

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
riscv64-unknown-elf-gdb \
...
monitor riscv reset_delays 127
target extended-remote localhost:40541
info threads
info threads
Id Target Id Frame
* 1 Remote target 0x00000012123406ae in ?? ()

p/x sizeof(char)
$1 = 0x1
p/x *((char*)0x1212340000) = 0xaa
p/x *((char*)0x122233ffff) = 0x78
p/x *((char*)0x1212340000)
0xaa
p/x *((char*)0x122233ffff)
0x78
Result: pass

fpga 运行:

通过 openocd + fpga 测试
这个没有跑测环境, 大概推测是由 fpga 运行对应的bin
openocd 连接调试环境, 通过gdb 连接openocd, 给fpga 发送cmd 进行测试

其他几个目录的测试

isa

为cpu指令集测试, 包含 S/U/M 模式下的 I, M, A, F, D, V测试

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
rv32mi-p-breakpoint
rv32mi-p-csr
rv32mi-p-illegal
rv32mi-p-lh-misaligned
rv32mi-p-lw-misaligned
rv32mi-p-ma_addr
rv32mi-p-ma_fetch
rv32mi-p-mcsr
rv32mi-p-sbreak
rv32mi-p-scall
rv32mi-p-sh-misaligned
rv32mi-p-shamt
rv32mi-p-sw-misaligned
rv32mi-p-zicntr
rv32si-p-csr
rv32si-p-dirty
rv32si-p-ma_fetch
rv32si-p-sbreak
rv32si-p-scall
rv32si-p-wfi
rv32ua-p-amoadd_w
rv32ua-p-amoand_w
rv32ua-p-amomax_w
rv32ua-p-amomaxu_w
rv32ua-p-amomin_w
rv32ua-p-amominu_w
rv32ua-p-amoor_w
rv32ua-p-amoswap_w
rv32ua-p-amoxor_w
rv32ua-p-lrsc
rv32ua-v-amoadd_w
rv32ua-v-amoand_w
rv32ua-v-amomax_w
rv32ua-v-amomaxu_w
rv32ua-v-amomin_w
rv32ua-v-amominu_w
rv32ua-v-amoor_w
rv32ua-v-amoswap_w
rv32ua-v-amoxor_w
rv32ua-v-lrsc
rv32uc-p-rvc
rv32uc-v-rvc
rv32ud-p-fadd
rv32ud-p-fclass
rv32ud-p-fcmp
rv32ud-p-fcvt
rv32ud-p-fcvt_w
rv32ud-p-fdiv
rv32ud-p-fmadd
rv32ud-p-fmin
rv32ud-p-ldst
rv32ud-p-recoding
rv32ud-v-fadd
rv32ud-v-fclass
rv32ud-v-fcmp
rv32ud-v-fcvt
rv32ud-v-fcvt_w
rv32ud-v-fdiv
rv32ud-v-fmadd
rv32ud-v-fmin
rv32ud-v-ldst
rv32ud-v-recoding
rv32uf-p-fadd
rv32uf-p-fclass
rv32uf-p-fcmp
rv32uf-p-fcvt
rv32uf-p-fcvt_w
rv32uf-p-fdiv
rv32uf-p-fmadd
rv32uf-p-fmin
rv32uf-p-ldst
rv32uf-p-move
rv32uf-p-recoding
rv32uf-v-fadd
rv32uf-v-fclass
rv32uf-v-fcmp
rv32uf-v-fcvt
rv32uf-v-fcvt_w
rv32uf-v-fdiv
rv32uf-v-fmadd
rv32uf-v-fmin
rv32uf-v-ldst
rv32uf-v-move
rv32uf-v-recoding
rv32ui-p-add
rv32ui-p-addi
rv32ui-p-and
rv32ui-p-andi
rv32ui-p-auipc
rv32ui-p-beq
rv32ui-p-bge
rv32ui-p-bgeu
rv32ui-p-blt
rv32ui-p-bltu
rv32ui-p-bne
rv32ui-p-fence_i
rv32ui-p-jal
rv32ui-p-jalr
rv32ui-p-lb
rv32ui-p-lbu
rv32ui-p-lh
rv32ui-p-lhu
rv32ui-p-lui
rv32ui-p-lw
rv32ui-p-or
rv32ui-p-ori
rv32ui-p-sb
rv32ui-p-sh
rv32ui-p-simple
rv32ui-p-sll
rv32ui-p-slli
rv32ui-p-slt
rv32ui-p-slti
rv32ui-p-sltiu
rv32ui-p-sltu
rv32ui-p-sra
rv32ui-p-srai
rv32ui-p-srl
rv32ui-p-srli
rv32ui-p-sub
rv32ui-p-sw
rv32ui-p-xor
rv32ui-p-xori
rv32ui-v-add
rv32ui-v-addi
rv32ui-v-and
rv32ui-v-andi
rv32ui-v-auipc
rv32ui-v-beq
rv32ui-v-bge
rv32ui-v-bgeu
rv32ui-v-blt
rv32ui-v-bltu
rv32ui-v-bne
rv32ui-v-fence_i
rv32ui-v-jal
rv32ui-v-jalr
rv32ui-v-lb
rv32ui-v-lbu
rv32ui-v-lh
rv32ui-v-lhu
rv32ui-v-lui
rv32ui-v-lw
rv32ui-v-or
rv32ui-v-ori
rv32ui-v-sb
rv32ui-v-sh
rv32ui-v-simple
rv32ui-v-sll
rv32ui-v-slli
rv32ui-v-slt
rv32ui-v-slti
rv32ui-v-sltiu
rv32ui-v-sltu
rv32ui-v-sra
rv32ui-v-srai
rv32ui-v-srl
rv32ui-v-srli
rv32ui-v-sub
rv32ui-v-sw
rv32ui-v-xor
rv32ui-v-xori
rv32um-p-div
rv32um-p-divu
rv32um-p-mul
rv32um-p-mulh
rv32um-p-mulhsu
rv32um-p-mulhu
rv32um-p-rem
rv32um-p-remu
rv32um-v-div
rv32um-v-divu
rv32um-v-mul
rv32um-v-mulh
rv32um-v-mulhsu
rv32um-v-mulhu
rv32um-v-rem
rv32um-v-remu
rv64mi-p-access
rv64mi-p-breakpoint
rv64mi-p-csr
rv64mi-p-illegal
rv64mi-p-ld-misaligned
rv64mi-p-lh-misaligned
rv64mi-p-lw-misaligned
rv64mi-p-ma_addr
rv64mi-p-ma_fetch
rv64mi-p-mcsr
rv64mi-p-sbreak
rv64mi-p-scall
rv64mi-p-sd-misaligned
rv64mi-p-sh-misaligned
rv64mi-p-sw-misaligned
rv64mi-p-zicntr
rv64si-p-csr
rv64si-p-dirty
rv64si-p-icache-alias
rv64si-p-ma_fetch
rv64si-p-sbreak
rv64si-p-scall
rv64si-p-wfi
rv64ssvnapot-p-napot
rv64ua-p-amoadd_d
rv64ua-p-amoadd_w
rv64ua-p-amoand_d
rv64ua-p-amoand_w
rv64ua-p-amomax_d
rv64ua-p-amomax_w
rv64ua-p-amomaxu_d
rv64ua-p-amomaxu_w
rv64ua-p-amomin_d
rv64ua-p-amomin_w
rv64ua-p-amominu_d
rv64ua-p-amominu_w
rv64ua-p-amoor_d
rv64ua-p-amoor_w
rv64ua-p-amoswap_d
rv64ua-p-amoswap_w
rv64ua-p-amoxor_d
rv64ua-p-amoxor_w
rv64ua-p-lrsc
rv64ua-v-amoadd_d
rv64ua-v-amoadd_w
rv64ua-v-amoand_d
rv64ua-v-amoand_w
rv64ua-v-amomax_d
rv64ua-v-amomax_w
rv64ua-v-amomaxu_d
rv64ua-v-amomaxu_w
rv64ua-v-amomin_d
rv64ua-v-amomin_w
rv64ua-v-amominu_d
rv64ua-v-amominu_w
rv64ua-v-amoor_d
rv64ua-v-amoor_w
rv64ua-v-amoswap_d
rv64ua-v-amoswap_w
rv64ua-v-amoxor_d
rv64ua-v-amoxor_w
rv64ua-v-lrsc
rv64uc-p-rvc
rv64uc-v-rvc
rv64ud-p-fadd
rv64ud-p-fclass
rv64ud-p-fcmp
rv64ud-p-fcvt
rv64ud-p-fcvt_w
rv64ud-p-fdiv
rv64ud-p-fmadd
rv64ud-p-fmin
rv64ud-p-ldst
rv64ud-p-move
rv64ud-p-recoding
rv64ud-p-structural
rv64ud-v-fadd
rv64ud-v-fclass
rv64ud-v-fcmp
rv64ud-v-fcvt
rv64ud-v-fcvt_w
rv64ud-v-fdiv
rv64ud-v-fmadd
rv64ud-v-fmin
rv64ud-v-ldst
rv64ud-v-move
rv64ud-v-recoding
rv64ud-v-structural
rv64uf-p-fadd
rv64uf-p-fclass
rv64uf-p-fcmp
rv64uf-p-fcvt
rv64uf-p-fcvt_w
rv64uf-p-fdiv
rv64uf-p-fmadd
rv64uf-p-fmin
rv64uf-p-ldst
rv64uf-p-move
rv64uf-p-recoding
rv64uf-v-fadd
rv64uf-v-fclass
rv64uf-v-fcmp
rv64uf-v-fcvt
rv64uf-v-fcvt_w
rv64uf-v-fdiv
rv64uf-v-fmadd
rv64uf-v-fmin
rv64uf-v-ldst
rv64uf-v-move
rv64uf-v-recoding
rv64ui-p-add
rv64ui-p-addi
rv64ui-p-addiw
rv64ui-p-addw
rv64ui-p-and
rv64ui-p-andi
rv64ui-p-auipc
rv64ui-p-beq
rv64ui-p-bge
rv64ui-p-bgeu
rv64ui-p-blt
rv64ui-p-bltu
rv64ui-p-bne
rv64ui-p-fence_i
rv64ui-p-jal
rv64ui-p-jalr
rv64ui-p-lb
rv64ui-p-lbu
rv64ui-p-ld
rv64ui-p-lh
rv64ui-p-lhu
rv64ui-p-lui
rv64ui-p-lw
rv64ui-p-lwu
rv64ui-p-ma_data
rv64ui-p-or
rv64ui-p-ori
rv64ui-p-sb
rv64ui-p-sd
rv64ui-p-sh
rv64ui-p-simple
rv64ui-p-sll
rv64ui-p-slli
rv64ui-p-slliw
rv64ui-p-sllw
rv64ui-p-slt
rv64ui-p-slti
rv64ui-p-sltiu
rv64ui-p-sltu
rv64ui-p-sra
rv64ui-p-srai
rv64ui-p-sraiw
rv64ui-p-sraw
rv64ui-p-srl
rv64ui-p-srli
rv64ui-p-srliw
rv64ui-p-srlw
rv64ui-p-sub
rv64ui-p-subw
rv64ui-p-sw
rv64ui-p-xor
rv64ui-p-xori
rv64ui-v-add
rv64ui-v-addi
rv64ui-v-addiw
rv64ui-v-addw
rv64ui-v-and
rv64ui-v-andi
rv64ui-v-auipc
rv64ui-v-beq
rv64ui-v-bge
rv64ui-v-bgeu
rv64ui-v-blt
rv64ui-v-bltu
rv64ui-v-bne
rv64ui-v-fence_i
rv64ui-v-jal
rv64ui-v-jalr
rv64ui-v-lb
rv64ui-v-lbu
rv64ui-v-ld
rv64ui-v-lh
rv64ui-v-lhu
rv64ui-v-lui
rv64ui-v-lw
rv64ui-v-lwu
rv64ui-v-ma_data
rv64ui-v-or
rv64ui-v-ori
rv64ui-v-sb
rv64ui-v-sd
rv64ui-v-sh
rv64ui-v-simple
rv64ui-v-sll
rv64ui-v-slli
rv64ui-v-slliw
rv64ui-v-sllw
rv64ui-v-slt
rv64ui-v-slti
rv64ui-v-sltiu
rv64ui-v-sltu
rv64ui-v-sra
rv64ui-v-srai
rv64ui-v-sraiw
rv64ui-v-sraw
rv64ui-v-srl
rv64ui-v-srli
rv64ui-v-srliw
rv64ui-v-srlw
rv64ui-v-sub
rv64ui-v-subw
rv64ui-v-sw
rv64ui-v-xor
rv64ui-v-xori
rv64um-p-div
rv64um-p-divu
rv64um-p-divuw
rv64um-p-divw
rv64um-p-mul
rv64um-p-mulh
rv64um-p-mulhsu
rv64um-p-mulhu
rv64um-p-mulw
rv64um-p-rem
rv64um-p-remu
rv64um-p-remuw
rv64um-p-remw
rv64um-v-div
rv64um-v-divu
rv64um-v-divuw
rv64um-v-divw
rv64um-v-mul
rv64um-v-mulh
rv64um-v-mulhsu
rv64um-v-mulhu
rv64um-v-mulw
rv64um-v-rem
rv64um-v-remu
rv64um-v-remuw
rv64um-v-remw

是通过spike 进行测试的.
跑测结果

1
2
# 对所有测试项进行测试, 会通过Makefile中的指定对应的isa 进行测试
make run

例子
编译 执行

1
2
3
4
5
# 编译
riscv64-unknown-elf-gcc -march=rv64g -mabi=lp64 -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles -DENTROPY=0xcaa8519 -std=gnu99 -O2 -I./../env/v -I./macros/scalar -T./../env/v/link.ld ./../env/v/entry.S ./../env/v/*.c rv64ui/lui.S -o rv64ui-v-lui
# 执行
# 执行结果放在 *.out 文件中, 无log为正常现象
spike --isa=rv64gc_zfh_zicboz_svnapot rv64ui-v-lui 2> rv64ui-v-lui.out

benchmarks

跑测执行

1
2
3
4
5
6
7
8
9
10
11
12
make run
# 例子 qsort 编译
...
riscv64-unknown-elf-gcc -I./../env -I./common -I./median -I./qsort -I./rsort -I./towers -I./vvadd -I./multiply -I./mm -I./dhrystone -I./spmv -I./mt-vvadd -I./mt-matmul -I./pmp -DPREALLOCATE=1 -mcmodel=medany -static -std=gnu99 -O2 -ffast-math -fno-common -fno-builtin-printf -fno-tree-loop-distribute-patterns -o qsort.riscv ./qsort/qsort_main.c ./common/syscalls.c ./common/crt.S -static -nostdlib -nostartfiles -lm -lgcc -T ./common/test.ld

# 执行
spike --isa=rv64gc qsort.riscv > qsort.riscv.out
# 结果
cat qsort.riscv.out
mcycle = 127363
minstret = 127368
...

qsort 主要源码:

1
2
3
4
5
6
setStats(1);  // 计时开始
sort( DATA_SIZE, input_data ); //对 dataset1.h 存的 input_data 进行排序
setStats(0); // 计时结束, 输出时间

// Check the results
return verify( DATA_SIZE, input_data, verify_data ); // 判断排序结果是否和 预期的 dataset1.h 存的 verify_data 一致, 不一致, 退出case报错

跑分测试

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
├── Makefile
├── common # 公共源文件, 启动相关
│ ├── crt.S
│ ├── syscalls.c
│ ├── test.ld
│ └── util.h
├── dhrystone
│ ├── dhrystone.c
│ ├── dhrystone.h
│ └── dhrystone_main.c
├── median
│ ├── dataset1.h # 存放预期的执行结果
│ ├── median.c
│ ├── median.h
│ ├── median_gendata.pl
│ └── median_main.c
├── mm
│ ├── common.h
│ ├── gen.scala
│ ├── mm.c
│ ├── mm_main.c
│ └── rb.h
├── mt-matmul
│ ├── dataset.h # 存放预期的执行结果
│ ├── matmul.c
│ ├── matmul_gendata.pl
│ └── mt-matmul.c
├── mt-vvadd
│ ├── dataset.h # 存放预期的执行结果
│ ├── mt-vvadd.c
│ ├── vvadd.c
│ └── vvadd_gendata.pl
├── multiply
│ ├── dataset1.h
│ ├── multiply.c
│ ├── multiply.h
│ ├── multiply_gendata.pl
│ └── multiply_main.c
├── pmp
│ └── pmp.c
├── qsort
│ ├── dataset1.h # 存放预期的执行结果
│ ├── qsort_gendata.pl
│ └── qsort_main.c
├── qsort.riscv.out.tags
├── readme.txt
├── rsort
│ ├── dataset1.h
│ └── rsort.c
├── spmv
│ ├── dataset1.h # 存放预期的执行结果
│ ├── spmv_gendata.scala
│ └── spmv_main.c
├── towers
│ └── towers_main.c
└── vvadd
├── dataset1-large.h # 存放预期的执行结果
├── dataset1.h
├── vvadd_gendata.pl
└── vvadd_main.c

mt

矩阵乘法相关, 编译报错, 不是重点, 暂时跳过

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
├── Makefile
├── ad_matmul.c
├── ae_matmul.c
├── af_matmul.c
├── ag_matmul.c
├── ai_matmul.c
├── ak_matmul.c
├── al_matmul.c
├── am_matmul.c
├── an_matmul.c
├── ap_matmul.c
├── aq_matmul.c
├── ar_matmul.c
├── at_matmul.c
├── av_matmul.c
├── ay_matmul.c
├── az_matmul.c
├── bb_matmul.c
├── bc_matmul.c
├── bf_matmul.c
├── bh_matmul.c
├── bj_matmul.c
├── bk_matmul.c
├── bm_matmul.c
├── bo_matmul.c
├── br_matmul.c
├── bs_matmul.c
├── ce_matmul.c
├── cf_matmul.c
├── cg_matmul.c
├── ci_matmul.c
├── ck_matmul.c
├── cl_matmul.c
├── cm_matmul.c
├── crt.o
├── cs_matmul.c
├── cv_matmul.c
├── cy_matmul.c
├── dc_matmul.c
├── df_matmul.c
├── dm_matmul.c
├── do_matmul.c
├── dr_matmul.c
├── ds_matmul.c
├── du_matmul.c
├── dv_matmul.c
├── mt-vvadd.o
├── syscalls.o
├── vvadd0.c
├── vvadd0.o
├── vvadd1.c
├── vvadd2.c
├── vvadd3.c
└── vvadd4.c

sifive freedom-e-sdk

https://github.com/sifive/freedom-e-sdk

目录结构

1
2
3
4
5
6
7
8
9
10
11
12
13
❯ tree -L 1 -d
.
├── FreeRTOS-metal #FreeRTOS 相关
├── bsp # board 相关
├── doc
├── docker
├── freedom-devicetree-tools # device tree 编译相关
├── freedom-metal # baremental 相关
├── pip-cache # python 环境相关
├── scl-metal # software crypto库
├── scripts # 编译 执行相关脚本
├── software # baremental app
└── venv # python 环境相关

software case

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
❯ tree -L 1 -d
.
├── atomics
├── cflush
├── clic-hardware-vector-interrupts
├── clic-nested-interrupts
├── clic-nonvector-interrupts
├── clic-selective-vector-interrupts
├── coremark
├── csr
├── dhrystone
├── empty
├── example-buserror
├── example-freertos-blinky
├── example-freertos-minimal
├── example-freertos-pmp-blinky
├── example-hca-metal
├── example-hello
├── example-hpm
├── example-i2c
├── example-itim
├── example-l2pf
├── example-l2pm
├── example-lim
├── example-pmp
├── example-privilege-level
├── example-pwm
├── example-remapper
├── example-rnmi
├── example-rtc
├── example-spi
├── example-user-mode
├── example-user-syscall
├── example-vm-test
├── example-watchdog
├── hello
├── local-interrupt
├── local-vector-interrupts
├── mem-latency
├── minimal-boot
├── multicore-hello
├── plic-interrupts
├── return-fail
├── return-pass
├── sifive-welcome
├── software
├── software-interrupt
├── test-coreip
├── timer-interrupt
├── uart-interrupt
└── vm-test

基础编译

1
make TARGET=${target} PROGRAM=${program}

引用的文件

头文件:
PLATFORM_HEADER = bsp/qemu-sifive-s51/metal-platform.h
MACHINE_HEADER = bsp/qemu-sifive-s51/metal.h
MACHINE_INLINE = bsp/qemu-sifive-s51/metal-inline.h

march=rv64imac -mabi=lp64

ld: bsp/qemu-sifive-s51/metal.default.lds

freedom-metal/src/ 下的文件会编译为 bsp/qemu-sifive-s51/install/lib/debug/libmetal.a
freedom-metal/gloss/ 下的文件编译为 bsp/qemu-sifive-s51/install/lib/debug/libmetal-gloss.a

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
libmetal_a_SOURCES = \
src/drivers/fixed-clock.c \
src/drivers/fixed-factor-clock.c \
src/drivers/inline.c \
src/drivers/riscv_clint0.c \
src/drivers/riscv_cpu.c \
src/drivers/riscv_plic0.c \
src/drivers/sifive_remapper2.c \
src/drivers/sifive_buserror0.c \
src/drivers/sifive_ccache0.c \
src/drivers/sifive_clic0.c \
src/drivers/sifive_fe310-g000_hfrosc.c \
src/drivers/sifive_fe310-g000_hfxosc.c \
src/drivers/sifive_fe310-g000_lfrosc.c \
src/drivers/sifive_fe310-g000_pll.c \
src/drivers/sifive_fe310-g000_prci.c \
src/drivers/sifive_global-external-interrupts0.c \
src/drivers/sifive_gpio-buttons.c \
src/drivers/sifive_gpio-leds.c \
src/drivers/sifive_gpio-switches.c \
src/drivers/sifive_gpio0.c \
src/drivers/sifive_i2c0.c \
src/drivers/sifive_l2pf0.c \
src/drivers/sifive_l2pf1.c \
src/drivers/sifive_local-external-interrupts0.c \
src/drivers/sifive_pl2cache0.c \
src/drivers/sifive_prci0.c \
src/drivers/sifive_pwm0.c \
src/drivers/sifive_rtc0.c \
src/drivers/sifive_spi0.c \
src/drivers/sifive_test0.c \
src/drivers/sifive_trace.c \
src/drivers/sifive_uart0.c \
src/drivers/sifive_simuart0.c \
src/drivers/sifive_wdog0.c \
src/drivers/ucb_htif0.c \
src/remapper.c \
src/atomic.c \
src/button.c \
src/cache.c \
src/clock.c \
src/cpu.c \
src/entry.S \
src/scrub.S \
src/trap.S \
src/gpio.c \
src/hpm.c \
src/i2c.c \
src/init.c \
src/interrupt.c \
src/led.c \
src/lock.c \
src/memory.c \
src/pmp.c \
src/prci.c \
src/privilege.c \
src/pwm.c\
src/rtc.c \
src/shutdown.c \
src/spi.c \
src/switch.c \
src/synchronize_harts.c \
src/timer.c \
src/time.c \
src/trap.S \
src/tty.c \
src/uart.c \
src/vector.S \
src/watchdog.c

libmetal_gloss_a_SOURCES = \
gloss/crt0.S \
gloss/nanosleep.c \
gloss/sys_access.c \
gloss/sys_chdir.c \
gloss/sys_chmod.c \
gloss/sys_chown.c \
gloss/sys_clock_gettime.c \
gloss/sys_close.c \
gloss/sys_execve.c \
gloss/sys_exit.c \
gloss/sys_faccessat.c \
gloss/sys_fork.c \
gloss/sys_fstat.c \
gloss/sys_fstatat.c \
gloss/sys_ftime.c \
gloss/sys_getcwd.c \
gloss/sys_getpid.c \
gloss/sys_gettimeofday.c \
gloss/sys_isatty.c \
gloss/sys_kill.c \
gloss/sys_link.c \
gloss/sys_lseek.c \
gloss/sys_lstat.c \
gloss/sys_open.c \
gloss/sys_openat.c \
gloss/sys_read.c \
gloss/sys_sbrk.c \
gloss/sys_stat.c \
gloss/sys_sysconf.c \
gloss/sys_times.c \
gloss/sys_unlink.c \
gloss/sys_utime.c \
gloss/sys_wait.c \
gloss/sys_write.c
# software 下的源文件
software/minimal-boot/minimal-boot.c

跑测

1
./scripts/test-qemu-targets

scripts/test-qemu-targets

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#TARGETS=(qemu-sifive-e31 qemu-sifive-s51 qemu-sifive-u54 qemu-sifive-u54mc )
TARGETS=(qemu-sifive-s51 )
PROGRAMS=(minimal-boot )

for target in ${TARGETS[@]} ; do
for program in ${PROGRAMS[@]} ; do

build_output_file=$( mktemp -p ./ tmp.${target}.${program}.build.XXXXXXXXXX)
run_output_file=$( mktemp -p ./ tmp.${target}.${program}.run.XXXXXXXXXX)

case $program in
hello) expected_output="Hello, World!";;
minimal-boot) expected_output="minimal-boot";;
*) expected_output="";;
esac

>&2 echo "Building ${program} on ${target}"

make TARGET=${target} PROGRAM=${program} 2>&1 | tee ${build_output_file}
timeout --foreground ${TIMEOUT_SECONDS}s bash -c "make TARGET=${target} PROGRAM=${program} simulate 2>/dev/null | tee ${run_output_file}"

if [ ! -f ${run_output_file} -o `cat ${run_output_file} | grep -c "${expected_output}"` -eq 0 ] ; then
>&2 echo "${program} on ${target} failed to produce the expected output"
else
>&2 echo "${program} on ${target} passed"
fi

# Make sure we clean up after ourselves
make TARGET=${target} PROGRAM=${program} clean 2>&1 >/dev/null
done

跑测命令:

1
scripts/simulate --elf /home/liguang/program/riscv-lab/freedom-e-sdk/software/minimal-boot/debug/minimal-boot.elf --qemu qemu-system-riscv64 --qemu-config bsp/qemu-sifive-s51/qemu.cfg

实际跑测命令:

1
qemu-system-riscv64 -M sifive_e -kernel /home/liguang/program/riscv-lab/freedom-e-sdk/software/minimal-boot/debug/minimal-boot.elf -nographic

build benchmark

Building an Benchmark Program

Building a benchmark program is slightly special in that certain section is required to be loaded in specific memory region. A specialize linker file has been created for its optimal run.

1
make PROGRAM=dhrystone TARGET=coreip-e31-arty LINK_TARGET=ramrodata software

Debugging a Target Program

1
make [PROGRAM=hello] [TARGET=sifive-hifive1] [CONFIGURATION=debug] debug