Commit 12d977f0 by Zachary Snow

visit nested LHSs in enum, typedef, and typeof conversions

parent 8f2dc46e
......@@ -11,6 +11,8 @@
* Fixed `--write path/to/dir/` with directives like `` `default_nettype ``
* Fixed `logic` incorrectly converted to `wire` even when provided to a task or
function output port
* Fixed conversion of enum item names and typenames nested deeply within the
left-hand side of an assignment
* Fixed `input signed` ports of interface-using modules producing invalid
declarations after inlining
* Fixed `` `resetall `` not resetting the `` `default_nettype ``
......
......@@ -47,7 +47,7 @@ traverseModuleItemM (Genvar x) =
insertElem x Nil >> return (Genvar x)
traverseModuleItemM item =
traverseNodesM traverseExprM return traverseTypeM traverseLHSM return item
where traverseLHSM = traverseLHSExprsM traverseExprM
where traverseLHSM = traverseNestedLHSsM $ traverseLHSExprsM traverseExprM
traverseGenItemM :: GenItem -> SC GenItem
traverseGenItemM = traverseGenItemExprsM traverseExprM
......
......@@ -79,7 +79,7 @@ insertType ident typ = do
traverseModuleItemM :: ModuleItem -> ST ModuleItem
traverseModuleItemM =
traverseNodesM traverseExprM return traverseTypeM traverseLHSM return
where traverseLHSM = traverseLHSExprsM traverseExprM
where traverseLHSM = traverseNestedLHSsM $ traverseLHSExprsM traverseExprM
-- convert TypeOf in a GenItem
traverseGenItemM :: GenItem -> ST GenItem
......
......@@ -88,7 +88,7 @@ traverseModuleItemM item = traverseModuleItemM' item
traverseModuleItemM' :: ModuleItem -> SC ModuleItem
traverseModuleItemM' =
traverseNodesM traverseExprM return traverseTypeM traverseLHSM return
where traverseLHSM = traverseLHSExprsM traverseExprM
where traverseLHSM = traverseNestedLHSsM $ traverseLHSExprsM traverseExprM
traverseGenItemM :: GenItem -> SC GenItem
traverseGenItemM = traverseGenItemExprsM traverseExprM
......
module top;
logic x;
logic [2:0] y;
for (genvar i = 0; i < 3; i++) begin : blk
wire w;
assign y[i] = w;
end
localparam type T = enum int { K = 0 };
assign blk[K].w = 1;
assign blk[$bits(x)].w = 1;
assign blk[$bits(T) - 30].w = 1;
endmodule
module top;
wire x;
wire [2:0] y;
assign y = 1'sb1;
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