I was getting having problems simulating a XAUIcore with multiple errors like# ** Error: nofile(38): in protected region
(when vopt was enabled) or# ** Fatal: Error occurred in protected context.# Time: 0 ps Iteration: 0 Protected: /test_bench/UUT/XAUI_IF/xaui_phy_inst/genblk2/alt_xaui_phy/genblk2/sxaui_0/imp_soft_pcs/alt_soft_xaui_pcs/xaui_rx/imp_soft_pcs/pcs_deskew/imp_soft_pcs/deskew_chan3/imp_soft_pcs/deskew_ram File: nofile# FATAL ERROR while loading design# Error loading design# Error: Error loading design
I solved this error problem by editing the <design_instance>_sim/mentor/mssim_setup.tcl file, which is generated by the Megawizard (and Qsys?). I added my own libraries using their ensure_lib/vmap syntax. I also added my own alias followed by the vcom or vlog lines, using their syntax, for my design files under theirs in the 'Compile the design files in the correct order section'. The alias allows you to type single word in modelsim's transcript window to perform a multitude of actions. Following their paradigm, I added my own alias for elaborating my design under their Elaboration section. To make sure that I did not miss any library files, I copied their vsim line into my elaboration alias definition, I added my own desing libraries to that file and then replaced their $TOP_LEVEL_NAME, with my test bench entity name.
I also ld_mydesign as an alias under the# Compile all the design files and elaborate the top level design
section. When I defined this last alias, I couldn't resist add to that alias definition the lines:
add wave *
view structure
view signals
run -all
Finally, just for reminder's sake, I added my alias definitions under the# Print out user alias section.
These are printed out when modelsim executes the .tcl file. I then saved this tcl file as <my_tcl_file_name>.tcl in the directory <Project_folder>/simulation/modelsim, which is where ModelSim finds its modelsim.ini file.
This .tcl file can now be read in by modelsim either through the Tools/Tcl menu or by typing
do <my_tcl_file_name>.tcl
in ModelSim's transcript window. After 'do <my_tcl_file_name>.tcl' in ModelSim's transcript window, I simply type
ld_mydesign
in the transcript window. No more of those nasty loading errors!