Commit f71accb3 by Zachary Snow

fix simple delayed multi-pack conversion within interface

parent 12c57ecc
...@@ -61,7 +61,8 @@ traverseModuleItemM defaultNetType (orig @ (NOutputGate _ _ x lhss expr)) = do ...@@ -61,7 +61,8 @@ traverseModuleItemM defaultNetType (orig @ (NOutputGate _ _ x lhss expr)) = do
_ <- mapM (needsLHS defaultNetType) lhss _ <- mapM (needsLHS defaultNetType) lhss
needsExpr defaultNetType expr needsExpr defaultNetType expr
return orig return orig
traverseModuleItemM defaultNetType (orig @ (Instance _ _ _ _ ports)) = do traverseModuleItemM defaultNetType (orig @ (Instance _ _ x _ ports)) = do
insertElem x ()
_ <- mapM (needsExpr defaultNetType . snd) ports _ <- mapM (needsExpr defaultNetType . snd) ports
return orig return orig
traverseModuleItemM _ item = return item traverseModuleItemM _ item = return item
......
...@@ -39,8 +39,13 @@ import Language.SystemVerilog.AST ...@@ -39,8 +39,13 @@ import Language.SystemVerilog.AST
type TypeInfo = (Type, [Range]) type TypeInfo = (Type, [Range])
convert :: [AST] -> [AST] convert :: [AST] -> [AST]
convert = map $ traverseDescriptions $ partScoper convert = map $ traverseDescriptions convertDescription
traverseDeclM traverseModuleItemM traverseGenItemM traverseStmtM
convertDescription :: Description -> Description
convertDescription (description @ (Part _ _ Module _ _ _ _)) =
partScoper traverseDeclM traverseModuleItemM traverseGenItemM traverseStmtM
description
convertDescription other = other
-- collects and converts declarations with multiple packed dimensions -- collects and converts declarations with multiple packed dimensions
traverseDeclM :: Decl -> Scoper TypeInfo Decl traverseDeclM :: Decl -> Scoper TypeInfo Decl
......
interface Interface;
logic [0:1][0:2] arr;
endinterface
module Module(intf);
Interface intf;
endmodule
module top;
Interface intf();
Module mod [1][2] (intf);
assign intf.arr[1] = 6;
assign intf.arr[0][0] = 1;
initial $display("%b", intf.arr);
endmodule
module top;
if (1) begin : intf
wire [0:1][0:2] arr;
end
assign intf.arr[1] = 6;
assign intf.arr[0][0] = 1;
initial $display("%b", intf.arr);
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