Let's say I've following code:
always_ff @(posedge clk, negedge rst) begin
if (~rst) begin
bad_singal <= '0;
good_signal <= '0;
end else begin
// do something
// bad_signal is not used here or anywhere in design.
if (some condition)
good_signal <= 1'b1;
end
end
What will happen to bad_signal in synthesis? Will the synthesis tool optimize away the flop as it's not used anywhere in the design?