test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
sp.h
Go to the documentation of this file.
1 // This C++ header file was automatically generated
2 // by VPPC from a Verilog HDL project.
3 // VPPC web-page: http://www.phys.ufl.edu/~madorsky/vppc/
4 
5 // Author : madorsky
6 // Timestamp : Thu Mar 12 14:54:01 2015
7 
8 #ifndef __sp_h_file__
9 #define __sp_h_file__
10 #include "vppc_sim_lib.h"
11 #include "prim_conv_sector.h"
12 #include "zones.h"
13 #include "extend_sector.h"
14 #include "ph_pattern_sector.h"
15 #include "sort_sector.h"
16 #include "coord_delay.h"
17 #include "match_ph_segments.h"
18 #include "deltas_sector.h"
19 #include "best_tracks.h"
20 
21 class sp
22 {
23  public:
24  sp(){built = false; glbl_gsr = true; defparam();}
25  void defparam();
26  void build();
27  bool built;
28  bool glbl_gsr;
29  unsigned station;
30  unsigned cscid;
31  // segments per chamber
32  unsigned seg_ch;
33  // bit widths of ph and th outputs, reduced precision
34 // have to be derived from pattern width on top level
35  unsigned bw_ph;
36  unsigned bw_th;
37  // bit widths of ph and th, full precision
38  unsigned bw_fph;
39  unsigned bw_fth;
40  // wiregroup input bit width (0..111)
41  unsigned bw_wg;
42  // bit width of dblstrip input (max 80 for ME234/1 with double-width strips)
43  unsigned bw_ds;
44  // width of halfstrip input
45  unsigned bw_hs;
46  // pattern half-width for stations 3,4
47  unsigned pat_w_st3; //4;
48  // pattern half-width for station 1
49  unsigned pat_w_st1;
50  // number of input bits for stations 3,4
51  unsigned full_pat_w_st3;
52  // number of input bits for st 1
53  unsigned full_pat_w_st1;
54  // width of zero padding for station copies
55  unsigned padding_w_st1;
56  unsigned padding_w_st3;
57  // full pattern widths (aka reduced pattern)
58  unsigned red_pat_w_st3;
59  unsigned red_pat_w_st1;
60  // number of folds for pattern detectors, do not set to 1
61  unsigned fold;
62  // number of th outputs for ME1/1
63  unsigned th_ch11;
64  unsigned bw_q;
65  unsigned bw_addr;
66  // strips per section, calculated so ph pattern would cover +/- 8 deg in st 1
67  unsigned ph_raw_w; // kludge to fix synth error, need to understand
68  unsigned th_raw_w;
69  // max possible drifttime
70  unsigned max_drift;
71  // bit widths of precise phi and eta outputs
72  unsigned bw_phi;
73  unsigned bw_eta;
74  // width of ph raw hits, max coverage +8 to cover possible chamber displacement
75  unsigned ph_hit_w; //80 + 8;
76  // for 20 deg chambers
77  unsigned ph_hit_w20;
78  // for 10 deg chambers
79  unsigned ph_hit_w10; //40 + 8;
80  // width of th raw hits, max coverage +8 to cover possible chamber displacement
81  unsigned th_hit_w;
82  unsigned endcap;
83  unsigned n_strips;
84  unsigned n_wg;
85  // theta range (take +1 because th_coverage contains max th value starting from 0)
86  unsigned th_coverage;
87  // phi range
88  unsigned ph_coverage; //80 : 40;
89  // number of th outputs takes ME1/1 th duplication into account
90  unsigned th_ch;
91  // is this chamber mounted in reverse direction?
92  unsigned ph_reverse;
93  unsigned th_mem_sz;
94  unsigned th_corr_mem_sz;
95  // multiplier bit width (phi + factor)
96  unsigned mult_bw;
97  // ph zone boundaries for chambers that cover more than one zone
98 // hardcoded boundaries must match boundaries in ph_th_match module
99  unsigned ph_zone_bnd1;
100  unsigned ph_zone_bnd2;
101  unsigned zone_overlap;
102  // sorter parameters
103  unsigned bwr; // rank width
104  unsigned bpow; // (1 << bpow) is count of input ranks
105  unsigned cnr; // internal rank count
106  unsigned cnrex; // actual input rank count, must be even
107 
116  signal_ r_in; // input data for memory or register
117  signal_ we; // write enable for memory or register
120  signal_ r_out; // output data from memory or register
129  signal_ bt_vi; // valid
130  signal_ bt_hi; // bx index
131  signal_ bt_ci; // chamber
132  signal_ bt_si; // segment
133 
134  // coordinates [station][chamber][segment]
142  // numbers of best ranks [zone][num]
144  // best ranks [zone][num]
147  // ph and th raw hits [station][chamber]
150  // ph zones [zone][station]
152  // ph zones extended [zone][station]
154  // hardcoded (at this time) inputs
155 // drifttime and th_window have to become inputs eventually
158  // fold numbers for multiplexed pattern detectors
161  // ph quality codes output [zone][key_strip]
163  // coordinate outputs delayed and with history [bx_history][station][chamber][segment]
164 // most recent in bx = 0
171  // find_segment outputs, in terms of segments match in zones [zone][pattern_num][station 0-3]
177  signal_storage th_match__storage; signal_ th_match; // matching th, 2 segments
178  signal_storage th_match11__storage; signal_ th_match11; // matching th for ME11 (station 0 only), 4 segments (due to th duplication)
183  // ph and th deltas from best stations
184 // [zone][pattern_num], last index: [0] - best pair of stations, [1] - second best pair
189  // updated ranks [zone][pattern_num]
191  //[zone][pattern_num][station 0-3]
196 
197 
198  void init ();
199  void operator()
200  (
201  signal_& q__io,
202  signal_& wg__io,
203  signal_& hstr__io,
204  signal_& cpat__io,
205  signal_& pcs_cs__io,
206  signal_& pps_cs__io,
207  signal_& sel__io,
208  signal_& addr__io,
209  signal_& r_in__io,
210  signal_& r_out__io,
211  signal_& we__io,
212  signal_& bt_phi__io,
213  signal_& bt_theta__io,
214  signal_& bt_cpattern__io,
215  signal_& bt_delta_ph__io,
216  signal_& bt_delta_th__io,
217  signal_& bt_sign_ph__io,
218  signal_& bt_sign_th__io,
219  signal_& bt_rank__io,
220  signal_& bt_vi__io,
221  signal_& bt_hi__io,
222  signal_& bt_ci__io,
223  signal_& bt_si__io,
224  signal_& clk__io,
225  signal_& control_clk__io
226  );
236 };
237 #endif
unsigned seg_ch
Definition: sp.h:32
unsigned ph_hit_w
Definition: sp.h:75
signal_storage sign_ph__storage
Definition: sp.h:187
unsigned ph_raw_w
Definition: sp.h:67
unsigned ph_reverse
Definition: sp.h:92
signal_ vir
Definition: sp.h:192
unsigned bw_ds
Definition: sp.h:43
signal_storage cir__storage
Definition: sp.h:194
signal_ patt_ph_hi
Definition: sp.h:173
sp()
Definition: sp.h:24
signal_storage patt_ph_si__storage
Definition: sp.h:175
signal_ ph_qr
Definition: sp.h:146
signal_storage th_match__storage
Definition: sp.h:177
signal_ bt_ci
Definition: sp.h:131
unsigned bw_wg
Definition: sp.h:41
signal_ cir
Definition: sp.h:194
signal_storage phd__storage
Definition: sp.h:165
signal_ bt_sign_ph
Definition: sp.h:126
signal_storage th_foldn__storage
Definition: sp.h:160
unsigned ph_zone_bnd1
Definition: sp.h:99
unsigned red_pat_w_st3
Definition: sp.h:58
signal_ hstr
Definition: sp.h:110
signal_storage patt_ph_vi__storage
Definition: sp.h:172
sort_sector srts
Definition: sp.h:231
signal_ vl
Definition: sp.h:138
signal_ phd
Definition: sp.h:165
signal_storage th__storage
Definition: sp.h:137
coord_delay cdl
Definition: sp.h:232
signal_storage cpattern__storage
Definition: sp.h:182
signal_ pcs_cs
Definition: sp.h:112
signal_storage th_hito__storage
Definition: sp.h:149
unsigned n_wg
Definition: sp.h:84
signal_ ph_foldn
Definition: sp.h:159
signal_ th
Definition: sp.h:137
signal_storage ph_qr__storage
Definition: sp.h:146
signal_ we
Definition: sp.h:117
signal_ ph_hito
Definition: sp.h:148
signal_ bt_delta_th
Definition: sp.h:125
unsigned cnr
Definition: sp.h:105
signal_ vld
Definition: sp.h:168
unsigned fold
Definition: sp.h:61
bool glbl_gsr
Definition: sp.h:28
signal_ wg
Definition: sp.h:109
unsigned mult_bw
Definition: sp.h:96
signal_storage patt_ph_ci__storage
Definition: sp.h:174
prim_conv_sector pcs
Definition: sp.h:227
unsigned bwr
Definition: sp.h:103
bool built
Definition: sp.h:27
signal_ bt_sign_th
Definition: sp.h:127
signal_ th11d
Definition: sp.h:166
signal_ control_clk
Definition: sp.h:119
unsigned padding_w_st1
Definition: sp.h:55
void init()
signal_ me11a
Definition: sp.h:140
signal_storage ph_q__storage
Definition: sp.h:145
signal_storage patt_ph_hi__storage
Definition: sp.h:173
unsigned bw_phi
Definition: sp.h:72
signal_ ph_rank
Definition: sp.h:162
signal_storage cpatd__storage
Definition: sp.h:170
zones zns
Definition: sp.h:228
unsigned ph_hit_w10
Definition: sp.h:79
signal_ ph_num
Definition: sp.h:143
signal_ sir
Definition: sp.h:195
Definition: zones.h:12
void defparam()
signal_storage me11a__storage
Definition: sp.h:140
signal_ delta_ph
Definition: sp.h:185
signal_storage sign_th__storage
Definition: sp.h:188
signal_ sel
Definition: sp.h:114
signal_storage th11__storage
Definition: sp.h:136
unsigned bw_ph
Definition: sp.h:35
signal_ r_in
Definition: sp.h:116
signal_ sign_th
Definition: sp.h:188
signal_ phzvl
Definition: sp.h:139
signal_ cpat_match
Definition: sp.h:179
unsigned th_corr_mem_sz
Definition: sp.h:94
unsigned red_pat_w_st1
Definition: sp.h:59
signal_ bt_delta_ph
Definition: sp.h:124
signal_ addr
Definition: sp.h:115
signal_ sign_ph
Definition: sp.h:187
signal_storage phzvl__storage
Definition: sp.h:139
signal_ ph_q
Definition: sp.h:145
unsigned th_coverage
Definition: sp.h:86
signal_ cpatd
Definition: sp.h:170
unsigned cnrex
Definition: sp.h:106
signal_storage ph_rank__storage
Definition: sp.h:162
signal_ cpattern
Definition: sp.h:182
signal_storage thd__storage
Definition: sp.h:167
signal_ th_match11
Definition: sp.h:178
signal_ thd
Definition: sp.h:167
signal_storage th_match11__storage
Definition: sp.h:178
unsigned full_pat_w_st3
Definition: sp.h:51
unsigned bw_hs
Definition: sp.h:45
signal_storage th_window__storage
Definition: sp.h:157
ph_pattern_sector phps
Definition: sp.h:230
signal_ patt_ph_si
Definition: sp.h:175
unsigned bw_th
Definition: sp.h:36
signal_ ph_zone
Definition: sp.h:151
signal_storage delta_ph__storage
Definition: sp.h:185
unsigned bw_fph
Definition: sp.h:38
signal_ delta_th
Definition: sp.h:186
unsigned max_drift
Definition: sp.h:70
signal_ drifttime
Definition: sp.h:156
signal_storage ph__storage
Definition: sp.h:135
signal_ bt_theta
Definition: sp.h:122
signal_ bt_rank
Definition: sp.h:128
unsigned th_raw_w
Definition: sp.h:68
signal_ th_hito
Definition: sp.h:149
match_ph_segments mphseg
Definition: sp.h:233
unsigned bw_addr
Definition: sp.h:65
signal_storage sir__storage
Definition: sp.h:195
signal_storage drifttime__storage
Definition: sp.h:156
signal_ bt_si
Definition: sp.h:132
signal_ th_foldn
Definition: sp.h:160
signal_ bt_vi
Definition: sp.h:129
signal_storage vld__storage
Definition: sp.h:168
void build()
unsigned th_mem_sz
Definition: sp.h:93
signal_storage ph_ext__storage
Definition: sp.h:153
unsigned ph_coverage
Definition: sp.h:88
unsigned station
Definition: sp.h:29
best_tracks bt
Definition: sp.h:235
signal_ phi
Definition: sp.h:180
signal_storage ph_zone__storage
Definition: sp.h:151
signal_storage me11ad__storage
Definition: sp.h:169
unsigned n_strips
Definition: sp.h:83
signal_ r_out
Definition: sp.h:120
signal_ q
Definition: sp.h:108
signal_ ph_match
Definition: sp.h:176
unsigned pat_w_st3
Definition: sp.h:47
signal_storage cpat_match__storage
Definition: sp.h:179
signal_ me11ad
Definition: sp.h:169
signal_storage cpatr__storage
Definition: sp.h:141
signal_ patt_ph_ci
Definition: sp.h:174
signal_ patt_ph_vi
Definition: sp.h:172
signal_ th_window
Definition: sp.h:157
unsigned ph_hit_w20
Definition: sp.h:77
signal_ ph_ext
Definition: sp.h:153
unsigned th_ch11
Definition: sp.h:63
unsigned zone_overlap
Definition: sp.h:101
signal_ hir
Definition: sp.h:193
unsigned ph_zone_bnd2
Definition: sp.h:100
signal_storage vir__storage
Definition: sp.h:192
signal_storage th11d__storage
Definition: sp.h:166
deltas_sector ds
Definition: sp.h:234
signal_storage ph_foldn__storage
Definition: sp.h:159
signal_ clk
Definition: sp.h:118
unsigned bw_q
Definition: sp.h:64
signal_storage ph_match__storage
Definition: sp.h:176
signal_ th_match
Definition: sp.h:177
unsigned bpow
Definition: sp.h:104
unsigned endcap
Definition: sp.h:82
signal_storage ph_hito__storage
Definition: sp.h:148
unsigned bw_eta
Definition: sp.h:73
signal_ rank
Definition: sp.h:190
unsigned pat_w_st1
Definition: sp.h:49
Definition: sp.h:21
unsigned th_ch
Definition: sp.h:90
signal_ th11
Definition: sp.h:136
signal_storage theta__storage
Definition: sp.h:181
signal_storage vl__storage
Definition: sp.h:138
signal_storage ph_num__storage
Definition: sp.h:143
signal_storage delta_th__storage
Definition: sp.h:186
signal_storage rank__storage
Definition: sp.h:190
signal_ bt_phi
Definition: sp.h:121
signal_storage phi__storage
Definition: sp.h:180
unsigned bw_fth
Definition: sp.h:39
unsigned full_pat_w_st1
Definition: sp.h:53
unsigned padding_w_st3
Definition: sp.h:56
signal_ cpatr
Definition: sp.h:141
extend_sector exts
Definition: sp.h:229
signal_ bt_cpattern
Definition: sp.h:123
unsigned th_hit_w
Definition: sp.h:81
signal_ bt_hi
Definition: sp.h:130
signal_storage hir__storage
Definition: sp.h:193
signal_ ph
Definition: sp.h:135
unsigned cscid
Definition: sp.h:30
signal_ pps_cs
Definition: sp.h:113
signal_ cpat
Definition: sp.h:111
signal_ theta
Definition: sp.h:181