Line 55... |
Line 55... |
-- Known bugs :
|
-- Known bugs :
|
-- To Optimze :
|
-- To Optimze :
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
|
|
-- (!)
|
-- (!)
|
-- Original file modified to reduce code.
|
-- Original file modified to reduce code and make WR and reset signals
|
|
-- positive and make Reset sincronous
|
|
|
|
|
library ieee;
|
library ieee;
|
|
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
Line 132... |
Line 133... |
process (clk, reset)
|
process (clk, reset)
|
|
|
begin -- PROCESS
|
begin -- PROCESS
|
-- activities triggered by asynchronous reset (active low)
|
-- activities triggered by asynchronous reset (active low)
|
|
|
if reset = '0' then
|
-- activities triggered by rising edge of clock
|
|
if clk'event and clk = '1' then
|
|
|
|
if reset = '1' then
|
data_out <= (others => DEFAULT_OUT);
|
data_out <= (others => DEFAULT_OUT);
|
init_mem ( data);
|
init_mem ( data);
|
|
else
|
-- activities triggered by rising edge of clock
|
|
elsif clk'event and clk = '1' then
|
|
if CS = '1' then
|
if CS = '1' then
|
if WR = '0' then
|
if WR = '1' then
|
data(conv_integer(add)) <= data_in;
|
data(conv_integer(add)) <= data_in;
|
data_out <= (others => DEFAULT_OUT);
|
data_out <= (others => DEFAULT_OUT);
|
else
|
else
|
data_out <= data(conv_integer(add));
|
data_out <= data(conv_integer(add));
|
end if;
|
end if;
|
else
|
else
|
data_out <= (others => DEFAULT_OUT);
|
data_out <= (others => DEFAULT_OUT);
|
end if;
|
end if;
|
|
|
end if;
|
end if;
|
|
end if;
|
end process;
|
end process;
|
-- end generate CS_ENABLED;
|
-- end generate CS_ENABLED;
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-- CS_DISABLED : if USE_CS = false generate
|
-- CS_DISABLED : if USE_CS = false generate
|