README.md 23.1 KB
Newer Older
1
Cbc_default_electron# CMS Ph2 ACF (Acquisition & Control Framework) 
Georg Auzinger's avatar
Georg Auzinger committed
2

Georg Auzinger's avatar
Georg Auzinger committed
3
##### Contains:
Georg Auzinger's avatar
Georg Auzinger committed
4

5
    - A middleware API layer, implemented in C++, which wraps the firmware calls and handshakes into abstracted functions
npierre's avatar
npierre committed
6
7

- A C++ object-based library describing the system components (CBCs,
8
        Hybrids, Boards) and their properties(values, status)
npierre's avatar
npierre committed
9

Georg Auzinger's avatar
Georg Auzinger committed
10
- several utilities (like visitors to execute certain tasks for each item in the hierarchical Item description)
nipierre's avatar
nipierre committed
11

12
- a tools/ directory with several utilities (currently: calibration, hybrid testing, common-mode analysis)
Georg Auzinger's avatar
Georg Auzinger committed
13

14
    - some applications: datatest, interfacetest, hybridtest, system, calibrate, commission, fpgaconfig
Georg Auzinger's avatar
Georg Auzinger committed
15

Georg Auzinger's avatar
Georg Auzinger committed
16
##### Different versions
nipierre's avatar
nipierre committed
17

18
19
20
    On this Repo, you can find different version of the software :
    - a hopefully working and stable version on the master branch
    - An in-progress version in the Dev branch
nipierre's avatar
nipierre committed
21

Georg Auzinger's avatar
Georg Auzinger committed
22
### Changelog:
npierre's avatar
npierre committed
23

Georg Auzinger's avatar
Georg Auzinger committed
24

Georg Auzinger's avatar
Georg Auzinger committed
25
26
27
28
29
30
31
32
- 09/07/14 : Added threading for stack writing registers
- 12/08/14 : Working agnostic version of the new structure on Master
- 15/08/14 : System Controller Class working
- 19/08/14 : Project wrapped, called ACF for Acquisition & ContFramework
- 09/10/14 : added Visitor class and the corresponding accept methodsthe HWDescription objects
- 15/10/14 : re-wrote the GlibFWInterface::ReadData() method, completere-wrote the parsing of the raw buffer and the offsets, modified the Dand Event classes to be more lightweight and less complex
- 17/10/14 : renamed the project to Ph2_ACF & re-structured the folarchitecture and added command line parsing to the executables (v1-00)
- 17/12/14 : major update (v1-01) including:
33
- performance improvements (use of C++11 features)
34
35
36
37
38
39
40
41
    - general bugfixes
    - a new, faster calibration routine
    - a common-mode-noise tester tool
    - compatability with DIO5 FW for external triggering / clocking
    - updated address table for 2 & 8 CBC setups
    - new FW files for DIO5 FW for 2 & 8 CBC setups
    - a macro directory with a macro to visualize calibration results

Georg Auzinger's avatar
Georg Auzinger committed
42
- 11/02/15 : new update (v1-02) with the following changes:
Georg Auzinger's avatar
Georg Auzinger committed
43
    - removed all dependences on ROOT from the HWDescription/ HWInterface / System / Utils Library
Georg Auzinger's avatar
Georg Auzinger committed
44
    - added a new Tool base-class that inherits from SystemController and handles the creation of Root files for the Tools (the Tools library is the onely one that requires ROOT)
Georg Auzinger's avatar
Georg Auzinger committed
45
46
47
48
    - all Tools (cmd-line applications) now inherit from Tool instead of SystemController
    - added a loop to the Destructors of HWDescription Objects that explicityl delete the child-objects in the HWDescription ownership strucuter to avoid memory leaks
    - added a parameter to some methods of the SystemController class that allow to pass an ostream - this allows to redirect the output from std::cout as desired
    - new Methods:
49
50
51
52
    - RegManager::GetHWInterface and RegManager::getUhalNode methods
    - BeBoardInterface::ReadBlockBoardReg and a BeBoardInterface::WriteBlockBoardReg
    - BeBoard::getReg & BeBoard::setReg use uint32_t instead of uint16_t
    - BeBoardFWInterface::ReadBlockRegValue pure virtual method and GlibFWInterface::ReadBlockRegValue that implements the uHAL bug workaround
