ATLAS Offline Software
Loading...
Searching...
No Matches
CTPFiles.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include <iostream>
7#include <iomanip>
8#include <stdexcept>
9
10using namespace std;
11
12unsigned int TrigConf::CTPFiles::ALL_CTPCORELUT_SIZE = 0;
13unsigned int TrigConf::CTPFiles::ALL_CTPCORECAM_SIZE = 0;
14unsigned int TrigConf::CTPFiles::ALL_CTPINMONSEL_SIZE = 0;
15unsigned int TrigConf::CTPFiles::ALL_CTPINMONDEC_SIZE = 0;
16unsigned int TrigConf::CTPFiles::CTPMON_MUX_OUTPUT_NUMBER = 0;
17unsigned int TrigConf::CTPFiles::CTPMON_ADDRESS_SELECTOR_NUMBER = 0;
18unsigned int TrigConf::CTPFiles::ALL_CTPMONSELECTOR_SIZE = 0;
19unsigned int TrigConf::CTPFiles::ALL_CTPMONDECODER_SIZE = 0;
20
21
30
31void
33 if(run==1) {
34 ALL_CTPCORELUT_SIZE = 49664;
35 ALL_CTPCORECAM_SIZE = 8192;
36
37 ALL_CTPINMONSEL_SIZE = 124;
38 ALL_CTPINMONDEC_SIZE = 4096;
39
40 CTPMON_MUX_OUTPUT_NUMBER = 9;
41 CTPMON_ADDRESS_SELECTOR_NUMBER = 24;
42 ALL_CTPMONSELECTOR_SIZE = CTPMON_MUX_OUTPUT_NUMBER * CTPMON_ADDRESS_SELECTOR_NUMBER;
43 ALL_CTPMONDECODER_SIZE = 6656;
44 } else {
45 // https://svnweb.cern.ch/trac/atlastdaq/browser/LVL1/ctp/CtpcorePlusModule/trunk/CtpcorePlusModule/CtpcorePlusModule.h
46 ALL_CTPCORELUT_SIZE = 725248; // 0xb1100
47 ALL_CTPCORECAM_SIZE = 55296;
48
49 ALL_CTPINMONSEL_SIZE = 124;
50 ALL_CTPINMONDEC_SIZE = 4096;
51
52 CTPMON_MUX_OUTPUT_NUMBER = 9;
53 CTPMON_ADDRESS_SELECTOR_NUMBER = 24;
54 ALL_CTPMONSELECTOR_SIZE = CTPMON_MUX_OUTPUT_NUMBER * CTPMON_ADDRESS_SELECTOR_NUMBER;
55 ALL_CTPMONDECODER_SIZE = 6656;
56 }
57}
58
59
60// get the files
61const std::vector<uint32_t> &
65
66void
67TrigConf::CTPFiles::setCtpcoreLUT( const std::vector<u_int>& vec)
68{
69 if(vec.size() != ALL_CTPCORELUT_SIZE)
70 throw std::runtime_error( "CTPFiles: LUT size incorrect" );
72}
73
74const std::vector<uint32_t> &
78
79void
80TrigConf::CTPFiles::setCtpcoreCAM( const std::vector<u_int>& vec ) {
81 if(vec.size() != ALL_CTPCORECAM_SIZE)
82 throw std::runtime_error( "CTPFiles: CAM size incorrect" );
84}
85
86// get the different decoder & selection files
87const std::vector<uint32_t> &
91
92void
94 if(vec.size() != ALL_CTPINMONSEL_SIZE)
95 throw std::runtime_error( "CTPFiles: MonSel size slot 7 incorrect" );
97}
98
99const std::vector<uint32_t> &
103
104void
106 if(vec.size() != ALL_CTPINMONSEL_SIZE)
107 throw std::runtime_error( "CTPFiles: MonSel size slot 8 incorrect" );
109}
110
111
112const std::vector<uint32_t> &
116
117void
119 if(vec.size() != ALL_CTPINMONSEL_SIZE)
120 throw std::runtime_error( "CTPFiles: MonSel size slot 9 incorrect" );
122}
123
124
125const std::vector<uint32_t> &
129
130
131void
132TrigConf::CTPFiles::setCtpmonSelector( const std::vector<u_int>& vec ) {
133 if(vec.size() != ALL_CTPMONSELECTOR_SIZE)
134 throw std::runtime_error( "CTPFiles: CTPMON Selector size incorrect" );
136}
137
138
139const std::vector<uint32_t> &
143
144void TrigConf::CTPFiles::setCtpinMonDecoderSlot7( const std::vector<u_int>& vec ) {
145 if(vec.size() != ALL_CTPINMONDEC_SIZE)
146 throw std::runtime_error( "CTPFiles: MonSel size slot 7 incorrect" );
148}
149
150const std::vector<uint32_t> &
154
155void
157 if(vec.size() != ALL_CTPINMONDEC_SIZE)
158 throw std::runtime_error( "CTPFiles: MonSel size slot 8 incorrect" );
160}
161
162
163const std::vector<uint32_t> &
167
168void
170 if(vec.size() != ALL_CTPINMONDEC_SIZE)
171 throw std::runtime_error( "CTPFiles: MonSel size slot 9 incorrect" );
173}
174
175const std::vector<uint32_t> &
179
180
181void
182TrigConf::CTPFiles::setCtpmonDecoder(const std::vector<u_int>& vec) {
183 if(vec.size() != ALL_CTPMONDECODER_SIZE)
184 throw std::runtime_error( "CTPFiles: CTPMON Decoder size incorrect" );
186}
187
188// get files stop
189
190void
191TrigConf::CTPFiles::print(const std::string& indent, unsigned int /*detail*/) const {
192 cout << indent << "CTPFiles: " << endl;
193 cout << indent << "id:\t\t\t" << id() << endl;
194 cout << indent << "Name: \t\t\t" << name() << endl;
195 cout << indent << "Version: \t\t" << version() << endl;
196 cout << indent << "Print the LUT" << endl;
197
198 for (unsigned int i=0; i<(ALL_CTPCORELUT_SIZE); i++)
199 cout << indent << i << "\t:t0x" << setw(8) << setfill('0')
200 << hex << m_ctpcoreLUT[i] << dec << endl;
201
202 cout << indent << "Print the CAM" << endl;
203 for (unsigned int i=0; i<(ALL_CTPCORECAM_SIZE); i++)
204 cout << indent << i << "\t:\t0x" << setw(8) << setfill('0')
205 << hex << m_ctpcoreCAM[i] << dec << endl;
206
207 cout << indent << "Print the CTPIN mon decoders slot 7" << endl;
208 for (unsigned int i=0; i<(ALL_CTPINMONDEC_SIZE); i++)
209 cout << indent << i << "\t:\t0x" << setw(8) << setfill('0')
210 << hex << m_ctpinMonDecoderSlot7[i] << dec << endl;
211 cout << indent << "Print the CTPIN mon decoders slot 8" << endl;
212 for (unsigned int i=0; i<(ALL_CTPINMONDEC_SIZE); i++)
213 cout << indent << i << "\t:\t0x" << setw(8) << setfill('0')
214 << hex << m_ctpinMonDecoderSlot8[i] << dec << endl;
215 cout << indent << "Print the CTPIN mon decoders slot 9" << endl;
216 for (unsigned int i=0; i<(ALL_CTPINMONDEC_SIZE); i++)
217 cout << indent << i << "\t:\t0x" << setw(8) << setfill('0')
218 << hex << m_ctpinMonDecoderSlot9[i] << dec << endl;
219
220 cout << indent << "Print the CTPIN mon selectors slot 7" << endl;
221 for (unsigned int i=0; i<(ALL_CTPINMONSEL_SIZE); i++)
222 cout << indent << i << "\t:\t0x" << setw(8) << setfill('0')
223 << hex << m_ctpinMonSelectorSlot7[i] << dec << endl;
224 cout << indent << "Print the CTPIN mon selectors slot 8" << endl;
225 for (unsigned int i=0; i<(ALL_CTPINMONSEL_SIZE); i++)
226 cout << indent << i << "\t:\t0x" << setw(8) << setfill('0')
227 << hex << m_ctpinMonSelectorSlot8[i] << dec << endl;
228 cout << indent << "Print the CTPIN mon selectors slot 9" << endl;
229 for (unsigned int i=0; i<(ALL_CTPINMONSEL_SIZE); i++)
230 cout << indent << i << "\t:\t0x" << setw(8) << setfill('0')
231 << hex << m_ctpinMonSelectorSlot9[i] << dec << endl;
232
233 cout << indent << "Print the CTPMON selector" << endl;
234 for (unsigned int i=0; i < ALL_CTPMONSELECTOR_SIZE; i++)
235 cout << indent << i << "\t:\t" << setw(2) << setfill(' ')
236 << m_ctpmonSelector[i] << endl;
237 cout << indent << "Print the CTPMON decoder" << endl;
238 for (unsigned int i=0; i < ALL_CTPMONDECODER_SIZE; i++)
239 cout << indent << i << "\t:\t0x" << setw(8) << setfill('0')
240 << hex << m_ctpmonDecoder[i] << dec << endl;
241
242 cout << indent << "SMX no " << m_smxId << " '" << m_smxName << "'" << endl;
243 cout << indent << "VHDL slot 7 : " << endl;
244 cout << m_ctpinSmxVhdlSlot7 << endl;
245 cout << indent << "VHDL slot 8 : " << endl;
246 cout << m_ctpinSmxVhdlSlot8 << endl;
247 cout << indent << "VHDL slot 9 : " << endl;
248 cout << m_ctpinSmxVhdlSlot9 << endl;
249
250 cout << indent << "SVFI slot 7 : " << endl;
251 cout << m_ctpinSmxSvfiSlot7 << endl;
252 cout << indent << "SVFI slot 8 : " << endl;
253 cout << m_ctpinSmxSvfiSlot8 << endl;
254 cout << indent << "SVFI slot 9 : " << endl;
255 cout << m_ctpinSmxSvfiSlot9 << endl;
256
257 cout << indent << "SMX Output file: " << endl;
258 cout << m_ctpinSmxOutput << endl;
259}
std::vector< size_t > vec
std::string m_ctpinSmxSvfiSlot9
Definition CTPFiles.h:131
const std::vector< uint32_t > & ctpmonSelector() const
Definition CTPFiles.cxx:126
const std::vector< uint32_t > & ctpinMonSelectorSlot7() const
Definition CTPFiles.cxx:88
const std::vector< uint32_t > & ctpinMonSelectorSlot8() const
Definition CTPFiles.cxx:100
std::vector< uint32_t > m_ctpcoreLUT
Definition CTPFiles.h:113
void setCtpcoreCAM(const std::vector< u_int > &vec)
Definition CTPFiles.cxx:80
std::vector< uint32_t > m_ctpinMonSelectorSlot9
Definition CTPFiles.h:117
const std::vector< uint32_t > & ctpcoreLUT() const
Definition CTPFiles.cxx:62
virtual void print(const std::string &indent="", unsigned int detail=1) const override
Definition CTPFiles.cxx:191
std::vector< uint32_t > m_ctpmonDecoder
Definition CTPFiles.h:122
const std::vector< uint32_t > & ctpmonDecoder() const
Definition CTPFiles.cxx:176
std::string m_smxName
Definition CTPFiles.h:125
void setFileSizes(unsigned int run)
Definition CTPFiles.cxx:32
void setCtpinMonDecoderSlot7(const std::vector< u_int > &vec)
Definition CTPFiles.cxx:144
std::vector< uint32_t > m_ctpmonSelector
Definition CTPFiles.h:118
void setCtpmonSelector(const std::vector< u_int > &vec)
Definition CTPFiles.cxx:132
const std::vector< uint32_t > & ctpinMonSelectorSlot9() const
Definition CTPFiles.cxx:113
const std::vector< uint32_t > & ctpinMonDecoderSlot8() const
Definition CTPFiles.cxx:151
void setCtpinMonSelectorSlot7(const std::vector< u_int > &vec)
Definition CTPFiles.cxx:93
void setCtpinMonSelectorSlot8(const std::vector< u_int > &vec)
Definition CTPFiles.cxx:105
const std::vector< uint32_t > & ctpcoreCAM() const
Definition CTPFiles.cxx:75
std::vector< uint32_t > m_ctpinMonDecoderSlot8
Definition CTPFiles.h:120
std::string m_ctpinSmxSvfiSlot7
Definition CTPFiles.h:129
std::string m_ctpinSmxVhdlSlot8
Definition CTPFiles.h:127
std::string m_ctpinSmxOutput
Definition CTPFiles.h:132
void setCtpmonDecoder(const std::vector< u_int > &vec)
Definition CTPFiles.cxx:182
std::vector< uint32_t > m_ctpinMonSelectorSlot7
Definition CTPFiles.h:115
void setCtpinMonDecoderSlot9(const std::vector< u_int > &vec)
Definition CTPFiles.cxx:169
std::string m_ctpinSmxSvfiSlot8
Definition CTPFiles.h:130
const std::vector< uint32_t > & ctpinMonDecoderSlot9() const
Definition CTPFiles.cxx:164
std::vector< uint32_t > m_ctpcoreCAM
Definition CTPFiles.h:114
void setCtpinMonSelectorSlot9(const std::vector< u_int > &vec)
Definition CTPFiles.cxx:118
std::vector< uint32_t > m_ctpinMonSelectorSlot8
Definition CTPFiles.h:116
std::vector< uint32_t > m_ctpinMonDecoderSlot7
Definition CTPFiles.h:119
std::string m_ctpinSmxVhdlSlot7
Definition CTPFiles.h:126
void setCtpcoreLUT(const std::vector< u_int > &vec)
Definition CTPFiles.cxx:67
std::vector< uint32_t > m_ctpinMonDecoderSlot9
Definition CTPFiles.h:121
std::string m_ctpinSmxVhdlSlot9
Definition CTPFiles.h:128
void setCtpinMonDecoderSlot8(const std::vector< u_int > &vec)
Definition CTPFiles.cxx:156
const std::vector< uint32_t > & ctpinMonDecoderSlot7() const
Definition CTPFiles.cxx:140
unsigned int id() const
std::ostream & indent(std::ostream &o, int lvl, int size) const
unsigned int version() const
Definition run.py:1
STL namespace.