Commit 3834b9f1 by Zachary Snow

support type lookup of genvars

parent 698e3b0b
......@@ -38,7 +38,11 @@ traverseDeclM decl = do
CommentDecl{} -> return decl'
traverseModuleItemM :: ModuleItem -> Scoper Type ModuleItem
traverseModuleItemM = traverseTypesM $ traverseNestedTypesM traverseTypeM
traverseModuleItemM (Genvar x) = do
insertElem x $ IntegerAtom TInteger Unspecified
return $ Genvar x
traverseModuleItemM item =
traverseTypesM (traverseNestedTypesM traverseTypeM) item
traverseGenItemM :: GenItem -> Scoper Type GenItem
traverseGenItemM = traverseGenItemExprsM traverseExprM
......
......@@ -62,4 +62,12 @@ module top;
$display("%b %d %d %d", y, y, $left(y), $right(y));
$display("%b %d %d %d", z, z, $left(z), $right(z));
end
for (genvar i = 0; i < 2; ++i)
initial begin
type(i) a;
a = ~i;
$display("%b %d %d %d", i, i, $left(i), $right(i));
$display("%b %d %d %d", a, a, $left(a), $right(a));
end
endmodule
......@@ -75,4 +75,14 @@ module top;
$display("%b %d %d %d", y, y, 31, 0);
$display("%b %d %d %d", z, z, 31, 0);
end
generate
genvar i;
for (i = 0; i < 2; i = i + 1)
initial begin : block5
localparam a = ~i;
$display("%b %d %d %d", i, i, 31, 0);
$display("%b %d %d %d", a, a, 31, 0);
end
endgenerate
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