From: Shalom.Bresticker@motorola.com
Date: Thu Jan 08 2004 - 02:50:00 PST
The following reply was made to PR errata/527; it has been noted by GNATS.
From: Shalom.Bresticker@motorola.com
To: Brad Pierce <Brad.Pierce@synopsys.com>
Cc: etf-bugs@boyd.com
Subject: Re: errata/527: Replication operator on concats involving function
calls
Date: Thu, 8 Jan 2004 12:50:59 +0200 (IST)
Brad,
> In section (4.1.14) it says "If the replication operator is
> used on a function call ...". But this is inconsistent with the
> language of http://www.boyd.com/1364_btf/report/full_pr/73.html ,
> because a replication operator cannot be used on a function
> call, but only on a concatenation.
Obviously, the text means a concatenation which contains a function call.
If you want to change the language to say that explicitly, OK.
> It seems to me that it should not be legal to implement
>
> result = {4(func(w)}
Obviously, you mean {} instead of ().
> as
> result = { func(w), func(w), func(w), func(w) }
>
> and that if there's a side-effect in func, it should happen
> exactly once. That is, the replication operator should
> replicate the value of the concatentation. Otherwise, why can't
> the result of the replication operator be used as an lvalue?
Because it is not generally useful as an lvalue.
And I think that has nothing to do with how it is evaluated on a RHS.
> For example, shouldn't the following example unambiguously yield
> |0001000100010001|, even though Verilog-XL didn't do it that way?
Your "even though" is the answer to your question.
That is a good enough reason.
I have even been told, I seem to remember, that different simulators have treated {y,y} on LHS differently.
Oh, and this duplicates issue 288, I think.
Shalom
>
> module m (o);
> output [15:0] o ;
> reg [15:0] o ;
> reg [3:0] t;
>
> function [3:0] f ;
> input i ;
> begin
> t = t + i ;
> f = t ;
> end
> endfunction
>
> initial begin
> t = 0 ;
> o = {4{f(1'b1)}} ;
> $display("|%b|", o) ;
> end
>
> endmodule
>
> Is replication an operator or syntactic sugar? If syntactic sugar,
> why not allow it in lvalues?
--
Shalom Bresticker Shalom.Bresticker@motorola.com
Design, Verification & Reuse Methodology Tel: +972 9 9522268
Motorola Semiconductor Israel, Ltd. Fax: +972 9 9522890
POB 2208, Herzlia 46120, ISRAEL Cell: +972 50 441478
This archive was generated by hypermail 2.1.4
: Thu Jan 08 2004 - 02:50:04 PST
and
sponsored by Boyd Technology, Inc.