Professional Documents
Culture Documents
mmediate Assertions
Assertion Fail Assertion Pass assertion(label : assert )e!pression* pass block code+ else fail block code+
'ynta! :
0oncurrent Assertions
'pans over time, evaluated based on events 1ifference between clock tick and simulation ticks
"!pressions such as )clk 22 gating(signal* and )clk iff gating(signal* can be used to represent a gated clock/
'e3uences
n place of a,b or c there can be any Boolean e!pression or se3/ A 66 followed by a number or range specifies the delay from the current clock tick to the beginning of the se3uence that follows/
'e3uences "!amples
a 668 b , when a is true after 8 clock ticks b must be true concatenation of overlapped se3uences
)a 664 b 664 c* 66% )d 664 e 664 f* same as )a 664 b 664 c2d 664 e 664 f*
'e3uences "!amples
9hen delay is not fi!ed value but in specific time window it can be specified as follows :
a 66:4:;< b
same as ))a 664 b* or )a 667 b* or )a 66; b* *
a 66:=:>%< b a 66:8:-< b - indicates end of simulation when a is true b must be true after 8 clock ticks/
'e3uences "!amples
Consecutive repetition
a :?;< means a 664 a 664 a a 664 b :?;< 664 c b 664 a:?%:4< 667 c means )b 667 c* or )b 664 a 667 c* )a 667 b* :?@< same as )a 667 b 664 a 667 b 664 a 667 b 664 a 667 b 664 a 667 b*
'e3uences "!amples
a 664 b :,A=< 664 c indicates after a is true b must be true four times with no gap between b and c , same as a 664 ))Bb:?%:-< 664 b* :?=<* 664 c a 664 b :CA=< 664 c indicates after a is true b must be true four times with gap between b and c , same as a 664 ))B b:?%:-< 664 b* :?=<* 664 Bb:?%:-< 664 c
Non-consecutive repetition ( [= )
and operation
se34 and se37 'e3uence must start at the same time and can end at any time/ Datch is done after last se3uence is ended )te4 667 te7* and )te; 667 te= 667 te@*
Or operation
se34 or se37 'e3uence must start at the same time and can end at any time/ Datch is done at both the se3uences ends
se34 intersect se37 se3uences must start at the same time and end at same time/ Datch is done at the end time/ )te4 66:4:@< te7* intersect )te; 667 te= 667 te@*
first_matc operation :
first_matc )se34* Datches only the first match and ignores other matches A t rou! out se34 Boolean e!pression A must be throughout se34
Arguments in 'e3uence
Function -sampled returns the sampled value of the e!pression with respect to the last occurrence of the clocking event/ 9hen -sampled is invoked prior to the occurrence of the first clocking event, the value of # is returned/ "!ample:
always 5)posedge clk* begin cnt C cnt E 4%+ temp C -sampled)cnt*+ end
"rose$ returns true if F'B of the e!pression changed to 4/ &therwise, it returns false "fe##$ returns true if F'B of the e!pression changed to %/ &therwise, it returns false "sta%#e$ returns true if the value of the e!pression did not change/ &therwise, it returns false
"past$
past) e!pression4 :, number(of(ticks< :, e!pression7< :, clocking(event<* Three optional arguments are provided:
e&pression2 is used as a gating e!pression for the clocking event num%er_of_tic's specifies the number of clock ticks in the past c#oc'in!_event specifies the clocking event for sampling e!pression4 -past)in4, , enable*+ always 5)posedge clk* reg4 GC a 2 -past)b*+ -past)3, 7,enable*+
"!amples:
Thank You