5#include "TrigScint/Firmware/hitproducer.h"
6#include "TrigScint/Firmware/objdef.h"
10#ifdef TS_NOT_EMULATION
11#pragma HLS ARRAY_PARTITION variable = FIFO complete
12#pragma HLS ARRAY_PARTITION variable = amplitude complete
13#pragma HLS ARRAY_PARTITION variable = Peds complete
14#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[0]
15#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[1]
16#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[2]
17#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[3]
18#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[4]
19#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[5]
20#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[6]
21#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[7]
22#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[8]
23#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[9]
24#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[10]
25#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[11]
26#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[12]
27#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[13]
28#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[14]
29#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[15]
30#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[16]
31#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[17]
32#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[18]
33#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[19]
35#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[20]
36#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[21]
37#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[22]
38#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[23]
39#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[24]
40#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[25]
41#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[26]
42#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[27]
43#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[28]
44#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[29]
46#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[30]
47#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[31]
48#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[32]
49#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[33]
50#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[34]
51#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[35]
52#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[36]
53#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[37]
54#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[38]
55#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[39]
57#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[40]
58#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[41]
59#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[42]
60#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[43]
61#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[44]
62#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[45]
63#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[46]
64#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[47]
66#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[48]
67#pragma HLS INTERFACE ap_fifo depth = 16 port = FIFO[49]
87 ap_uint<14> edges_[17] = {0, 34, 158, 419, 517, 915,
88 1910, 3990, 4780, 7960, 15900, 32600,
89 38900, 64300, 128000, 261000, 350000};
91 ap_uint<14> sense_[16] = {3, 6, 12, 25, 25, 50, 99, 198,
92 198, 397, 794, 1587, 1587, 3174, 6349, 12700};
94 for (
int i = 0; i < NHITS; i++) {
120 1 * (v1 > nbins_[1]) + 1 * (v1 > nbins_[2]) + 1 * (v1 > nbins_[3]);
121 charge1 = edges_[4 * rr + ss] + (v1 - nbins_[ss]) * sense_[4 * rr + ss] +
122 sense_[4 * rr + ss] / 2 - 1;
124 rr = (word2 >> 6) / 64;
125 v1 = (word2 >> 6) % 64;
126 ss = 1 * (v1 > nbins_[1]) + 1 * (v1 > nbins_[2]) + 1 * (v1 > nbins_[3]);
127 charge2 = edges_[4 * rr + ss] + (v1 - nbins_[ss]) * sense_[4 * rr + ss] +
128 sense_[4 * rr + ss] / 2 - 1;
130 rr = (word3 >> 6) / 64;
131 v1 = (word3 >> 6) % 64;
132 ss = 1 * (v1 > nbins_[1]) + 1 * (v1 > nbins_[2]) + 1 * (v1 > nbins_[3]);
133 charge3 = edges_[4 * rr + ss] + (v1 - nbins_[ss]) * sense_[4 * rr + ss] +
134 sense_[4 * rr + ss] / 2 - 1;
136 rr = (word4 >> 6) / 64;
137 v1 = (word4 >> 6) % 64;
138 ss = 1 * (v1 > nbins_[1]) + 1 * (v1 > nbins_[2]) + 1 * (v1 > nbins_[3]);
139 charge4 = edges_[4 * rr + ss] + (v1 - nbins_[ss]) * sense_[4 * rr + ss] +
140 sense_[4 * rr + ss] / 2 - 1;
142 rr = (word5 >> 6) / 64;
143 v1 = (word5 >> 6) % 64;
144 ss = 1 * (v1 > nbins_[1]) + 1 * (v1 > nbins_[2]) + 1 * (v1 > nbins_[3]);
145 charge5 = edges_[4 * rr + ss] + (v1 - nbins_[ss]) * sense_[4 * rr + ss] +
146 sense_[4 * rr + ss] / 2 - 1;
155 outHit[i].Time = (word1 & 63);
165 ((charge1 + charge2 + charge3 + charge4 + charge5 - 36) * .00625);
Unsigned Arbitrary Precision Type.