Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

Modelsim: How to change default time unit?

I'd like to change the timeunit for Modelsim. By default Modelsim uses ps, but I'd like to change to ns. Currently if I issue the command run 1000 in the wave window, the time advances 1000ps. I'd like that to run 1000ns.

Where can I define the default time unit to ns?

I have tried changing both the Resolution and UserTimeUnit variables in the modelsim.ini file and neither of those did the trick. Is that setting set somewhere else?

Thanks,

-phil

7 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

    You must execute:
    run 1000 ns

    See the help for the commands like run, you will learn its syntax and its options ;).

    Regards
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    cs1400, thank you for the reply. I know how to use the command line to change the timescale as you described. What I'm asking is, how can I universally and permanently change the time scale so that units are not necessary during run commands?

    -phil
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    you cant afaik.

    How about changing the testbench so that it halts iteself, so you can always just type:

    run -all
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    What I'm asking is, how can I universally and permanently change the time scale so that units are not necessary during run commands?

    --- Quote End ---

    I have Questasim, but I remember they have the same GUI.

    1. Go to Tools in the toolbar, and Edit Preferences.

    2. Go to the second tab named "By name".

    3. Clic on Exapnd all, then on Find...

    4. Enter the default value of time that your simulator has, check Value in Field, and clic on Find next

    You could also see the items

    • Postscript : perpage

    • Compare : defaultLeadUnits and defaultTrailUnits

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Basically all defaults are set in the vsim section of modelsim .ini

    
    ; vopt flow
    ; Set to turn on automatic optimization of a design.
    ; Default is off (pre-6.0 flow without vopt).
    ; VoptFlow = 1
    ; Simulator resolution
    ; Set to fs, ps, ns, us, ms, or sec with optional prefix of 1, 10, or 100.
    Resolution = ps
    ; User time unit for run commands
    ; Set to default, fs, ps, ns, us, ms, or sec. The default is to use the
    ; unit specified for Resolution. For example, if Resolution is 100ps,
    ; then UserTimeUnit defaults to ps.
    ; Should generally be set to default.
    UserTimeUnit = default
    ; Default run length
    RunLength = 100
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Basically all defaults are set in the vsim section of modelsim .ini

    
     
    ; vopt flow
    ; Set to turn on automatic optimization of a design.
    ; Default is off (pre-6.0 flow without vopt).
    ; VoptFlow = 1
     
    ; Simulator resolution
    ; Set to fs, ps, ns, us, ms, or sec with optional prefix of 1, 10, or 100.
    Resolution = ps
     
    ; User time unit for run commands
    ; Set to default, fs, ps, ns, us, ms, or sec. The default is to use the
    ; unit specified for Resolution. For example, if Resolution is 100ps,
    ; then UserTimeUnit defaults to ps.
    ; Should generally be set to default.
    UserTimeUnit = default
     
    ; Default run length
    RunLength = 100

    --- Quote End ---

    For some reason, changing the Resolution or UserTime Unit to ns doesn't do what I want. Even though those variables are set to ns in my modelsim.ini, and the perferences dialog reports that ns is the chosen unit, when I issue the command run 100, the simulation advance 100 ps, not 100 ns.

    -phil
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The default settings can be overwritten in the GUI and possibly in a script. Or you are looking to the wrong instance of modelsim.ini.