Re: [sv-bc] $bits question

From: Brad Pierce <Brad.Pierce_at_.....>
Date: Tue Jan 17 2006 - 18:11:12 PST
So you'd want to also restrict param_expression and
constant_param_expression, forcing

    parameter type T = type(logic [N-1:0]);

in place of

    parameter type T = logic [N-1:0];

?

-- Brad

-----Original Message-----
From: Steven Sharp [mailto:sharp@cadence.com] 
Sent: Tuesday, January 17, 2006 5:50 PM
To: sv-bc@eda.org; Brad.Pierce@synopsys.COM
Subject: Re: [sv-bc] $bits question


>From: "Brad Pierce" <Brad.Pierce@synopsys.com>

>Why disallow an anonymous data type?  Why require an intermediate
>typedef? 
>
>For example, if
>
>   logic [N-1: 0] x; 
>
>then why can I ask for $bits(x), but not for $bits(type(x))?

I don't have a problem with that.  The ugliness is in allowing

   $bits(logic [N-1:0])

That looks kind of like a part-select, but is actually an anonymous
data type.  It isn't valid expression syntax, and doesn't belong in
a system task argument.  It would be improved if it were required to
be enclosed in type(), as in $bits(type(logic [N-1:0])), like all
other places where a type is allowed in an expression.  Perhaps this
is something that should have been revisited when $typeof() got turned
into type().

>It seems like an arbitrary new restriction to me, not a bug fix.

Allowing type declaration syntax in the middle of expressions seems
like a bizarre extension that should never have been allowed.  Removing
them would not be arbitrary.  Do you think that it is an arbitrary
restriction that casts can only use type names, not arbitrary data type
syntax?  I don't.

Steven Sharp
sharp@cadence.com
Received on Tue Jan 17 18:11:19 2006

This archive was generated by hypermail 2.1.8 : Tue Jan 17 2006 - 18:11:42 PST