From: Karen L. Pieper (pieper@synopsys.com)
Date: Thu Feb 26 1998 - 18:01:15 PST
BAD MSG:
I suspect you'll find that in VCS, the assignment had affect in that on the
ext invocation of the function, the value will be 1 before the non-blocking
assignment occurs. The problem with non-blocking assignments with either
copy out semantics (tasks) or return current value assignments (functions)
is that the non-blocking assignment may (or for functions will) not have
matured at the point at which the copy occurs. Cadence is probably wise
calling this behavior a syntax error.
Content-Length: 1928
X-Lines: 80
X-Status: $$$$
X-UID: 0000000322
Status: RO
In my opinion, it is ok for functions to contain non-blocking assignments,
especially to instantiated data. It is just non-blocking assignments to copy
out data that is really problematic.
Karen
> From owner-btf@boyd.com Thu Feb 26 17:26:07 1998
> X-Authentication-Warning: gw.boyd.com: majordomo set sender to owner-btf@boyd.com using -f
> From: Adam Krolnik <adamk@cyrix.com>
> Date: Thu, 26 Feb 98 18:24:00 +0600
> To: btf@boyd.com
> Subject: Re: BTF - BE17 - Can functions contain immediate non blocking
> assignments
>
>
> Good afternoon:
>
> Interesting question:
>
> module test;
> reg[1:0] a;
>
> initial begin
> a = 2'b0;
> a[0] = f(1);
> $display("A is %0b", a[0]);
> #0;
> $display("A is now %0b", a[0]);
> end
>
> function f;
> input dummy;
> begin
> f <= dummy;
> end
> endfunction
> endmodule
>
> ---
> XL rejects it -- parse error.
> Error! Statement in function is illegal [Verilog-SIFIL]
> "b3.v", 16: f <= #(0) dummy;
>
> VCS accepts it -- assignments have no effect.
> Contains Chronologic Simulation proprietary information. Feb 26 18:22 1998
>
> A is x
> A is now x
>
> ---
> Others??
>
> Proposal:
>
> Amend "section 10.3.4 Function rules"
>
> The second setence was "The following five rules govern their usage:". It it changed to
> "The following six rules govern their usage:".
>
> Add the sixth rule as "f) A function may not contain nonblocking assignments."
>
> --------------------------------------------------------------------------------
>
> Also, we may want to add a recursive example of factorial as a comparison to the iterative one.
>
> function automatic [31:0] factorial;
> input[31:0] operand;
> if (operand <= 1)
> factorial = 1;
> else
> factorial = operand * factorial(operand-1);
> endfunction
>
>
>
> Adam Krolnik
> Verification Engineer
> Cyrix - NSM.
> Richardson TX. 75085
>
This archive was generated by hypermail 2.1.4
: Mon Jul 08 2002 - 12:52:46 PDT
and
sponsored by Boyd Technology, Inc.