Skip to content

Commit 65878e7

Browse files
committed
feat: re-organize assets dir
1 parent c07168c commit 65878e7

18 files changed

+99
-90
lines changed

01-basics/01-first-run.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
"source": [
157157
"我们可以直接运行 `./build/emu` 对 XiangShan 进行仿真,运行 riscv64 的程序。\n",
158158
"\n",
159-
"在本次 tutorial 中我们没有实际编译 emu,因此改为运行 `${READY2RUN_HOME}` 目录下预先编译好的 emu\n",
159+
"在本次 tutorial 中我们没有实际编译 emu,因此改为运行 `${ASSET_DIR}/precompile` 目录下预先编译好的 emu\n",
160160
"\n",
161161
"运行参数我们将在后面进行介绍。"
162162
]
@@ -172,8 +172,8 @@
172172
"cd ../ && source env.sh >/dev/null\n",
173173
"cd $NOOP_HOME\n",
174174
"\n",
175-
"${READY2RUN_HOME}/emu \\\n",
176-
" -i ${READY2RUN_HOME}/hello-riscv64-xs.bin \\\n",
175+
"${ASSETS_DIR}/emu-precompile/emu \\\n",
176+
" -i ${ASSETS_DIR}/workload/hello-riscv64-xs.bin \\\n",
177177
" --no-diff \\\n",
178178
" 2>/dev/null\n",
179179
"\n",

01-basics/02-workload.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
"cd $NOOP_HOME\n",
9696
"\n",
9797
"# 使用 emu 运行新编译的软件负载\n",
98-
"${READY2RUN_HOME}/emu -i $AM_HOME/apps/hello/build/hello-riscv64-xs.bin --no-diff 2>/dev/null"
98+
"${ASSETS_DIR}/emu-precompile/emu -i $AM_HOME/apps/hello/build/hello-riscv64-xs.bin --no-diff 2>/dev/null"
9999
]
100100
},
101101
{
@@ -137,7 +137,7 @@
137137
"name": "python",
138138
"nbconvert_exporter": "python",
139139
"pygments_lexer": "ipython3",
140-
"version": "3.10.12"
140+
"version": "3.12.3"
141141
}
142142
},
143143
"nbformat": 4,

01-basics/03-formal-run.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
"cd ../ && source env.sh >/dev/null\n",
2222
"cd $NOOP_HOME\n",
2323
"\n",
24-
"${READY2RUN_HOME}/emu --help"
24+
"${ASSETS_DIR}/emu-precompile/emu --help"
2525
]
2626
},
2727
{
2828
"cell_type": "markdown",
2929
"id": "2fa6557b",
3030
"metadata": {},
3131
"source": [
32-
"和 01-first-run 章节不同,这次我们跑一个稍微复杂一些的程序:2 轮的 Coremark。这一程序的二进制已经在 Xiangshan/ready-to-run 文件夹中准备好了"
32+
"和 01-first-run 章节不同,这次我们跑一个稍微复杂一些的程序:Coremark。"
3333
]
3434
},
3535
{
@@ -43,8 +43,8 @@
4343
"cd ../ && source env.sh >/dev/null\n",
4444
"cd $NOOP_HOME\n",
4545
"\n",
46-
"${READY2RUN_HOME}/emu \\\n",
47-
" -i ./ready-to-run/copy_and_run.bin \\\n",
46+
"${ASSETS_DIR}/emu-precompile/emu \\\n",
47+
" -i ${ASSETS_DIR}/workload/copy_and_run.bin \\\n",
4848
" --no-diff \\\n",
4949
" 2>/dev/null"
5050
]
@@ -69,8 +69,8 @@
6969
"cd $NOOP_HOME\n",
7070
"\n",
7171
"# 错误 1\n",
72-
"${READY2RUN_HOME}/emu-alu-err \\\n",
73-
" -i ./ready-to-run/coremark-2-iteration.bin \\\n",
72+
"${ASSETS_DIR}/emu-precompile/emu-alu-err \\\n",
73+
" -i ${ASSETS_DIR}/workload/coremark-2-iteration.bin \\\n",
7474
" --no-diff \\\n",
7575
" -C 10000 \\\n",
7676
" 2>/dev/null || true"
@@ -101,7 +101,7 @@
101101
"name": "python",
102102
"nbconvert_exporter": "python",
103103
"pygments_lexer": "ipython3",
104-
"version": "3.10.12"
104+
"version": "3.12.3"
105105
}
106106
},
107107
"nbformat": 4,

02-functional/01-nemu.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"# 以批模式运行 workload\n",
6363
"./build/riscv64-nemu-interpreter \\\n",
6464
" -b \\\n",
65-
" ${READY2RUN_HOME}/hello-riscv64-xs.bin"
65+
" ${ASSETS_DIR}/workload/hello-riscv64-xs.bin"
6666
]
6767
}
6868
],
@@ -82,7 +82,7 @@
8282
"name": "python",
8383
"nbconvert_exporter": "python",
8484
"pygments_lexer": "ipython3",
85-
"version": "3.10.12"
85+
"version": "3.12.3"
8686
}
8787
},
8888
"nbformat": 4,

