ModelSim Question

Discussion in 'VHDL' started by vtc, Sep 15, 2010.

  1. vtc

    vtc

    Joined:
    Sep 15, 2010
    Messages:
    1
    In ModelSim i have a project with an entity that has an input port of type STD_LOGIC_VECTOR.

    I have this little TCL script in a DO file to test the entity.

    I just want it to count up binary on the input... so it has to go from 0000 to 0001 to 0010 to 0011 to 0100 etc...

    I am trying to put this in a loop. And of course it doesnt work

    for { set i 0 } { $i < 16 } { incr i } {
    force input $i
    run 100
    }

    of course the std_logic_vector input is an array, and $i isn't.
    I've looked at typecasting in the ModelSim TCL reference manual and it says i can cast by using (std_logic_vector) but somehow it still won't do this, besides, how does it know to howmany bits logic vector it must cast?

    I am very new to TCL so please forgive me if this seems newbish :)

    I get this error:

    # ** Error: Value length (1) does not equal array index length (4).
    # ** Error: (vsim-4011) Invalid force value: 0.

    If anyone knows how to convert from a normal integer variable to a 4 bit wide std_logic_vector to make this loop i'd be much obliged for your help

    thanks,

    v
    vtc, Sep 15, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simone Winkler

    Please help me!!! ModelSim question

    Simone Winkler, Aug 27, 2003, in forum: VHDL
    Replies:
    1
    Views:
    696
    Mike Treseler
    Aug 27, 2003
  2. blf
    Replies:
    5
    Views:
    2,525
  3. Yttrium
    Replies:
    1
    Views:
    705
    Jonathan Bromley
    Oct 31, 2003
  4. jk
    Replies:
    3
    Views:
    1,496
  5. kwaj
    Replies:
    3
    Views:
    1,702
    Grigorios Angelis
    Feb 18, 2004
Loading...

Share This Page