RE: [sv-bc] Deadline for detailed feedback on Data Types on Nets Proposal

From: Warmke, Doug <doug_warmke@mentorg.com>
Date: Mon Nov 15 2004 - 15:01:36 PST

>
> The struct is a data type that can be used to declare both
> nets and variables. Using the 'var' keyword for variables
> and saying 'reg' is a data type we have:
>
> typedef struct { reg a; } ST;
> var ST sv;
> wire ST sw;
>
> Now sv.a is a variable with data type reg and sw.a is a net with a
> resoultion function of a wire and a data type of reg.
>
> On the other hand if we say that the 'reg' keyword is for variables,
> then:
>
> typedef struct { reg a; } ST;
> reg ST sv;
> wire ST sw;
>
> This makes sv.a a variable of type 'logic' (default type for
> variables) and sw.a a net with a resoultion function of a wire
> and a data type of 'logic'!!!
> This seems wrong to me.
>
> The fields of a struct are not variables unless the struct
> type is used in a variable declaration.
>

I agree with Mark.
An analogous (though syntactially illegal) case
that seems even more wrong would be like this:

typedef struct { wire a; } ST;
reg ST sv;
wire ST sw;

I'm sure few people would be happy with this.
Similarly, I wouldn't want to see

typedef struct { var logic a; } ST;
reg ST sv;
wire ST sw;

Semantics will be simplified and improved if we do what Mark
suggests and leave struct declarations as pure data type decls,
with no provision for assigning "variableness" or "netness"
to individual elements.

Regards,
Doug
Received on Mon Nov 15 15:01:54 2004

This archive was generated by hypermail 2.1.8 : Mon Nov 15 2004 - 15:02:07 PST