Skip to content

verilog ND-array generation should be packed arrays instead of unpacked arrays. #974

@rdaly525

Description

@rdaly525

Currently the verilog for commonlib.MuxN is generated like the following:

module commonlib_muxn__N2__width9 (
    input [8:0] in_data [1:0],
    input [0:0] in_sel,
    output [8:0] out
);
wire [8:0] _join_out;
coreir_mux #(
    .width(9)
) _join (
    .in0(in_data[0]),
    .in1(in_data[1]),
    .sel(in_sel[0]),
    .out(_join_out)
);
assign out = _join_out;
endmodule

Some verilog tools cannot handle the unpacked input [8:0] in_data [1:0] for ports.

We should default ND-arrays to use packed arrays:

module commonlib_muxn__N2__width9 (
    input [1:0][8:0] in_data,
    input [0:0] in_sel,
    output [8:0] out
);
wire [8:0] _join_out;
coreir_mux #(
    .width(9)
) _join (
    .in0(in_data[0]),
    .in1(in_data[1]),
    .sel(in_sel[0]),
    .out(_join_out)
);
assign out = _join_out;
endmodule

Or set up some verilog generation flags to choose these options.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions