mirror of https://github.com/zachjs/sv2v.git
fix premature typename cast conversion (resolves #88)
This commit is contained in:
parent
9042145695
commit
478f0d19d2
|
|
@ -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) =
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
module Example;
|
||||
parameter type T = logic [3:0];
|
||||
T v = T'('1);
|
||||
initial #1 $display("%b", v);
|
||||
endmodule
|
||||
module top; Example example(); endmodule
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
module Example;
|
||||
wire [3:0] v = 4'b1111;
|
||||
initial #1 $display("%b", v);
|
||||
endmodule
|
||||
module top; Example example(); endmodule
|
||||
Loading…
Reference in New Issue