History

I'm fine with this concept but can you instead please update the patch to add a method to VDirection and AstVarType class similar to the existing ones there that is called by V3EmitXml? (Or perhaps verilogKwd() is sufficient.) That gets rid of the internal-peeking switch statement.

This is a second attempt, which tries harder to dump the more interesting information, and also identifies interfaces.
The vartype=unused option is not used as far as I know, but I'm no Verilator expert.

I realized too late that the patch previously submitted does not cover dumping port directions for modports. The attached fix seems to be rather simple unless you know of undesirable side-effects. Sorry for the confusion over the previous message, I did not realise your repository is not browsable.

interface modportnames are not mentioned in the typetable (which leaves direction of module interface ports ambiguous).
Also need a syntax to indicate when the whole of an interface is referred to, and not just its modport.

That resolution didn't last long. It turns out AstVarXRef's are not qualified with the path
of the interface that they belong to (stored in the m_dotted field). I definitely predict the
rate of submission of patches will decline from now on.