Forum Discussion
Altera_Forum
Honored Contributor
14 years agoI tried following your example to use multiple libraries, but I ended up with similar errors as before. Sticking to one library seems easier to wrap my head around. I made some progress, but I still do not have it working. This is the current state of my ModelSim script:
# Clean the transcript window
.main clear
# delete the library directory if it exists
if { vdel -lib libraries -all }
# Extra stuff for Nios goes here---------------
set QSYS_SIMDIR "../nios/simulation"
source ../nios/simulation/mentor/msim_setup.tcl
dev_com
com
vlog -incr "../nios/simulation/my_nios_spi.v"
----------------------------------------------
# Compile files
# These two lines attempt to compile my existing code into the work location defined by Altera
vlog -incr "../tb/tb_sketchpad.sv"
vlog -incr "../src/DE0_Nano.sv"
# More Nios stuff------------------------------
set TOP_LEVEL_NAME tb_sketchpad
elab
# ---------------------------------------------
# Run my testbench
vsim -l ./transcript +notimingchecks -t ps tb_sketchpad
rad hex
view structure
view signals
do wave.do
run -all
If I comment out the Nios module in my FPGA design, that ModelSim script will actually run the rest of the design. In that sense it is progress compared to nothing working. However, it still does not work with the Nios module actually instantiated. The script makes it all the way to the vsim command, then starts spitting out errors like this:
# ** Error: (vsim-3033) ../nios/simulation/my_nios_spi.v(456): Instantiation of 'my_nios_spi_nios2_qsys_0' failed. The design unit was not found.
# Region: /tb_sketchpad/m_nano/m_nios
# Searched libraries:
# C:\Users\afaulstich\Documents\FPGA\DE0_Nano_sketch_pad_NiosSPI\sim\libraries\work
If I type “vmap” into the ModelSim console I see that the design unit does have a mapping in place:
# "my_nios_spi_nios2_qsys_0" maps to directory ./libraries/my_nios_spi_nios2_qsys_0/.
It looks the same for all the other errors; they have mappings in place, but the files are not being recognized. It looks like vsim is searching for the mapped files in ./libraries/work instead of ./libraries. Is there a simple way to correct that?