Commit d137fd3d by Zachary Snow

fix premature elaboration of single element patterns

parent ad18c583
...@@ -36,6 +36,7 @@ simplifyStep (UniOp LogNot (BinOp Ne a b)) = BinOp Eq a b ...@@ -36,6 +36,7 @@ simplifyStep (UniOp LogNot (BinOp Ne a b)) = BinOp Eq a b
simplifyStep (UniOp UniSub (UniOp UniSub e)) = e simplifyStep (UniOp UniSub (UniOp UniSub e)) = e
simplifyStep (UniOp UniSub (BinOp Sub e1 e2)) = BinOp Sub e2 e1 simplifyStep (UniOp UniSub (BinOp Sub e1 e2)) = BinOp Sub e2 e1
simplifyStep (e @ (Concat [Pattern{}])) = e
simplifyStep (Concat [e]) = e simplifyStep (Concat [e]) = e
simplifyStep (Concat es) = Concat $ filter (/= Concat []) es simplifyStep (Concat es) = Concat $ filter (/= Concat []) es
simplifyStep (Repeat (Dec 0) _) = Concat [] simplifyStep (Repeat (Dec 0) _) = Concat []
......
module top;
typedef struct packed {
logic a, b;
} T;
typedef struct packed {
logic x;
T y;
} S;
localparam WIDTH = 1;
S [WIDTH] s = '{
'{x: 1, y: '{a: 1, b: 0}}
};
initial #1 $display("%b", s);
endmodule
module top;
wire [2:0] s = 3'b110;
initial #1 $display("%b", s);
endmodule
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment