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
49 lines
1.5 KiB
Tcl
49 lines
1.5 KiB
Tcl
# xsim_run.tcl - Vivado xsim compilation and simulation script
|
|
#
|
|
# Compiles s_bram, sd_bram, and tb_storage_xsim testbench.
|
|
# Run from the project root: ~/Dev/mlkem/
|
|
#
|
|
# Prerequisites:
|
|
# source /opt/Xilinx/Vivado/2019.2/settings64.sh
|
|
#
|
|
# Usage:
|
|
# xsim -runall xsim_run.tcl
|
|
# vivado -mode batch -source xsim_run.tcl
|
|
|
|
# ================================================================
|
|
# Configuration
|
|
# ================================================================
|
|
set SRC_DIR sync_rtl/storage
|
|
set TB_DIR sync_rtl/storage/TB
|
|
|
|
# ================================================================
|
|
# Step 1: Compile RTL sources (xvlog)
|
|
# ================================================================
|
|
puts "=== Compiling RTL sources ==="
|
|
|
|
xvlog -sv ${SRC_DIR}/s_bram.v
|
|
xvlog -sv ${SRC_DIR}/sd_bram.v
|
|
|
|
# ================================================================
|
|
# Step 2: Compile testbench
|
|
# ================================================================
|
|
puts "=== Compiling testbench ==="
|
|
|
|
xvlog -sv ${TB_DIR}/tb_storage_xsim.v
|
|
|
|
# ================================================================
|
|
# Step 3: Elaborate snapshot (xelab)
|
|
# ================================================================
|
|
puts "=== Elaborating snapshot ==="
|
|
|
|
xelab tb_storage_xsim -s tb_storage_xsim
|
|
|
|
# ================================================================
|
|
# Step 4: Run simulation
|
|
# ================================================================
|
|
puts "=== Running storage test ==="
|
|
xsim tb_storage_xsim -R
|
|
|
|
puts ""
|
|
puts "=== Storage simulation complete ==="
|