I am trying to simulate a test bench for an Intel IP (AVST CDC) in Questa using cocotb. What would be the correct way to add generated simulation files to run in cocotb?
I've generated IP Simulation files through Quartus - a couple of .tcl scripts. I've figured how to use those files - I wrote a small script to source generated .tcl file, which compiles libraries for simulation:
set QSYS_SIMDIR "../../ip/ip_avst_cdc/sim"
source $QSYS_SIMDIR/mentor/msim_setup.tcl
com
After that, I've added this file as SCRIPT_FILE in cocotb makefile. Questa successfully elaborates and adds those libraries to the internal library list, but I can't figure out a good way to pass those libraries' names to the simulator for the run. The only option I've found is to manually check generated library names, and type those into makefile. For my case, I've checked generated library names in modelsim_files.tcl:
namespace eval ip_avst_cdc {
proc get_design_libraries {} {
set libraries [dict create]
dict set libraries hs_clk_xer_1940 1
dict set libraries ip_avst_cdc 1
return $libraries
}
And added those names to the makefile using SIM_ARGS:
SIM_ARGS += -L ip_avst_cdc -L hs_clk_xer_1940
This works, but it's too complicated. Next, I want to run a simulation with lots of IP, so doing stuff manually like this is not an option. Does anyone know of a better way to do this?
I've managed to automatically generate those library names and save them to SIM_ARGS. I've written get_lib_names.tcl, which prints (puts) only library names, returned by namespace::get_design_libraries. This script is invoked in makefile:
LIBRARIES captures whatever get_lib_names.tcl prints, and then data from it is added to SIM_ARGS with -L as prefix. In conclusion, this allows IP usage without user manual input from generated files.