A design contains the following RTL:
reg [15:0] result;
always @(posedge clk or negedge rst_n) begin
if (!rst_n)
result <= 16'b0;
else if (enable)
result <= a * b;
end
assign done = enable;Assume that a and b are 8-bit unsigned inputs. The register result is not connected to any output or other logic, and no preservation attributes are applied.
After synthesis, the engineer finds that both the multiplier and the result register have disappeared. What is the best explanation?
Synthesis preserves the design’s observable behavior rather than every RTL declaration. Here, result does not influence an output or any state that eventually affects an output. Consequently, storing and calculating its value serves no observable purpose.
This generally happens when the optimization effort is set high by the designer. Here tool tries to optimize the design little too much.