Examples
1) Force input1 to 0 at the current simulator time.
force input1 0
2) Force the fourth element of the array bus1 to 1 at the current simulator time.
force bus1(4) 1
3) Force bus1 to 01XZ at 100 ns after the current simulator time.
force bus1 01XZ 100 ns
4) Force bus1 to 16#F at the absolute time 200 measured in the resolution units selected at simulation start-up.
force bus1 16#f @200
5) Force input1 to 1 at 10 time units after the current simulation time and to 0 at 20 time units after current. Repeat this cycle every 100 time units after current. If the current simulation time is 100 ns, the next transition is to 1 at 110 ns and 0 at 120 ns, this pattern to start repeating at 200 ns.
force input1 1 10, 0 20 -r 100
6) Similar to the previous example, but also specifies the time units.
force input1 1 10 ns, 0 20 ns -r 100 ns
7) Force signal s to alternate between values 1 and 0 every 100 time units until 1000 time units have occurred, starting from time Now. Cancellation occurs at the last simulation delta cycle of a time unit.
force s 1 0, 0 100 -repeat 200 -cancel 1000
So,
force s 1 0 -cancel 0
will force signal s to 1 for the duration of the current time period.
8) Force siga to decimal value 85 whenever the value on the signal is 1.
when {/mydut/siga = 10#1} {
force -deposit /mydut/siga 10#85
}
9) Force one bit of a record containing an array.
force struct1.bus1(4) 1
10) Force a slice of an array.
force {bus1[2:5]} 'hF