3 Replies Latest reply on Jul 12, 2018 9:08 AM by samantha_lizak

    Simulation using Do file

    joniengr081

      Hi,

       

      I found the following in a Do file. Can anyone explain it's function and how this code run in Do file ?

       

      quietly set lib_name "lib_name"

      quietly set part_name "part_name"

      # path from mpf-file in sim

      quietly set ip_path "../..//$mid_name/$part_name"

       

      if { [info exists 1] } {

        # path from this part to target part

        quietly set ip_path "$1/..//$mid_name/$part_name"

        unset 1

      }

       

      Is there any user manual to understand syntax in Do file ?

        • 1. Re: Simulation using Do file
          samantha_lizak

          Hi Joni-

          What product?  I did see that the ModelSim Command Reference Manual documents "quietly".  Assuming this is Tcl-based, the lines are setting lib_name, part_name, and ip_path.  "info exists 1" is always going to evaluate as true; given it refers to $1, I'm guessing it is a fragment of a larger script. $1 would be the first argument after the calling program's name on the command line.

           

          A .do file is just a Tcl file (and yes, commonly used in ModelSim). I found a bunch of hits by searching on "Tcl dofile".

           

          Best-

           

          Sam.

          • 2. Re: Simulation using Do file
            joniengr081

            Does this means that "quietly set" will only set the path but will not print on the transcript in Questa ?

            Untitled25.png

            • 3. Re: Simulation using Do file
              samantha_lizak

              Yep.

               

              By the way, if you can suggest a way to make the documentation more clear, send it in using the "Documentation feedback" link that all the manuals have.  (In your screenshot, it is the last line in the bookmarks column on the left.)  The writers love hearing from people who are using the manuals, and even happier when the people are "real users" rather than customer support.

               

              Best-

               

              Sam.