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

Subversion Repositories modular_oscilloscope

[/] [modular_oscilloscope/] [trunk/] [hdl/] [ctrl/] [memory_writer.vhd] - Diff between revs 48 and 55

Show entire file | Details | Blame | View Log

Rev 48 Rev 55
Line 87... Line 87...
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
architecture ARCH12 of ctrl_memory_writer is
architecture ARCH12 of ctrl_memory_writer is
 
 
  type DataStatusType is (
  type DataStatusType is (
          FINISHED,
          FINISHED,
          INIT,
        --  INIT,
          WORKING
          WORKING
          );
          );
 
 
  signal data_status: DataStatusType;
  signal data_status: DataStatusType;
 
 
Line 126... Line 126...
                           data_status = WORKING  and
                           data_status = WORKING  and
                           s_STB_mem = '1' and
                           s_STB_mem = '1' and
                           ACK_I_mem = '1'
                           ACK_I_mem = '1'
                      else
                      else
                  '0';
                  '0';
  reset_count <= '1' when reset_I = '1' or s_finished = '1'  else
  reset_count <= '1' when reset_I = '1' or (s_finished = '1' and enable_count = '1') else
                 '0';
                 '0';
 
 
  -- outputs
  -- outputs
  finished_O <= s_finished;
  finished_O <= s_finished;
  STB_O_adc <= s_STB_adc and enable_I;  -- !
  STB_O_adc <= s_STB_adc and enable_I;  -- !
Line 160... Line 160...
  P_stb_signals: process (CLK_I, reset_I, data_status, s_STB_adc, s_STB_mem, ACK_I_adc, ACK_I_mem)
  P_stb_signals: process (CLK_I, reset_I, data_status, s_STB_adc, s_STB_mem, ACK_I_adc, ACK_I_mem)
  begin
  begin
 
 
    if CLK_I'event and CLK_I = '1' then
    if CLK_I'event and CLK_I = '1' then
      if reset_I = '1' or RST_I = '1' then
      if reset_I = '1' or RST_I = '1' then
        data_status <= INIT;
        data_status <= WORKING;
        s_STB_adc <= '0';
        s_STB_adc <= '0';
        s_STB_mem <= '0';
        s_STB_mem <= '0';
        data <= (others => '0');
        data <= (others => '0');
      elsif enable_I = '1' then
      elsif enable_I = '1' then
        case data_status is
        case data_status is
          when INIT =>
--           when INIT =>
            -- this state is only necessary when there are adc convertions in every clock
--             -- this state is only necessary when there are adc convertions in every clock
            -- (for the first convertion)
--             -- (for the first convertion)
            s_STB_adc <= '1';
--             s_STB_adc <= '1';
            s_STB_mem <= '1';
--             s_STB_mem <= '1';
            data_status <= WORKING;
--             data_status <= WORKING;
 
--             data <= DAT_I_adc; -- save data
 
 
          when WORKING =>
          when WORKING =>
            if s_STB_adc = '1' and ACK_I_adc = '1' then
            if ACK_I_adc = '1' then
              s_STB_mem <= '1'; -- strobe when adc ack
              s_STB_mem <= '1'; -- strobe when adc ack
              data <= DAT_I_adc; -- save data
              data <= DAT_I_adc; -- save data
            elsif s_STB_mem = '1' and ACK_I_mem = '1' then
            elsif s_STB_mem = '1' and ACK_I_mem = '1' then
              s_STB_mem <= '0';
              s_STB_mem <= '0';
            end if;
            end if;
 
 
            if s_STB_mem = '1' and ACK_I_mem = '1' then
--             if s_STB_mem = '1' and ACK_I_mem = '1' then
              s_STB_adc <= '1'; -- strobe when mem ack
              s_STB_adc <= '1'; -- strobe when mem ack
            elsif s_STB_adc = '1' and ACK_I_adc = '1' then
--             elsif s_STB_adc = '1' and ACK_I_adc = '1' then
              s_STB_adc <= '0';
--               s_STB_adc <= '0';
            end if;
--             end if;
 
 
            if continuous_I = '0' and s_finished = '1' then
            if continuous_I = '0' and reset_count = '1' then
              data_status <= FINISHED;
              data_status <= FINISHED;
            end if;
            end if;
 
 
          when others => -- FINISHED
          when others => -- FINISHED
            s_STB_adc <= '0';
            s_STB_adc <= '0';

powered by: WebSVN 2.1.0

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