Georg Auzinger's avatar
Georg Auzinger committed
53
- 24/02/15 : new update (v1-03) with the following changes:
Georg Auzinger's avatar
Georg Auzinger committed
54
55
56
57
58
    - CbcInterface::WriteReg() now return the written Register value
    - writing to the Glib now also takes care of avoiding the 256th word uHAL bug
    - some modifications to HybridTester tool to make it compatible with the GUI
    - added a CMD line option: g for GUI, should only be used by the latter
    - SystemController class can now parse .json files in addition to .xml
Georg Auzinger's avatar
Georg Auzinger committed
59
60
- 04/03/15: added GUI (v1-10)
- 05/03/15 : New FpgaConfig object in HWInterface to manage firmware uploading. 
Christian Bonnin's avatar
Christian Bonnin committed
61
62
    - added WriteBlockAtAddress and ReadAtAddress functions in RegManager used by the upload dialog. 
    - BeBoardInterface::FlashProm(...) uploads an MCS file into the FPGA
Georg Auzinger's avatar
Georg Auzinger committed
63
- 15/04/15 : Acquisition in a separate thread (v1-11)
Christian Bonnin's avatar
Christian Bonnin committed
64
65
66
67
    - Start() should be called when acquisition begins, Stop() when it ends and ReadData(...) at each iteration.
    - New functions BeBoardInterface::StartThread, StopThread, getNumAcqThread, isRunningThread. Abstract class HwInterfaceVisitor.
    - datatest -p option to perform an acquisition in a separate thread
    - datatest -i option to ignore CBC configuration. Can be run on a bare GLIB board without CBC
Georg Auzinger's avatar
Georg Auzinger committed
68
- 07/05/15: merged Commissioning branch (v1-12)
Georg Auzinger's avatar
Georg Auzinger committed
69
    - contains class for Commissioning: latency scan, threshold scan, stub latency scan
Georg Auzinger's avatar
Georg Auzinger committed
70
71
72
73
74
75
76
77
78
79
80
    - some additions to the Utils/CommonVisitors
    - added a stub bit method to the Event class
    - restructured the ostream operator of the Event class
- 05/06/2015: minor modifications
    - BeBoardFWInterface::ReadData() now returns the number of packets read during the acquisition for faster event counter checks. 
- 11/06/2015: merging a new design for Data and Event classes (v1-20)
    - Data class now holds a vector of Events and the events are directly decoded after acquisition - the char* databuffer does not exist any longer
    - added methods: std::vector<Event*> GetEvents(); Event* GetEvent()
    - updated all scripts
- 17/07/2015: including a new executable fpgaconfig to upload .mcs files to the EPROM, updated tool base-class, included DQM code from the Beamtest
    - fpgaconfig binary allows to upload FW images to EPROM (2 separate images)
Georg Auzinger's avatar
Georg Auzinger committed
81
82
    - tool base class now contains containers for histograms along with bookHisto(), getHisto(), saveHisto() methods
    - modified all other tools accordingly
83
84
    - merged the DQM code from the June '15 beamtest into miniDQM binary
    - updated Makefiles to build RootWeb & miniDQM
Georg Auzinger's avatar
Georg Auzinger committed
85
86
- 04/08/2015: adding a faster & more precise algorithm to extract the parameters from SCurves via differentiating it - implemented in FastCalibration
- 11/08/2015: adding threaded File IO features (v1-21)
87
    - added FileHandler class for threaded saving of binary data as it comes from the GLIB to file (without speed penalty)
Georg Auzinger's avatar
Georg Auzinger committed
88
    - FileHandler can also read binary files for playback (see miniDAQ/datatestFromfile.cc)
89
90
    - adding miniDAQ executable that saves to file and handles runnumber in a hidden Data/.run_number.txt file
    - miniDQM code based on BT DQM still available for playing back the binary data
Georg Auzinger's avatar
Georg Auzinger committed
91
92
    - datatest now has a -s option to specify a filename where binary data should be saved (optionally)
- 06/10/2015: adding several new features:
93
94
95
96
    - bugfix w.r.t. 8CBC data format
    - bugfixed 8CBC_DIO5 firmware
    - a mechanism that throws an exception if a non-existing CBC register is to be written
    - a binary to measure the pulseshape of the CBC on all channels of a test-group
Georg Auzinger's avatar
Georg Auzinger committed
97
    - added support for THttp Server support (web access to histograms & root objects)
98
99
100
101
    - a webgui
    - re-worked Fpga configuration options
    - CTA FW interface
    - revised Root-web DQM structure
Georg Auzinger's avatar
Georg Auzinger committed
102
103
- 18/11/2015: new features added (v1-30):
    - BeBoard configuration option that specifies the # of CBCs that are in the data coming from the FW
