build(vivado): add sd_bram to create_project.tcl, fix run instructions

mlkem_top instantiates sd_bram (ek/dk byte buffers) but create_project.tcl
was missing it -- elaboration would fail. Add sync_rtl/storage/sd_bram.v to
match xsim_run.tcl exactly. Also clarify the run flow: runtime=all means
launch_simulation runs to the TB $finish; a manual 'run all' afterwards trips
the 120ms watchdog and prints a spurious timeout.

Verified: vivado -mode batch builds the project (0 errors) and the simulation
prints 'K=2 CASE 0 PASS: ek==pk, dk==sk'.
This commit is contained in:
2026-06-28 17:14:14 +08:00
parent f4493966ac
commit 0fa7f48ed4

View File

@@ -2,7 +2,7 @@
# 顶层 mlkem_top 及其全部叶子算子与参数化 KAT testbench。
#
# 与已验证的 XSIM 流程sync_rtl/top/TB/xsim_run.tcl保持一致
# - 加载 mlkem_top 实际依赖的 14 个源文件
# - 加载 mlkem_top 实际依赖的全部 RTL 源文件(含 sd_bram 存储)
# - 顶层仿真模块 = tb_mlkem_kg_katK_xsim
# - 运行时安全等级由 generic KP2/3/4选择用例号由 +CASE 选择
#
@@ -30,7 +30,7 @@ create_project -force ${PROJECT_NAME} ${PROJECT_DIR}/vivado_prj
set_property target_simulator XSim [current_project]
# ===================================================================
# RTL 源文件 —— 与 xsim_run.tcl 完全一致的 14 个文件
# RTL 源文件 —— 与 xsim_run.tcl 完全一致
# ===================================================================
# ── SHA3 / Keccak ──
@@ -53,6 +53,9 @@ read_verilog -sv ${PROJECT_DIR}/sync_rtl/poly_mul/basecase_mul.v
read_verilog -sv ${PROJECT_DIR}/sync_rtl/poly_mul/poly_mul_zeta_rom.v
read_verilog -sv ${PROJECT_DIR}/sync_rtl/poly_mul/poly_mul_sync.v
# ── 存储ek/dk 字节缓冲registered-read BRAM──
read_verilog -sv ${PROJECT_DIR}/sync_rtl/storage/sd_bram.v
# ── 顶层 KeyGen 集成 ──
read_verilog -sv ${PROJECT_DIR}/sync_rtl/top/mlkem_top.v
@@ -107,7 +110,13 @@ set_property -name {xsim.simulate.xsim.more_options} \
puts "========================================"
puts " Project created: ${PROJECT_DIR}/vivado_prj/${PROJECT_NAME}.xpr"
puts " 仿: ML-KEM K=${SIM_KP}, KAT CASE=${SIM_CASE}"
puts " 仿: launch_simulation; run all"
puts ""
puts " 仿runtime=all TB \$finish"
puts " - GUI: Run Simulation Tcl Console: launch_simulation"
puts " - batch: vivado -mode batch -source create_project.tcl "
puts " : open_project vivado_prj/mlkem.xpr; launch_simulation"
puts " launch_simulation run all 仿 \$finish"
puts " run TB 120ms timeout"
puts " : K=${SIM_KP} CASE ${SIM_CASE} PASS: ek==pk, dk==sk"
puts ""
puts " K=4 SIM_KP/SIM_CASE "