mirror of https://github.com/zachjs/sv2v.git
fix combined array declarations (resolves #34)
This commit is contained in:
parent
a0068f60f2
commit
46242aac5d
|
|
@ -314,6 +314,10 @@ tripLookahead l0 =
|
|||
-- know we must have a valid triplet ahead
|
||||
else if null l1 || asgn /= Nothing then
|
||||
True
|
||||
-- if there is an ident followed by some number of ranges, and that's it,
|
||||
-- then there is a trailing declaration of an array ahead
|
||||
else if (not $ null l1) && (null l2) then
|
||||
True
|
||||
-- if there is a comma after the identifier (and optional ranges and
|
||||
-- assignment) that we're looking at, then we know this identifier is not a
|
||||
-- type name, as type names must be followed by a first identifier before a
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
module top;
|
||||
typedef struct packed {
|
||||
logic f1;
|
||||
logic f2;
|
||||
} T;
|
||||
|
||||
T a[1:0];
|
||||
T b[1:0];
|
||||
|
||||
T c[1:0], d[1:0];
|
||||
T e[1:0], f[1:0], g;
|
||||
T h, i[1:0];
|
||||
T j;
|
||||
|
||||
struct packed {
|
||||
logic f1;
|
||||
logic f2;
|
||||
} k;
|
||||
endmodule
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
module top;
|
||||
reg [1:0] a[1:0];
|
||||
reg [1:0] b[1:0];
|
||||
|
||||
reg [1:0] c[1:0], d[1:0];
|
||||
reg [1:0] e[1:0], f[1:0], g;
|
||||
reg [1:0] h, i[1:0];
|
||||
reg [1:0] j;
|
||||
|
||||
reg [1:0] k;
|
||||
endmodule
|
||||
Loading…
Reference in New Issue