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

From: Brad Pierce <Brad.Pierce@synopsys.com>
Date: Thu Oct 20 2011 - 16:47:08 PDT

> 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
--
This message has been scanned for viruses and
dangerous content by MailScanner<http://www.mailscanner.info/>, 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 Thu Oct 20 16:47:29 2011

This archive was generated by hypermail 2.1.8 : Thu Oct 20 2011 - 16:47:33 PDT