Re: [sv-ec] ERR-4


Subject: Re: [sv-ec] ERR-4
From: Dave Rich (David.Rich@synopsys.com)
Date: Mon Aug 18 2003 - 08:19:21 PDT


Hi Shalom,

This is not the same as #281 because of the statements spawned by join_none, which is added by SystemVerilog, outlive the return of the task. Actually in this case, it doesn't matter whether the task is automatic or static, or even inside a task. It's the automatic loop variable j that needs to be copied. In case I can't make it to today's meeting I would like to propose the following change to the example that I think is a little clearer:

initial
    for( int j = 1; j <= 3; ++j )
        fork
            #1 $display( "j = %0d", j );
	join_none
The example above displays values for j as 1,2, and 3 in any order, but not all 3.


Shalom Bresticker wrote:
Arturo,

I believe this is contrary to IEEE 1364-2001.

The automatic variable j belongs to the automatic task loop_fork.

There is only one copy of it, referenced by the forked processes.

The 1364 ETF discussed this in issue #281.

Shalom


Arturo Salz wrote:

  
Lifetime of automatic variables in fork/join_none I propose that the following
be added to Section 9.6
-------------------------------------------------------------------------------
Automatic variables in the scope enclosing a fork-join_none or fork-join_any
shall be copied on fork of each process that references those variables. Only
the variables actually used by a sub-process need to be copied, not all
automatic variables. For example:

task automatic loop_fork();
for( int j = 1; j <= 3; ++j )
            fork
                $display( "%0d", j );
            join_none
    endtask

The example above displays 123 (not 333).
-------------------------------------------------------------------------------
     Arturo
    

--
Shalom Bresticker                           Shalom.Bresticker@motorola.com
Design & Reuse Methodology                             Tel: +972 9 9522268
Motorola Semiconductor Israel, Ltd.                    Fax: +972 9 9522890
POB 2208, Herzlia 46120, ISRAEL                       Cell: +972 50 441478




  

-- 
--
David.Rich@Synopsys.com
Technical Marketing Consultant
http://www.SystemVerilog.org
tele:  650-584-4026
cell:  510-589-2625



This archive was generated by hypermail 2b28 : Mon Aug 18 2003 - 08:20:48 PDT