Signal not driven/used warning when assigning values to modports
Hi Verilator team,
I have observed certain behaviour with Verilator of which I am not sure if this intended or not.
I am using an interface with two modports to create a master/slave structure. I happen to get "Signal is not driven, nor used" warnings for signals of which I am certain that they are driven/used.
Attached is a small example where this behaviour occurs and illustrates the problem. I can suppress the warnings by adding lint_off tags, but I prefer not to do this every time. I do run verilator with the -Wwarn-style option, which also triggers these warnings.
The small design synthesizes fine and shows the correct behavior (without any non-driven signals).
I look forward to hearing your opinions about this.
#2 Updated by Laurens van Dam about 1 year ago
Todd Strader wrote:
Your master modport's signal is an input, yet you are assigning it in your example module. Try swapping master and slave's directions.
Swapping directions does not get rid of the Verilator warnings. Attached are the new files. Synthesis in Vivado does not mention anything about non-driven/used signals.
%Warning-UNUSED: example_module.sv:11: Signal is not driven, nor used: dummy_in %Warning-UNUSED: Use "/* verilator lint_off UNUSED */" and lint_on around source to disable this message. %Warning-UNUSED: example_module.sv:12: Signal is not driven, nor used: dummy_out %Error: Exiting due to 2 warning(s)
Also available in: Atom