02-functional/02-difftest.ipynb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"\n",
2525
"cd $NOOP_HOME\n",
2626
"\n",
27-
"${READY2RUN_HOME}/emu \\\n",
28-
" -i ${READY2RUN_HOME}/hello-riscv64-xs.bin \\\n",
27+
"${ASSETS_DIR}/emu-precompile/emu \\\n",
28+
" -i ${ASSETS_DIR}/workload/hello-riscv64-xs.bin \\\n",
2929
" --diff $NEMU_HOME/build/riscv64-nemu-interpreter-so \\\n",
3030
" 2>/dev/null"
3131
]
@@ -50,8 +50,8 @@
5050
"\n",
5151
"cd $NOOP_HOME\n",
5252
"\n",
53-
"${READY2RUN_HOME}/emu-alu-err \\\n",
54-
" -i ${READY2RUN_HOME}/hello-riscv64-xs.bin \\\n",
53+
"${ASSETS_DIR}/emu-precompile/emu-alu-err \\\n",
54+
" -i ${ASSETS_DIR}/workload/hello-riscv64-xs.bin \\\n",
5555
" --diff $NEMU_HOME/build/riscv64-nemu-interpreter-so \\\n",
5656
" 2>/dev/null || true # tutorial:添加 \"|| true\" 避免 notebook 报错,实际使用不需要"
5757
]
@@ -82,10 +82,12 @@
8282
"%%bash\n",
8383
"cd ../ && source env.sh >/dev/null\n",
8484
"cd $NOOP_HOME\n",
85+
"\n",
86+
"mkdir -p build\n",
8587
"rm -f ./build/*.vcd\n",
8688
"\n",
87-
"${READY2RUN_HOME}/emu-alu-err \\\n",
88-
" -i ${READY2RUN_HOME}/hello-riscv64-xs.bin \\\n",
89+
"${ASSETS_DIR}/emu-precompile/emu-alu-err \\\n",
90+
" -i ${ASSETS_DIR}/workload/hello-riscv64-xs.bin \\\n",
8991
" --diff $NEMU_HOME/build/riscv64-nemu-interpreter-so \\\n",
9092
" -b 8000 \\\n",
9193
" -e 10000 \\\n",
@@ -113,7 +115,7 @@
113115
"name": "python",
114116
"nbconvert_exporter": "python",
115117
"pygments_lexer": "ipython3",
116-
"version": "3.10.12"
118+
"version": "3.12.3"
117119
}
118120
},
119121
"nbformat": 4,

02-functional/03-lightsss.ipynb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@
2525
"cd ../ && source env.sh >/dev/null\n",
2626
"cd $NOOP_HOME\n",
2727
"\n",
28+
"mkdir -p build\n",
2829
"rm -f ./build/*.vcd\n",
2930
"\n",
30-
"${READY2RUN_HOME}/emu-alu-err \\\n",
31-
" -i ${READY2RUN_HOME}/hello-riscv64-xs.bin \\\n",
31+
"${ASSETS_DIR}/emu-precompile/emu-alu-err \\\n",
32+
" -i ${ASSETS_DIR}/workload/hello-riscv64-xs.bin \\\n",
3233
" --diff $NEMU_HOME/build/riscv64-nemu-interpreter-so \\\n",
3334
" --enable-fork \\\n",
3435
" 2> /dev/null || true\n",
@@ -62,7 +63,7 @@
6263
"name": "python",
6364
"nbconvert_exporter": "python",
6465
"pygments_lexer": "ipython3",
65-
"version": "3.10.12"
66+
"version": "3.12.3"
6667
}
6768
},
6869
"nbformat": 4,

02-functional/04-chiseldb.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"\n",
3737
"rm -f ./build/*.db\n",
3838
"\n",
39-
"${READY2RUN_HOME}/emu-cdb-err \\\n",
39+
"${ASSETS_DIR}/emu-precompile/emu-cdb-err \\\n",
4040
" -i $NOOP_HOME/ready-to-run/linux.bin \\\n",
4141
" --diff $NOOP_HOME/ready-to-run/riscv64-nemu-interpreter-so \\\n",
4242
" --dump-db \\\n",

03-performance/01-checkpoint-env.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ export WORKLOAD=stream_100000
88
export CHECKPOINT_INTERVAL=$((50*1000*1000))
99

1010
# path
11-
export SIMPOINT_HOME=$WORK_DIR/checkpoint
11+
export SIMPOINT_HOME=$WORK_DIR/03-performance/01-checkpoint
1212

13-
export PAYLOAD_PATH=$READY2RUN_HOME/07-checkpoint
13+
export PAYLOAD_PATH=$ASSETS_DIR/workload
1414

