Line 1... |
Line 1... |
-------------------------------------------------------------------------------------------------100
|
-------------------------------------------------------------------------------------------------100
|
--| Modular Oscilloscope
|
--| Modular Oscilloscope
|
--| UNSL - Argentine
|
--| UNSL - Argentine
|
--|
|
--|
|
--| File: ctrl_output_manager.vhd
|
--| File: ctrl_output_manager.vhd
|
--| Version: 0.5
|
--| Version: 0.54
|
--| Tested in: Actel A3PE1500
|
--| Tested in: Actel A3PE1500
|
--| Board: RVI Prototype Board + LP Data Conversion Daughter Board
|
--| Board: RVI Prototype Board + LP Data Conversion Daughter Board
|
--|-------------------------------------------------------------------------------------------------
|
--|-------------------------------------------------------------------------------------------------
|
--| Description:
|
--| Description:
|
--| CONTROL - Output manager
|
--| CONTROL - Output manager
|
Line 16... |
Line 16... |
--| 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
|
--| 0.31 | jul-2009 | Internal WE signals
|
--| 0.5 | jul-2009 | Architecture completely renovated (reduced)
|
--| 0.5 | jul-2009 | Architecture completely renovated (reduced)
|
|
--| 0.54 | aug-2009 | New finish_O and init flag behavior
|
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
--| 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.
|
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
|
|
|
|
--==================================================================================================
|
--==================================================================================================
|
-- TO DO
|
-- TO DO
|
-- · Spped up address_counter
|
-- NO Speed up address_counter
|
-- · Test new architecture
|
-- OK Full test of new architecture
|
|
-- OK Fix default value of s_finish signal
|
|
-- · General speed up
|
--==================================================================================================
|
--==================================================================================================
|
|
|
|
|
library ieee;
|
library ieee;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
Line 97... |
Line 100... |
);
|
);
|
end entity ctrl_output_manager;
|
end entity ctrl_output_manager;
|
|
|
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
architecture ARCH20 of ctrl_output_manager is
|
architecture ARCH22 of ctrl_output_manager is
|
|
|
signal address_counter: std_logic_vector(MEM_ADD_WIDTH - 1 downto 0);
|
signal address_counter: std_logic_vector(MEM_ADD_WIDTH - 1 downto 0);
|
signal enable_read: std_logic;
|
signal enable_read: std_logic;
|
signal enable_count: std_logic;
|
signal enable_count: std_logic;
|
signal s_finish: std_logic; -- register previous (and equal) to output
|
signal s_finish: std_logic; -- register previous (and equal) to output
|
Line 118... |
Line 121... |
ADR_O_mem <= address_counter;
|
ADR_O_mem <= address_counter;
|
WE_O_mem <= '0' ;
|
WE_O_mem <= '0' ;
|
|
|
--------------------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------------------
|
-- Status signals
|
-- Status signals
|
|
-- there is an init signal because in the first read, address_counter may be = to pause_address_I
|
enable_read <= '1' when enable_I = '1' and WE_I_port = '0' and s_finish = '0' and
|
enable_read <= '1' when enable_I = '1' and WE_I_port = '0' and s_finish = '0' and
|
(address_counter /= pause_address_I or init = '1')
|
(address_counter /= pause_address_I or init = '1')
|
else '0';
|
else '0';
|
|
|
enable_count <= CYC_I_port and STB_I_port and ACK_I_mem and enable_read;
|
enable_count <= CYC_I_port and STB_I_port and ACK_I_mem and enable_read;
|
|
|
finish_O <= s_finish;
|
finish_O <= s_finish;
|
|
s_finish <= '1' when address_counter = initial_address_I and init = '0' else
|
|
'0';
|
|
|
P_finish: process ( CLK_I, RST_I, address_counter, initial_address_I, load_I)
|
-- P_finish: process ( CLK_I, RST_I, address_counter, initial_address_I, load_I)
|
begin
|
-- begin
|
if CLK_I'event and CLK_I = '1' and CLK_I'LAST_VALUE = '0' then
|
-- if CLK_I'event and CLK_I = '1' and CLK_I'LAST_VALUE = '0' then
|
if RST_I = '1' then
|
-- if RST_I = '1' then
|
s_finish <= '1';
|
-- --s_finish <= '0'; -- !! enable signal must be '0' until load
|
init <= '0';
|
-- init <= '0';
|
elsif load_I = '1' then
|
-- elsif load_I = '1' then
|
s_finish <= '0';
|
-- --s_finish <= '0';
|
init <= '1';
|
-- init <= '1';
|
elsif address_counter + 1 = initial_address_I then
|
-- -- elsif address_counter + 1 = initial_address_I then
|
s_finish <= '1';
|
-- -- s_finish <= '1';
|
init <= '0';
|
-- -- init <= '0';
|
else
|
-- elsif enable_count = '1' then
|
init <= '0';
|
-- init <= '0';
|
end if;
|
-- end if;
|
end if;
|
-- end if;
|
end process;
|
-- end process;
|
|
|
--------------------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------------------
|
-- Address counter
|
-- Address counter
|
P_count: process(CLK_I, address_counter, enable_count, load_I)
|
P_count: process(CLK_I, RST_I, address_counter, enable_count, load_I)
|
begin
|
begin
|
if CLK_I'event and CLK_I = '1' and CLK_I'LAST_VALUE = '0' then
|
if CLK_I'event and CLK_I = '1' and CLK_I'LAST_VALUE = '0' then
|
if load_I = '1' then
|
if RST_I = '1' then
|
|
address_counter <= (others => '0');
|
|
init <= '1';
|
|
elsif load_I = '1' then
|
address_counter <= initial_address_I;
|
address_counter <= initial_address_I;
|
|
init <= '1';
|
elsif enable_count = '1' and address_counter >= biggest_address_I then
|
elsif enable_count = '1' and address_counter >= biggest_address_I then
|
address_counter <= (others => '0');
|
address_counter <= (others => '0');
|
elsif enable_count = '1' then
|
elsif enable_count = '1' then
|
address_counter <= address_counter + 1;
|
address_counter <= address_counter + 1;
|
|
init <= '0';
|
end if;
|
end if;
|
end if;
|
end if;
|
end process;
|
end process;
|
|
|
end architecture;
|
end architecture;
|
No newline at end of file
|
No newline at end of file
|