
Assertion-based verification and Verilog-RTL
Assertions may be used for the following purposes:
1. Dynamic Verification
2. Formal Verification (Model Checking)
3. Synthesis.
OVL assertions may be helpful in regular Dynamic Verification.
However, because they target mostly low-level checks (one-hot/cold
fsm, parity, fifo etc) the main assertion users may be designers.
However, Verification engineers may also use OVL assertions for some
simple checks.
Formal tools allow designer to check their design (preferably
block-level) without developing tesbench and appying stimulus.
Assertion monitors may be adjasted for specific formal tool whith
$display statement form ovl_task.v file replaced by tool-specific
assertion operator.
In synthesis, IMHO, assertions may be used not for extra design
constraining, but for extra information from some important internal
nodes. OVL assertion must be changed for this purpose: all
non-syntesiseable operators such as $display must be removed and
"status" output must be added for each one of assertion monitors. As
a result, for each assertion we'll have the signal which informs upper
logic when assertion fails. This signal may be used as "internal
output" for emulation purposes. If emulation is not the case, there is
no reason to synthesise assertions. OVL assertions, for example,
contain synopsys off & synopsys on comments which exclude assertion
body from synthesis.
And finally, small example which demonstrates assertion usage for
formal verification & synthesis using simplified version of
assert_always assertion monitor:
// Assertion monitor for Synthesis
//---------------------------------
module assert_always (clk, reset_n, test_expr, out);
input clk, reset_n, test_expr;
output out;
reg out_reg;
if (reset_n != 0) begin
if (test_expr == 1'b1) out_reg <= 1;
else out_reg <= 0;
end
end
assign out = out_reg;
endmodule
//Synthesiseable module; c goes low when a less or eq. b
//-----------------------------------------------------
module check (clk, rst_n, a, b, c);
input clk, rst;
input a, b;
output c;
assert_always (clk, rst_n, (a > b), c);
endmodule
// Assertion monitor for formal model checking with SMV:
//-----------------------------------------------------
module assert_always (clk, reset_n, test_expr);
input clk, reset_n, test_expr;
if (reset_n != 0) begin
assert assert_always : (test_expr == 1'b1)
end
end
endmodule
Regards,
Alexander Gnusin
www.TCLforEDA.net