[sv-bc] SV-BC 14 non-local typedefs.


Subject: [sv-bc] SV-BC 14 non-local typedefs.
From: Dave Rich (David.Rich@synopsys.com)
Date: Sat Oct 11 2003 - 22:49:18 PDT


The following section is being replaced to make it clear that hierarchical references to types are not allowed.

Replace the following in section 3.9 User defined types
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
If the type is defined within an interface, it must be re-defined locally before being used.

interface it;
typedef int intP;
endinterface
it it1 ();
typedef it1.intP intP;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
with
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
User defined type identifiers have the same scoping rules as data identifiers, except that hierarchical reference to type identifiers shall not be allowed. References to type identifiers defined within an interfaces through ports are allowed provided they are locally re-defined before being used.
interface intf_i;
  typedef int data_t;
endinterface

module sub(intf_i_i p)
  typedef p.data_t my_data_t;
  my_data_t data; //type of 'data'' will be int when connected to interface above
endmodule
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Note: keywords in example above are bold.


-- 
--
David.Rich@Synopsys.com
Technical Marketing Consultant
http://www.SystemVerilog.org
tele:  650-584-4026
cell:  510-589-2625



This archive was generated by hypermail 2b28 : Sat Oct 11 2003 - 22:51:09 PDT