Line 22... |
Line 22... |
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
|
|
|
|
--==================================================================================================
|
--==================================================================================================
|
-- TO DO
|
-- TO DO
|
-- · clean
|
-- ·
|
--==================================================================================================
|
--==================================================================================================
|
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.math_real.all;
|
use ieee.math_real.all;
|
Line 171... |
Line 171... |
|
|
begin
|
begin
|
--------------------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------------------
|
-- Instances
|
-- Instances
|
|
|
U_OUTMGR0: ctrl_output_manager
|
U_CTRL_OUTMGR0: ctrl_output_manager
|
generic map(
|
generic map(
|
MEM_ADD_WIDTH => 14 --: integer := 14
|
MEM_ADD_WIDTH => 14 --: integer := 14
|
)
|
)
|
port map(
|
port map(
|
-- MASTER (to memory)
|
-- MASTER (to memory)
|
Line 342... |
Line 342... |
memwr_in_ack_mem <= ACK_I_memw;
|
memwr_in_ack_mem <= ACK_I_memw;
|
|
|
------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------
|
-- Machine
|
-- Machine
|
P_sm_comb: process (present_state, reg_trigger_en, trigger_out_adr, memwr_out_adr,
|
P_sm_comb: process (present_state, reg_trigger_en, trigger_out_adr, memwr_out_adr,
|
memwr_in_ack_mem, outmgr_finish, continuous, ack_i_daq)
|
memwr_in_ack_mem, outmgr_finish, continuous, ack_i_daq,next_status1,trigger_act)
|
begin
|
begin
|
-- signals from output manager are described in next process
|
-- signals from output manager are described in next process
|
case present_state is
|
case present_state is
|
when ST_INIT =>
|
when ST_INIT =>
|
|
|
Line 359... |
Line 359... |
|
|
trigger_reset <= '1';
|
trigger_reset <= '1';
|
trigger_en <= '-';
|
trigger_en <= '-';
|
|
|
status(0) <= '1';
|
status(0) <= '1';
|
next_status1 <= not(next_status1); -- will be changed every buffer full read
|
-- next_status1: above
|
|
|
strobe_adc <= '0';
|
strobe_adc <= '0';
|
|
|
-- -- -- --
|
-- -- -- --
|
|
if outmgr_finish = '0' then
|
next_state <= ST_RUNNING;
|
next_state <= ST_RUNNING;
|
-- if there is an error manager, influde an if for errors in parameters
|
next_status1 <= not(status(1)); -- will be changed every buffer full read
|
|
else
|
|
next_state <= ST_INIT;
|
|
next_status1 <= status(1);
|
|
end if;
|
|
-- if there is an error manager, include "if" for errors in parameters
|
|
|
|
|
|
|
when ST_RUNNING =>
|
when ST_RUNNING =>
|
|
|
memwr_reset <= '0';
|
memwr_reset <= '0';
|
Line 469... |
Line 476... |
|
|
end process;
|
end process;
|
|
|
|
|
|
|
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,next_status1)
|
begin
|
begin
|
|
|
if RST_I_daq = '1' then
|
if RST_I_daq = '1' then
|
present_state <= ST_IDLE;
|
present_state <= ST_IDLE;
|
status(1) <= '0';
|
status(1) <= '0';
|
elsif stop = '1' then
|
elsif stop = '1' then
|
present_state <= ST_IDLE;
|
present_state <= ST_IDLE;
|
|
status(1) <= '0';
|
elsif write_in_adc = '1' then
|
elsif write_in_adc = '1' then
|
present_state <= ST_ADCWRITE_INIT;
|
present_state <= ST_ADCWRITE_INIT;
|
|
status(1) <= next_status1;
|
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;
|
|
status(1) <= next_status1;
|
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;
|
status(1) <= next_status1;
|
end if;
|
end if;
|
|
|