mirror of https://github.com/zachjs/sv2v.git
keep enum localparam types for later resolution
This commit is contained in:
parent
eeeade3e19
commit
4ddbff9b97
|
|
@ -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'
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
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
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
module top;
|
||||
localparam W = 4;
|
||||
localparam A = 4'b1010;
|
||||
localparam B = 4'b0101;
|
||||
initial $display("%d %d %b %b", W, W, A, B);
|
||||
endmodule
|
||||
Loading…
Reference in New Issue