Commit 478f0d19 by Zachary Snow

fix premature typename cast conversion (resolves #88)

parent 90421456
......@@ -70,6 +70,12 @@ traverseExprM =
_ -> convertCastM (Number s) (Number n)
convertExprM (orig @ (Cast (Right DimsFn{}) _)) =
return orig
convertExprM (Cast (Right (Ident x)) e) = do
typeMap <- get
-- can't convert this cast yet because x could be a typename
if Map.notMember x typeMap
then return $ Cast (Right $ Ident x) e
else convertCastM (Ident x) e
convertExprM (Cast (Right s) e) =
convertCastM s e
convertExprM (Cast (Left (IntegerVector _ Signed rs)) e) =
......
module Example;
parameter type T = logic [3:0];
T v = T'('1);
initial #1 $display("%b", v);
endmodule
module top; Example example(); endmodule
module Example;
wire [3:0] v = 4'b1111;
initial #1 $display("%b", v);
endmodule
module top; Example example(); 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