Line 158... |
Line 158... |
constant CLK_EPP_PERIOD: time := 100 ns;
|
constant CLK_EPP_PERIOD: time := 100 ns;
|
|
|
-- Control Signal Declarations
|
-- Control Signal Declarations
|
signal tb_InitFlag : boolean := false;
|
signal tb_InitFlag : boolean := false;
|
signal tb_ParameterInitFlag : boolean := false;
|
signal tb_ParameterInitFlag : boolean := false;
|
signal i: std_logic;
|
|
signal runflag: std_logic;
|
signal runflag: std_logic;
|
|
|
-- Parm Declarations
|
-- Parm Declarations
|
signal clk_Duty : real := 0.0;
|
signal clk_Duty : real := 0.0;
|
signal clk_Period : time := 0 ns;
|
signal clk_Period : time := 0 ns;
|
Line 209... |
Line 209... |
|
|
|
|
--------------------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------------------
|
-- Main process
|
-- Main process
|
P_Unclocked : process
|
P_Unclocked : process
|
|
variable i: integer range 0 to 1200;
|
|
|
------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------
|
-- Procedure for write in epp port
|
-- Procedure for write in epp port
|
procedure WriteData(
|
procedure WriteData(
|
constant in_address: in std_logic_vector(7 downto 0);
|
constant in_address: in std_logic_vector(7 downto 0);
|
constant in_data: in std_logic_vector(15 downto 0);
|
constant in_data: in std_logic_vector(15 downto 0);
|
Line 421... |
Line 423... |
-- -- 100110110 1 310 32
|
-- -- 100110110 1 310 32
|
-- -- 100111001 0 313 32
|
-- -- 100111001 0 313 32
|
-- -- 101010110 1 342 32
|
-- -- 101010110 1 342 32
|
--
|
--
|
--
|
--
|
|
--
|
|
-- wait for 50 ns;
|
|
--
|
|
-- ------------------------------------------------------------------------------------------------
|
|
-- -- Test 5 - Trigger - one shot
|
|
-- -- daq freq = ctrl freq/2 (default), trigger channel 1, level 30 %, not continuous, skipper = 5,
|
|
-- -- channels 1 and 2, buffer size = 100h, rissing edge, trigg offset = 0
|
|
-- test_number <= 5;
|
|
--
|
|
-- WriteData(X"01", X"0003", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- Channels_R
|
|
-- WriteData(X"02", X"0100", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- BuffSize_R
|
|
-- WriteData(X"03", X"0133", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- TrigLvl_R
|
|
-- WriteData(X"04", X"0000", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- TrigOff_R
|
|
-- WriteData(X"00", B"00000_00101_1_1_0_1_0_1", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- RunConf_R
|
|
--
|
|
--
|
|
-- ReadData(runflag, X"08", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
|
|
-- while (runflag = '1') loop
|
|
-- ReadData(runflag, X"08", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
|
|
-- end loop;
|
|
|
wait for 50 ns;
|
|
|
|
------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------
|
-- Test 5 - Trigger - one shot
|
-- Test 6 - Trigger
|
-- daq freq = ctrl freq/2 (default), trigger channel 1, level 30 %, not continuous, skipper = 5,
|
-- daq freq = ctrl freq/2 (default), trigger channel 1, level 70 %, continuous, skipper = 3,
|
-- channels 1 and 2, buffer size = 100h, rissing edge, trigg offset = 0
|
-- channels 1, buffer size = 150h, falling edge, full negative trigger offset
|
test_number <= 5;
|
test_number <= 6;
|
|
|
WriteData(X"01", X"0003", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- Channels_R
|
WriteData(X"01", X"0002", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- Channels_R
|
WriteData(X"02", X"0100", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- BuffSize_R
|
WriteData(X"02", X"0150", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- BuffSize_R
|
WriteData(X"03", X"0133", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- TrigLvl_R
|
WriteData(X"03", X"02CD", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- TrigLvl_R
|
WriteData(X"04", X"0000", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- TrigOff_R
|
WriteData(X"04", X"FF6A", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- TrigOff_R -150
|
WriteData(X"00", B"00000_00101_1_1_0_1_0_1", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- RunConf_R
|
WriteData(X"00", B"00000_00011_1_1_1_1_1_1", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- RunConf_R
|
|
|
|
|
ReadData(runflag, X"08", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
|
ReadData(runflag, X"08", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
|
while (runflag = '1') loop
|
i := 0;
|
|
while (i <= 200) loop
|
ReadData(runflag, X"08", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
|
ReadData(runflag, X"08", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
|
|
i := i + 1;
|
end loop;
|
end loop;
|
|
|
|
|
------------------------------------------------------------------------------------------------
|
|
-- Test 6 - Trigger
|
|
-- daq freq = ctrl freq/2 (default), trigger channel 1, level 30 %, continuous, skipper = 5,
|
|
-- channels 1, buffer size = 50
|
|
|
|
|
|
------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------
|
-- Test 7 - One channel
|
-- Test 7 - One channel
|
-- daq freq = ctrl freq/2 (default), trigger channel 1, level 30 %, continuous, skipper = 5,
|
-- daq freq = ctrl freq/2 (default), trigger channel 0, level 30 %, continuous, skipper = 5,
|
-- channels 1, buffer size = 50
|
-- channels 1, buffer size = 30, trigger offset 29, skipper = 10
|
|
--11101101010
|
|
-- test_number <= 7;
|
|
--
|
|
-- WriteData(X"01", X"0001", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- Channels_R
|
|
-- WriteData(X"02", X"0030", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- BuffSize_R
|
|
-- WriteData(X"03", X"0010", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- TrigLvl_R
|
|
-- WriteData(X"04", X"0029", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- TrigOff_R -150
|
|
-- WriteData(X"00", B"00000_01010_1_0_1_1_1_1", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O); -- RunConf_R
|
|
--
|
|
--
|
|
-- ReadData(runflag, X"08", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
|
|
-- while (i <= 1200) loop
|
|
-- ReadData(runflag, X"08", Data_IO, nStrobe_I, nSelectIn_I, nAutoFd_I, Busy_O);
|
|
-- i = i + 1;
|
|
-- end loop;
|
|
|
|
|
------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------
|
-- Test 8 - Test write while working
|
-- Test 8 - Test write while working
|
-- daq freq = ctrl freq/2 (default), trigger channel 1, level 30 %, continuous, skipper = 5,
|
-- daq freq = ctrl freq/2 (default), trigger channel 1, level 30 %, continuous, skipper = 5,
|