Georg Auzinger's avatar
Georg Auzinger committed
104
    - compatability with 16 CBC firmware
Georg Auzinger's avatar
Georg Auzinger committed
105
    - handling of 16 CBC modules as one FE  in SW (2 FEs in FW)
Georg Auzinger's avatar
Georg Auzinger committed
106
    - new SCurve BaseClass for Calibraton & noise scans
Georg Auzinger's avatar
Georg Auzinger committed
107
108
109
110
111
112
113
114
115
116
117
118
119
120
    - iterative readback-error correction (SW tries to write every register agin that produced an error for 5 times)
    - simplified FastCalibration
    - removed old Calibration algorithm
    - introduced new, bitwise and super-fast calibration algorithm 
- 11/12/2015: new uHAL connection configuration:
      - added new Constructors to RegManager, BeBoardFWInterface, GlibFWInterface, CtaFWInterface that take uhal connection: id, uri, address_table
      - modified system controller accordingly so these strings are passed to the constructor
      - adapted config files
- 15/12/2015: simplified Glib/CtaFWInterfaces (v1-31):
    - adapted and simplifeid FWInterfaces
    - removed #define statements for FW registers - are now called directly as string from code
    - simplified Definitions.h
    - added an Encode Reg method that can be passed the FE ID instead of decoding it from the CBC id
    - merged DQM code from Nov15 beamtest
121
122
123
124
- 03.03.2016: some updates & additions (v1-32)
    - added support for CMS Tk Ph2 Data format (.daq) files generation
    - added the option for CMS Tk Ph2 Antenna driver as plugin
    - removed the Shelf objects from the code for simplicity
npierre's avatar
npierre committed
125

Georg Auzinger's avatar
Georg Auzinger committed
126
### Setup
127

Georg Auzinger's avatar
Georg Auzinger committed
128
129
Firmware for the GLIB can be found in /firmware. Since the "old" FMC flavour is deprecated, only new FMCs (both connectors on the same side) are supported.
You'll need Xilinx Impact and a [Xilinx Platform Cable USB II] (http://uk.farnell.com/xilinx/hw-usb-ii-g/platform-cable-configuration-prog/dp/1649384)
npierre's avatar
npierre committed
130

Georg Auzinger's avatar
Georg Auzinger committed
131
#### Setup on the Strasbourg [VM v1.1.0] (http://sbgcmstrackerupgrade.in2p3.fr/) 
npierre's avatar
npierre committed
132

Georg Auzinger's avatar
Georg Auzinger committed
133
1. Remove the current gcc and old boost libraries:
npierre's avatar
npierre committed
134

135
136
          $> sudo yum remove devtoolset-1.1-gcc-debuginfo
          $> sudo yum remove boost
npierre's avatar
npierre committed
137

Georg Auzinger's avatar
Georg Auzinger committed
138
2. Install the latest gcc compiler:
npierre's avatar
npierre committed
139

