Table of Contents Previous page Next page Index

ModelSim Documentation Bookcase

Model Technology Inc.


Examples

/top/bus and $bit_mask

This expression takes the bitwise AND function of signal /top/bus and the array constant contained in the global Tcl variable bit_mask.

clk'event && (/top/xyz == 16'hffae)

This expression evaluates to a boolean 1 when signal clk changes and signal /top/xyz is equal to hex ffae; otherwise is 0.

clk'rising && (mystate == reading) && (/top/u3/addr == 32'habcd1234)

Evaluates to a boolean 1 when signal clk just changed from low to high and signal mystate is the enumeration reading and signal /top/u3/addr is equal to the specified 32-bit hex constant; otherwise is 0.

(/top/u3/addr and 32'hff000000) == 32'hac000000

Evaluates to a boolean 1 when the upper 8 bits of the 32-bit signal /top/u3/adder equals hex ac.

/top/signalA'delayed(10ns)

This expression returns /top/signalA delayed by 10 ns.

/top/signalA'delayed(10 ns) AND /top/signalB

This expression takes the logical AND of a delayed /top/signalA with the undelayed
/top/signalB.

virtual function { (#-10 /top/signalA) AND /top/signalB} mySignalB_AND_DelayedSignalA

This evaluates /top/signalA at 10 simulation time steps before the current time, and takes the logical AND of the result with the current value of /top/signalB. The '#' notation uses positive numbers for looking into the future, and negative numbers for delay. This notation does not support the use of time units.

((NOW > 23 us) && (NOW < 54 us)) && clk'rising && (mode == writing)

Evaluates to a boolean 1 when logfile time is between 23 and 54 microseconds, clk just changed from low to high, and signal mode is enumeration writing.


Model Technology Inc.
Model Technology Incorporated
Voice: (503) 641-1340
Fax: (503)526-5410
www.model.com
sales@model.com
Table of Contents Previous page Next page Index

ModelSim Documentation Bookcase