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
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