Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21325 Discussions

Initial Register Value

Altera_Forum
Honored Contributor II
1,335 Views

Hi Guys, 

I would like to ask the next question. 

The first one: Is it synthesizeable to determine value, such as 50000(integer), during reset (one step before "clk'event and clk..." line)?  

 

*** 

if(reset = '1') then 

conter <= 50000; 

elsif(clk'event and clk = '1') then 

........ 

........ 

........ 

end if; 

*** 

 

The second one: Is it synthesizeable to determine value, such as 50000(integer), as an initial value of the signal that declarated as an integer. 

 

**** 

signal counter1 :integer range 0 to 50000 := 50000; 

**** 

 

Thanks
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
639 Views

Both methods should set the initial value of the register fine in Quartus.

0 Kudos
Altera_Forum
Honored Contributor II
639 Views

Thanks for the quick reply, 

but when I enter the value during the reset state, it's work but sometimes FPGA doesn't respond at all. All processes are like a frozen. 

What can be the reason? 

 

Tnx
0 Kudos
Altera_Forum
Honored Contributor II
639 Views

Are you providing a reset signal to your FPGA? With the initial value you are sure that the design will power up with that value. If you set it in the reset state, it is only guaranteed to start with this value if you have an asserted reset signal in the FPGA.

0 Kudos
Reply