Line 58... |
Line 58... |
|
|
constant User_Addr : std_logic_vector(15 downto 0) := Address(15 downto 0);
|
constant User_Addr : std_logic_vector(15 downto 0) := Address(15 downto 0);
|
alias Comp_Addr is Open8_Bus.Address(15 downto 0);
|
alias Comp_Addr is Open8_Bus.Address(15 downto 0);
|
|
|
signal Addr_Match : std_logic := '0';
|
signal Addr_Match : std_logic := '0';
|
signal Rd_En : std_logic := '0';
|
signal Rd_En_d : std_logic := '0';
|
|
signal Rd_En_q : std_logic := '0';
|
|
|
signal Sample : DATA_TYPE := x"00";
|
signal Sample : DATA_TYPE := x"00";
|
signal RAM_Addr : std_logic_vector(9 downto 0) := (others => '0');
|
signal RAM_Addr : std_logic_vector(9 downto 0) := (others => '0');
|
signal RAM_Data : DATA_TYPE := x"00";
|
signal RAM_Data : DATA_TYPE := x"00";
|
signal Accumulator : std_logic_vector(17 downto 0) := (others => '0');
|
signal Accumulator : std_logic_vector(17 downto 0) := (others => '0');
|
signal Average : DATA_TYPE := x"00";
|
signal Average : DATA_TYPE := x"00";
|
begin
|
begin
|
|
|
Addr_Match <= Open8_Bus.Rd_En when Comp_Addr = User_Addr else '0';
|
Addr_Match <= '1' when Comp_Addr = User_Addr else '0';
|
|
Rd_En_d <= Addr_Match and Open8_Bus.Rd_En;
|
|
|
io_reg: process( Clock, Reset )
|
io_reg: process( Clock, Reset )
|
begin
|
begin
|
if( Reset = Reset_Level )then
|
if( Reset = Reset_Level )then
|
Rd_En <= '0';
|
Rd_En_q <= '0';
|
Rd_Data <= OPEN8_NULLBUS;
|
Rd_Data <= OPEN8_NULLBUS;
|
|
|
elsif( rising_edge( Clock ) )then
|
elsif( rising_edge( Clock ) )then
|
|
|
Rd_En <= Addr_Match and Open8_Bus.Rd_En;
|
Rd_En_q <= Rd_En_d;
|
Rd_Data <= OPEN8_NULLBUS;
|
Rd_Data <= OPEN8_NULLBUS;
|
|
if( Rd_En_q = '1' )then
|
if( Rd_En = '1' )then
|
|
Rd_Data <= Average;
|
Rd_Data <= Average;
|
end if;
|
end if;
|
end if;
|
end if;
|
end process;
|
end process;
|
|
|