File tree Expand file tree Collapse file tree 4 files changed +18
-7
lines changed Expand file tree Collapse file tree 4 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -141,14 +141,24 @@ Enter the test cycle:
141141
142142` projects/soc ` 目录下存放了接入` ysyxSoC ` 的示例程序。源码中只有一个占位符,能够通过编译但不能正常运行。
143143
144- 使用该脚本,需要先按照 [ ysyx SoC 的 readme] ( https://github.com/osCPU/ysyxsoc ) 完成命名规范和 CPU 内部修改两个步骤,得到 ` ysyx_21xxxx.v ` ,随后放入 ` projects/soc/vsrc/ ` 中。脚本会根据 ` myinfo.txt ` 中的 ID 自动进行 ` cpu-check ` 和 ` soc ` 的编译。
145-
146- ` ysyxSoC ` 中附带的例程会被自动软连接至 ` build ` 目录下,仿真时可以如下快速使用。
144+ 要使用该框架,需要先按照 [ ysyx SoC 的 readme] ( https://github.com/osCPU/ysyxsoc ) 完成 ` 命名规范 ` 和 ` CPU 内部修改 ` 两个步骤,得到 ` ysyx_21xxxx.v ` ,随后放入 ` projects/soc/vsrc/ ` 中。此后,执行下面的命令将会根据 ` myinfo.txt ` 中的 ID 自动 对代码进行规范检查、集成到 ` soc ` 并运行指定的程序。` ysyxSoC ` 中附带的例程会被自动软连接至 ` build ` 目录下,仿真时可以快速使用。
147145
148146``` bash
149147./build.sh -e soc -b -s -y -v ' --timescale "1ns/1ns" -Wno-fatal --trace' -a " -i ysyxSoC/flash/hello-flash.bin --dump-wave"
150148```
151149
150+ 由于无法直接使用 ` difftest ` 框架,暂时只支持少量参数。
151+ ``` bash
152+ $ ./emu -h
153+ Usage: ./emu [OPTION...]
154+
155+ -i, --image=FILE run with this image file
156+ --dump-wave dump waveform when log is enabled
157+ -b, --log-begin=NUM display log from NUM th cycle
158+ -e, --log-end=NUM stop display log at NUM th cycle
159+ -h, --help print program help info
160+ ```
161+
152162## 查看波形
153163
154164在` oscpu ` 目录下使用命令可以通过` gtkwave ` 查看输出的波形,其中` xxx ` 表示例程名。
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ build_soc_proj() {
121121 mkdir -p $BUILD_PATH /vsrc $BUILD_PATH /csrc
122122
123123 if [[ ! -f " $PROJECT_PATH /$VSRC_FOLDER /ysyx_${ID: 0-6} .v" ]]; then
124- echo " $PROJECT_PATH / $ VSRC_FOLDER /ysyx_${ID: 0-6} .v not detected. Failed to compile with ysyxSoC."
124+ echo " $VSRC_FOLDER /ysyx_${ID: 0-6} .v not detected. Please follow the README of ysyxSoC to get this file ."
125125 exit 1
126126 fi
127127
Original file line number Diff line number Diff line change @@ -19,10 +19,10 @@ class Emulator
1919
2020 if (args.image == nullptr )
2121 throw " Image file unspecified. Use -i to provide the image of flash" ;
22+ printf (" Initializing flash with \" %s\" ...\n " , args.image );
2223 flash_init (args.image );
23- printf (" Flash initialized with \" %s\"\n " , args.image );
2424
25- printf (" Initializing DUT...\n " );
25+ printf (" Initializing and resetting DUT ...\n " );
2626 dut_ptr = new VysyxSoCFull;
2727 dut_ptr->reset = 1 ;
2828 for (int i = 0 ; i < 10 ; i++)
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ void sig_handler(int signo)
1515 puts (" SIGINT received, forcely shutting down.\n " );
1616 _exit (0 );
1717 }
18- puts (" SIGINT received, gracefully shutting down...\n " );
18+ puts (" SIGINT received, gracefully shutting down... Type Ctrl+C again to stop forcely. \n " );
1919 signal_received = signo;
2020}
2121
@@ -37,6 +37,7 @@ int main(int argc, char *argv[])
3737 atexit (release);
3838
3939 emu = new Emulator (argc, argv);
40+ printf (" Start simulating ...\n " );
4041 while (!Verilated::gotFinish () && signal_received == 0 )
4142 {
4243 emu->step ();
You can’t perform that action at this time.
0 commit comments