forever begin
@(posedge clk);
vif.w_en<=txn.w_en;
vif.w_data<=txn.w_data;
....
...
end
forever begin
@(posedge clk)
begin
vif.w_en<=txn.w_en;
vif.w_data<=txn.w_data;
....
...
end
end
In 2nd forever block w_en and w_data are sampled at posedge of clk, can anyone explain even for 1st forever block also w_en and w_data are sampled at posedge of clk?? or i it will add one clock cycle delay??
Thankyou sir for your reply, but i have another doubt which is
for example
forever begin
@(posedge clk);
vif.w_en<=txn.w_en;
vif.w_data<=txn.w_data;
…
…
vif.w_data_out<=txn.w_data_out;
end
here vif.w_data_out<=txn.w_data_out; //which is not supposed to be sample at posedge clk for that is it mandate to use begin/end to @(posedge clk)? or any other way?
forever begin
@(posedge clk);
vif.w_en<=txn.w_en;
vif.w_data<=txn.w_data;
…
…
vif.w_data_out<=txn.w_data_out;// write this statement outside the begin so that it will not take place at posedge clk.
end
In reply to kathula venkatesh:
forever begin
@(posedge clk);
vif.w_en<=txn.w_en;
vif.w_data<=txn.w_data;
…
…
vif.w_data_out<=txn.w_data_out;// write this statement outside the begin so that it will not take place at posedge clk.
end
hi agoel,
there i didn’t mention begin/end to @(posedge clk); that’s y i am asking whether it is required begin/end or not?