Assign random values to the inputs with TCL in NCSim

Status
Not open for further replies.

Amir Yazdanbakhsh

Newbie level 5
Joined
Jun 18, 2013
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
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.

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
}
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…