CMS 3D CMS Logo

prim_conv.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_conv_h_file__
9 #define __prim_conv_h_file__
10 #include "vppc_sim_lib.h"
11 
12 class prim_conv
13 {
14  public:
15  prim_conv(){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  signal_storage params__storage; signal_ params; // programmable parameters [0] = ph_init, [1] = th_init, [2] = ph_displacement, [3] = th_displacement
126  // initial ph for this chamber scaled to 0.1333 deg/strip
129  signal_storage me11a_w__storage; signal_ me11a_w; // flag showing that we're working on ME11a region
130  signal_storage clct_pat_corr__storage; signal_ clct_pat_corr; // phi correction derived from clct pattern
132 
134 
135  unsigned i;
136  // signals only for ME1/1
137 // have to declare them here since vppc does not support declarations in generate blocks yet
138  unsigned j;
139 
140  void init ();
141  void operator()
142  (
143  signal_& quality__io,
144  signal_& wiregroup__io,
145  signal_& hstrip__io,
146  signal_& clctpat__io,
147  signal_& ph__io,
148  signal_& th__io,
149  signal_& vl__io,
150  signal_& phzvl__io,
151  signal_& me11a__io,
152  signal_& clctpat_r__io,
153  signal_& ph_hit__io,
154  signal_& th_hit__io,
155  signal_& sel__io,
156  signal_& addr__io,
157  signal_& r_in__io,
158  signal_& r_out__io,
159  signal_& we__io,
160  signal_& clk__io,
161  signal_& control_clk__io
162  );
163 };
164 #endif
signal_ me11a
Definition: prim_conv.h:113
unsigned bw_q
Definition: prim_conv.h:55
bool built
Definition: prim_conv.h:18
prim_conv()
Definition: prim_conv.h:15
signal_ ph_tmp
Definition: prim_conv.h:120
unsigned j
Definition: prim_conv.h:138
unsigned red_pat_w_st3
Definition: prim_conv.h:49
unsigned cscid
Definition: prim_conv.h:21
void defparam()
unsigned padding_w_st3
Definition: prim_conv.h:47
unsigned ph_coverage
Definition: prim_conv.h:79
unsigned bw_phi
Definition: prim_conv.h:63
unsigned max_drift
Definition: prim_conv.h:61
unsigned mult_bw
Definition: prim_conv.h:87
signal_ clctpat
Definition: prim_conv.h:102
signal_storage clct_pat_sign__storage
Definition: prim_conv.h:131
signal_ wg
Definition: prim_conv.h:121
void init()
signal_ clct_pat_sign
Definition: prim_conv.h:131
unsigned ph_zone_bnd1
Definition: prim_conv.h:90
signal_ params
Definition: prim_conv.h:125
signal_ eight_str
Definition: prim_conv.h:118
signal_storage mult__storage
Definition: prim_conv.h:119
unsigned station
Definition: prim_conv.h:20
signal_storage fph__storage
Definition: prim_conv.h:127
signal_ control_clk
Definition: prim_conv.h:108
unsigned ph_reverse
Definition: prim_conv.h:83
unsigned th_ch
Definition: prim_conv.h:81
signal_ clk
Definition: prim_conv.h:107
signal_ clctpat_r
Definition: prim_conv.h:114
signal_ th
Definition: prim_conv.h:110
unsigned bw_ds
Definition: prim_conv.h:34
unsigned full_pat_w_st1
Definition: prim_conv.h:44
signal_ fph
Definition: prim_conv.h:127
unsigned th_ch11
Definition: prim_conv.h:54
signal_ r_in
Definition: prim_conv.h:105
unsigned th_coverage
Definition: prim_conv.h:77
signal_storage factor__storage
Definition: prim_conv.h:128
signal_ we
Definition: prim_conv.h:106
unsigned bw_fth
Definition: prim_conv.h:30
unsigned th_hit_w
Definition: prim_conv.h:72
signal_ th_mem
Definition: prim_conv.h:124
signal_ th_tmp
Definition: prim_conv.h:122
unsigned full_pat_w_st3
Definition: prim_conv.h:42
unsigned cnrex
Definition: prim_conv.h:97
signal_ mult
Definition: prim_conv.h:119
unsigned ph_raw_w
Definition: prim_conv.h:58
unsigned i
Definition: prim_conv.h:135
signal_ pc_id
Definition: prim_conv.h:133
unsigned ph_hit_w10
Definition: prim_conv.h:70
unsigned padding_w_st1
Definition: prim_conv.h:46
signal_storage me11a_w__storage
Definition: prim_conv.h:129
signal_ me11a_w
Definition: prim_conv.h:129
signal_storage clct_pat_corr__storage
Definition: prim_conv.h:130
unsigned endcap
Definition: prim_conv.h:73
signal_ th_hit
Definition: prim_conv.h:116
unsigned zone_overlap
Definition: prim_conv.h:92
unsigned fold
Definition: prim_conv.h:52
unsigned n_wg
Definition: prim_conv.h:75
unsigned pat_w_st1
Definition: prim_conv.h:40
unsigned th_raw_w
Definition: prim_conv.h:59
signal_ factor
Definition: prim_conv.h:128
unsigned bw_eta
Definition: prim_conv.h:64
bool glbl_gsr
Definition: prim_conv.h:19
unsigned n_strips
Definition: prim_conv.h:74
signal_ sel
Definition: prim_conv.h:103
void build()
signal_ r_out
Definition: prim_conv.h:117
unsigned bpow
Definition: prim_conv.h:95
signal_storage params__storage
Definition: prim_conv.h:125
signal_storage eight_str__storage
Definition: prim_conv.h:118
signal_ clct_pat_corr
Definition: prim_conv.h:130
unsigned bw_ph
Definition: prim_conv.h:26
signal_storage th_tmp__storage
Definition: prim_conv.h:122
signal_ hstrip
Definition: prim_conv.h:101
unsigned bw_hs
Definition: prim_conv.h:36
signal_ ph_hit
Definition: prim_conv.h:115
unsigned red_pat_w_st1
Definition: prim_conv.h:50
signal_storage wg__storage
Definition: prim_conv.h:121
unsigned th_mem_sz
Definition: prim_conv.h:84
signal_ vl
Definition: prim_conv.h:111
unsigned ph_zone_bnd2
Definition: prim_conv.h:91
unsigned th_corr_mem_sz
Definition: prim_conv.h:85
unsigned ph_hit_w20
Definition: prim_conv.h:68
unsigned bw_wg
Definition: prim_conv.h:32
unsigned bw_th
Definition: prim_conv.h:27
unsigned cnr
Definition: prim_conv.h:96
unsigned pat_w_st3
Definition: prim_conv.h:38
signal_ ph
Definition: prim_conv.h:109
signal_ addr
Definition: prim_conv.h:104
signal_ phzvl
Definition: prim_conv.h:112
unsigned bw_addr
Definition: prim_conv.h:56
signal_storage pc_id__storage
Definition: prim_conv.h:133
signal_storage th_mem__storage
Definition: prim_conv.h:124
unsigned bw_fph
Definition: prim_conv.h:29
unsigned ph_hit_w
Definition: prim_conv.h:66
signal_ wiregroup
Definition: prim_conv.h:100
signal_storage ph_tmp__storage
Definition: prim_conv.h:120
unsigned bwr
Definition: prim_conv.h:94
signal_ quality
Definition: prim_conv.h:99
unsigned seg_ch
Definition: prim_conv.h:23