fork..join_none is harmless as it doesn't block. I vaguely remember this was discussed in SV-EC/BC commitee. VCS has been allowing this for years so it looks like all 3 tools allow this.
Ajeetha, CVC
www.noveldv.com
Using fork-join (parallel blocks) construct in functions are not LRM compliant. Here, this construct is used in the member function of class ovm_component.
Code snippet from ovm_component.sv file:
Code:function void ovm_component::do_exit_action(ovm_report_object object); if ( ovm_top_levels.size() ) begin ovm_component nc; fork global_stop_request(); join_none if( $cast(nc, object) ) begin if ( nc.m_env != null ) object.die(); end end else begin object.die(); end endfunction
Regards,
Vikas Singhal
fork..join_none is harmless as it doesn't block. I vaguely remember this was discussed in SV-EC/BC commitee. VCS has been allowing this for years so it looks like all 3 tools allow this.
Ajeetha, CVC
www.noveldv.com
Ajeetha Kumari,
Contemporary Verification Consultants Pvt Ltd. http://www.cvcblr.com
Looking for SystemVerilog in Bangalore? Contact Us!
* A Pragmatic Approach to VMM Adoption http://www.systemverilog.us/
* SystemVerilog Assertions Handbook
* Using PSL/Sugar
Sometimes a bug in a tool is exploited as a feature by a user. However if the feature is used in a slightly different context, interaction with the rest of the system is ill-defined.
The proposal to allow fork/join_none in a function(login guest/guest) was approved a year ago, then rejected, then approved, then rejected, then re-approved just a few days ago..
Once the door was opened up for fork/join_none, other restrictions in functions start to become meaningless, like clocking block drives, non-blocking assignments, event triggers. A restriction remains that you can't fork a process unless the parent process is a process created by an initial or always block. That means it illegal to have a static variable initialization function call fork/join_none.
Dave
You can never use a blocking statement in a function unless it is within a fork/join_none constructAND the other conditions have been met. (must be from a thread started by an initial or always construct).
There are a number of advantages by allowing non-blocking statements in a function:So this is mainly an small enhancement for the testbench, but with much larger impact to the people that have to implement it.
- The fact that a function is guaranteed not to block is a contract between the caller and the callee, just as the formal argument types are the contract as part of the interface between caller and callee.
- The construction of a class may spawn a process. This can eliminate a lot of bookkeeping that would otherwise have to be done to keep track of all the constructed classes.
- You can't nest task calls. Now, more tasks can be written as functions, and it easier to have a function return a value as part of an expression than to output through an argument.
Dave
Last edited by dave_59; 01-16-2008 at 11:49 PM.
Thanks a lot for your reply.
Regards,
Vikas Singhal
Bookmarks