eFEX firmware  1.7.3
ATLAS l1-calo - electron and tau feature extraction firmware for eFEX boards

Back to eFEX documentation
BDTModel_decision_function_2.vhd
1 -- ==============================================================
2 -- Generated by Vitis HLS v2024.1.2
3 -- Copyright 1986-2022 Xilinx, Inc. All Rights Reserved.
4 -- Copyright 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
5 -- ==============================================================
6 
7 library IEEE;
8 use IEEE.std_logic_1164.all;
9 use IEEE.numeric_std.all;
10 
12 port (
13  ap_ready : OUT STD_LOGIC;
14  x_0_val : IN STD_LOGIC_VECTOR (15 downto 0);
15  x_1_val : IN STD_LOGIC_VECTOR (15 downto 0);
16  x_9_val : IN STD_LOGIC_VECTOR (15 downto 0);
17  ap_return : OUT STD_LOGIC_VECTOR (5 downto 0) );
18 end;
19 
20 
22  constant ap_const_logic_1 : STD_LOGIC := '1';
23  constant ap_const_boolean_1 : BOOLEAN := true;
24  constant ap_const_lv16_255 : STD_LOGIC_VECTOR (15 downto 0) := "0000001001010101";
25  constant ap_const_lv32_3 : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000000011";
26  constant ap_const_lv32_F : STD_LOGIC_VECTOR (31 downto 0) := "00000000000000000000000000001111";
27  constant ap_const_lv13_0 : STD_LOGIC_VECTOR (12 downto 0) := "0000000000000";
28  constant ap_const_lv16_B : STD_LOGIC_VECTOR (15 downto 0) := "0000000000001011";
29  constant ap_const_lv1_1 : STD_LOGIC_VECTOR (0 downto 0) := "1";
30  constant ap_const_lv2_2 : STD_LOGIC_VECTOR (1 downto 0) := "10";
31  constant ap_const_lv2_3 : STD_LOGIC_VECTOR (1 downto 0) := "11";
32  constant ap_const_lv6_29 : STD_LOGIC_VECTOR (5 downto 0) := "101001";
33  constant ap_const_lv6_2F : STD_LOGIC_VECTOR (5 downto 0) := "101111";
34  constant ap_const_lv6_34 : STD_LOGIC_VECTOR (5 downto 0) := "110100";
35  constant ap_const_lv6_24 : STD_LOGIC_VECTOR (5 downto 0) := "100100";
36  constant ap_const_logic_0 : STD_LOGIC := '0';
37 
38 attribute shreg_extract : string;
39  signal tmp_fu_74_p4 : STD_LOGIC_VECTOR (12 downto 0);
40  signal comparison_fu_68_p2 : STD_LOGIC_VECTOR (0 downto 0);
41  signal comparison_35_fu_84_p2 : STD_LOGIC_VECTOR (0 downto 0);
42  signal comparison_36_fu_90_p2 : STD_LOGIC_VECTOR (0 downto 0);
43  signal activation_69_fu_96_p2 : STD_LOGIC_VECTOR (0 downto 0);
44  signal activation_fu_102_p2 : STD_LOGIC_VECTOR (0 downto 0);
45  signal xor_ln170_fu_114_p2 : STD_LOGIC_VECTOR (0 downto 0);
46  signal activation_72_fu_108_p2 : STD_LOGIC_VECTOR (0 downto 0);
47  signal zext_ln170_fu_120_p1 : STD_LOGIC_VECTOR (1 downto 0);
48  signal or_ln170_fu_124_p2 : STD_LOGIC_VECTOR (0 downto 0);
49  signal select_ln170_fu_130_p3 : STD_LOGIC_VECTOR (1 downto 0);
50  signal agg_result_fu_146_p9 : STD_LOGIC_VECTOR (5 downto 0);
51  signal agg_result_fu_146_p10 : STD_LOGIC_VECTOR (1 downto 0);
52  signal agg_result_fu_146_p11 : STD_LOGIC_VECTOR (5 downto 0);
53  signal agg_result_fu_146_p1 : STD_LOGIC_VECTOR (1 downto 0);
54  signal agg_result_fu_146_p3 : STD_LOGIC_VECTOR (1 downto 0);
55  signal agg_result_fu_146_p5 : STD_LOGIC_VECTOR (1 downto 0);
56  signal agg_result_fu_146_p7 : STD_LOGIC_VECTOR (1 downto 0);
57  signal ap_ce_reg : STD_LOGIC;
58 
59  component BDTModel_sparsemux_9_2_6_1_1 IS
60  generic (
61  ID : INTEGER;
62  NUM_STAGE : INTEGER;
63  CASE0 : STD_LOGIC_VECTOR (1 downto 0);
64  din0_WIDTH : INTEGER;
65  CASE1 : STD_LOGIC_VECTOR (1 downto 0);
66  din1_WIDTH : INTEGER;
67  CASE2 : STD_LOGIC_VECTOR (1 downto 0);
68  din2_WIDTH : INTEGER;
69  CASE3 : STD_LOGIC_VECTOR (1 downto 0);
70  din3_WIDTH : INTEGER;
71  def_WIDTH : INTEGER;
72  sel_WIDTH : INTEGER;
73  dout_WIDTH : INTEGER );
74  port (
75  din0 : IN STD_LOGIC_VECTOR (5 downto 0);
76  din1 : IN STD_LOGIC_VECTOR (5 downto 0);
77  din2 : IN STD_LOGIC_VECTOR (5 downto 0);
78  din3 : IN STD_LOGIC_VECTOR (5 downto 0);
79  def : IN STD_LOGIC_VECTOR (5 downto 0);
80  sel : IN STD_LOGIC_VECTOR (1 downto 0);
81  dout : OUT STD_LOGIC_VECTOR (5 downto 0) );
82  end component;
83 
84 
85 
86 begin
87  sparsemux_9_2_6_1_1_U27 : component BDTModel_sparsemux_9_2_6_1_1
88  generic map (
89  ID => 1,
90  NUM_STAGE => 1,
91  CASE0 => "00",
92  din0_WIDTH => 6,
93  CASE1 => "01",
94  din1_WIDTH => 6,
95  CASE2 => "10",
96  din2_WIDTH => 6,
97  CASE3 => "11",
98  din3_WIDTH => 6,
99  def_WIDTH => 6,
100  sel_WIDTH => 2,
101  dout_WIDTH => 6)
102  port map (
103  din0 => ap_const_lv6_29,
104  din1 => ap_const_lv6_2F,
105  din2 => ap_const_lv6_34,
106  din3 => ap_const_lv6_24,
107  def => agg_result_fu_146_p9,
108  sel => agg_result_fu_146_p10,
109  dout => agg_result_fu_146_p11);
110 
111 
112 
113 
114  activation_69_fu_96_p2 <= (comparison_fu_68_p2 xor ap_const_lv1_1);
115  activation_72_fu_108_p2 <= (comparison_36_fu_90_p2 and activation_69_fu_96_p2);
116  activation_fu_102_p2 <= (comparison_fu_68_p2 and comparison_35_fu_84_p2);
117  agg_result_fu_146_p10 <=
118  select_ln170_fu_130_p3 when (or_ln170_fu_124_p2(0) = '1') else
119  ap_const_lv2_3;
120  agg_result_fu_146_p9 <= "XXXXXX";
121  ap_ready <= ap_const_logic_1;
122  ap_return <= agg_result_fu_146_p11;
123  comparison_35_fu_84_p2 <= "1" when (tmp_fu_74_p4 = ap_const_lv13_0) else "0";
124  comparison_36_fu_90_p2 <= "1" when (unsigned(x_9_val) < unsigned(ap_const_lv16_B)) else "0";
125  comparison_fu_68_p2 <= "1" when (unsigned(x_0_val) < unsigned(ap_const_lv16_255)) else "0";
126  or_ln170_fu_124_p2 <= (comparison_fu_68_p2 or activation_72_fu_108_p2);
127  select_ln170_fu_130_p3 <=
128  zext_ln170_fu_120_p1 when (comparison_fu_68_p2(0) = '1') else
129  ap_const_lv2_2;
130  tmp_fu_74_p4 <= x_1_val(15 downto 3);
131  xor_ln170_fu_114_p2 <= (ap_const_lv1_1 xor activation_fu_102_p2);
132  zext_ln170_fu_120_p1 <= std_logic_vector(IEEE.numeric_std.resize(unsigned(xor_ln170_fu_114_p2),2));
133 end behav;