3 use IEEE.STD_LOGIC_1164.
ALL;
4 use IEEE.STD_LOGIC_ARITH.
ALL;
5 use IEEE.STD_LOGIC_UNSIGNED.
ALL;
7 use work.params_package.
ALL;
13 MASTER_CLK : in ;
-- 125 MHz Ethernet Clock
16 BURST_FORCE_PACKET: in ;
21 end burst_traffic_controller;
26 signal clocks_since_send : (33 downto 0);
27 signal writes_in_curr_burst : (7 downto 0);
--this count should always be
28 -- equal to burst_controller_sm/b_packet_qw_size
29 signal force_packet_old : ;
36 if rising_edge(MASTER_CLK) then
38 -- keep pulses to only one clock
39 BURST_END_PACKET <= '0';
41 force_packet_old <= BURST_FORCE_PACKET;
45 clocks_since_send <= (others => '0');
46 writes_in_curr_burst <= (others => '0');
50 if clocks_since_send /= '1' & x"00000000" then -- increment clocks since last burst packet send
51 clocks_since_send <= clocks_since_send + 1;
54 if BURST_WE = '1' then
56 clocks_since_send <= (others => '0');
58 if writes_in_curr_burst >= 181 then
59 writes_in_curr_burst <= (others => '0');
61 writes_in_curr_burst <= writes_in_curr_burst + 1;
64 --allow for case when packet ended and write occurs
65 if (force_packet_old = '0' and BURST_FORCE_PACKET = '1') then
66 BURST_END_PACKET <= '1';
-- force end burst packet
67 writes_in_curr_burst <= x"01";
-- based on what happens in burst_controller_sm .. this write is first in next packet!
72 -- check if between hits should end Burst Packet due to time out period or external force signal
73 if ( writes_in_curr_burst /= 0 and
74 ( (force_packet_old = '0' and BURST_FORCE_PACKET = '1')
76 --BURST_PERIOD_MAX & '1' & x"E848" then -- in ms : [<val> * 0x1E848] 125Mhz clocks is max wait
77 (clocks_since_send >= '0' & x"0080" & '1' & x"E848") ) ) then
79 BURST_END_PACKET <= '1';
-- force end burst packet
80 clocks_since_send <= (others => '0');
81 writes_in_curr_burst <= (others => '0');