[A] I am trying to code a generic sequence : ( seq1[*count] ##N seq2 ) where N is passed while asserting the sequence.
bit clk , a , b , c , d;
int dyn ;
always #5 clk = !clk;
sequence my_seq(seq,count,N,seq3);
((count == 0) ##0 seq[*0] ##((N > 0) ? N:0) seq3) // Need help with this sequence
or ((count > 0) ##0 <some_sequence>) ;
endsequence
asp:assert property( @(posedge clk) my_seq( a ##1 b,dyn,2,c ##0 d) ) $display("T:%0t Pass",$time); else $display("T:%0t Fails",$time);
initial begin
dyn = 0 ;
#04; c = 1 ; d = 1;
#12; $finish();
end
On 2 tools I run into a compilation error ::
Error-[SVA-SEQPROPEMPTYMATCH] Invalid sequence as property
A sequence that is used as property must be non-degenerate and admit no empty match.
xmsim: *E,ABVNDG: Degenerate sequence used in assertion ‘asp’. Assertion will not be checked
I am aware that ( empty_seq ## 0 seq ) is illegal however such a sequence doesn’t exist based on actual sequence argument ( N == 2 )
My expectation was that based on the arguments to my_seq the sequence expression would be
seq[*0] ##(2) seq3 ; // same as ##1 seq3
I expected pass at t:15 units
[B] My intention is the generic sequence to behave as
// For N > 0 and ( count == 0 ) ::
sequence my_seq(seq,count,N,seq3);
(count == 0) ##0 seq[*0] ##N seq3 ; // Equivalent to ##(N-1) seq3
endsequence
// For N <= 0 and ( count == 0 ) ::
sequence my_seq(seq,count,N,seq3);
(count == 0) ##0 seq[*0] ##N seq3 ; // Should observe compilation error
endsequence
Any suggestions are welcome
[C] Following assertion is illegal since it’s a degenerate sequence
prop1:assert property( @(posedge clk) empty_seq ## 0 seq ) ; // Illegal
If I were to add an expression after the clocking event
prop2:assert property( @(posedge clk) (some_variable == 0) ##0 empty_seq ## 0 seq );
In this latter case when (some_variable == 0) we should observe compilation error
but when (some_variable != 0 ) , shouldn’t the fail action block execute ?
I expected that when (some_variable != 0) the sequence ( empty_seq ## 0 seq ) won’t be evaluated ,
hence there would be No compilation error ( for the degenerate sequence )