CMS 3D CMS Logo

prim_conv11.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 __prim_conv11_h_file__
9 #define __prim_conv11_h_file__
10 #include "vppc_sim_lib.h"
11 
13 {
14  public:
15  prim_conv11(){built = false; glbl_gsr = true; defparam();}
16  void defparam();
17  void build();
18  bool built;
19  bool glbl_gsr;
20  unsigned station;
21  unsigned cscid;
22  // segments per chamber
23  unsigned seg_ch;
24  // bit widths of ph and th outputs, reduced precision
25 // have to be derived from pattern width on top level
26  unsigned bw_ph;
27  unsigned bw_th;
28  // bit widths of ph and th, full precision
29  unsigned bw_fph;
30  unsigned bw_fth;
31  // wiregroup input bit width (0..111)
32  unsigned bw_wg;
33  // bit width of dblstrip input (max 80 for ME234/1 with double-width strips)
34  unsigned bw_ds;
35  // width of halfstrip input
36  unsigned bw_hs;
37  // pattern half-width for stations 3,4
38  unsigned pat_w_st3; //4;
39  // pattern half-width for station 1
40  unsigned pat_w_st1;
41  // number of input bits for stations 3,4
42  unsigned full_pat_w_st3;
43  // number of input bits for st 1
44  unsigned full_pat_w_st1;
45  // width of zero padding for station copies
46  unsigned padding_w_st1;
47  unsigned padding_w_st3;
48  // full pattern widths (aka reduced pattern)
49  unsigned red_pat_w_st3;
50  unsigned red_pat_w_st1;
51  // number of folds for pattern detectors, do not set to 1
52  unsigned fold;
53  // number of th outputs for ME1/1
54  unsigned th_ch11;
55  unsigned bw_q;
56  unsigned bw_addr;
57  // strips per section, calculated so ph pattern would cover +/- 8 deg in st 1
58  unsigned ph_raw_w; // kludge to fix synth error, need to understand
59  unsigned th_raw_w;
60  // max possible drifttime
61  unsigned max_drift;
62  // bit widths of precise phi and eta outputs
63  unsigned bw_phi;
64  unsigned bw_eta;
65  // width of ph raw hits, max coverage +8 to cover possible chamber displacement
66  unsigned ph_hit_w; //80 + 8;
67  // for 20 deg chambers
68  unsigned ph_hit_w20;
69  // for 10 deg chambers
70  unsigned ph_hit_w10; //40 + 8;
71  // width of th raw hits, max coverage +8 to cover possible chamber displacement
72  unsigned th_hit_w;
73  unsigned endcap;
74  unsigned n_strips;
75  unsigned n_wg;
76  // theta range (take +1 because th_coverage contains max th value starting from 0)
77  unsigned th_coverage;
78  // phi range
79  unsigned ph_coverage; //80 : 40;
80  // number of th outputs takes ME1/1 th duplication into account
81  unsigned th_ch;
82  // is this chamber mounted in reverse direction?
83  unsigned ph_reverse;
84  unsigned th_mem_sz;
85  unsigned th_corr_mem_sz;
86  // multiplier bit width (phi + factor)
87  unsigned mult_bw;
88  // ph zone boundaries for chambers that cover more than one zone
89 // hardcoded boundaries must match boundaries in ph_th_match module
90  unsigned ph_zone_bnd1;
91  unsigned ph_zone_bnd2;
92  unsigned zone_overlap;
93  // sorter parameters
94  unsigned bwr; // rank width
95  unsigned bpow; // (1 << bpow) is count of input ranks
96  unsigned cnr; // internal rank count
97  unsigned cnrex; // actual input rank count, must be even
98 
99  signal_ quality; // quality inputs
100  signal_ wiregroup; // wiregroup numbers
101  signal_ hstrip; // halfstrip numbers
102  signal_ clctpat; // clct pattern numbers
103  signal_ sel; // binary address of the register or memory to access
104  signal_ addr; // address in memory to access. For registers, set to 0
105  signal_ r_in; // input data for memory or register
106  signal_ we; // write enable for memory or register
107  signal_ clk; // write clock
108  signal_ control_clk; // control interface clock
112  signal_ phzvl; // raw hit valid flags for up to 3 ph zones
114  signal_ clctpat_r; // clct pattern numbers
117  signal_ r_out; // output data from memory or register
123  // theta lut, takes wiregroup, returns theta
124 signal_storage th_mem__storage; signal_ th_mem; // make memory size such that any address will be in range
125  // programmable parameters
126 // [0] = ph_init_b
127 // [1] = ph_displacement_b
128 // [2] = ph_init_a
129 // [3] = ph_displacement_a
130 // [4] = th_init
131 // [5] = th_displacement
133  // initial ph for this chamber scaled to 0.1333 deg/strip
138  // theta correction lut, for me1/1 only
139 // takes index = {wiregroup(2 MS bits), dblstrip}, returns theta correction for tilted wires
141  signal_storage factor__storage; signal_ factor; // strip width factors for each segment
142  signal_storage me11a_w__storage; signal_ me11a_w; // flag showing that we're working on ME11a region
143  signal_storage clct_pat_corr__storage; signal_ clct_pat_corr; // phi correction derived from clct pattern
145  signal_storage ph_init_ix__storage; signal_ ph_init_ix; // parameter index for ph_init
146 
148 
149  unsigned i;
150  // signals only for ME1/1
151 // have to declare them here since vppc does not support declarations in generate blocks yet
152  unsigned j;
153 
154  void init ();
155  void operator()
156  (
157  signal_& quality__io,
158  signal_& wiregroup__io,
159  signal_& hstrip__io,
160  signal_& clctpat__io,
161  signal_& ph__io,
162  signal_& th__io,
163  signal_& vl__io,
164  signal_& phzvl__io,
165  signal_& me11a__io,
166  signal_& clctpat_r__io,
167  signal_& ph_hit__io,
168  signal_& th_hit__io,
169  signal_& sel__io,
170  signal_& addr__io,
171  signal_& r_in__io,
172  signal_& r_out__io,
173  signal_& we__io,
174  signal_& clk__io,
175  signal_& control_clk__io
176  );
177 };
178 #endif
unsigned n_wg
Definition: prim_conv11.h:75
unsigned bw_wg
Definition: prim_conv11.h:32
unsigned th_hit_w
Definition: prim_conv11.h:72
signal_storage ph_tmp__storage
Definition: prim_conv11.h:120
signal_ ph_hit
Definition: prim_conv11.h:115
unsigned pat_w_st1
Definition: prim_conv11.h:40
signal_ clctpat
Definition: prim_conv11.h:102
signal_storage pc_id__storage
Definition: prim_conv11.h:147
unsigned red_pat_w_st1
Definition: prim_conv11.h:50
signal_ hstrip
Definition: prim_conv11.h:101
signal_ me11a
Definition: prim_conv11.h:113
unsigned bw_phi
Definition: prim_conv11.h:63
signal_ r_out
Definition: prim_conv11.h:117
unsigned th_mem_sz
Definition: prim_conv11.h:84
unsigned ph_zone_bnd2
Definition: prim_conv11.h:91
signal_storage fph__storage
Definition: prim_conv11.h:134
unsigned bw_fth
Definition: prim_conv11.h:30
signal_ we
Definition: prim_conv11.h:106
unsigned bw_fph
Definition: prim_conv11.h:29
unsigned bw_addr
Definition: prim_conv11.h:56
unsigned bw_ph
Definition: prim_conv11.h:26
unsigned padding_w_st3
Definition: prim_conv11.h:47
signal_storage clct_pat_sign__storage
Definition: prim_conv11.h:144
unsigned bw_th
Definition: prim_conv11.h:27
signal_storage eight_str__storage
Definition: prim_conv11.h:118
unsigned bw_ds
Definition: prim_conv11.h:34
unsigned th_coverage
Definition: prim_conv11.h:77
void defparam()
bool glbl_gsr
Definition: prim_conv11.h:19
unsigned ph_hit_w
Definition: prim_conv11.h:66
signal_ th_mem
Definition: prim_conv11.h:124
void build()
signal_storage th_corr__storage
Definition: prim_conv11.h:135
signal_ th_corr
Definition: prim_conv11.h:135
unsigned endcap
Definition: prim_conv11.h:73
signal_ fph
Definition: prim_conv11.h:134
signal_ clct_pat_sign
Definition: prim_conv11.h:144
unsigned ph_hit_w10
Definition: prim_conv11.h:70
signal_storage index__storage
Definition: prim_conv11.h:136
signal_ eight_str
Definition: prim_conv11.h:118
unsigned ph_reverse
Definition: prim_conv11.h:83
unsigned n_strips
Definition: prim_conv11.h:74
signal_storage ph_init_ix__storage
Definition: prim_conv11.h:145
unsigned bw_hs
Definition: prim_conv11.h:36
signal_ th
Definition: prim_conv11.h:110
signal_storage me11a_w__storage
Definition: prim_conv11.h:142
unsigned th_ch
Definition: prim_conv11.h:81
signal_ me11a_w
Definition: prim_conv11.h:142
signal_ wiregroup
Definition: prim_conv11.h:100
unsigned th_corr_mem_sz
Definition: prim_conv11.h:85
unsigned cscid
Definition: prim_conv11.h:21
unsigned fold
Definition: prim_conv11.h:52
unsigned seg_ch
Definition: prim_conv11.h:23
signal_ params
Definition: prim_conv11.h:132
signal_ ph_init_ix
Definition: prim_conv11.h:145
unsigned ph_zone_bnd1
Definition: prim_conv11.h:90
signal_storage th_tmp__storage
Definition: prim_conv11.h:122
unsigned ph_coverage
Definition: prim_conv11.h:79
signal_ th_orig
Definition: prim_conv11.h:137
signal_ clk
Definition: prim_conv11.h:107
signal_storage th_mem__storage
Definition: prim_conv11.h:124
signal_ mult
Definition: prim_conv11.h:119
unsigned th_ch11
Definition: prim_conv11.h:54
unsigned ph_raw_w
Definition: prim_conv11.h:58
signal_ control_clk
Definition: prim_conv11.h:108
signal_ ph
Definition: prim_conv11.h:109
signal_storage th_orig__storage
Definition: prim_conv11.h:137
unsigned bpow
Definition: prim_conv11.h:95
unsigned full_pat_w_st3
Definition: prim_conv11.h:42
unsigned padding_w_st1
Definition: prim_conv11.h:46
unsigned ph_hit_w20
Definition: prim_conv11.h:68
signal_ vl
Definition: prim_conv11.h:111
signal_ th_corr_mem
Definition: prim_conv11.h:140
signal_ addr
Definition: prim_conv11.h:104
signal_storage params__storage
Definition: prim_conv11.h:132
signal_storage wg__storage
Definition: prim_conv11.h:121
signal_ th_tmp
Definition: prim_conv11.h:122
unsigned red_pat_w_st3
Definition: prim_conv11.h:49
signal_ clct_pat_corr
Definition: prim_conv11.h:143
unsigned full_pat_w_st1
Definition: prim_conv11.h:44
signal_ factor
Definition: prim_conv11.h:141
signal_ th_hit
Definition: prim_conv11.h:116
signal_ clctpat_r
Definition: prim_conv11.h:114
unsigned max_drift
Definition: prim_conv11.h:61
signal_ wg
Definition: prim_conv11.h:121
unsigned bw_q
Definition: prim_conv11.h:55
unsigned cnr
Definition: prim_conv11.h:96
unsigned th_raw_w
Definition: prim_conv11.h:59
signal_ r_in
Definition: prim_conv11.h:105
unsigned bwr
Definition: prim_conv11.h:94
signal_storage th_corr_mem__storage
Definition: prim_conv11.h:140
signal_storage clct_pat_corr__storage
Definition: prim_conv11.h:143
unsigned j
Definition: prim_conv11.h:152
signal_ sel
Definition: prim_conv11.h:103
signal_ quality
Definition: prim_conv11.h:99
unsigned zone_overlap
Definition: prim_conv11.h:92
signal_ phzvl
Definition: prim_conv11.h:112
signal_storage factor__storage
Definition: prim_conv11.h:141
unsigned bw_eta
Definition: prim_conv11.h:64
signal_ pc_id
Definition: prim_conv11.h:147
unsigned mult_bw
Definition: prim_conv11.h:87
unsigned station
Definition: prim_conv11.h:20
signal_ ph_tmp
Definition: prim_conv11.h:120
signal_ index
Definition: prim_conv11.h:136
unsigned pat_w_st3
Definition: prim_conv11.h:38
unsigned cnrex
Definition: prim_conv11.h:97
unsigned i
Definition: prim_conv11.h:149
signal_storage mult__storage
Definition: prim_conv11.h:119