Skip to content

Formal Verification : Unconstrained Initial Value Leads to Invalid Verification Results #4322

Answered by KrystalDelusion
Qin141209 asked this question in Q&A
Discussion options

You must be logged in to vote

I would instead phrase this as two questions:

  1. How to initialise the circuit into a known state (e.g. reset), and
  2. How to ignore assertions during the initial (potentially invalid) state.

For the first question there are a few options, the simplest is to add the following line:

initial assume (!rst);

Which will work for wires, registers, and anything else (and as an aside, if you have an active low reset like this it is common to put _n or similar after the name to signify).

Another option for if you want to reset once and only once:

reg init = 0;
always @(posedge clk) begin
    assume (rst == init);
    if (init) begin
        assert (b <= 4'b1000);
    end
    init <= 1;
end

This method…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Qin141209
Comment options

Answer selected by Qin141209
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants