It is hard to help you without seeing any timing information. If there was no hang, how long would proc1 and proc2 take to complete? How long does it take to know that proc1 is hung? What conditions would you need to know that it is hung (a timeout?).
fork
// proc 1 which will generate ahb error and hang waiting for acknowledment which //in this scenario not generated,so hang process1
begin
`uvm_info(get_name(), $sformatf("1Waiting tran_in_progress "), UVM_DEBUG)
stam_env_inst.stam_sqr.stam_ppe_sqr.write_address(32'hffff_0000,32'h12345678);
`uvm_info(get_name(), $sformatf("error ahb done"), UVM_DEBUG)
`uvm_info(get_name(), $sformatf("AHB error during ppe configuration: waiting for err_pin to be asserted "), UVM_DEBUG)
end
join_any
// proc2 here we wait for error and reset
fork
begin
`uvm_info(get_name(), $sformatf("waiting error pin AHB ERROR"), UVM_DEBUG)
wait(stam_env_inst.stam_events_inst.err_pin);
`uvm_info(get_name(), $sformatf("waiting for AHB ERROR DONE"), UVM_DEBUG)
`uvm_info(get_name(), $sformatf("waiting for AHB done"), UVM_DEBUG)
`uvm_info(get_name(), $sformatf("reseting the AHB"), UVM_DEBUG)
`uvm_info(get_name(), $sformatf("generating the reset "), UVM_DEBUG)
generate_all_reset();
`uvm_info(get_name(), $sformatf("geneRATD the reset "), UVM_DEBUG)
release_all_reset();
end
join
$display("outside the fork join 1");
$display("disable fork");
join
$display("outside the fork join
Proc2 completes whereas proc1 does not but hang,is there a way we can come out of this fork join and kill the hand process,thanks
Please use code tags making your code easier to read. Proper indenting also helps. I have added them for you.
Your code has one more join without a fork.
A fork/join or fork/join_any with only one statement (in your case that one statement is a begin/end block)
If you want proc1 to be killed as soon as proc2 completes or kill proc2 when proc1 completes, then you would write
fork
// proc 1 which will generate ahb error and hang waiting for acknowledment which //in this scenario not generated,so hang process1
begin : proc1
`uvm_info(get_name(), $sformatf("1Waiting tran_in_progress "), UVM_DEBUG)
stam_env_inst.stam_sqr.stam_ppe_sqr.write_address(32'hffff_0000,32'h12345678);
`uvm_info(get_name(), $sformatf("error ahb done"), UVM_DEBUG)
`uvm_info(get_name(), $sformatf("AHB error during ppe configuration: waiting for err_pin to be asserted "), UVM_DEBUG)
end
// proc2 here we wait for error and reset
begin : proc2
`uvm_info(get_name(), $sformatf("waiting error pin AHB ERROR"), UVM_DEBUG)
wait(stam_env_inst.stam_events_inst.err_pin);
`uvm_info(get_name(), $sformatf("waiting for AHB ERROR DONE"), UVM_DEBUG)
`uvm_info(get_name(), $sformatf("waiting for AHB done"), UVM_DEBUG)
`uvm_info(get_name(), $sformatf("reseting the AHB"), UVM_DEBUG)
`uvm_info(get_name(), $sformatf("generating the reset "), UVM_DEBUG)
generate_all_reset();
`uvm_info(get_name(), $sformatf("geneRATD the reset "), UVM_DEBUG)
release_all_reset();
end
join_any
disable fork; // kills the remaining fork process