[sv-bc] Reference to type identifier defined within an interface through instance are allowed??

From: Dhiraj Kumar Prasad <dhiraj_at_.....>
Date: Tue Mar 27 2007 - 03:35:19 PDT
Hi,

According to LRM P1800.2005 ,Section 4.9
"References to type identifiers defined within an interface through ports
  are allowed provided they are locally redefined before being used."
Is the following testcase legal as some of simulation tool passes.


module tmp(input in1,in2,output reg out1,out2,out3,out4);
 
interface it(input in1,in2);
    typedef int myint;
    typedef struct { chandle isfloat; union { int i; shortreal f; } n;} 
mystruct;
    typedef enum bit [1:0] {bronze1=2'b1, silver1, gold1} MEDAL;
endinterface
 

it it1(in1,in2);

typedef it1.myint myint;
myint mi;
typedef it1.mystruct mystruct;
mystruct ms;

always @(in1,in2)
begin
 mi = in1 | in2;
 ms.n.i = in1 & in2;
 ms.n.f = in1 &~ in2;
end

always @(in1,in2)
begin
 out1 = mi;
 out2 = ms.n.i;
 out3 = ms.n.f;
end
endmodule

Thanks,
Dhiraj



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Mar 27 03:38:39 2007

This archive was generated by hypermail 2.1.8 : Tue Mar 27 2007 - 03:39:07 PDT