Where to start for implementation of a width mismatch rule?

27 views
Skip to first unread message

Wes Piard

unread,
Jan 23, 2025, 7:02:02 AM1/23/25
to Verible Developers
I would like to look into implementing a rule that checks for a width mismatch between LHS and RHS values. There have been a couple of issues already submitted: 


I have browsed the codebase a little, but I figured it would probably be more efficient for anyone here to provide some guidance on where to look. Does the ability to evaluate the total bit width of lhs/rhs expressions and port connections exist already? If so, do any current rules utilize this functionality? 

I feel like detecting width mismatches should be one of the first lint rules created since it is one of the most controversial topics when discussing SV vs. VHDL, etc. I fear that because this type of rule doesn't exist, there may not be any mechanism in place yet in Verible to easily implement it. Hopefully I'm wrong!

David Fang

unread,
Jan 23, 2025, 1:55:15 PM1/23/25
to Wes Piard, Verible Developers
I've commented on the above issues just now.
Verible at the moment doesn't evaluate types or widths; it's not an actual compiler (yet).  
To add this capability, one would start with the information that's present in the symbol table, (declarations' types, and symbol bindings/uses).

--
You received this message because you are subscribed to the Google Groups "Verible Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to verible-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/verible-dev/ec1e51ac-841a-460a-83d6-b505158763fbn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages