CMS 3D CMS Logo

find_segment.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:00 2015
7 
8 #ifndef __find_segment_h_file__
9 #define __find_segment_h_file__
10 #include "vppc_sim_lib.h"
11 
13 {
14  public:
15 
17 {
18  public:
19  comp3_class(){built = false; glbl_gsr = true; defparam();}
20  void defparam();
21  void build();
22  bool built;
23  bool glbl_gsr;
24 
29  signal_storage comp3_retval__storage; signal_ comp3_retval; // vppc generated: function return value holder
30 
31 
32 
33  void init ();
34  signal_& operator()
35  (
36  signal_& a__io,
37  signal_& b__io,
38  signal_& c__io
39  );
40 } comp3;
41  find_segment(){built = false; glbl_gsr = true; defparam();}
42  void defparam();
43  void build();
44  bool built;
45  bool glbl_gsr;
46  unsigned station;
47  unsigned cscid;
48  unsigned zone_cham; // 6 chambers in this zone and station
49  unsigned zone_seg; // segments per chamber in this zone and station
50  // segments per chamber
51  unsigned seg_ch;
52  // bit widths of ph and th outputs, reduced precision
53 // have to be derived from pattern width on top level
54  unsigned bw_ph;
55  unsigned bw_th;
56  // bit widths of ph and th, full precision
57  unsigned bw_fph;
58  unsigned bw_fth;
59  // wiregroup input bit width (0..111)
60  unsigned bw_wg;
61  // bit width of dblstrip input (max 80 for ME234/1 with double-width strips)
62  unsigned bw_ds;
63  // width of halfstrip input
64  unsigned bw_hs;
65  // pattern half-width for stations 3,4
66  unsigned pat_w_st3; //4;
67  // pattern half-width for station 1
68  unsigned pat_w_st1;
69  // number of input bits for stations 3,4
70  unsigned full_pat_w_st3;
71  // number of input bits for st 1
72  unsigned full_pat_w_st1;
73  // width of zero padding for station copies
74  unsigned padding_w_st1;
75  unsigned padding_w_st3;
76  // full pattern widths (aka reduced pattern)
77  unsigned red_pat_w_st3;
78  unsigned red_pat_w_st1;
79  // number of folds for pattern detectors, do not set to 1
80  unsigned fold;
81  // number of th outputs for ME1/1
82  unsigned th_ch11;
83  unsigned bw_q;
84  unsigned bw_addr;
85  // strips per section, calculated so ph pattern would cover +/- 8 deg in st 1
86  unsigned ph_raw_w; // kludge to fix synth error, need to understand
87  unsigned th_raw_w;
88  // max possible drifttime
89  unsigned max_drift;
90  // bit widths of precise phi and eta outputs
91  unsigned bw_phi;
92  unsigned bw_eta;
93  // width of ph raw hits, max coverage +8 to cover possible chamber displacement
94  unsigned ph_hit_w; //80 + 8;
95  // for 20 deg chambers
96  unsigned ph_hit_w20;
97  // for 10 deg chambers
98  unsigned ph_hit_w10; //40 + 8;
99  // width of th raw hits, max coverage +8 to cover possible chamber displacement
100  unsigned th_hit_w;
101  unsigned endcap;
102  unsigned n_strips;
103  unsigned n_wg;
104  // theta range (take +1 because th_coverage contains max th value starting from 0)
105  unsigned th_coverage;
106  // phi range
107  unsigned ph_coverage; //80 : 40;
108  // number of th outputs takes ME1/1 th duplication into account
109  unsigned th_ch;
110  // is this chamber mounted in reverse direction?
111  unsigned ph_reverse;
112  unsigned th_mem_sz;
113  unsigned th_corr_mem_sz;
114  // multiplier bit width (phi + factor)
115  unsigned mult_bw;
116  // ph zone boundaries for chambers that cover more than one zone
117 // hardcoded boundaries must match boundaries in ph_th_match module
118  unsigned ph_zone_bnd1;
119  unsigned ph_zone_bnd2;
120  unsigned zone_overlap;
121  // sorter parameters
122  unsigned bwr; // rank width
123  unsigned bpow; // (1 << bpow) is count of input ranks
124  unsigned cnr; // internal rank count
125  unsigned cnrex; // actual input rank count, must be even
126  unsigned max_ph_diff; // max phi difference between pattern and segment
127  unsigned bw_phdiff; // ph difference bit width
128  unsigned tot_diff;
129  // `localpar nodiff = ((1 << (bpow+1)) - 1);
130  unsigned nodiff; // invalid difference
131 
132  signal_ ph_pat_p; // ph detected in pattern
133  signal_ ph_pat_q_p; // pattern valid
136  signal_ th_seg_p; // theta
137  signal_ cpat_seg_p; // patterns
139  signal_ vid; // match valid, each flag shows validity of th coord
140  signal_ hid; // history id
141  signal_ cid; // chamber id
142  signal_ sid; // segment id
143  signal_ ph_match; // ph from matching segment
145  signal_ cpat_match; // pattern from matching segment
146  signal_storage ph_pat__storage; signal_ ph_pat; // ph detected in pattern
168 
169 
170  unsigned i;
171  unsigned j;
172  unsigned k;
173  unsigned di;
174 
175  void init ();
176  void operator()
177  (
178  signal_& ph_pat_p__io,
179  signal_& ph_pat_q_p__io,
180  signal_& ph_seg_p__io,
181  signal_& ph_seg_v_p__io,
182  signal_& th_seg_p__io,
183  signal_& cpat_seg_p__io,
184  signal_& vid__io,
185  signal_& hid__io,
186  signal_& cid__io,
187  signal_& sid__io,
188  signal_& ph_match__io,
189  signal_& th_match__io,
190  signal_& cpat_match__io,
191  signal_& clk__io
192  );
193 };
194 #endif
unsigned n_strips
Definition: find_segment.h:102
unsigned zone_cham
Definition: find_segment.h:48
unsigned th_coverage
Definition: find_segment.h:105
signal_ cpat_seg_p
Definition: find_segment.h:137
signal_ ph_pat
Definition: find_segment.h:146
unsigned mult_bw
Definition: find_segment.h:115
unsigned station
Definition: find_segment.h:46
unsigned i
Definition: find_segment.h:170
unsigned th_corr_mem_sz
Definition: find_segment.h:113
signal_ ph_pat_v
Definition: find_segment.h:147
unsigned red_pat_w_st3
Definition: find_segment.h:77
signal_storage comp3_retval__storage
Definition: find_segment.h:29
unsigned bw_hs
Definition: find_segment.h:64
signal_ diffi2
Definition: find_segment.h:160
unsigned bw_th
Definition: find_segment.h:55
unsigned endcap
Definition: find_segment.h:101
unsigned th_hit_w
Definition: find_segment.h:100
signal_ diffi0
Definition: find_segment.h:156
signal_storage cmp4__storage
Definition: find_segment.h:163
signal_storage th_seg__storage
Definition: find_segment.h:150
unsigned ph_zone_bnd2
Definition: find_segment.h:119
signal_ ph_seg_v
Definition: find_segment.h:149
signal_ ph_pat_p
Definition: find_segment.h:132
unsigned bpow
Definition: find_segment.h:123
unsigned cnr
Definition: find_segment.h:124
signal_storage ph_seg_v__storage
Definition: find_segment.h:149
signal_ ph_segr
Definition: find_segment.h:152
signal_storage ph_diff_tmp__storage
Definition: find_segment.h:153
signal_ th_seg
Definition: find_segment.h:150
signal_storage ph_diff__storage
Definition: find_segment.h:154
signal_ cpat_seg
Definition: find_segment.h:151
unsigned ph_raw_w
Definition: find_segment.h:86
signal_ diffi1
Definition: find_segment.h:158
signal_storage ph_segr__storage
Definition: find_segment.h:152
signal_ ph_diff
Definition: find_segment.h:154
signal_ diffi3
Definition: find_segment.h:162
class find_segment::comp3_class comp3
unsigned n_wg
Definition: find_segment.h:103
unsigned ph_hit_w
Definition: find_segment.h:94
unsigned max_drift
Definition: find_segment.h:89
signal_storage diffi0__storage
Definition: find_segment.h:156
unsigned zone_seg
Definition: find_segment.h:49
unsigned pat_w_st1
Definition: find_segment.h:68
signal_ diffi4
Definition: find_segment.h:164
signal_ ph_seg_p
Definition: find_segment.h:134
unsigned bw_eta
Definition: find_segment.h:92
signal_ th_match
Definition: find_segment.h:144
unsigned th_mem_sz
Definition: find_segment.h:112
signal_ th_seg_p
Definition: find_segment.h:136
unsigned seg_ch
Definition: find_segment.h:51
unsigned padding_w_st1
Definition: find_segment.h:74
unsigned ph_reverse
Definition: find_segment.h:111
unsigned bwr
Definition: find_segment.h:122
signal_storage rj__storage
Definition: find_segment.h:166
unsigned full_pat_w_st3
Definition: find_segment.h:70
signal_storage cmp3__storage
Definition: find_segment.h:161
signal_storage r__storage
Definition: find_segment.h:28
unsigned pat_w_st3
Definition: find_segment.h:66
signal_ cmp1
Definition: find_segment.h:157
unsigned cnrex
Definition: find_segment.h:125
unsigned fold
Definition: find_segment.h:80
signal_storage diffi3__storage
Definition: find_segment.h:162
unsigned bw_q
Definition: find_segment.h:83
unsigned ph_hit_w10
Definition: find_segment.h:98
signal_ ph_pat_q_p
Definition: find_segment.h:133
signal_ ph_match
Definition: find_segment.h:143
signal_storage ph_pat_v__storage
Definition: find_segment.h:147
signal_storage rcomp__storage
Definition: find_segment.h:155
signal_storage rk__storage
Definition: find_segment.h:167
signal_ cmp2
Definition: find_segment.h:159
unsigned max_ph_diff
Definition: find_segment.h:126
unsigned j
Definition: find_segment.h:171
signal_ ph_diff_tmp
Definition: find_segment.h:153
unsigned nodiff
Definition: find_segment.h:130
unsigned th_ch11
Definition: find_segment.h:82
signal_ ph_seg
Definition: find_segment.h:148
unsigned bw_ph
Definition: find_segment.h:54
unsigned bw_ds
Definition: find_segment.h:62
unsigned tot_diff
Definition: find_segment.h:128
unsigned th_ch
Definition: find_segment.h:109
unsigned zone_overlap
Definition: find_segment.h:120
signal_storage cpat_seg__storage
Definition: find_segment.h:151
signal_storage diffi2__storage
Definition: find_segment.h:160
unsigned ph_zone_bnd1
Definition: find_segment.h:118
signal_ cmp3
Definition: find_segment.h:161
signal_storage ri__storage
Definition: find_segment.h:165
signal_ rcomp
Definition: find_segment.h:155
unsigned bw_fth
Definition: find_segment.h:58
signal_storage diffi1__storage
Definition: find_segment.h:158
signal_storage ph_pat__storage
Definition: find_segment.h:146
signal_storage cmp1__storage
Definition: find_segment.h:157
unsigned full_pat_w_st1
Definition: find_segment.h:72
unsigned ph_hit_w20
Definition: find_segment.h:96
unsigned ph_coverage
Definition: find_segment.h:107
signal_ cpat_match
Definition: find_segment.h:145
signal_storage diffi4__storage
Definition: find_segment.h:164
unsigned bw_phdiff
Definition: find_segment.h:127
unsigned k
Definition: find_segment.h:172
signal_storage ph_seg__storage
Definition: find_segment.h:148
signal_ ph_seg_v_p
Definition: find_segment.h:135
unsigned bw_phi
Definition: find_segment.h:91
unsigned th_raw_w
Definition: find_segment.h:87
unsigned di
Definition: find_segment.h:173
unsigned cscid
Definition: find_segment.h:47
unsigned bw_wg
Definition: find_segment.h:60
unsigned bw_addr
Definition: find_segment.h:84
unsigned padding_w_st3
Definition: find_segment.h:75
unsigned red_pat_w_st1
Definition: find_segment.h:78
signal_storage cmp2__storage
Definition: find_segment.h:159
unsigned bw_fph
Definition: find_segment.h:57
signal_ cmp4
Definition: find_segment.h:163