passing command line argument on Modelsim - TCL

This is a discussion on passing command line argument on Modelsim - TCL ; Hi, I am a begginer in TCL. I want to write a script in TCL to be sourced on Modelsim by saying > do run.tcl I want to pass some arguments to run.tcl on the above command line i.e. > ...

+ Reply to Thread
Results 1 to 5 of 5

passing command line argument on Modelsim

  1. Default passing command line argument on Modelsim

    Hi,

    I am a begginer in TCL.
    I want to write a script in TCL to be sourced on Modelsim by saying

    > do run.tcl


    I want to pass some arguments to run.tcl on the above command line
    i.e.

    > do run.tcl test1 test2


    I tried using argv but argv list does not contain the argument test1
    whereas argc correctly shows number of arguments as 2.

    Please help.


  2. Default Re: passing command line argument on Modelsim

    pacific29@gmail.com wrote:

    > I want to pass some arguments to run.tcl on the above command line
    > i.e.
    >
    > > do run.tcl test1 test2

    >
    > I tried using argv but argv list does not contain the argument test1
    > whereas argc correctly shows number of arguments as 2.


    What *does* argv contain?

  3. Default Re: passing command line argument on Modelsim

    On Sep 18, 4:58 pm, Alan Anderson <arand...@insightbb.com> wrote:
    > pacifi...@gmail.com wrote:
    > > I want to pass some arguments to run.tcl on the above command line
    > > i.e.

    >
    > > > do run.tcl test1 test2

    >
    > > I tried using argv but argv list does not contain the argument test1
    > > whereas argc correctly shows number of arguments as 2.

    >
    > What *does* argv contain?


    lindex argv 0 ==> -gui
    lindex argv 1 ==> .....nothing
    lindex argv 2 ==> .....nothing


  4. Default Re: passing command line argument on Modelsim

    On 18 Sep., 14:00, pacific29 <pacifi...@gmail.com> wrote:
    > On Sep 18, 4:58 pm, Alan Anderson <arand...@insightbb.com> wrote:
    >
    > > pacifi...@gmail.com wrote:
    > > > I want to pass some arguments to run.tcl on the above command line
    > > > i.e.

    >
    > > > > do run.tcl test1 test2

    >
    > > > I tried using argv but argv list does not contain the argument test1
    > > > whereas argc correctly shows number of arguments as 2.

    >
    > > What *does* argv contain?

    >
    > lindex argv 0 ==> -gui
    > lindex argv 1 ==> .....nothing
    > lindex argv 2 ==> .....nothing


    So the [do] command (which is not standard Tcl, but probably provided
    by Modelsim) does not put its arguments into argv. Have you checked
    the modelsim documentation?



  5. Default Re: passing command line argument on Modelsim

    suchenwi wrote:
    > On 18 Sep., 14:00, pacific29 <pacifi...@gmail.com> wrote:
    >> On Sep 18, 4:58 pm, Alan Anderson <arand...@insightbb.com> wrote:
    >>
    >>> pacifi...@gmail.com wrote:
    >>>> I want to pass some arguments to run.tcl on the above command line
    >>>> i.e.
    >>>>> do run.tcl test1 test2
    >>>> I tried using argv but argv list does not contain the argument test1
    >>>> whereas argc correctly shows number of arguments as 2.
    >>> What *does* argv contain?

    >> lindex argv 0 ==> -gui
    >> lindex argv 1 ==> .....nothing
    >> lindex argv 2 ==> .....nothing

    >
    > So the [do] command (which is not standard Tcl, but probably provided
    > by Modelsim) does not put its arguments into argv. Have you checked
    > the modelsim documentation?
    >
    >


    It took me less than a minute to find the modelsim user guide on the net
    (how did we ever live without google?), and it is written:

    -begin quote-
    You can increase the flexibility of DO files by using parameters.
    parameters specify values that are passed to the corresponding
    parameters $1 through $9 in the macro file. For example say the
    macro "testfile" contains the line bp $1 $2. The command below would
    place a breakpoint in the source file named design.vhd at line 127:

    do testfile design.vhd 127

    There is no limit on the number of parameters that can be passed to
    macros, but only nine values are visible at one time. You can use the
    shift command to see the other parameters.
    -end quote-

    --
    Bryan Oakley
    http://www.tclscripting.com

+ Reply to Thread

Similar Threads

  1. Command line argument
    By Application Development in forum Java
    Replies: 2
    Last Post: 12-02-2007, 06:53 PM
  2. ruby libpcap fails when passing command-line argument
    By Application Development in forum RUBY
    Replies: 0
    Last Post: 10-30-2007, 12:35 AM
  3. What is the PHP -n command line argument?
    By Application Development in forum PHP
    Replies: 0
    Last Post: 07-22-2007, 04:55 PM
  4. Modelsim simulation progress in batch/command line mode?
    By Application Development in forum verilog
    Replies: 6
    Last Post: 04-26-2007, 12:05 PM
  5. Modelsim simulation progress in batch/command line mode?
    By Application Development in forum vhdl
    Replies: 6
    Last Post: 04-26-2007, 12:05 PM