Re: [sv-bc] $onehot(), $bits() and $signed() of streaming concatenations

From: Brad Pierce <brad_pierce@acm.org>
Date: Sun Oct 23 2011 - 09:36:23 PDT

It would be a weird outcome to allow as the argument to $onehot every
expression of bit-stream type except a streaming_concatenation, and to
allow a streaming_concatenation as the argument of a user-defined
function but not as the argument of $onehot. If the language of 2476
somehow has that outcome, there's a problem with the language of 2476.

-- Brad

On Sun, Oct 23, 2011 at 8:58 AM, Bresticker, Shalom
<shalom.bresticker@intel.com> wrote:
> Brad,
>
>
>
> For context, it may be helpful to see the threads beginning with
>
>
>
> http://www.eda.org/sv-ac/hm/9764.html
>
> http://www.eda.org/sv-ac/hm/9765.html
>
> http://www.eda.org/sv-ac/hm/9791.html
>
> http://www.eda.org/sv-ac/hm/9793.html
>
>
>
> It is not clear to me, for example, that
>
>
>
> So for $onehot() it’s clear that you can legally call
>
>
>
>      $onehot({>>{x,y,z}})
>
>
>
> Regards,
>
> Shalom
>
>
>
> From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of Brad
> Pierce
> Sent: Friday, October 21, 2011 1:47 AM
> To: sv-bc@eda.org
> Subject: RE: [sv-bc] $onehot(), $bits() and $signed() of streaming
> concatenations
>
>
>
>> in such a context
>
>
>
> I meant “in an assignment-like context”.
>
>
>
> ---
>
>
>
> When 11.4.14 says that a streaming_concatenation, such as, {>>{x,y,z}}, can
> be used “as the target of an assignment, or as the source of an assignment”,
> I take that to mean that in an assignment-like context it’s not “an operand
> in an expression” and that it can be used without “first casting it to a
> bit-stream type”.
>
>
>
> For example, if a streaming_concatenation is the actual input argument of a
> subroutine call and it’s passed by value to a formal input argument of a
> bit-stream type, then the streaming_concatenation actual is being legally
> assigned to the formal with no need for a static cast.
>
>
>
>      f({>>{x,y,z}}, …)
>
>
>
> What though about calls to LRM-defined $-functions that are polymorphic,
> such as $onehot(), $bits() and $signed()?
>
>
>
> Mantis 2476 (http://www.eda-stds.org/mantis/view.php?id=2476) clarifies that
> the argument to $onehot() can be anything of bit-stream type, and that, if
> the argument is “expression”, then “For the purpose of calculating the
> return value, the argument is treated as a vector of equal size assigned
> from {>>{expression}} (see 11.4.14).”
>
>
>
> So for $onehot() it’s clear that you can legally call
>
>
>
>      $onehot({>>{x,y,z}})
>
>
>
> But what about $bits() and $signed()? It seems to me that it should be legal
> to call them, too, with a streaming_concatenation argument, but that’s not
> so clear in the LRM, as far as I can tell.
>
>
>
> -- Brad
>
> ---------------------------------------------------------------------
> Intel Israel (74) Limited
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Sun Oct 23 09:36:48 2011

This archive was generated by hypermail 2.1.8 : Sun Oct 23 2011 - 09:36:54 PDT