Immediate Vs Concurrent Assertions

Immediate assertions use expressions and are executed like a statement in a procedural block. They are not temporal in nature and are evaluated immediately when executed. Immediate assertions are used only in dynamic simulations. Following is an example of a simple immediate assertion that checks “if x and y are always equal”:

always_comb begin
x_eq_y: assert (x==y) else $error (“X not equal Y“);
end

Concurrent assertions are temporal in nature and the test expression is evaluated at clock edges based on the sampled values of the variables involved. They are executed concurrently with other design blocks. They can be placed inside a module or an interface. Concurrent assertions can be used with both dynamic simulations as well static (formal) verification. Following is a simple example of a concurrent assertion that checks “if z is high on a clock cycle, then on the next cycle, the value of x and y is equal”:

x_eq_y : assert property((@posedge clk) z |=> (x == y));