RE: [sv-bc] nettype

From: Steven Sharp <sharp@cadence.com>
Date: Tue Dec 06 2011 - 11:28:35 PST

That is true. There are places where the full type syntax would be too messy, and a typedef is required for a complex type. Another example would be in a cast.

This is another case of a use for a typedef that would not apply to renaming a nettype.

-----Original Message-----
From: Bresticker, Shalom [mailto:shalom.bresticker@intel.com]
Sent: Tuesday, December 06, 2011 3:27 AM
To: Steven Sharp; Daniel Mlynek; Francoise Martinolle
Cc: sv-bc@eda.org
Subject: RE: [sv-bc] nettype

Just by the way, another use for typedef is where a type declaration cannot be used but a typedef can. An example is defining a function return type as an unpacked array.

Shalom

> A typedef does not just allow creating a synonym for a simple type. It
> allows you to give a name to a complex type declaration, which can be large.
> That saves redeclaring the complex type in multiple places, saving a large
> amount of text and avoiding potential errors. It also allows multiple
> declarations to refer to the same type, which is important for type
> equivalence in languages like SV that don't use a structural equivalence
> rule for some types. For example, if you declare two different variables by
> repeating the same complex struct type declaration with members that have
> the same names and types, they are not considered to have the same struct
> type in SV. So using another mechanism such as a macro for the complex type
> declaration would not provide the same capability as a typedef.

---------------------------------------------------------------------
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.
Received on Tue Dec 6 11:29:40 2011

This archive was generated by hypermail 2.1.8 : Tue Dec 06 2011 - 11:29:55 PST