Using GLBL with OSVVM

Why OSVVM™? Forums OSVVM Using GLBL with OSVVM

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #2842
    jon
    Member

    I 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 glbl

    But 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.

    #2843
    jon
    Member

    It 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 8684

    If I remove the common_tb.glbl in the above the it runs.

    #2844
    Jim Lewis
    Member

    If you make this call:
    SetSecondSimulationTopLevel glbl

    Then OSVVM would do:
    vsim -c -t ps -lib common_tb TbStream_SendGetBurst1_opt glbl -suppress 8683 -suppress 8684

    That 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.glbl

    Note, 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.

    #2845
    jon
    Member

    Hi 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

    #2846
    jon
    Member

    To 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.
    #2847
    Jim Lewis
    Member

    Which 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_glbl

    If you are compiling glbl.v with osvvm, the library statement does this:
    library xilinx_glbl

    As 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_tb

    #2848
    jon
    Member

    I 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)
    #2849
    Jim Lewis
    Member

    Hi 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,
    Jim

    #2851
    jon
    Member

    Hi Jim

    Thanks for fixing this.

    Jon

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.