diff --git a/src/Convert/Interface.hs b/src/Convert/Interface.hs index d385e14..eb23173 100644 --- a/src/Convert/Interface.hs +++ b/src/Convert/Interface.hs @@ -570,7 +570,7 @@ inlineInstance global ranges modportBindings items partName makeParameterBind (x, Left t) = ParamType Localparam (paramTmp ++ x) t makeParameterBind (x, Right e) = - Param Localparam (TypeOf e) (paramTmp ++ x) e + Param Localparam UnknownType (paramTmp ++ x) e overrideParam :: Decl -> Decl overrideParam (Param Parameter t x e) = diff --git a/src/Convert/Simplify.hs b/src/Convert/Simplify.hs index 01cfd0c..0af2a8b 100644 --- a/src/Convert/Simplify.hs +++ b/src/Convert/Simplify.hs @@ -36,8 +36,6 @@ traverseDeclM decl = do case decl' of Param Localparam UnknownType x e -> insertExpr x e - Param Localparam (Implicit _ [(RawNum 31, RawNum 0)]) x e -> - insertExpr x e Param Localparam (Implicit sg rs) x e -> insertExpr x $ Cast (Left t) e where t = IntegerVector TLogic sg rs diff --git a/test/basic/simplify_type.sv b/test/basic/simplify_type.sv new file mode 100644 index 0000000..cd6d91b --- /dev/null +++ b/test/basic/simplify_type.sv @@ -0,0 +1,12 @@ +module top; + localparam _1B1 = 1'b1; + localparam _1SB1 = 1'sb1; + localparam [31:0] _1B1_EXT = 1'b1; + localparam [31:0] _1SB1_EXT = 1'sb1; + initial begin + $display("%d", $clog2({_1B1, 1'b0})); + $display("%d", $clog2({_1SB1, 1'b0})); + $display("%d", $clog2({_1B1_EXT, 1'b0})); + $display("%d", $clog2({_1SB1_EXT, 1'b0})); + end +endmodule