Commit 4ddbff9b by Zachary Snow

keep enum localparam types for later resolution

parent eeeade3e
......@@ -76,7 +76,10 @@ traverseDeclM decl = do
insertElem x UnknownType >> return decl'
ParamType Localparam x t -> do
traverseTypeM t >>= scopeType >>= insertElem x
return $ CommentDecl $ "removed localparam type " ++ x
return $ case t of
Enum{} -> ParamType Localparam tmpX t
_ -> CommentDecl $ "removed localparam type " ++ x
where tmpX = "_sv2v_keep_enum_for_params"
ParamType{} -> return decl'
CommentDecl{} -> return decl'
......
module top;
localparam int W = 4;
typedef logic [W - 1:0] T;
typedef enum T {
A = 4'b1010,
B = 4'b0101
} E;
initial $display("%d %d %b %b", $bits(A), $bits(B), A, B);
endmodule
module top;
localparam W = 4;
localparam A = 4'b1010;
localparam B = 4'b0101;
initial $display("%d %d %b %b", W, W, A, B);
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