Hi experts, I have a particular scenario wherein the dut_bfm receives transaction when asked from driver block and then block completes the task in some time. So implemented a pipelined process wherein driver “seq_item_port.get(req) method” gets transaction and sends data to bfm and waits in fork join_none till the process is completed and uses “put method to send the response back”, the sequence body implements a for loop which uses create, randomize, finish_item and in fork join_none has “get_response(rsp,req.get_transaction_id())” is called.
Scenario wherein 10 transactions are to be transferred some responses are written back from the driver but all the responses are not been looked to be obtained and the simulations comes out.
Currently, when I used “wait fork” in the sequence body method I see expected results, but confused would it be ok to have a wait fork statement ??
Since I already have get_reponse() blocking method sitting inside fork join_none
In reply to sankethjitta:
As, I understand from your explanation
Your sequence implementation is like below.
task body();
fork
for ( int i = 0; i<=9; i++) begin
//create item
//Start item
//randomized
// send request
// finish item
// get response
end
join_none
wait fork // Your query need to use or not.
endtask : body
If your implementation is mentioned like above.
I think you required wait fork even get_responce is blocking.
Because, as join_none eveluate in background.
Your body will over instantly and not wait for to complete background process launch via fork.
Thanks!
In reply to harsh pandya:
Hi Harsh ,
the for loop and parallel block is as below :-
task body();
for ( int i = 0; i<=9; i++) begin
//create item
//Start item
//randomized
// send request
// finish item
fork
// get response
join_none
end
wait fork // My query need to use or not ??
endtask : body
Thanks for commenting.
In reply to sankethjitta:
In your mentioned case, it is also required.
Because, you are initiating “get_response” call in background via join_none.
So, when itression of “for loop” over, body task will be over and not wait for all get_response thread to be completed which is initiated in background.
So, you need wait until all get_respose background call to be completed before come out from body.
This will be done by waik fork.
Thanks!