>From: Surya Pratik Saha <spsaha@cal.interrasystems.com> >Then I think same restriction to be applied on a normal automatic >variable too. Why then automatic variable is relaxed, but 'ref' variable >is restricted? The Verilog-2001 LRM actually says that automatic variables cannot be referenced by constructs that could refer to them after the call had returned (such as $monitor and forces). I pointed out early on that this restriction would apply to fork..join_any/join_none processes also, as the same issue occurs there. However, this would have severely restricted many uses for these forks, so the SV LRM specifically allowed it. This requires that the lifetime of automatic variables be extended as long as there is a forked subprocess that can access them. This is a bit messy, but the tracking is local. A subprocess knows all about the automatic scopes it has access to. When a subprocess is forked, it always has access to activations of the same set of nested scopes. And a scope knows statically which statements could be forked inside it. For ref args, the situation would have been far more complex. The relationships are nonlocal, and not known until runtime. Someone did suggest a basic approach that could have worked, but it would have made code involving automatic variables much slower. The committee chose to make this restriction instead. Steven Sharp sharp@cadence.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Fri Dec 5 17:27:03 2008
This archive was generated by hypermail 2.1.8 : Fri Dec 05 2008 - 17:27:39 PST