Hi All, I have a driver, which drive signal A for one cycle, and drive signal B for two cycles.
Because, thread A only spend one clock and seq_item_port will get next req after thread A finish. But,the thread B spend two clocks, so new thread B will start even older thread B not finish . Now I have two questions
Q1:In my code, new thread B will start even older thread B not finish. Am I correct?
Q2: In older thread B, req.b will be changed due to seq_item_port getting new req. it means that the vif.b can not keep stable for two clocks. Am I correct? How to fix this problem?
Thanks a lot!
Here is my code
while(1)begin
seq_item_port.get_next_item(req);
fork
begin // thread A
@(posedge clk);
vif.a <= req.a;
end
begin // thread B
@(posedge clk);
@(posedge clk);
vif.b <= req.b;
end
join_any
seq_item_port.item_done();
end