I am trying to learn SV on my own and came accross this piece of code:
task reset();
##1 fifo_io.cb.resetb <= 1'b1;
##1 fifo_io.cb.resetb <= 1'b0;
fifo_io.cb.in_vld <= 1'b0;
fifo_io.cb.out_rdy <= 1'b0;
##1 fifo_io.cb.resetb <= 1'b1;
repeat (2) @(fifo_io.cb);
endtask: reset
What I am curious about is what repeat does since there is no begin or end, so what's it repeating? And what does "@(fifo_io.cb)" do?
- - - Updated - - -
Actually one more question, for the code bellow I don't understand what "@(design_io.cb);" is doing.
Essentially it is saying @(clocking block)...so I am assuming it is similar to @(posedge clk), but not sure?
Also just as important, I am not sure what the statement applies to (again with no
task push(input int num = 1);
for (int i = 0; i < num; i++) begin
<stuff>
@(design_io.cb);
end
<more stuff>
@(design_io.cb);
endtask: push