electronical
Advanced Member level 4
hello, how can i assign initail value to signal without using process?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
signal a : std_logic := '1';
thank you , but it is just for simulation not in real synth model,I need for real circuit
thank you , but it is just for simulation not in real synth model,I need for real circuit
Hi,I write this code but when I synt ,I face with this error:signal a : std_logic := '1';
package my_package is
type matrix1x8 is array ( 1 to 8) of integer range -127 to 127;
end package;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_logic_unsigned.all;
use work.my_package.all;
entity as is
port(clk,clr,reset:in bit;col_L:in matrix1x8
...);
end;
architecture behave of new_min_value is
signal a:integer range -127 to 127 :=1;
signal ii:integer range 1 to 8;
signal Mes_c_to_v:integer range -127 to 127:=1;
signal out_1:integer range -127 to 127:=1;
signal d:integer range -127 to 127:=1;
signal Lnew:integer range -127 to 127:=1;
begin
.
.
.
a<=col_L(ii);
d<=a-Mes_c_to_v;
...
process(clk,reset,clr )
variable i:integer range 0 to 8;
begin
if reset ='1' then
i:=0;
else
if (clk 'event and clk='1' )then
if clr='1' then
if i=8 then
i:=1;
else
i:=i+1;ii<=i;
end if;
end if;
end if;
end if;
end process;
--------------------------------------------------------------------------------------
;
end;
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
signal a:integer range -127 to 127 :=1;
signal Mes_c_to_v:integer range -127 to 127:=1;
d<=a-Mes_c_to_v;
Don't put initial values on signals your synthesizable vhdl.
Initial signal values can be supported by fpgas, taking effect straight after configuration. But they're usually regarded as bad news.
Otherwise your design may behave differently on the board than on the simulator. This can confuse you and others during debugging.
Are you sure it's a bad idea? In the past I've read some conflicting opinions about it. Because I also used to use explicit reset circuitry in fpga's ... because the folk wisdom said so. But as usual with folk wisdom, these folks should update their wisdom more often!
While explicit reset code for everything in your HDL looks nice and clean, and makes you a better and happier person, there's a flip-side to it. All those nice reset lines (and of course there is going to be more than one ) will cost you precious routing resources. And this while you could be using the global reset for it.
This will work for a real circuit - at least with Xilinx and Altera.
There is a very good engineering reason and it has nothing to do with 'folk wisdom' or 'opinions'. It's also a very simple explanation best explained by considering the following:Are you sure it's a bad idea? In the past I've read some conflicting opinions about it. Because I also used to use explicit reset circuitry in fpga's ... because the folk wisdom said so. But as usual with folk wisdom, these folks should update their wisdom more often!
The flip side also is that reset code can (and should be) designed to meet timing requirements. Specifically, 'reset' needs to go inactive at a known time relative to the clock. If you have multiple clocks, then you need seperate resets signals for each clock domain. A dual clock fifo? You hope that the designer knows what they were doing.While explicit reset code for everything in your HDL looks nice and clean, and makes you a better and happier person, there's a flip-side to it. All those nice reset lines (and of course there is going to be more than one ) will cost you precious routing resources. And this while you could be using the global reset for it.
- There is rarely a need to reset everything. Certain key things do need to be reset somehow, examples being the state of a state machine. Many flip flops do not need to be reset, examples being pretty much the entire data path. While reset can still have a lot of loads, the number of flops dedicated to data path that do not need to be reset will far outnumber the state machine, control and status bits that do need to be reset.So if your design is intended to always target an fpga (i.e no plans for ASICs or some such), then as far as I can tell there is no need to ALWAYS do an explicit reset for everything. Just wondering what other people experiences regarding this are...
Most FPGAs allow to trigger configuration by an external signal, many are exposing an optional input feeding the POR net.- At a system level, if the FPGA needs to be 'reset', is it acceptable that the reset be performed by re-configuring the device in order to reload those initial values?
- If FPGA configuration is only performed at power up, then the only way to reload those initial values to reset the device is to cycle power. Is that acceptable in your application?
Which difference do you imagine? If reset is asynchronously released, there's no difference in timing behaviour I think. Of course reset can be applied on demand, and it can be originated from a reset synchronizer, which changes a lot.Also, side note, I could be mistaken but I believe that there's a subtle difference between the initial (power-on) reset mechanism for:
signal a : std_logic := '0';
vs
if reset = '1' then
a <= '0';
else rising_edge(clock) then
end if;
Incidentally, an FPGA configuration file will usually default to loading all device flip-flops with an initial value of 0 during configuration.
I hear a lack of knowledge about actual FPGA hardware behind this statement. I'm not talking about ASICs.I'm a little concerned a few might not be recognising the gulf between an initial value and a reset - they're worlds apart in digital circuitry, as some have described above.
I hear a lack of knowledge about actual FPGA hardware behind this statement. I'm not talking about ASICs.
There is no thing like loading flip-flops with a value from configuration file with the FPGA families I was talking about, e.g. all recent Altera FPGAs.