OpenCores
URL https://opencores.org/ocsvn/modular_oscilloscope/modular_oscilloscope/trunk

Subversion Repositories modular_oscilloscope

[/] [modular_oscilloscope/] [trunk/] [hdl/] [ctrl/] [output_manager.vhd] - Diff between revs 35 and 37

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 35 Rev 37
Line 1... Line 1...
-------------------------------------------------------------------------------------------------100
-------------------------------------------------------------------------------------------------100
--| Modular Oscilloscope
--| Modular Oscilloscope
--| UNSL - Argentine
--| UNSL - Argentine
--|
--|
--| File: output_manager.vhd
--| File: ctrl_output_manager.vhd
--| Version: 0.5
--| Version: 0.5
--| Tested in: Actel A3PE1500
--| Tested in: Actel A3PE1500
 
--|   Board: RVI Prototype Board + LP Data Conversion Daughter Board
--|-------------------------------------------------------------------------------------------------
--|-------------------------------------------------------------------------------------------------
--| Description:
--| Description:
--|   CONTROL - Output manager
--|   CONTROL - Output manager
--|   Reads a memory incrementaly under certain parameters.
--|   Reads a memory incrementaly under certain parameters.
--|   
--|   
Line 25... Line 26...
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
 
 
 
 
--==================================================================================================
--==================================================================================================
-- TODO
-- TODO
-- · Spped up address_counter.
-- · Spped up address_counter
-- · Test new architecture
-- · Test new architecture
--==================================================================================================
--==================================================================================================
 
 
 
 
library ieee;
library ieee;
Line 39... Line 40...
 
 
 
 
 
 
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
entity output_manager is
entity ctrl_output_manager is
  generic(
  generic(
    MEM_ADD_WIDTH: integer :=  14
    MEM_ADD_WIDTH: integer :=  14
  );
  );
  port(
  port(
    ------------------------------------------------------------------------------------------------
    ------------------------------------------------------------------------------------------------
Line 92... Line 93...
 
 
    finish_O:           out std_logic
    finish_O:           out std_logic
    -- 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                                                    
 
 
        );
        );
end entity output_manager;
end entity ctrl_output_manager;
 
 
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
architecture ARCH20 of output_manager is
architecture ARCH20 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
 
  signal init: std_logic;     -- register
 
 
begin
begin
 
 
  --------------------------------------------------------------------------------------------------
  --------------------------------------------------------------------------------------------------
  -- Wishbone signals
  -- Wishbone signals
 
 
  DAT_O_port <= DAT_I_mem;
  DAT_O_port <= DAT_I_mem;
  CYC_O_mem <= CYC_I_port;
  CYC_O_mem <= CYC_I_port;
  STB_O_mem <= STB_I_port and enable_read;
  STB_O_mem <= STB_I_port and enable_read;
  ACK_O_port <= ACK_I_mem;
  ACK_O_port <= ACK_I_mem;
  ADR_O_mem <= address_counter;
  ADR_O_mem <= address_counter;
  WE_O_mem <= '0' ;
  WE_O_mem <= '0' ;
 
 
  --------------------------------------------------------------------------------------------------
  --------------------------------------------------------------------------------------------------
  -- Status signals  
  -- Status signals  
 
  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 s_finish = '0' and address_counter /= pause_address_I
                        (address_counter /= pause_address_I or init = '1')
                        and WE_I_port = '0'
 
            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;
Line 132... Line 131...
  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 <= '1';
 
        init <= '0';
      elsif load_I = '1' then
      elsif load_I = '1' then
        s_finish <= '0';
        s_finish <= '0';
      elsif address_counter = initial_address_I then
        init <= '1';
 
      elsif address_counter + 1 = initial_address_I then
        s_finish <= '1';
        s_finish <= '1';
 
        init <= '0';
 
      else
 
        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, 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  load_I = '1' then
        address_counter <= initial_address_I;
        address_counter <= initial_address_I;
      elsif enable_count = '1' then
      elsif enable_count = '1' and address_counter >= biggest_address_I then
        if address_counter >= biggest_address_I then
 
          address_counter <= (others => '0');
          address_counter <= (others => '0');
        else
      elsif  enable_count = '1' then
          address_counter <= address_counter + 1;
          address_counter <= address_counter + 1;
        end if;
        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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.