You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wonder if it would make sense to convert all but 1 packed dimensions into unpacked dimensions:
Input
logic [1:0][1:0] mem [2][2];
Output
reg [1:0] mem [0:1][0:1][1:0];
One issue I see is that BRAM inference will change: the word size will be the 1st packed array dimension size, not the total size of the packed array. However, this may be fine because Vivado only supports BRAM inference on SystemVerilog with 1 packed array dimension (source), so this change will make sv2v more similar to Vivado. I haven't tested other tools.
Another possible issue is I'm not sure of tool support for mixing big-endian and little-endian unpacked arrays.
Thanks!
The text was updated successfully, but these errors were encountered:
Actually, one issue I see is that Verilog ports don't support unpacked arrays. This makes me wonder if it would be better to flatten the ports, and assign to them with a generate for. It seems this is what used to be done (fb3d68e). What was the reason for switching to flattening?
Hello!
When sv2v processes multidimensional arrays, the output differs compared to passing the SystemVerilog directly to commercial tools.
Original SystemVerilog
Original SystemVerilog passed into sv2v
Original SystemVerilog passed into Genus
Issues
mem[2*i+:2]
.Bigger Example
(Source code for provided examples: sv2v_array_example.tar.gz).
This is a summary of how sv2v, Genus, Vivado, and DC handle multidimensional arrays:
logic [1:0] mem;
sv2v
Genus
Vivado
DC
logic [1:0][1:0] mem;
sv2v
Genus
Vivado
DC
logic [1:0] mem [2];
sv2v
Genus
Vivado
DC
logic [1:0][1:0] mem [2];
sv2v
Genus
Vivado
DC
logic [1:0] mem [2][2];
sv2v
Genus
Vivado
DC
logic [1:0][1:0] mem [2][2];
sv2v
Genus
Vivado
DC
Possible Solution
I wonder if it would make sense to convert all but 1 packed dimensions into unpacked dimensions:
Input
Output
One issue I see is that BRAM inference will change: the word size will be the 1st packed array dimension size, not the total size of the packed array. However, this may be fine because Vivado only supports BRAM inference on SystemVerilog with 1 packed array dimension (source), so this change will make sv2v more similar to Vivado. I haven't tested other tools.
Another possible issue is I'm not sure of tool support for mixing big-endian and little-endian unpacked arrays.
Thanks!
The text was updated successfully, but these errors were encountered: