Hi all, I want to implement below specification using assertion .
I have four signals: sig_a, sig_b, sig_c, and sig_d. Each can be masked/unmasked and has a 2-bit setting for each signals specifying one of these conditions: Level 1, Level 0, Posedge, or Negedge.
When enable is triggered, monitor only the unmasked signals and ensure they meet their specified conditions based on their setting. The ready signal must stay low until all the unmasked signals are triggered.
Note: There will be always one unmask signal after enable is triggered.
Your requirements are very ambiguous.
I have NO idea as to what you are talking about. I tried perplexity.ai and it gave me the following, which confused me even more.
To implement the described requirements, you'll need to create a monitoring system with the following components:
Four signals: sig_a, sig_b, sig_c, and sig_d
A mask for each signal (4 mask bits total)
A 2-bit setting for each signal (8 bits total)
An enable signal
A ready signal
Signal Settings
Each signal has a 2-bit setting that specifies one of four conditions:
Setting Condition
00 Level 1
01 Level 0
10 Posedge
11 Negedge
Monitoring Logic
When the enable signal is triggered, the system should:
Identify which signals are unmasked
Monitor only the unmasked signals
Check if each unmasked signal meets its specified condition
The ready signal should:
Stay low until all unmasked signals have met their conditions
Go high once all conditions are met
There will always be at least one unmasked signal after enable is triggered
we can use for loop to write assertion for each signal. if each assertion is pass, then ready signal remain 0 until all unmasked signals are triggered.
Thanks @flyant . This will work i think. I have thought of another method:
sequence s1;
(sig_a_mask && ( ((sig_a_cfg == 2'b00) && sig_a) || ((sig_a_cfg == 2'b01) && !sig_a) || ((sig_a_cfg == 2'b10) && $rose(sig_a)) || ((sig_a_cfg == 2'b11) && $fell(sig_a))) || !sig_a_mask) [->1];
endsequence : s1
Similar sequence for sig_b,sig_c,sig_d.
Then using all these sequences in the final property as :
property sig_monitor;
$rose(enable) |-> !ready throughout (s1 and s2 and s3 and s4);
endproperty
Why? When we use and operator , the endpoint for different sequence can be different right(So in this sequence s1,s2,s3,s4 can have different endpoints)?
So endpoints for s1 will 10ns, for s2 it will be 15ns, for s3 it will be 20ns and for s4 it will be 25ns and the consequent (s1 and s2 and s3 and s4) will finally match at 25ns
I would prefer Separate throughout assertions, one for each sequence;
It’s clearer and easier to debug.
Might also be better for Formal.
I never used this “and” with the intersect or throughout.
See my paper