forked from llvm/circt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIRRTL] Fix unpacked array ordering in GCT and ExportVerilog (llvm#2049
) The FIRRTL Grand Central pass and ExportVerilog currently order unpacked arrays in reverse upon emission. A nested array like `uarray<2 x uarray<3 x i1>>` has the shape `[[a,b,c], [d,e,f]]` and should produce the following verilog: logic foo [2][3]; // non-range indices used for clarity Generally the following SV declaration: logic [2:0][1:0] bar [4:0][3:0]; Reads its dimensions from outer- to innermost as: [4:0], [3:0], [2:0], [1:0] Currently, ExportVerilog will emit the above `foo` example as `foo[3][2]`, which is incorrect. Fixing ExportVerilog also provides a fix for an issue @seldridge tackled earlier in ca5bfac. This change reverts parts of that older fix since the updated declaration order now makes the original Grand Central index order correct. The output now matches what the Scala FIRRTL compiler produces.
- Loading branch information
1 parent
67bc21a
commit 027e6ef
Showing
6 changed files
with
345 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.