Skip to content

Instantly share code, notes, and snippets.

@tejainece
Created January 29, 2014 17:59
Show Gist options
  • Save tejainece/8693379 to your computer and use it in GitHub Desktop.
Save tejainece/8693379 to your computer and use it in GitHub Desktop.
Not all variables declared as reg gets synthesized to registers in verilog.
module ThisRegWontProduceReg(
output reg o1,
input i1, i2, i3
);
always @(i1, i2, i3) begin
if (i1 == 1'b1) begin
o1 <= i2;
end else begin
o1 <= i3;
end
end
endmodule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment