Reply To: Passing arguments to simulation run script

Why OSVVM™? Forums OSVVM Passing arguments to simulation run script Reply To: Passing arguments to simulation run script

#2093
Jim Lewis
Member

Hi Anna,
Sorry, some how while answering your questions on GitHub, I missed your question here.

For all others, here is a summary of the resolution of Anna’s question.

With the 2022.10 update, the same actions can be accomplished with the following call to simulate. Note while the items in square brackets are optional, if you use generic and DoWaves, the square brackets are required (they tell TCL to execute the script).

simulate tb_top_wrapper [generic SIM_TIME 10us] [DoWaves wave1.do wave2.do]

It should be noted that DoWaves (2022.10) is a direct result of Anna’s question, so please do ask questions.

If you would like to extend OSVVM scripts, I recommend using TCL procedures rather than the EDA vendor do macro commands. The following TCL run_simulation procedure is closer to the functionality of the “do macro”, but still takes advantage of OSVVM allowing additional commands at the end of simulate, you can add a script such as the following to the file LocalScriptDefaults.tcl. I made one change from the blog post, I put this before the OSVVM context:

  proc run_simulation {LibraryUnit {WaveFiles ""} {SimTimeGeneric ""} args} {
    set SimOptions ""
    if {$SimTimeGeneric ne ""} {
      append SimOptions [generic SIM_TIME $SimTimeGeneric] " "
    }
    if {$WaveFiles ne ""} {
      foreach wave $WaveFiles {
        append SimOptions "-do $wave " 
      }
    }
    if {$args ne ""} {
      append SimOptions {*}$args
    }
    
    simulate $LibraryUnit {*}$SimOptions
  }

namespace eval ::osvvm {
. . .