Power-on reset

Is there a dedicated power-on reset function in Verilog? What I want to achieve is that my own reset functionality will be executed when the FPGA (Xilinx Spartan3/400) undergoes power-on reset.

Maybe power-on reset is available as a Xilix core, but I haven't been able to find anything like that.

I was hoping to avoid external POR circuitry.

Thanks,

Borge

P.S. Cross-posted to comp.lang.verilog

Reply to
Borge
Loading thread data ...

Xilinx comes up in a programmable known state. You can instantiate the ROC primitive to make your design take advantage of it (unless explicitly told otherwise, all the flip-flops come up cleared).

Reply to
Ray Andraka

Thanks Ray,

but

formatting link
says the ROC is used for VHDL simulation, not for Verilog or synthesis.

I was perhaps a bit unclear. The power-on-reset is something I will need for synthesis. I wonder if the Xilinx part has a power-on detection circuit with a logical output that I could OR with my (active high) reset input.

I don't mind the gates resetting to '0', but I'm using some random number generators that have constant, nonzero seeds set up in my code.

Regards, B=F8rge

Ray Andraka wrote

Reply to
Borge

Actually, any FDP, FDPE, FDS, or FDSE primitives come up set unless explicitly told otherwise, at least in the Spartan-N(E) families I've used. The FD, FDR, FDRS, FDC, FDCP, FDE, FDRE, FDRSE, FDCE, and FDCPE primitives all come up cleared as expected unless explicitly told otherwise.

All BlockRAM and CLB SelectRAM (including SRLs) come up cleared by default but can be overridden as well.

Reply to
John_H

formatting link

+++++++++++++++++++++++++++++++++++++++++++++++

As all the FPGA's FF's are reset to zero on powerup, why not create a counter that inhibits itself after reaching a suitable a preset value when clocked with one of your system clocks? Use the terminal count decode as your POR (adjusting polarity as appropriate).

Slurp

Reply to
Slurp

Good idea!

Or perhaps even better, have a register with no reset value be counted up towards a preset and let the local reset be active between preset one and preset two. After reaching preset two there's no more counting.

If we can KNOW that the register is reset to either 0xFF or 0x00, and not the preset values, this should generate a local reset pulse.

So, for example, a 4-bit register could count up from 0 (or F) to 2, activate reset, count to 4 and then deactivate reset and stop counting.

I love your abbreviations, but how would you declare the 4-bit register in practical, synthesizable Verilog?

Thanks, Borge

Slurp skrev:> As all the FPGA's FF's are reset to zero on powerup, why not create a

Reply to
Borge

Yes, that is true if you instantiate the primitives. The synthesis, however, does not force the use of those primitives necessarily. If you want it to come up in a known state then you need to use the ROC.

Borge, yes and no on the ROC. It is there mainly for the benefit of simulation, however if you instantiate the ROC component as a black box, synthesis leaves it in, and the Xilinx translate takes the black boxes out, leaving you with flip-flops that are explicitly forced to a specific starting state.

Reply to
Ray Andraka

Synthesis doesn't force the use of the set-on-power-up primitives but it doesn't exclude their use either. Look at any synthesis-produced instance of the mentioned primitives in your designs and you should find they power up to a logic high unless you explicitly override their operation.

Reply to
John_H

Without trying to write verilog after a couple of glasses of wine, use the 'initial' keyword for a block instead of 'always'; it gets executed precisely once (immediately post configuration).

Cheers

PeteS

Reply to
PeteS

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.