Improve error report when erroneously using interface in expression
When an interface ("din" in this example) is erroneously used in an expression like this:
assign dummy = din.data & din;
Verilator reports the following:
%Error: Internal Error: top.sv:15: ../V3Gate.cpp:440: Var didn't get varscoped in V3Scope.cpp : ... In instance wrap_dut.din__Viftop assign dummy = din.data & din; ^~~ ... See the manual and http://www.veripool.org/verilator for more assistance.
Maybe a more informative error can be returned.
#1 Updated by Wilson Snyder 3 months ago
- Category set to Lint
- Status changed from New to Resolved
- Assignee set to Wilson Snyder
Thanks for your issue. I was unable to get the exact error message you did, but got other ugly messages when misusing an interface, so please check this also fixes your case.
Fixed in git towards eventual 4.020 release.
Here's what it does now:
%Error: t/t_interface_asvar_bad.v:29: Operator ADD expected non-interface on RHS but 'itf' is an interface. : ... In instance t.source getter = 4'd3 + itf; ^~~
Also available in: Atom