# 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 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 --timescale 1ns/1ps # ================================================================ # Step 4: Run simulation # ================================================================ puts "=== Running storage test ===" xsim tb_storage_xsim -R puts "" puts "=== Storage simulation complete ==="