G
gene
Guest
consider this example:
----------------------------------------
module bob (iReset, iClock, oCount)
input iReset;
input iClock;
output [3:0] oCount;
reg [3:0] oCount;
always @(posedge iReset or posedge iClock)
begin
if (iReset == 1)
oCount <= 0;
else
if (oCount < 4'b1111)
oCount <= oCount + 1;
else
oCount <= oCount;
end
--------------------------------------------
Using XST, it generates a counter and it looks correct. If I remove
the
"else oCount <= oCount" line, it synthesizes exactly the same.
In my VHDL days, I was taught to fully describe the logic so that it
doesn't infer unnecessary latches. In this case, it didn't. Is that a
property of verilog or XST, or am I missing something?
thanks
gene
----------------------------------------
module bob (iReset, iClock, oCount)
input iReset;
input iClock;
output [3:0] oCount;
reg [3:0] oCount;
always @(posedge iReset or posedge iClock)
begin
if (iReset == 1)
oCount <= 0;
else
if (oCount < 4'b1111)
oCount <= oCount + 1;
else
oCount <= oCount;
end
--------------------------------------------
Using XST, it generates a counter and it looks correct. If I remove
the
"else oCount <= oCount" line, it synthesizes exactly the same.
In my VHDL days, I was taught to fully describe the logic so that it
doesn't infer unnecessary latches. In this case, it didn't. Is that a
property of verilog or XST, or am I missing something?
thanks
gene