Hello
I am designing dynamic nonconsecutive repetition that can receive variables.
I’m designing it by referring to the code on this site.
But I have a lot of difficulties and I ask for your help.
// #count
// ex) #count
sequence dynamic_delay(count);
int v;
(count<=0) or ((1, v=count) ##0 (v>0, v=v-1) [+] ##1 v<=0);
endsequence
sequence nonconsecutive(sq1,count);
int v;
(1,v=count) ##0
(v <=0 and !sq1) or ( v>0 ##[] sq1, v=v-1) [+] ##0 v<=0) ##1 !sq1[];
endsequence
sequence nonconsecutive_sub(sq1,count);
int v;
(1,v=count) ##0
(v <=0 and !sq1) or ( v>0 ##[*] sq1, v=v-1) [+] ##0 v<=0) ;
endsequence
// ##nonconsecutive range
// ex) sq1[=m:n] #Delay sq2
sequence nonconsecutive_range(sq1, m, n);
int v,diff,count;
(1, count = m,diff = n-m) ##0
nonconsecutive_sub(sq1,count) ##0
first_match((diff > 0 ##[] sq1, diff = diff - 1)[+]) ##1 !sq1[] ;
endsequence
In the range, if I use first_match on the diff variable, sequence occurs fail only looking at the first clock.
@(posedge clk) disable iff(!resetn||$isunknown(resetn)) (~$isunknown(start)&&$rose(start)) |=> nonconsecutive_range(val,check_data,check_data2) ##3 val2
Are there other design methods?