Subject: Re: [sv-ec] ERR-4
From: Dave Rich (David.Rich@synopsys.com)
Date: Mon Aug 18 2003 - 08:19:21 PDT
initial for( int j = 1; j <= 3; ++j ) fork #1 $display( "j = %0d", j ); join_noneThe example above displays values for j as 1,2, and 3 in any order, but not all 3.
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