Extend UNUSED to flag signals which are not in the cone of a module output
The following code produces no warnings:
module unused_vars ( input var logic ck, output var logic c ); logic d, q; always_ff @(posedge ck) q <= d; always_comb d = q; always_comb c = '0; endmodule : unused_vars
The combination of UNUSED and UNOPTFLAT means (I think) that we will always get a warning if signals are not either in the cone of an output or a nonblocking assignment. However, d and q are only used by each other and can be eliminated from the module and it would be very useful to get a warning about this.
Also available in: Atom