verilog-auto-sense

verilog-auto-sense is a compiled Lisp function in `verilog-mode.el'.

(verilog-auto-sense)

Expand AUTOSENSE statements, as part of M-x verilog-auto.
Replace the always (/*AUTOSENSE*/) sensitivity list (/*AS*/ for short)
with one automatically derived from all inputs declared in the always
statement. Signals that are generated within the same always block are NOT
placed into the sensitivity list (see `verilog-auto-sense-include-inputs').
Long lines are split based on the `fill-column', see C-x f.

Limitations:
Verilog does not allow memories (multidimensional arrays) in sensitivity
lists. AUTOSENSE will thus exclude them, and add a /*memory or*/ comment.

Constant signals:
AUTOSENSE cannot always determine if a `define is a constant or a signal
(it could be in an include file for example). If a `define or other signal
is put into the AUTOSENSE list and is not desired, use the AUTO_CONSTANT
declaration anywhere in the module (parenthesis are required):

/* AUTO_CONSTANT ( `this_is_really_constant_dont_autosense_it ) */

Better yet, use a parameter, which will be understood to be constant
automatically.

OOps!
If AUTOSENSE makes a mistake, please report it. (First try putting
a begin/end after your always!) As a workaround, if a signal that
shouldn't be in the sensitivity list was, use the AUTO_CONSTANT above.
If a signal should be in the sensitivity list wasn't, placing it before
the /*AUTOSENSE*/ comment will prevent it from being deleted when the
autos are updated (or added if it occurs there already).

An example:

always @ (/*AS*/) begin
/* AUTO_CONSTANT (`constant) */
outin = ina | inb | `constant;
out = outin;
end

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

always @ (/*AS*/ina or inb) begin
/* AUTO_CONSTANT (`constant) */
outin = ina | inb | `constant;
out = outin;
end

Note in Verilog 2001, you can often get the same result from the new @*
operator. (This was added to the language in part due to AUTOSENSE!)

always @* begin
outin = ina | inb | `constant;
out = outin;
end