verilog-auto-unused

verilog-auto-unused is an interactive compiled Lisp function in `verilog-mode.el'.


(verilog-auto-unused)

Expand AUTOUNUSED statements, as part of M-x verilog-auto.
Replace the /*AUTOUNUSED*/ comment with a comma separated list of all unused
input and inout signals.

/*AUTOUNUSED*/ is used to make stub modules; modules that have the same
input/output list as another module, but no internals. Specifically, it
finds all inputs and inouts in the module, and if that input is not otherwise
used, adds it to a comma separated list.

The comma separated list is intended to be used to create a _unused_ok
signal. Using the exact name "_unused_ok" for name of the temporary
signal is recommended as it will insure maximum forward compatibility, it
also makes lint warnings easy to understand; ignore any unused warnings
with "unused" in the signal name.

To reduce simulation time, the _unused_ok signal should be forced to a
constant to prevent wiggling. The easiest thing to do is use a
reduction-and with 1'b0 as shown.

This way all unused signals are in one place, making it convenient to add
your tool's specific pragmas around the assignment to disable any unused
warnings.

You can add signals you do not want included in AUTOUNUSED with
`verilog-auto-unused-ignore-regexp'.

An example of making a stub for another module:

module ExampStub (/*AUTOINST*/);
/*AUTOINOUTPARAM("Examp")*/
/*AUTOINOUTMODULE("Examp")*/
/*AUTOTIEOFF*/
// verilator lint_off UNUSED
wire _unused_ok = &{1'b0,
/*AUTOUNUSED*/
1'b0};
// verilator lint_on UNUSED
endmodule

Typing M-x verilog-auto will make this into:

...
// verilator lint_off UNUSED
wire _unused_ok = &{1'b0,
/*AUTOUNUSED*/
// Beginning of automatics
unused_input_a,
unused_input_b,
unused_input_c,
// End of automatics
1'b0};
// verilator lint_on UNUSED
endmodule