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

Subversion Repositories modular_oscilloscope

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

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

Rev 55 Rev 56
Line 156... Line 156...
  signal write_in_adc: std_logic;
  signal write_in_adc: std_logic;
 
 
 
 
  --------------------------------------------------------------------------------------------------
  --------------------------------------------------------------------------------------------------
  -- Flags
  -- Flags
  signal running: std_logic;
  signal status: std_logic_vector(1 downto 0);
 
  signal next_status1: std_logic;
  signal stop: std_logic;
  signal stop: std_logic;
  signal start: std_logic;
  signal start: std_logic;
  signal continuous: std_logic;
  signal continuous: std_logic;
 
 
 
 
Line 312... Line 313...
      trigger_level_O   => reg_trigger_level,
      trigger_level_O   => reg_trigger_level,
      trigger_offset_O  => reg_trigger_offset,
      trigger_offset_O  => reg_trigger_offset,
      trigger_channel_O => reg_trigger_channel,
      trigger_channel_O => reg_trigger_channel,
 
 
      error_number_I    => "000", -- not implemented yet
      error_number_I    => "000", -- not implemented yet
      error_flag_I      => '0',   -- not implemented yet
 
 
 
      adc_conf_O        => dat_to_adc,
      adc_conf_O        => dat_to_adc,
 
 
      start_O           => start,
      start_O           => start,
      continuous_O      => continuous,
      continuous_O      => continuous,
      running_I         => running,
      status_I         =>  status,
      write_in_adc_O    => write_in_adc,
      write_in_adc_O    => write_in_adc,
      stop_O            => stop
      stop_O            => stop
    );
    );
 
 
  ------------------------------------------------------------------------------------------------
  ------------------------------------------------------------------------------------------------
Line 358... Line 358...
        chsel_reset   <= '0';
        chsel_reset   <= '0';
 
 
        trigger_reset <= '1';
        trigger_reset <= '1';
        trigger_en    <= '-';
        trigger_en    <= '-';
 
 
        running <= '1';
        status(0) <= '1';
 
        next_status1 <= not(next_status1); -- will be changed every buffer full read 
 
 
        strobe_adc <= '0';
        strobe_adc <= '0';
 
 
        -- -- -- --
        -- -- -- --
        next_state    <= ST_RUNNING;
        next_state    <= ST_RUNNING;
 
        -- if there is an error manager, influde an if for errors in parameters
 
 
 
 
      when ST_RUNNING =>
      when ST_RUNNING =>
 
 
        memwr_reset       <= '0';
        memwr_reset       <= '0';
Line 382... Line 384...
        chsel_reset   <= '0';
        chsel_reset   <= '0';
 
 
        trigger_reset <= '0';
        trigger_reset <= '0';
        trigger_en    <= reg_trigger_en and memwr_in_ack_mem;
        trigger_en    <= reg_trigger_en and memwr_in_ack_mem;
 
 
        running <= '1';
        status(0) <= '1';
 
        next_status1 <= status(1);
 
 
        strobe_adc <= '0';
        strobe_adc <= '0';
 
 
        -- -- -- --
        -- -- -- --
 
        -- if there is an error manager, influde an if for errors in running, etc...
        if outmgr_finish = '1' then
        if outmgr_finish = '1' then
          if continuous = '1' then
          if continuous = '1' then
            next_state <= ST_INIT;
            next_state <= ST_INIT;
          else
          else
            next_state <= ST_IDLE;
            next_state <= ST_IDLE;
Line 408... Line 412...
        chsel_reset   <= '1';
        chsel_reset   <= '1';
 
 
        trigger_reset <= '1';
        trigger_reset <= '1';
        trigger_en    <= '-';
        trigger_en    <= '-';
 
 
        running <= '1'; -- aviod an ack if there is a read/write from port
        status(0) <= '1'; -- aviod an ack if there is a read/write from port
 
        next_status1 <= status(1);
 
 
        strobe_adc <= '0';
        strobe_adc <= '0';
 
 
        -- -- -- --
        -- -- -- --
        next_state <= ST_ADCWRITE;
        next_state <= ST_ADCWRITE;
Line 427... Line 432...
        chsel_reset   <= '1';
        chsel_reset   <= '1';
 
 
        trigger_reset <= '1';
        trigger_reset <= '1';
        trigger_en    <= '-';
        trigger_en    <= '-';
 
 
        running <= '1'; -- aviod an ack if there is a read/write from port
        status(0) <= '1'; -- aviod an ack if there is a read/write from port
 
        next_status1 <= status(1);
 
 
        strobe_adc <= '1';
        strobe_adc <= '1';
 
 
        -- -- -- --
        -- -- -- --
        if ACK_I_daq = '1' then
        if ACK_I_daq = '1' then
Line 450... Line 456...
        chsel_reset   <= '1';
        chsel_reset   <= '1';
 
 
        trigger_reset <= '1';
        trigger_reset <= '1';
        trigger_en    <= '-';
        trigger_en    <= '-';
 
 
        running <= '0';
        status(0) <= '0';
 
        next_status1 <= '0'; -- or error when there is an error manager
 
 
        strobe_adc <= '0';
        strobe_adc <= '0';
 
 
        -- -- -- --
        -- -- -- --
        next_state    <= ST_IDLE;
        next_state    <= ST_IDLE;
Line 465... Line 472...
 
 
 
 
  P_sm_clkd: process (RST_I_daq, stop, start, CLK_I_daq, next_state, write_in_adc)
  P_sm_clkd: process (RST_I_daq, stop, start, CLK_I_daq, next_state, write_in_adc)
  begin
  begin
 
 
    if RST_I_daq = '1' or stop = '1' then
    if RST_I_daq = '1' then
 
      present_state <= ST_IDLE;
 
      status(1) <= '0';
 
    elsif stop = '1' then
      present_state <= ST_IDLE;
      present_state <= ST_IDLE;
    elsif write_in_adc = '1' then
    elsif write_in_adc = '1' then
      present_state <= ST_ADCWRITE_INIT;
      present_state <= ST_ADCWRITE_INIT;
    elsif start = '1' and present_state /= ST_ADCWRITE and present_state /= ST_ADCWRITE_INIT then
    elsif start = '1' and present_state /= ST_ADCWRITE and present_state /= ST_ADCWRITE_INIT then
      present_state <= ST_INIT;
      present_state <= ST_INIT;
    elsif CLK_I_daq'event and CLK_I_daq = '1' then
    elsif CLK_I_daq'event and CLK_I_daq = '1' then
      present_state <= next_state;
      present_state <= next_state;
 
      status(1) <= next_status1;
    end if;
    end if;
 
 
 
 
  end process;
  end process;
 
 

powered by: WebSVN 2.1.0

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