In TB world, sometime you will need a signal which is N clock delayed version of another signal. You can do it by using 9 intermediate variables, or use these.
// I want 10 clock delayed version of signal abc
always @(posedge clk) begin
    abc_10_clk_delayed_1 <= $past(abc, 10); // This works in vcs
    abc_10_clk_delayed_2 <= repeat(10) @(posedge clk) abc;
end

 
    
0 comments:
Post a Comment