feat(tb): add Vivado XSIM Verilog testbenches for all 10 sync modules
Add file-based vector testbenches ( + ) for: - mod_add_sync, rng_sync, poly_arith_sync, comp_decomp_sync - s_bram/sd_bram, sha3_chain_top - ntt_core, poly_mul_sync - sample_cbd_sync, sample_ntt_sync Each module includes: - tb_<module>_xsim.v: Vivado XSIM testbench - gen_vectors.py: Python vector generator (stdlib only) - vectors/<module>_input.hex: test input vectors - xsim_run.tcl: compile + elaborate + simulate script
This commit is contained in:
56
sync_rtl/sample_cbd/TB/xsim_run.tcl
Normal file
56
sync_rtl/sample_cbd/TB/xsim_run.tcl
Normal file
@@ -0,0 +1,56 @@
|
||||
# xsim_run.tcl - Vivado xsim compilation and simulation for sample_cbd_sync
|
||||
#
|
||||
# Compiles sample_cbd_sync RTL + SHA3 dependencies + testbench and runs simulation.
|
||||
# Run from the project root: ~/Dev/mlkem/
|
||||
#
|
||||
# Prerequisites:
|
||||
# source /opt/Xilinx/Vivado/2019.2/settings64.sh
|
||||
#
|
||||
# Usage:
|
||||
# xsim -runall sync_rtl/sample_cbd/TB/xsim_run.tcl
|
||||
#
|
||||
# # Or step-by-step:
|
||||
# vivado -mode batch -source sync_rtl/sample_cbd/TB/xsim_run.tcl
|
||||
|
||||
# ================================================================
|
||||
# Configuration
|
||||
# ================================================================
|
||||
set SRC_DIR sync_rtl/sample_cbd
|
||||
set SHA3_DIR sync_rtl/sha3
|
||||
set COMMON_DIR sync_rtl/common
|
||||
set TB_DIR sync_rtl/sample_cbd/TB
|
||||
|
||||
# ================================================================
|
||||
# Step 1: Compile all source files (xvlog)
|
||||
# ================================================================
|
||||
puts "=== Compiling RTL sources ==="
|
||||
|
||||
# Keccak round (combinational, used by keccak_core)
|
||||
xvlog -sv ${SHA3_DIR}/keccak_round.v
|
||||
|
||||
# Keccak core (24-round sequential core, used by sample_cbd_sync)
|
||||
xvlog -sv ${SHA3_DIR}/keccak_core.v
|
||||
|
||||
# sample_cbd_sync (DUT)
|
||||
xvlog -sv ${SRC_DIR}/sample_cbd_sync.v
|
||||
|
||||
# ================================================================
|
||||
# Step 2: Compile testbench
|
||||
# ================================================================
|
||||
puts "=== Compiling testbench ==="
|
||||
xvlog -sv ${TB_DIR}/tb_sample_cbd_xsim.v
|
||||
|
||||
# ================================================================
|
||||
# Step 3: Elaborate snapshot (xelab)
|
||||
# ================================================================
|
||||
puts "=== Elaborating snapshot ==="
|
||||
xelab tb_sample_cbd_xsim -s tb_sample_cbd_xsim
|
||||
|
||||
# ================================================================
|
||||
# Step 4: Run simulation
|
||||
# ================================================================
|
||||
puts "=== Running simulation ==="
|
||||
xsim tb_sample_cbd_xsim -R
|
||||
|
||||
puts ""
|
||||
puts "=== sample_cbd simulation complete ==="
|
||||
Reference in New Issue
Block a user