Amir Yazdanbakhsh
Newbie level 5
- Joined
- Jun 18, 2013
- Messages
- 9
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 66
Hi,
I am trying to assign random values to the inputs of my design. I would like to do in the TCL scripts. I have the TCL for the Modelsim. I need something similar in the NCSim.
I am trying to assign random values to the inputs of my design. I would like to do in the TCL scripts. I have the TCL for the Modelsim. I need something similar in the NCSim.
Code:
set DUTInS [] # Set to store all the inputs
# Find all the inputs and add them to the set
foreach k [find signals -in DUT/*] {
set o [string map {DUT GM} $k]
lappend DUTInS $k
}
# Assign a random value to them
foreach k1 $DUTInS {
set r [ expr { int(floor(rand() * 2.0)) } ]
force $k1 $r 0ps
}