[sv-bc] RE: Connecting generated interface instances

From: Mark Hartoog <Mark.Hartoog@synopsys.com>
Date: Sun Feb 22 2015 - 19:03:39 PST
The basic reason is that modules can access parameters and types from the interface connected to an interface port.  When the high conn of an interface port is a hierarchical reference, then accessing the parameters from it is similar to a defparam.  Since the static hierarchy must be elaborated first and all parameters evaluated before generate block unrolling starts, a hierarchical reference through generate blocks can create a situation where not all parameters can be evaluated.

Consider this example:

interface if1#(p = 1) ();
endinterface

module test(if1 if1_port);
   localparam p = if1_port.p;

   if (p == 2) begin : block
      if1#(4) if1_inst();
   end
   else begin : block
      if1#(2) if1_inst();
   end
endmodule

module top;
   test t(top.t.block.if1_inst);
endmodule

From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of Bresticker, Shalom
Sent: Saturday, February 21, 2015 11:53 PM
To: sv-bc@eda.org
Subject: [sv-bc] RE: Connecting generated interface instances

The LRM says in 25.3,

"If the actual of an interface port connection is a hierarchical reference to an interface ..., the hierarchical reference shall refer to an interface instance and shall not resolve through ... a generate block."

What is the reason for this restriction ?

Example:

///////////////////// Beginning of code ///////////////////////

interface if1 ();
endinterface

module module1 (if1 if1_inst);
endmodule

module test();
      generate
            for (genvar i=0; i<2; i++) begin : if_gen
                  if1 if1_inst();
            end
      endgenerate

      module1 module1_inst
            (
            .if1_inst(if_gen[0].if1_inst)
            );

endmodule

//////////////////////// End of code /////////////////////////

I saw 2 major compilers reject this code due to the above restriction.

Thanks,
Shalom

---------------------------------------------------------------------
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<http://www.mailscanner.info/>, and is
believed to be clean.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Sun Feb 22 19:04:05 2015

This archive was generated by hypermail 2.1.8 : Sun Feb 22 2015 - 19:04:10 PST