Trivial check to make sure that each module's ports satisfy basic well-formedness conditions and agree with its port declarations and to issue style warnings for tricky ports.
In this check, we try to identify cases like:
module foo (o, a, b); | module bar (o, a, b); output o; | output o; input a; | input c; // oops, no such port // oops, no declaration for b | ... endmodule | endmodule
This is mostly straightforward. One complication is that ports can have many names internally, for instance:
module baz (o, a, .foo({b, c, d) ; ... endmodule })
So, in general, we need to gather the names from the port expressions.