Line 1... |
Line 1... |
-------------------------------------------------------------------------------------------------100
|
-------------------------------------------------------------------------------------------------100
|
--| Modular Oscilloscope
|
--| Modular Oscilloscope
|
--| UNSL - Argentine
|
--| UNSL - Argentine
|
--|
|
--|
|
--| File: output_manager.vhd
|
--| File: output_manager.vhd
|
--| Version: 0.3
|
--| Version: 0.31
|
--| Tested in: Actel A3PE1500
|
--| Tested in: Actel A3PE1500
|
--|-------------------------------------------------------------------------------------------------
|
--|-------------------------------------------------------------------------------------------------
|
--| Description:
|
--| Description:
|
--| CONTROL - Output manager
|
--| CONTROL - Output manager
|
--| This is a pseudo buffer, wich reads a memory incrementaly under certain parameters.
|
--| This is a pseudo buffer, wich reads a memory incrementaly under certain parameters.
|
Line 13... |
Line 13... |
--|-------------------------------------------------------------------------------------------------
|
--|-------------------------------------------------------------------------------------------------
|
--| File history:
|
--| File history:
|
--| 0.1 | jun-2009 | First testing
|
--| 0.1 | jun-2009 | First testing
|
--| 0.2 | jul-2009 | Two levels internal buffer
|
--| 0.2 | jul-2009 | Two levels internal buffer
|
--| 0.3 | jul-2009 | One level internal buffer and only one clock
|
--| 0.3 | jul-2009 | One level internal buffer and only one clock
|
|
--| 0.31 | jul-2009 | Internal WE signals
|
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
--| Copyright ® 2009, Facundo Aguilera.
|
--| Copyright © 2009, Facundo Aguilera.
|
--|
|
--|
|
--| This VHDL design file is an open design; you can redistribute it and/or
|
--| This VHDL design file is an open design; you can redistribute it and/or
|
--| modify it and/or implement it after contacting the author.
|
--| modify it and/or implement it after contacting the author.
|
|
|
--| Wishbone Rev. B.3 compatible
|
|
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
|
|
|
|
|
--==================================================================================================
|
-- TODO
|
-- TODO
|
-- Config WE signals
|
-- · Spped up address_counter (with Actel SmartGen).
|
|
--==================================================================================================
|
|
|
-- This first release
|
|
|
|
library ieee;
|
library ieee;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
use IEEE.STD_LOGIC_UNSIGNED.ALL;
|
use IEEE.STD_LOGIC_UNSIGNED.ALL;
|
use IEEE.NUMERIC_STD.ALL;
|
use IEEE.NUMERIC_STD.ALL;
|
Line 78... |
Line 79... |
-- buffer starts and ends here
|
-- buffer starts and ends here
|
initial_address: in std_logic_vector (MEM_ADD_WIDTH - 1 downto 0);
|
initial_address: in std_logic_vector (MEM_ADD_WIDTH - 1 downto 0);
|
-- when the buffer arrives here, address is changed to 0 (buffer size)
|
-- when the buffer arrives here, address is changed to 0 (buffer size)
|
final_address: in std_logic_vector (MEM_ADD_WIDTH - 1 downto 0);
|
final_address: in std_logic_vector (MEM_ADD_WIDTH - 1 downto 0);
|
-- address wich is being writed by control
|
-- address wich is being writed by control
|
-- stop_address: in std_logic_vector (MEM_ADD_WIDTH - 1 downto 0);
|
stop_address: in std_logic_vector (MEM_ADD_WIDTH - 1 downto 0);
|
-- it is set when communication ends and remains until next restart or actual address change
|
-- it is set when communication ends and remains until next restart or actual address change
|
finish: out std_logic
|
finish: out std_logic
|
|
|
|
|
);
|
);
|
Line 91... |
Line 92... |
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
architecture ARCH11 of output_manager is
|
architecture ARCH11 of output_manager is
|
|
|
|
|
|
|
|
|
type DataStatusType is (
|
type DataStatusType is (
|
RESET,
|
RESET,
|
INIT, -- when restartet
|
INIT, -- when restartet
|
READY, -- data available to be read
|
READY, -- data available to be read
|
READ -- data was read from port, read next from memory
|
READ -- data was read from port, read next from memory
|
Line 157... |
Line 160... |
--------------------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------------------
|
-- Data read
|
-- Data read
|
ADR_O_mem <= address_counter;
|
ADR_O_mem <= address_counter;
|
s_finish <= '1' when address_counter = initial_address and data_status /= INIT else
|
s_finish <= '1' when address_counter = initial_address and data_status /= INIT else
|
'0';
|
'0';
|
enable_read <= enable and not(s_finish);
|
enable_read <= '1' when enable = '1' and s_finish = '0' and address_counter /= stop_address
|
|
else '0';
|
|
|
finish <= s_finish;
|
finish <= s_finish;
|
WE_O_mem <= '0' ;
|
WE_O_mem <= '0' ;
|
|
|
|
|
|
|
P_read: process(CLK_I, data_status, initial_address, address_counter, data, enable_read,
|
P_read: process(CLK_I, data_status, initial_address, address_counter, data, enable_read,
|
ACK_I_mem, WE_I_port)
|
ACK_I_mem, WE_I_port)
|
begin
|
begin
|
|
|
|
|
-- Clocked signals
|
-- Clocked signals
|
if (CLK_I'event and CLK_I = '1') then
|
if (CLK_I'event and CLK_I = '1') then
|
case data_status is
|
case data_status is
|
|
|
when RESET =>
|
when RESET =>
|
|
|
data <= (others => '0');
|
data <= (others => '0');
|
address_counter <= initial_address;
|
address_counter <= initial_address;
|
|
|
when READY =>
|
when READY =>
|
|
|