Commit e00582de by Zachary Snow

check for conflicts with unused declarations

parent a9f00cce
......@@ -123,8 +123,21 @@ convertPackages files =
-- injected package items
collectIdentConflicts :: Idents -> AST -> Writer Idents ()
collectIdentConflicts prefixes =
mapM_ $ collectModuleItemsM $ collectify traverseIdentsM $
collectIdent prefixes
mapM_ $ collectModuleItemsM collectModuleItem
where
collectModuleItem =
evalScoperT . scoper >=>
collectify traverseIdentsM ident
scoper = scopeModuleItem collectDecl return return return
collectDecl decl = do
case decl of
Variable _ _ x _ _ -> lift $ ident x
Net _ _ _ _ x _ _ -> lift $ ident x
Param _ _ x _ -> lift $ ident x
ParamType _ x _ -> lift $ ident x
CommentDecl{} -> return ()
return decl
ident = collectIdent prefixes
-- write down identifiers that have a package name as a prefix
collectIdent :: Idents -> Identifier -> Writer Idents ()
......
package P;
typedef logic T;
typedef logic [1:0] U;
endpackage
module top;
P::T P_T;
assign P_T = 0;
initial $display("%b", P_T);
P::U P_U = 0;
endmodule
......@@ -2,4 +2,5 @@ module top;
wire P_T;
assign P_T = 0;
initial $display("%b", P_T);
reg [1:0] P_U = 0;
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