[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-user: Icarus Verilog: FPGA-like automatic initialized registers?
- To: geda-user@moria.seul.org
- Subject: gEDA-user: Icarus Verilog: FPGA-like automatic initialized registers?
- From: geda@meko.dk
- Date: Sun, 10 Aug 2003 11:30:04 -0700 (PDT)
- Delivered-to: archiver@seul.org
- Delivered-to: geda-user-outgoing@seul.org
- Delivered-to: geda-user@moria.seul.org
- Delivery-date: Sun, 10 Aug 2003 14:30:01 -0400
- Reply-to: geda-user@seul.org
- Sender: owner-geda-user@seul.org
I'm a Verilog, but I've tried researching this question in vain, so I
turn to this forum.
In standard Verilog, registers start out in the unknown (x) state, and
initialization either requires explicit reset logic, eg.
....
always @(posedge clk)
if (~reset_n) begin
pc <= 32'h0000;
....
end else begin
// Normal path here
or simulation specific initialization
....
initial
begin
for (...)
reg[$i] = 0;
(I'm sloppy on the syntax here).
Both approaches becomes rather awkward with non-trivial arrays and in
the explicit reset case can hurt designs that doesn't need anything
but the default reset-on-power-on provided by all FPGAs.
So the question is: is there a simple switch to the Icarus Verilog
simulator which will make it let all registers come up initialized to
zero, just like an FPGA?
Thanks!
/Tommy