Re: SystemVerilog draft4 - PRELIMINARY


Subject: Re: SystemVerilog draft4 - PRELIMINARY
From: Paul Graham (pgraham@cadence.com)
Date: Fri Mar 01 2002 - 08:06:01 PST


A comment on draft 4:

In the section on array literals, the example is given:

    typedef int [1:3] triple; // 3 integers packed together
    b = triple'{0,1,2};

Variable b is not declared, but I assume that it's of type triple, which is
an unpacked array type. In the assignment statement it is assigned an array
value. However, text elsewhere in the standard suggests that an unpacked
array cannot be referenced except by indexing. This means that you cannot
assign an array as part of an assignment statement (though you apparently
can as part of a declaration initializer). So it appears that this example
assigning to b is illegal. Or did you mean to write:

    typedef int [1:3] triple; // 3 integers packed together
    triple b = triple'{0,1,2};
    
to make it an initialization?

Even so, it is not clear why you can assign an arbitrarily large value in an
initialization but not in an assignment statement.

Paul



This archive was generated by hypermail 2b28 : Fri Mar 01 2002 - 08:06:55 PST