run_tests.sh 354 B

12345678910111213141516
  1. #!/bin/bash
  2. # Set variables
  3. TOP_MODULE="top"
  4. TESTBENCH="src/top_tb.cpp"
  5. VERILATED_DIR="obj_dir"
  6. # Run Verilator to compile Verilog code into C++ simulation
  7. verilator --cc src/$TOP_MODULE.v --exe $TESTBENCH --trace
  8. # Build the simulation executable
  9. make -C obj_dir -f V$TOP_MODULE.mk V$TOP_MODULE
  10. # Run the compiled simulation
  11. ./obj_dir/V$TOP_MODULE