[sv-bc] Assignment compatibility of packed arrays of enums

From: Brad Pierce <Brad.Pierce_at_.....>
Date: Fri Oct 02 2009 - 11:17:27 PDT
2009 makes it legal to create packed arrays of enums.  Is it legal to assign a data object of such a type with a value that is not a packed array of the same kind of enums?

In the following element-by-element assignment, the explicit cast is required

typedef enum logic {FALSE, TRUE} Boolean;

module test1
(   input  logic   [5:0] in
,   output Boolean [5:0] out
);
  for (genvar I = 0; I < 6; I++) begin
     assign out[I] = Boolean'(in[I]);
  end
endmodule

But are both of the following assignments legal?

typedef enum logic {STOP, GO} NotBoolean;

module test2
(  input  logic      [5:0] in1
,  input  NotBoolean [5:0] in2
,  output Boolean    [5:0] out1, out2
);
  assign out1 = in1;
  assign out2 = in2;
endmodule


-- Brad


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri Oct 2 11:18:12 2009

This archive was generated by hypermail 2.1.8 : Fri Oct 02 2009 - 11:21:21 PDT