6 use IEEE.STD_LOGIC_1164.
all;
7 use ieee.numeric_std.
all;
10 use ipbus_lib.ipbus.
all;
16 clk_ipb : in std_logic;
19 ipb_out : out ipb_rbus;
21 BCNIn : in std_logic_vector(11 downto 0) := (others => '0');
22 SpyBCNIn : in std_logic := '0';
26 we : in std_logic := '0';
34 COMPONENT SortingOutputRAM
38 wea :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
39 addra :
IN STD_LOGIC_VECTOR(
6 DOWNTO 0);
40 dina :
IN STD_LOGIC_VECTOR(
31 DOWNTO 0);
41 douta :
OUT STD_LOGIC_VECTOR(
31 DOWNTO 0);
44 web :
IN STD_LOGIC_VECTOR(
0 DOWNTO 0);
45 addrb :
IN STD_LOGIC_VECTOR(
6 DOWNTO 0);
46 dinb :
IN STD_LOGIC_VECTOR(
31 DOWNTO 0);
47 doutb :
OUT STD_LOGIC_VECTOR(
31 DOWNTO 0)
52 signal din : std_logic_vector(31 downto 0);
53 signal q : std_logic_vector(31 downto 0);
54 signal counter : std_logic_vector(6 downto 0) := "0000000";
55 signal BC_counter : std_logic_vector(3 downto 0) := "0000";
56 signal dSync : std_logic_vector(4 downto 0);
62 signal ack : std_logic;
63 signal ack2 : std_logic;
64 signal ipbus_write : std_logic_vector(0 downto 0);
65 signal write_enable : std_logic_vector(0 downto 0);
68 IPBUS_RAM :
process(clk_ipb)
70 if rising_edge(clk_ipb) then
71 if ipb_in.ipb_strobe = '1' and ipb_in.ipb_write = '1' then
72 ipbus_write(0) <= '1';
74 ipbus_write(0) <= '0';
76 ack2 <= ipb_in.ipb_strobe and (not ack2) and (not ack);
82 ipb_out.ipb_ack <= ack;
83 ipb_out.ipb_err <= '0';
85 write_enable(0) <= we;
87 COUNTER_PROC :
process(rclk)
89 if rising_edge(rclk) then
91 dSync(dSync'high downto 1) <= dSync(dSync'high-1 downto 0);
93 if dSync(4) = '1' then
94 BC_counter <= std_logic_vector(unsigned(BC_counter) + 1);
97 if BC_Counter = "0000" and dSync(4) = '1' then
98 counter <= (others => '0');
100 counter <= std_logic_vector(unsigned(counter) + 1);
104 dOutput(0) <= to_AlgoTriggerObject(q);
105 dOutput(dOutput'high downto 1) <= dOutput(dOutput'high-1 downto 0);
109 ALGO_OUTPUT_RAM : SortingOutputRAM
112 ena => ipb_in.ipb_strobe,
114 addra => ipb_in.ipb_addr
(6 downto 0),
115 dina => ipb_in.ipb_wdata,
116 douta => ipb_out.ipb_rdata,
125 SortedOut <= dOutput(2);
126 din <= to_LogicVector(SortedIn) when spyBCNIn = '0' else x"f" & BCNIn & x"0fff";
External data-types and functions.
array(natural range <> ) of AlgoTriggerObject AlgoTriggerObjects
Algorithm OUTPUT port.
std_logic_vector( OUT_TOB_WIDTH- 1 downto 0) AlgoTriggerObject
Algorithm Trigger Object TOB.