Initial Value at start of process

R

Roger Planger

Hi

I have declared a Type with different states as you can see.

type STATE_TYPE is (IDLE, STLDA, STLDB, ADDS, FINISHS);

My question now is, how can I say my VHDL compiler that when he starts we
are in the IDLE State? Afterwards
it is easy to jump from one state to another.

Thanks for any hints

R
 
V

valentin tihomirov

Sorry for this stupid question, I figured it out in the meantime :)

Actually, it is not. Meantime I was sure that initialization during
declaration
signal STATE: TENUM := IDLE;

is intended for simulation while synthesis style must be:

process(CLK, RST)
if ASYNC_RST and RST = '1'
STATE <= IDLE;
else if Rising_Edge(CLK)
if not ASYNC_RST and RST = '1' then
STATE <= IDLE;

It turns out that the redundancy is needed as Xilinx FPGA loader will
initialize FFs to the values found in the declaration section.
 
R

Roger Planger

Hi

THanks for this hint, my problem is that I dont have a reset signal at the
moment. Therefore I want my State Machine to
be in the Idle state right from the beginning. It looks like that I have to
add this reset port to my IP

cheers

Roger
 
P

Pieter Hulshoff

Roger said:
THanks for this hint, my problem is that I dont have a reset signal at the
moment. Therefore I want my State Machine to
be in the Idle state right from the beginning. It looks like that I have
to add this reset port to my IP

I believe that within an FPGA you can make sure the design starts in a
defined state. For an ASIC however this is not possible. As such it is good
practice to place a reset within your design, and if I may be so bold:
please make it a synchronous reset i.s.o. an asynchronous one...

Regards,

Pieter Hulshoff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top