[sv-bc] how to access an interface paramter

From: Paul Graham <pgraham_at_.....>
Date: Tue Mar 28 2006 - 17:53:24 PST
I wonder if a reference to an interface parameter can be
used in a constant expression.  For instance:

    interface bustype();
	parameter DW = 8;
	...


    module cpu(bustype.master bus);
	reg [bus.DW-1:0] scratch;
	...


    module top();
	bustype #(.DW(6)) u1();
	cpu cpu1(u1.master);
	...

Here, module cpu wants to get the value of DW.  But bus.DW
does not appear to be a valid constant_primary.  The closest
thing is that a ps_parameter_identifier can be a hierarchical
name whose prefix is a generate_block_identifier.

Am I missing something?

Paul
Received on Tue Mar 28 17:53:30 2006

This archive was generated by hypermail 2.1.8 : Tue Mar 28 2006 - 17:53:39 PST