1515
export GCPT_PATH=$SIMPOINT_HOME/gcpt
1616
export LOG_PATH=$SIMPOINT_HOME/logs

03-performance/01-checkpoint.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@
189189
"\n",
190190
"CHECKPOINT=$(find ${RESULT_PATH}/checkpoint/${WORKLOAD} -type f -name \"*_.gz\" | tail -1)\n",
191191
"\n",
192-
"${READY2RUN_HOME}/emu \\\n",
192+
"${ASSETS_DIR}/emu-precompile/emu \\\n",
193193
" -i ${CHECKPOINT} \\\n",
194-
" --diff ${NOOP_HOME}/ready-to-run/riscv64-nemu-interpreter-so \\\n",
194+
" --diff ${ASSETS_DIR}/emu-precompile/riscv64-nemu-interpreter-so \\\n",
195195
" --max-cycles=50000 \\\n",
196196
" 2>/dev/null\n"
197197
]
@@ -341,7 +341,7 @@
341341
"\n",
342342
"# NOTE: should be same with 01-checkpoint-env.sh\n",
343343
"spec_list=[\"stream_100000\"]\n",
344-
"base_path = os.path.join(os.getcwd(), \"01-checkpoint\")\n",
344+
"base_path = os.path.join(os.getcwd(), \"..\", \"work\", \"03-performance\", \"01-checkpoint\")\n",
345345
"times = [1, 1, 1]\n",
346346
"ids = [0, 0, 0]\n",
347347
"\n",
@@ -351,7 +351,7 @@
351351
],
352352
"metadata": {
353353
"kernelspec": {
354-
"display_name": ".venv",
354+
"display_name": "Python 3",
355355
"language": "python",
356356
"name": "python3"
357357
},
@@ -365,7 +365,7 @@
365365
"name": "python",
366366
"nbconvert_exporter": "python",
367367
"pygments_lexer": "ipython3",
368-
"version": "3.13.6"
368+
"version": "3.12.3"
369369
}
370370
},
371371
"nbformat": 4,

03-performance/02-xsperf.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
"cd ../ && source env.sh >/dev/null\n",
2828
"cd ${NOOP_HOME}\n",
2929
"\n",
30-
"${READY2RUN_HOME}/emu \\\n",
31-
" -i ${READY2RUN_HOME}/hello-riscv64-xs.bin \\\n",
30+
"${ASSETS_DIR}/emu-precompile/emu \\\n",
31+
" -i ${ASSETS_DIR}/workload/hello-riscv64-xs.bin \\\n",
3232
" --no-diff 2>stderr.log\n",
3333
"\n",
3434
"echo \"=== Last 10 lines:\"\n",
@@ -77,14 +77,14 @@
7777
"# make emu EMU_THREADS=4 WITH_CHISELDB=1 WITH_ROLLINGDB=1 -j8 \\\n",
7878
"# PGO_WORKLOAD=${NOOP_HOME}/ready-to-run/coremark-2-iteration.bin \\\n",
7979
"# PGO_MAX_CYCLE=10000 PGO_EMU_ARGS=--no-diff LLVM_PROFDATA=llvm-profdata\n",
80-
"# ./build/emu -i ./ready-to-run/coremark-2-iteration.bin \\\n",
81-
"# --diff ./ready-to-run/riscv64-nemu-interpreter-so --dump-db\n",
80+
"# ./build/emu -i ${ASSETS_DIR}/workload/coremark-2-iteration.bin \\\n",
81+
"# --diff ${ASSETS_DIR}/workload/riscv64-nemu-interpreter-so --dump-db\n",
8282
"# cp `find $NOOP_HOME/build/ -type f -name \"*.db\" | tail -1` \\\n",
8383
"# ${XS_PROJECT_ROOT}/tutorial/${dir}/xs-perf-rolling.db\n",
8484
"\n",
8585
"# 使用脚本对 rolling db 进行分析\n",
8686
"cd ${NOOP_HOME}/scripts/rolling\n",
87-
"python3 rollingplot.py ${READY2RUN_HOME}/xs-perf-rolling.db ipc"
87+
"python3 rollingplot.py ${ASSETS_DIR}/emu-result/xs-perf-rolling.db ipc"
8888
]
8989
},
9090
{
@@ -94,7 +94,7 @@
9494
"source": [
9595
"该脚本会输出以下图片,可以看到 XiangShan 在运行这一程序时,每一段时间内的 IPC 变化:\n",
9696
"\n",
97-
"![perf](../XiangShan//scripts/rolling/results/perf.png)"
97+
"![perf](../XiangShan/scripts/rolling/results/perf.png)"
9898
]
9999
}
100100
],
@@ -114,7 +114,7 @@
114114
"name": "python",
115115
"nbconvert_exporter": "python",
116116
"pygments_lexer": "ipython3",
117-
"version": "3.10.12"
117+
"version": "3.12.3"
118118
}
119119
},
120120
"nbformat": 4,

0 commit comments

Comments
 (0)