Using GLBL with OSVVM
Why OSVVM™? › Forums › OSVVM › Using GLBL with OSVVM
- This topic has 8 replies, 2 voices, and was last updated 13 hours, 41 minutes ago by
jon.
-
AuthorPosts
-
December 29, 2025 at 12:59 #2842
jon
MemberI am trying to use the Xilinx XPM library in a simulation and it needs glbl.v. I compliled it using the Xilinx source into my work library. I also added the following to my script
SetSecondSimulationTopLevel glblBut I am getting the following warning
Warning: (vsim-3824) Optimized (MyTest_opt) and unoptimized (glbl) top-level design units are # simulated together. Unoptimized design units will not be optimized.It does carry on loading the modules then I get the following error
Error: (vsim-3043) Unresolved reference to 'glbl' in glbl.GSR.I am not sure if I am doing this the correct way.
December 30, 2025 at 15:04 #2843jon
MemberIt seems that the issue is to do with the Questasim vsim command. The script is doing the following
vsim -c -t ps -lib common_tb TbStream_SendGetBurst1_opt common_tb.glbl -suppress 8683 -suppress 8684If I remove the common_tb.glbl in the above the it runs.
January 1, 2026 at 05:51 #2844
Jim LewisMemberIf you make this call:
SetSecondSimulationTopLevel glblThen OSVVM would do:
vsim -c -t ps -lib common_tb TbStream_SendGetBurst1_opt glbl -suppress 8683 -suppress 8684That said, since a library is not specified for glbl, Questa will assume it to be in common_tb. So as a result, Questa may add the common_tb.glbl in their interpretation of it.
From the README.rst or Script_user_guide.pdf,
– SetSecondSimulationTopLevel library.TestName
– Sets the name of a second library unit to use during simulation.
– Called before simulate.I expect that Xilinx will want you to put glbl into a specific library. As a result, you need to call SetSecondSimulationTopLevel as:
SetSecondSimulationTopLevel Xilinx_Specified_Library.glblNote, just in case, the Xilinx_Specified_Library should never be named “work”. Naming a physical library “work” is a cruel thing some simulator vendors suggest. The name “work” in VHDL always refers to the “working library” which is the named library into which you are currently compiling (here it is: common_tb).
If you created the Xilinx_Specified_Library outside of OSVVM, you will need to link the library with:
– LinkLibrary library [path]
– Create a mapping to a library that is in the library directory specified by path.
– If path is not specified, use the library directory specified by SetLibraryDirectory.January 1, 2026 at 09:39 #2845jon
MemberHi Jim
I compliled GLBL into its own librrary but that didnt help. It seems that I need GLBL included for the vopt step but not in the simulate step. I manually added -L xilinx_glbl to the vopt command and that seemed to work. But I am not sure how I make the script add the library to vopt.
Thanks
Jon
January 1, 2026 at 15:16 #2846jon
MemberTo summarize I dont think its necessary to have GLBL in a seperate library. It seems as though I need to have GLBL in the vopt step but not in the vsim step. The following works, the only difference is that GLBL isnt included for the vsim step. If I use the script then it is included and the simulation wont start because of the error below.
vopt -reportprogress 300 -work common_tb -L common_tb fifo_test common_tb.glbl -o fifo_test_opt -designfile C:/hds/hdl/common/sim/common_RunDemoTests/reports/COMMON/fifo_test_design.bin vsim -c -t ps -lib common_tb fifo_test_opt -suppress 8683 -suppress 8684# ** Warning: (vsim-3824) Optimized (fifo_test_opt) and unoptimized (glbl) top-level design units are # simulated together. Unoptimized design units will not be optimized. # ** Error (suppressible): (vsim-12110) All optimizations are disabled because the -novopt option is in effect. This will cause your simulation to run very slowly. If you are using this switch to preserve visibility for Debug or PLI features, please see the User's Manual section on Preserving Object Visibility with vopt. -novopt option is now deprecated and will be removed in future releases.January 1, 2026 at 22:50 #2847
Jim LewisMemberWhich version of Questa are you using?
Historically Questa offered either a vsim or a vopt/vsim flow. Up until 2025, OSVVM only supported the vsim flow, but supports both vsim and vopt/vsim flow.
The startup VendorScripts_Siemens.tcl supports the vsim flow. VendorScripts_Questa.tcl supports the vopt/vsim flow.
To choose which one you get, you need to set the OSVVM_TOOL environment variable to either Siemens or Questa. By default, if Questa is 2025.2 or newer, StartUp.tcl selects the vopt/vsim flow. Older versions of Questa select the vsim flow.
One caution is that on Windows the vopt/vsim flow creates a library that is around 10X larger – which for OSVVM regressions is 30 to 40 GB.
If you compile glbl.v using a script separate from OSVVM, Questa will not know about the library. As a result, in OSVVM, you need to tell Questa about the library by doing:
LinkLibrary xilinx_glbl C:/temp/xilinx/VHDL_LIBS/xilinx_glblIf you are compiling glbl.v with osvvm, the library statement does this:
library xilinx_glblAs a result of the above, Questa will put a mapping for the library in its modelsim.ini/questa.ini file. If you delete the modelsim.ini/questa.ini, then you will need to repeat the above.
When you do not do the above, you can alternately specify the library in the
-L common_tbJanuary 2, 2026 at 09:36 #2848jon
MemberI am not sure what I am doing wrong. I am using the latest Questa base so I am using the VSIM/VOPT flow.
I compiled GLBL into my common_tb library where are the other design files are located. It just seems the issue is with the vsim command. Having coomon_tb.glbl makes it fail with the error shown in the previous post.vsim -c -t ps -lib common_tb fifo_test_opt common_tb.glbl -suppress 8683 -suppress 8684 (DOESNT WORK) vsim -c -t ps -lib common_tb fifo_test_opt -suppress 8683 -suppress 8684 (WORKS)January 2, 2026 at 14:05 #2849
Jim LewisMemberHi Jon,
Thanks for sticking with this one. Knowing which version of Questa you had made told me I needed to search harder in VendorScripts_Questa.tcl. I found the issue. It is fixed on Dev.If you do not want to update to the Dev branch, you can edit the line in VendorScripts_Questa.tcl that says:
set SimulateOptions [concat $::VsimArgs -t $SimulateTimeUnits -lib ${LibraryName} ${LibraryUnit}_opt ${::osvvm::SecondSimulationTopLevel} {*}${args} -suppress 8683 -suppress 8684]And remove the ${::osvvm::SecondSimulationTopLevel} so that it is now:
set SimulateOptions [concat $::VsimArgs -t $SimulateTimeUnits -lib ${LibraryName} ${LibraryUnit}_opt {*}${args} -suppress 8683 -suppress 8684]Best Regards,
JimJanuary 2, 2026 at 15:08 #2851jon
MemberHi Jim
Thanks for fixing this.
Jon
-
AuthorPosts
- You must be logged in to reply to this topic.