Problem simulating with genrics

Why OSVVM™? Forums OSVVM Problem simulating with genrics

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #2888
    jon
    Member

    I am trying to change a generic in my testbench when I start the simulation (using Questasim base). I am using the following script :-
    TestName tb_test1
    analyze tb_test1.vhd +acc
    simulate tb_test1 [generic USE_ADV_MODE 1]
    I get the following output from the simulator
    vopt {*}-work dma_mm2s -L dma_mm2s tb_test1 common.glbl -o tb_test1_opt -gUSE_ADV_MODE=1 -designfile C:/hds/hdl/dma/sim/dma_dma_mm2s/reports/JON/tb_test1_USE_ADV_MODE_1_design.bin
    Then a bit further down it says
    ** Warning: (vopt-3040) Command line generic/parameter “USE_ADV_MODE” not found in design.
    The simulation runs and I can see the generic is there but it has the default value I set in the testbench.
    I am not sure what I am doing wrong.
    Thanks

    #2889
    Jim Lewis
    Member

    Hi Jon
    Is the generic at the top level of the testbench or is it at a lower level?

    Best Regards,
    Jim

    #2899
    jon
    Member

    Hi Jim
    Sorry for the delay.
    The genric is in the testbench file where all items are instantiated (DUT, AXI compoents etc).
    Thanks
    Jon

    #2904
    Jim Lewis
    Member

    In VendorScripts_Questa (if version is 2025 or newer) or VendorScripts_Siemens, the generic switch is set by the following:

    # -------------------------------------------------
    proc vendor_generic {Name Value} {
      
      return "-g${Name}=${Value}"
    }

    According to the Questa command reference,

    -g <Name>=<Value> …
    (optional) Assigns a value to all specified VHDL generics and Verilog parameters that have
    not received explicit values in generic maps, instantiations, or from defparams (such as toplevel
    generics/parameters and generics/parameters that would otherwise receive their default
    values).
    . . . 
    -G<Name>=<Value> …
    (optional) Same as -g (see above) except that -G also overrides generics/parameters that
    received explicit values in generic maps, instantiations, or from defparams.

    OSVVM is using lower case g. If you want to override something set on the component, you can switch it to upper case G in the scripts. Perhaps OSVVM can make that a setting in the future.

    Alternately you can change how you are giving the generic its default value. Rather than putting it in a generic map, specify it as the default on a component declaration (if using component instances) or on the entity declaration (if using entity instances). The lower case “-g” should override these.

    Let me know how it goes.

    Best Regards,
    Jim

    #2905
    jon
    Member

    Setting it to -G solved the problem.
    Thanks
    Jon

    #2906
    Jim Lewis
    Member

    Be sure to try setting the generic defaults via the component (if used) or entity (if component not used).

    #2907
    jon
    Member

    It looks like the problem was that I was defining the generic as a default value in the testbench top. Doing that I needed to use the -G option. If i delete that statement then the -g option works.

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