fix(tb): fix Vivado 2019.2 compatibility and add run_tb.sh

- Replace -include_dirs . with -i . (Vivado 2019.2 syntax)
- Add --timescale 1ns/1ps to all xelab commands
- Add LD_PRELOAD comment for ncurses compatibility
- Add run_tb.sh convenience script
  Usage: ./run_tb.sh mod_add
         ./run_tb.sh --list
- Update spec with Vivado 2019.2 compatibility notes
This commit is contained in:
2026-06-25 20:53:47 +08:00
parent 52c625b3ef
commit 79653ac3a5
13 changed files with 181 additions and 27 deletions

View File

@@ -1,3 +1,7 @@
# NOTE: On some systems, you may need:
# export LD_PRELOAD=/usr/lib64/libtinfo.so.5
# before running this script.
# xsim_run.tcl - Vivado xsim compilation and simulation for sample_ntt_sync
#
# Compiles sample_ntt_sync RTL + SHA3 dependencies + testbench and runs simulation.
@@ -26,13 +30,13 @@ set TB_DIR sync_rtl/sample_ntt/TB
puts "=== Compiling RTL sources ==="
# Keccak round (combinational, used by keccak_core)
xvlog -sv -include_dirs . ${SHA3_DIR}/keccak_round.v
xvlog -sv -i . ${SHA3_DIR}/keccak_round.v
# Keccak core (24-round sequential core, used by sample_ntt_sync)
xvlog -sv -include_dirs . ${SHA3_DIR}/keccak_core.v
xvlog -sv -i . ${SHA3_DIR}/keccak_core.v
# sample_ntt_sync (DUT) — uses `include "sync_rtl/common/defines.vh"
xvlog -sv -include_dirs . ${SRC_DIR}/sample_ntt_sync.v
xvlog -sv -i . ${SRC_DIR}/sample_ntt_sync.v
# ================================================================
# Step 2: Compile testbench
@@ -44,7 +48,7 @@ xvlog -sv ${TB_DIR}/tb_sample_ntt_xsim.v
# Step 3: Elaborate snapshot (xelab)
# ================================================================
puts "=== Elaborating snapshot ==="
xelab tb_sample_ntt_xsim -s tb_sample_ntt_xsim
xelab tb_sample_ntt_xsim -s tb_sample_ntt_xsim --timescale 1ns/1ps
# ================================================================
# Step 4: Run simulation