140
141
          $> sudo yum install devtoolset-2
          $> sudo ln -s /opt/rh/devtoolset-2/root/usr/bin/* /usr/local/bin/
Georg Auzinger's avatar
Georg Auzinger committed
142
          $> hash -r
npierre's avatar
npierre committed
143

Georg Auzinger's avatar
Georg Auzinger committed
144
This should give you gcc 4.8.1:
npierre's avatar
npierre committed
145

Georg Auzinger's avatar
Georg Auzinger committed
146
          $> gcc --version
npierre's avatar
npierre committed
147

Georg Auzinger's avatar
Georg Auzinger committed
148
3. Finally, update uHAL to version 2.3:
npierre's avatar
npierre committed
149

Georg Auzinger's avatar
Georg Auzinger committed
150
151
          $> sudo yum groupremove uhal
          $>wget http://svnweb.cern.ch/trac/cactus/export/28265/tags/ipbus_sw/uhal_2_3_0/scripts/release/cactus.slc5.x86_64.repo 
Georg Auzinger's avatar
Georg Auzinger committed
152

Georg Auzinger's avatar
Georg Auzinger committed
153
(You may need the --no-check-certificate)
154

Georg Auzinger's avatar
Georg Auzinger committed
155
156
157
          $> sudo cp cactus.slc5.x86_64.repo /etc/yum.repos.d/cactus.repo
          $> sudo yum clean all
          $> sudo yum groupinstall uhal
npierre's avatar
npierre committed
158

Georg Auzinger's avatar
Georg Auzinger committed
159
4. Re-compile ROOT using the new gcc 4.8: [Instructions](http://root.cern.ch/drupal/content/installing-root-source) - make sure to use "fixed location installation"
160

Georg Auzinger's avatar
Georg Auzinger committed
161
Note: You may also need to set the environment variables (or source setup.sh):
npierre's avatar
npierre committed
162

Georg Auzinger's avatar
Georg Auzinger committed
163
164
          $> export LD_LIBRARY_PATH=/opt/cactus/lib:$LD_LIBRARY_PATH
          $> export PATH=/opt/cactus/bin:$PATH
Georg Auzinger's avatar
Georg Auzinger committed
165
166

#### Setup on SLC5/6
npierre's avatar
npierre committed
167

Georg Auzinger's avatar
Georg Auzinger committed
168
169
1. Install the latest gcc compiler:

Georg Auzinger's avatar
Georg Auzinger committed
170
171
172
173
174
175
176
177
178
179
For SLC5:

        $> wget -O /etc/yum.repos.d/slc5-devtoolset.repo http://linuxsoft.cern.ch/cern/devtoolset/slc5-devtoolset.repo
    
For SLC6:

        $> wget -O /etc/yum.repos.d/slc6-devtoolset.repo http://linuxsoft.cern.ch/cern/devtoolset/slc6-devtoolset.repo
        
then:

Georg Auzinger's avatar
Georg Auzinger committed
180
181
182
        $> sudo yum install devtoolset-2
        $> sudo ln -s /opt/rh/devtoolset-2/root/usr/bin/* /usr/local/bin/
        $> hash -r
Georg Auzinger's avatar
Georg Auzinger committed
183

184
This should give you gcc 4.8.1:
npierre's avatar
npierre committed
185

Georg Auzinger's avatar
Georg Auzinger committed
186
        $> gcc --version
Georg Auzinger's avatar
Georg Auzinger committed
187
188
189

2. Install uHAL  version 2.3:

190
191
For SLC5:

Georg Auzinger's avatar
Georg Auzinger committed
192
        $> wget http://svnweb.cern.ch/trac/cactus/export/28265/tags/ipbus_sw/uhal_2_3_0/scripts/release/cactus.slc5.x86_64.repo 
Georg Auzinger's avatar
Georg Auzinger committed
193

194
or for SLC6:
Georg Auzinger's avatar
Georg Auzinger committed
195

Georg Auzinger's avatar
Georg Auzinger committed
196
        $> wget http://svnweb.cern.ch/trac/cactus/export/28265/tags/ipbus_sw/uhal_2_3_0/scripts/release/cactus.slc6.x86_64.repo 
Georg Auzinger's avatar
Georg Auzinger committed
197

198
(You may need the --no-check-certificate)
npierre's avatar
npierre committed
199

200
for SLC5:
Georg Auzinger's avatar
Georg Auzinger committed
201

Georg Auzinger's avatar
Georg Auzinger committed
202
        $> sudo cp cactus.slc5.x86_64.repo /etc/yum.repos.d/cactus.repo
Georg Auzinger's avatar
Georg Auzinger committed
203

204
for SLC6:
Georg Auzinger's avatar
Georg Auzinger committed
205

Georg Auzinger's avatar
Georg Auzinger committed
206
        $> sudo cp cactus.slc6.x86_64.repo /etc/yum.repos.d/cactus.repo
Georg Auzinger's avatar
Georg Auzinger committed
207

208
then
Georg Auzinger's avatar
Georg Auzinger committed
209

Georg Auzinger's avatar
Georg Auzinger committed
210
211
        $> sudo yum clean all
        $> sudo yum groupinstall uhal
Georg Auzinger's avatar
Georg Auzinger committed
212

213
3. Install CERN ROOT: [Instructions](https://root.cern.ch/building-root) - make sure to use "fixed location installation"
Georg Auzinger's avatar
Georg Auzinger committed
214

Georg Auzinger's avatar
Georg Auzinger committed
215
Note: You may also need to set the environment variables (or source setup.sh):
Georg Auzinger's avatar
Georg Auzinger committed
216

Georg Auzinger's avatar
Georg Auzinger committed
217
218
        $> export LD_LIBRARY_PATH=/opt/cactus/lib:$LD_LIBRARY_PATH
        $> export PATH=/opt/cactus/bin:$PATH
Georg Auzinger's avatar
Georg Auzinger committed
219
220

### The Ph2_ACF Software : 
nipierre's avatar
nipierre committed
221

Georg Auzinger's avatar
Georg Auzinger committed
222
223
Follow these instructions to install and compile the libraries:
(provided you installed the latest version of gcc, µHal, boost as mentioned above)
npierre's avatar
npierre committed
224

Georg Auzinger's avatar
Georg Auzinger committed
225
1. Clone the GitHub repo.
Georg Auzinger's avatar
Georg Auzinger committed
226
  
npierre's avatar
npierre committed
227

Georg Auzinger's avatar
Georg Auzinger committed
228
        $> source setup.sh
229
230

3. Do a make in the root of the repo (make sure you have all µHal, root, boost... libraries on your computer).
npierre's avatar
npierre committed
231

232
3. Launch 
233

Georg Auzinger's avatar
Georg Auzinger committed
234
        $> systemtest --help
235
236

command if you want to test the parsing of the HWDescription.xml file
npierre's avatar
npierre committed
237

Georg Auzinger's avatar
Georg Auzinger committed
238
239
4. Launch

Georg Auzinger's avatar
Georg Auzinger committed
240
        $> datatest --help
241
242

command if you want to test if you can correctly read data.
Georg Auzinger's avatar
Georg Auzinger committed
243

244
6. Launch
Georg Auzinger's avatar
Georg Auzinger committed
245

Georg Auzinger's avatar
Georg Auzinger committed
246
        $> calibrate --help
Georg Auzinger's avatar
Georg Auzinger committed
247

248
to calibrate a hybrid,
Georg Auzinger's avatar
Georg Auzinger committed
249

Georg Auzinger's avatar
Georg Auzinger committed
250
        $> hybridtest --help
Georg Auzinger's avatar
Georg Auzinger committed
251

Georg Auzinger's avatar
Georg Auzinger committed
252
to test a hybird's I2C registers and input channel connectivity
253

254
          $> cmtest --help
255

Georg Auzinger's avatar
Georg Auzinger committed
256
to run the CM noise study
257

258
          $> pulseshape --help
Georg Auzinger's avatar
Georg Auzinger committed
259

Georg Auzinger's avatar
Georg Auzinger committed
260
to measure the analog pulseshape of the cbc
Georg Auzinger's avatar
Georg Auzinger committed
261

262
          $> configure --help
Georg Auzinger's avatar
Georg Auzinger committed
263

Georg Auzinger's avatar
Georg Auzinger committed
264
to apply a configuration to the CBCs
Georg Auzinger's avatar
Georg Auzinger committed
265

Georg Auzinger's avatar
Georg Auzinger committed
266
7. Launch
267

268
          $> commission --help
269

Georg Auzinger's avatar
Georg Auzinger committed
270
to do latency & threshold scans
271

Georg Auzinger's avatar
Georg Auzinger committed
272
8. Launch 
273

274
          $> fpgaconfig --help
275

Georg Auzinger's avatar
Georg Auzinger committed
276
to upload a new FW image to the GLIB
277

Georg Auzinger's avatar
Georg Auzinger committed
278
9. Launch
279

280
          $> miniDAQ --help
281

Georg Auzinger's avatar
Georg Auzinger committed
282
to save binary data from the GLIB to file
283

Georg Auzinger's avatar
Georg Auzinger committed
284
10. Launch
285

286
          $> miniDQM --help
287

Georg Auzinger's avatar
Georg Auzinger committed
288
to run the DQM code from the June '15 beamtest
npierre's avatar
npierre committed
289

npierre's avatar
npierre committed
290

Georg Auzinger's avatar
Georg Auzinger committed
291
##### What can you do with the software ?
npierre's avatar
npierre committed
292

Georg Auzinger's avatar
Georg Auzinger committed
293
At the moment the package provides the following features:
npierre's avatar
npierre committed
294

Georg Auzinger's avatar
Georg Auzinger committed
295
296
297
298
299
300
301
302
303
304
305
306
307
308
  - Configure the Glib & Cbcs
  - Manipulate the registers in the Glib
  - Manipulate the registers in the Cbcs
  - Read Data
  - Calibrate Hybrids
  - Validate Hybrids
  - Perform CM noise tests
  - user external trigger and clock signals for your tests
  - upload .mcs files to the GLIB
  - perform simple commissioning procedures
  - save binary data to file
  - create simple DQM histograms from binary data
  - measure the pulseshape of the CBC amp
  - any other routine you want to implement yourself ... 
npierre's avatar
npierre committed
309
310


Georg Auzinger's avatar
Georg Auzinger committed
311
##### Nota Bene:
Georg Auzinger's avatar
Georg Auzinger committed
312
When you write a register in the Glib or the Cbc, the corresponding map of the HWDescription object in memory is also updated, so that you always have an exact replica of the HW Status in the memory.
Georg Auzinger's avatar
Georg Auzinger committed
313

Georg Auzinger's avatar
Georg Auzinger committed
314
315
316
Register values are:
  - 8-bit unsigend integers for the CBCs that should be edited in hex notation, i.e. '0xFF'
  - 32-bit unsigned integers for the GLIB: decimal values
npierre's avatar
npierre committed
317

Georg Auzinger's avatar
Georg Auzinger committed
318
For debugging purpose, you can activate DEV_FLAG in the sources or in the Makefile and also activate the uHal log in RegManager.cc.
nipierre's avatar
nipierre committed
319

npierre's avatar
npierre committed
320

Georg Auzinger's avatar
Georg Auzinger committed
321
#### External Clock and Trigger:
npierre's avatar
npierre committed
322

Georg Auzinger's avatar
Georg Auzinger committed
323
324
In order to use external Clock and Trigger functionality, a DIO5 mezzanine is required. It is available from the [CERN OHR](http://www.ohwr.org/projects/fmc-dio-5chttla) and sold by several commercial vendors.
For instructions on how to use it, see this [file](https://github.com/gauzinge/Ph2_ACF/blob/Dev/doc/TK_DAQ_MONO_GLIB3_FMCDIO5_v3.0_09-12-2014.pdf). The [firmware](https://github.com/gauzinge/Ph2_ACF/tree/Dev/firmware) is included in this repository.
Georg Auzinger's avatar
Georg Auzinger committed
325
326
327



Georg Auzinger's avatar
Georg Auzinger committed
328
329
#### Example HWDescription.xml File with DIO5 support:

Georg Auzinger's avatar
Georg Auzinger committed
330
```xml
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397

          <?xml version='1.0' encoding = 'UTF-8' ?>
          <HwDescription>
          <Connections name="file://settings/connections_2CBC.xml"/>

          <Shelve Id="0" >
          <BeBoard Id="0" connectionId="board0" boardType="GLIB">
          <FW_Version NCbcDataSize="4"/>

          <Module FeId="0" FMCId="0" ModuleId="0" Status="1">
          <!--Global_CBC_Register name="VCth"> 0x88 </Global_CBC_Register>
          <Global_CBC_Register name="TriggerLatency"> 0x0C </Global_CBC_Register-->

          <CBC_Files path="./settings/"/>
          <CBC Id="0" configfile="Cbc_default_hole.txt"/>
          <CBC Id="1" configfile="Cbc_default_hole.txt"/>
          </Module>

          <!-- Commissioning Mode -->
          <!-- set to 1 to enable commissioning mode -->
          <Register name="COMMISSIONNING_MODE_RQ">0</Register>
          <!-- set to 1 to enable test pulse in commissioning mode -->
          <Register name="COMMISSIONNING_MODE_CBC_TEST_PULSE_VALID">0</Register>
          <Register name="COMMISSIONNING_MODE_DELAY_AFTER_FAST_RESET">50</Register>
          <Register name="COMMISSIONNING_MODE_DELAY_AFTER_L1A">400</Register>
          <Register name="COMMISSIONNING_MODE_DELAY_AFTER_TEST_PULSE">201</Register>

          <!-- Acquisition -->
          <Register name="cbc_stubdata_latency_adjust_fe1">1</Register>
          <Register name="cbc_stubdata_latency_adjust_fe2">1</Register>
          <Register name="user_wb_ttc_fmc_regs.pc_commands.CBC_DATA_PACKET_NUMBER">9</Register>

          <!-- Trigger -->
          <!-- set to 1 to use external triggers -->
          <Register name="user_wb_ttc_fmc_regs.pc_commands.TRIGGER_SEL">0</Register>
          <Register name="user_wb_ttc_fmc_regs.pc_commands.INT_TRIGGER_FREQ">10</Register>

          <!-- Clock -->
          <!-- set to 1 for external clocking -->
          <Register name="user_wb_ttc_fmc_regs.dio5.clk_mux_sel">0</Register>

          <!-- DIO5 Config -->
          <!-- set to 0 for rising edge, 1 for falling -->
          <Register name="user_wb_ttc_fmc_regs.dio5.fmcdio5_trig_in_edge">0</Register>
          <!-- set to 1 to output L1A signal, 0 for input pulse -->
          <Register name="user_wb_ttc_fmc_regs.dio5.fmcdio5_lemo2_sig_sel">1</Register>
          <!-- set to 1 for active low or 1 for active high || NEEDS TO BE 0 for the TLU-->
          <Register name="user_wb_ttc_fmc_regs.dio5.fmcdio5_backpressure_out_polar">0</Register>

          <!-- DIO5 threshold: [v]/3.3*256 -->
          <Register name="user_wb_ttc_fmc_regs.dio5.fmcdio5_threshold_trig_in">40</Register>
          <Register name="user_wb_ttc_fmc_regs.dio5.fmcdio5_threshold_clk_in">40</Register>

          <!-- DIO5 Termination -->
          <Register name="user_wb_ttc_fmc_regs.dio5.fmcdio5_clk_in_50ohms">1</Register>
          <Register name="user_wb_ttc_fmc_regs.dio5.fmcdio5_clk_out_50ohms">0</Register>
          <Register name="user_wb_ttc_fmc_regs.dio5.fmcdio5_trig_in_50ohms">1</Register>
          <Register name="user_wb_ttc_fmc_regs.dio5.fmcdio5_trig_out_50ohms">0</Register>
          </BeBoard>
          </Shelve>
          </HwDescription>

          <Settings>
          <Setting name="RunNumber"> 1 </Setting>
          <Setting name="HoleMode"> 1 </Setting>
          </Settings>

Georg Auzinger's avatar
Georg Auzinger committed
398
```
399

Georg Auzinger's avatar
Georg Auzinger committed
400
401
#### Example HWDescription.json File with DIO5 support:

Georg Auzinger's avatar
Georg Auzinger committed
402
```json
Georg Auzinger's avatar
Georg Auzinger committed
403
404
405
{
    "HwDescription":{
        "Connections":"file://settings/connections_2CBC.xml",
406
            "Shelves":[
Georg Auzinger's avatar
Georg Auzinger committed
407
408
409
            {
                "Id":0,
                "BeBoards":[
410
411
412
413
414
                {
                    "Id":0,
                    "boardType":"Glib",
                    "connectionId":"board0",
                    "Modules":[
Georg Auzinger's avatar
Georg Auzinger committed
415
                    {
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
                        "FeId":0,
                        "FMCId":0,
                        "ModuleId":0,
                        "Status":1,
                        "Global_CBC_Registers":{
                            "VCth":"0x78",
                            "TriggerLatency":"0x0C"
                        },
                        "CbcFilePath":"./settings/",
                        "CBCs":[
                        {
                            "Id":0,
                            "configfile":"Cbc_default_hole.txt",
                            "Register":{
                                "VCth":"0x78"
Georg Auzinger's avatar
Georg Auzinger committed
431
                            }
432
433
434
435
                        },
                        {
                            "Id":1,
                            "configfile":"Cbc_default_hole.txt"
Georg Auzinger's avatar
Georg Auzinger committed
436
                        }
437
                        ]
Georg Auzinger's avatar
Georg Auzinger committed
438
                    }
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
                    ],
                    "RegisterName":{
                        "COMMISSIONNING_MODE_RQ":"//COMMISSIONING MODE REGISTERS",
                        "COMMISSIONNING_MODE_RQ":"//set to 1 to enable commissioning mode",
                        "COMMISSIONNING_MODE_RQ":1,
                        "COMMISSIONNING_MODE_CBC_TEST_PULSE_VALID":"//set to 1 to enable test pulses in comissioningn mode",
                        "COMMISSIONNING_MODE_CBC_TEST_PULSE_VALID":1,
                        "COMMISSIONNING_MODE_DELAY_AFTER_FAST_RESET":50,
                        "COMMISSIONNING_MODE_DELAY_AFTER_L1A":400,
                        "COMMISSIONNING_MODE_DELAY_AFTER_TEST_PULSE":201,

                        "user_wb_ttc_fmc_regs.pc_commands.TRIGGER_SEL":"//TRIGGER",
                        "user_wb_ttc_fmc_regs.pc_commands.TRIGGER_SEL":"//set to 1 to enable external triggers",
                        "user_wb_ttc_fmc_regs.pc_commands.TRIGGER_SEL":0,
                        "user_wb_ttc_fmc_regs.pc_commands.INT_TRIGGER_FREQ":10,
                        "user_wb_ttc_fmc_regs.dio5.fmcdio5_threshold_trig_in":"//DIO5 threshold: [v]/3.3*256",
                        "user_wb_ttc_fmc_regs.dio5.fmcdio5_threshold_trig_in":40,
                        "user_wb_ttc_fmc_regs.dio5.fmcdio5_trig_in_edge":"//set to 0 for rising edge, 1 for falling",
                        "user_wb_ttc_fmc_regs.dio5.fmcdio5_trig_in_edge":0,
                        "user_wb_ttc_fmc_regs.dio5.fmcdio5_trig_in_50ohms":1,
                        "user_wb_ttc_fmc_regs.dio5.fmcdio5_trig_out_50ohms":0,
                        "user_wb_ttc_fmc_regs.dio5.fmcdio5_lemo2_sig_sel":"//set to 1 to output L1A signal, 0 for input pulse ",
                        "user_wb_ttc_fmc_regs.dio5.fmcdio5_lemo2_sig_sel":1,

                        "user_wb_ttc_fmc_regs.dio5.clk_mux_sel":"//CLOCK",
                        "user_wb_ttc_fmc_regs.dio5.clk_mux_sel":"//set to 1 to enable external clocking",
                        "user_wb_ttc_fmc_regs.dio5.clk_mux_sel":0,
                        "user_wb_ttc_fmc_regs.dio5.fmcdio5_threshold_clk_in":"//DIO5 threshold: [v]/3.3*256",
                        "user_wb_ttc_fmc_regs.dio5.fmcdio5_threshold_clk_in":40,
                        "user_wb_ttc_fmc_regs.dio5.fmcdio5_clk_in_50ohms":1,
                        "user_wb_ttc_fmc_regs.dio5.fmcdio5_clk_out_50ohms":0,

                        "user_wb_ttc_fmc_regs.pc_commands.ACQ_MODE":"//ACQUISITION",
                        "user_wb_ttc_fmc_regs.pc_commands.ACQ_MODE":1,
                        "cbc_stubdata_latency_adjust_fe1":1,
                        "cbc_stubdata_latency_adjust_fe2":1,
                        "user_wb_ttc_fmc_regs.pc_commands.CBC_DATA_GENE":1,
                        "user_wb_ttc_fmc_regs.pc_commands.CBC_DATA_PACKET_NUMBER":10,
                        "user_wb_ttc_fmc_regs.pc_commands2.clock_shift":0,

                        "user_wb_ttc_fmc_regs.pc_commands2.negative_logic_CBC":"//POLARITY",
                        "user_wb_ttc_fmc_regs.pc_commands2.negative_logic_CBC":1,
                        "user_wb_ttc_fmc_regs.pc_commands2.negative_logic_sTTS":0,
                        "user_wb_ttc_fmc_regs.pc_commands2.polarity_tlu":0
                    }
                }
Georg Auzinger's avatar
Georg Auzinger committed
485
486
487
488
                ]
            }
        ]
    },
489
490
491
492
        "Settings":{
            "RunNumber":1,
            "HoleMode":1
        }
Georg Auzinger's avatar
Georg Auzinger committed
493
494
}
```
495

Georg Auzinger's avatar
Georg Auzinger committed
496
### Known Issues:
497

Georg Auzinger's avatar
Georg Auzinger committed
498
Several bugs / problematic behavior has been reported by various users that is not direclty linked to the Ph2_ACF libraries, however, some workarounds are provided:
499

Georg Auzinger's avatar
Georg Auzinger committed
500
- When configuring a CBC object (writing all registers at once), the MSB of the Register "FrontEncControl" is read back incorrectly. This only manifests in electron mode (0xC3 instead of 0x43). The cause of this problem is identified as a FW artefact and the error itself can be safely ignored until the problem is solved. The chips will still properly configure and data quality should not be affected.
501

502
- uHAL exceptions and UDP timeouts when reading larger packet sizes from the GLIB board: 
503
this can happen for some users (cause not yet identified) but can be circumvented by changing the line
504

505
"ipbusudp-2.0://192.168.000.175:50001"
506

507
in the connections.xml file to
508

509
"chtcp-2.0://localhost:10203?target=192.168.000.175:50001"
510

511
& then launching the CACTUS control hub by the command:
512

513
/opt/cactus/bin/controlhub_start
514

515
This uses TCP protocol instead of UDP which accounts for packet loss but decreases the performance.
516

Georg Auzinger's avatar
Georg Auzinger committed
517
- SegmentationViolations on lines that contain
518

519
520
521
gStyle->Set ... ;

statements. This has been observed by several users on the VM and can be fixed by re-compiling ROOT using GCC 4.8
522
523


Georg Auzinger's avatar
Georg Auzinger committed
524
### Support, Suggestions ?
npierre's avatar
npierre committed
525

Georg Auzinger's avatar
Georg Auzinger committed
526
For any support/suggestions, mail georg.auzingerSPAMNOT@cern.ch