I’m quite new to SVA properties and assertions, so this might be a noob question.
But I think getting a good answer to this will bring me a long ways towards developing a real understanding.
I’m trying first with a short version.
If you need more detail in order to help, I’ll supply more context.
I’m using variants of the following sequence to check generic responses to requests on an interface.
The sequence is called from within a property, whenever a transaction is requested.
Once the sequence matches, I call another property which checks the responses.
The sequence carries an argument num_ahead, which specifies the number of outstanding unrelated responses expected before the relevant response arrives.
I’m observing some strange behavior depending on very subtle differences in the code.
In particular I can’t explain the difference which I observe for the following two variants.
Regarding the observed behavior, unfortunately I can’t go much beyond “variant 2 works, variant 1 does not”.
So some fundamental explanation of the difference between the two would be very very much appreciated.
Can anybody explain what is happening here?
Declaring local variables in sequence_port_list is confusing. I wrote several books,
lots of SVA code, analyzed several users’s requirements and have never found the need to do that. Declare the local variables in the assertion_variable_declaration; it make it so much easier.
Here is an awful example that demonstrates why one may want to declare local variables in the port list. I say awful because it creates code that is hard to read an understand, and then you have to worry that you don’t violate the many rules of doing this local variable declaration in the port list. My advice, KISS!
bit clk, a, b, c;
default clocking cb_clk @ (posedge clk); endclocking
sequence q_local_formal_arguments2( local input int i=0, untyped j, k,
local output bit t);
(i>10, j=i) ##1 (1, j=data, t=1'b1) ##1 k;
endsequence
property p_test_untype;
int x, z; // local variable
bit r; // local variable
(a, x=10) ##1
q_local_formal_arguments2( .i(x), .j(z), .k(a), .t(r)) ##1 x==z ##0 r;
endproperty : p_test_untype
ap_test_untype: assert property(p_test_untype);
In reply to ben@SystemVerilog.us:
You sequence declaration does not look correct. You need to explain your requirements.
This is my guess at what you need