ModelSim Question

vtc

Joined
Sep 15, 2010
Messages
1
Reaction score
0
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,531
Members
45,005
Latest member
MellisaSti

Latest Threads

Top