Re: [sv-bc] Static casting types

From: Brad Pierce <Brad.Pierce_at_.....>
Date: Mon Sep 18 2006 - 11:05:16 PDT
Dave,
 
See Footnote A.10.29 and http://www.eda-stds.org/sv-bc/hm/4819.html .
 
-- Brad

________________________________

From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of
Rich, Dave
Sent: Monday, September 18, 2006 10:55 AM
To: Bresticker, Shalom; sv-bc@eda-stds.org
Subject: RE: [sv-bc] Static casting types


 

I believe that a parameter type does in fact (or should) create a user
defined type identifier. Given

parameter type T = int
T V;

T would not be a valid data type otherwise.  We would have to create a
whole new set of rules for type equivalence and BNF productions that
include parameter types.

The constant primary must resolve to either a positive decimal number,
or data type that is compatible with the expression being cast; either
assignment compatible or a bit-stream cast.

I think constant_primary is too complex of a production for a
casting_type. That would allow things like 3'(2)'(4).

Also, I thought simple_type was part of constant_primary. What
production allows you to do the following?

generate if (type(V) == int) ...

 

Dave

 

 

 

________________________________

From: owner-sv-bc@server.eda.org [mailto:owner-sv-bc@server.eda.org] On
Behalf Of Bresticker, Shalom
Sent: Monday, September 18, 2006 1:14 AM
To: sv-bc@server.eda-stds.org
Subject: FW: [sv-bc] Static casting types

 

I never got a reply to this.

Any comments?

Thanks,

Shalom

 

________________________________

From: owner-sv-bc@server.eda.org [mailto:owner-sv-bc@server.eda.org] On
Behalf Of Bresticker, Shalom
Sent: Sunday, April 23, 2006 9:30 AM
To: sv-bc@server.eda.org
Subject: [sv-bc] Static casting types

 

This is a spinoff of Mantis 1273. 

That was an enhancement request from the 1364 database to allow writing
a numeric literal with a parametric size, something like P'3, where P is
a parameter identifier.

Brad pointed out that in SV, you can get the same result (ignoring
possible differences in bit-extension, which I did not check) by a
static cast by writing P'(3).

That serves the need, but 4.14 is not clear enough that this is
possible. It comes out of the BNF, but it is not at all clear from the
text.

All this raises two questions in my mind:

1.    What if P is a type parameter instead of a value parameter? 4.14
says, "When casting to a predefined type, the prefix of the cast must be
the predefined type keyword. When casting to a user-defined type, the
prefix of the cast must be the user-defined type identifier," so is this
allowed or not? A parameter type is neither of these.

2.    The casting_type BNF says that it can be constant_primary. What
are the restrictions, if any, on what type of constant_primary can be
used as a casting_type. This is the constant_primary BNF:

constant_primary ::=

primary_literal

| ps_parameter_identifier constant_select

| specparam_identifier [ constant_range_expression ]

| genvar_identifier

| [ package_scope | class_scope ] enum_identifier

| constant_concatenation

| constant_multiple_concatenation

| constant_function_call

| ( constant_mintypmax_expression )

| constant_cast

| constant_assignment_pattern_expression

| type_reference

Thanks,

Shalom

 

 

Shalom Bresticker

Intel Jerusalem LAD DA

+972 2 589-6852

+972 54 721-1033

I don't represent Intel 

 
Received on Mon Sep 18 11:05:28 2006

This archive was generated by hypermail 2.1.8 : Mon Sep 18 2006 - 11:05:38 PDT