Re: [sv-bc] condition type expressions

From: Gordon Vreugdenhil <gordonv@model.com>
Date: Tue Jun 15 2010 - 13:09:23 PDT

I'm sure that there would be uses for it, yes. Obviously one
can make the type algebra much more interesting than it is
now by allowing such forms. But where does one draw the
line? Just defaults of parameter types? What about overrides
from parent modules? Conditional dimensions of an array? Conditional
fields of a struct? Conditional qualifications (signed/packed)?

I'm not terribly interested in going through such things unless
there are compelling reasons for which there aren't existing
solutions.

Gord.

Paul Graham wrote:
> Would it be useful to allow a conditional type expression like the following?
>
> parameter two_state = 1;
> parameter type t = two_state ? bit : logic;
>
> You can get a similar effect using an extra level of hierarchy:
>
> generate
> if (two_state)
> sub #(bit) u1();
> else
> sub #(logic) u1();
> endgenerate
>
> Paul
>

-- 
--------------------------------------------------------------------
Gordon Vreugdenhil                                503-685-0808
Model Technology (Mentor Graphics)                gordonv@model.com
-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Jun 15 13:09:50 2010

This archive was generated by hypermail 2.1.8 : Tue Jun 15 2010 - 13:11:39 PDT