Commit 2e43dfee by Zachary Snow

fix failed indirection of unassigned function results

parent 4c3dcf52
......@@ -520,7 +520,11 @@ scopeModuleItem declMapperRaw moduleItemMapper genItemMapper stmtMapperRaw =
redirectTFDecl :: Type -> Identifier -> ScoperT a m (Type, Identifier)
redirectTFDecl typ ident = do
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
then (newType, newName)
else
......
module top;
function automatic bit foo;
input integer x;
// no return
endfunction
bit x;
assign x = foo(0);
endmodule
module top;
wire x;
assign x = 1'bx;
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