Multi-clocked sequences are built by concatenating multiple single clocked sequences in different clock domains using following operators.

- Single delay concatenation operator (##1)
- zero-delay concatenation operator (##0)

## Single delay concatenation operator (##1)

1 2 3 |
sequence mult_seq1; @(posedge clk1) seq1 ##1 @(posedge clk2) seq2; endsequence: mult_seq1 |

Match of mult_seq1 starts with a match of seq1 at posedge of clk1 and end with a match of seq2 at posedge clk2. After matching seq1, ##1 moves the time to the nearest strictly subsequent posedge clk2 and then try for seq2 match.

If clk1 and clk2 are identical, the above sequence will be equivalent to the following seq.

1 2 3 |
sequence mult_seq1; @(posedge clk1) seq1 ##1 seq2; endsequence: mult_seq1 |

## zero-delay concatenation operator (##0)

1 2 3 |
sequence mult_seq2; @(posedge clk1) seq1 ##0 @(posedge clk2) seq2; endsequence: mult_seq2 |

Match of mult_seq2 starts with a match of seq1 at posedge of clk1 and end with a match of seq2 at posedge clk2. After matching seq1, ##0 moves the time to the nearest possibly overlapping tick of posedge clk2 and then try for seq2 match.

If clk1 and clk2 are identical, the above sequence will be equivalent to the following seq.

1 2 3 4 5 6 7 |
sequence mult_seq1; @(posedge clk1) seq1 ##0 seq2; endsequence: mult_seq sequence mult_seq1; @(posedge clk1) seq1 && seq2; endsequence: mult_seq |

## Restrictions

Some examples are the following.

1 2 3 |
sequence mult_seq2; @(posedge clk1) seq1 ##2 @(posedge clk2) seq2; //Illegal !!!!! endsequence: mult_seq2 |

1 2 3 |
sequence mult_seq2; @(posedge clk1) seq1 and @(posedge clk2) seq2; //Illegal !!!!! endsequence: mult_seq2 |

This restriction guarantees to have well defined starting and ending clocking events and avoids ambiguity.

1 2 3 |
sequence mult_seq; @(posedge clk1) seq1 ##1 @(posedge clk2) seq3[*0:3]; //Illegal (possibility of an empty match) endsequence: mult_seq |

If more than one clock ticks have been allowed at the boundary then the ending clocking event is ambiguous. In other words, if clk1 and clk2 are not identical and if seq3 is an empty match, then there is an ambiguity on the ending clocking event.

1 2 |
@(posedge clk1) seq1 ##1 @(posedge clk2) seq3[*0:3]; //Illegal (possibility of an empty match) endsequence: mult_seq |

Multi clocked sequences are useful in verification, if it involves multiple clock domains.

### Sini Balakrishnan

#### Latest posts by Sini Balakrishnan (see all)

- SV Constraint random value generation : Introduction - May 1, 2015
- System Verilog : Mailbox - February 23, 2015
- SVA Basics: Bind - February 4, 2015

I don’t find any difference between Single delay concatenation operator (##1)

and zero-delay concatenation operator (##0) .

Would you please show waveform regarding both operator?

Thanks!