mirror of https://github.com/zachjs/sv2v.git
fix failed indirection of unassigned function results
This commit is contained in:
parent
4c3dcf5219
commit
2e43dfeeaa
|
|
@ -520,7 +520,11 @@ scopeModuleItem declMapperRaw moduleItemMapper genItemMapper stmtMapperRaw =
|
||||||
redirectTFDecl :: Type -> Identifier -> ScoperT a m (Type, Identifier)
|
redirectTFDecl :: Type -> Identifier -> ScoperT a m (Type, Identifier)
|
||||||
redirectTFDecl typ ident = do
|
redirectTFDecl typ ident = do
|
||||||
res <- declMapper $ Variable Local typ ident [] Nil
|
res <- declMapper $ Variable Local typ ident [] Nil
|
||||||
let Variable Local newType newName newRanges Nil = res
|
(newType, newName, newRanges) <-
|
||||||
|
return $ case res of
|
||||||
|
Variable Local t x r Nil -> (t, x, r)
|
||||||
|
Net Local TWire DefaultStrength t x r Nil -> (t, x, r)
|
||||||
|
_ -> error "redirectTFDecl invariant violated"
|
||||||
return $ if null newRanges
|
return $ if null newRanges
|
||||||
then (newType, newName)
|
then (newType, newName)
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
module top;
|
||||||
|
function automatic bit foo;
|
||||||
|
input integer x;
|
||||||
|
// no return
|
||||||
|
endfunction
|
||||||
|
bit x;
|
||||||
|
assign x = foo(0);
|
||||||
|
endmodule
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
module top;
|
||||||
|
wire x;
|
||||||
|
assign x = 1'bx;
|
||||||
|
endmodule
|
||||||
Loading…
Reference in New Issue