gondola_core/tof/master_trigger/
registers.rs

1//! MasterTriggerBoard registers
2//!
3//! This should be the same as the reference
4//! doucmentation on the [UCLA gitlab server](https://gitlab.com/ucla-gaps-tof/firmware/-/blob/master/regmap/mt_address_table.org?ref_type=heads)
5//! 
6//! <div class="warning"> This currently does NOT sync itself with the reposity, so we have to take extra care that these numbers are correct!.</div>
7//!
8//! All registers are 32bit
9
10use std::error::Error;
11use std::fmt;
12use crate::io::ipbus::IPBus;
13
14/// The prescale values are defined by a single u32
15/// This number represents 0 for trigger off and 
16/// 1.0 for 2**32 - 1 (which is u32::MAX)
17///
18/// The range for the prescale value is [0,1.0]. 
19/// If the given value is outside of the interval
20/// boundaries, it will be converted to the next 
21/// interval limit
22pub fn prescale_to_u32(mut prescale : f32) -> u32 {
23  if prescale > 1.0 {
24    warn!("Prescale value > 1.0 will be converted to 1.0!");
25    prescale = 1.0
26  }
27  if prescale < 0.0 {
28    prescale = 0.0
29  }
30  // converion
31  ((u32::MAX as f32) * prescale).floor() as u32
32}
33
34
35/// A single 32bit register on the MTB with an 
36/// associated mask to mask parts of ig
37pub struct MTBRegister<'a> {
38  /// the address of the register on the MTB
39  /// (not Addr8)
40  pub addr  : u32,
41  /// Some registers on the MTB share functionality, which 
42  /// we are splitting in different MTBRegisters. So even
43  /// if two MTBRegisters share the same address, they
44  /// might have a different mask to achieve different 
45  /// things and will thus have a different name.
46  pub mask  : u32,
47  /// Description about what is achieved when setting 
48  /// this register?
49  pub descr : &'a str,
50  /// Is this register shared with other values? In that 
51  /// case we need to do a rmw operation instead of 
52  /// writing
53  pub rmw   : bool,
54  /// This register is only read-only (e.g. providing 
55  /// a monitoring value
56  pub ro    : bool,
57  /// This register is "pulse" type. So it can be 
58  /// asserted, but there is no point in reading it 
59  /// out, since it will reset itself.
60  pub pulse : bool,
61}
62
63impl MTBRegister<'_> {
64
65  /// Set the register to desired value
66  pub fn set(&self, bus : &mut IPBus, value : u32) 
67    -> Result<(), Box<dyn Error>> {
68    //println!("Settting {}", self);
69    if self.rmw {
70      self.rmw(bus, value)?;
71    }
72    else {
73      self.write(bus, value)?;
74    }
75    // this can be used for debugging
76    // (print back the value)
77    //let rv = self.read_all(bus)?;
78    //println!("Register reads {:x} {} {:x} after write ops!", self.addr, self.descr, rv);
79    Ok(())
80  }
81
82  /// Get the value this register is set to
83  pub fn get(&self, bus : &mut IPBus)
84    -> Result<u32, Box<dyn Error>> {
85    //FIXME - error type
86    //if self.pulse {
87    //  return(Err)
88    //}
89    let rv = self.read(bus)?;
90    //if self.addr != 0x13 && self.addr != 0x11 {
91    //  //
92    //  //println!("Register reads {:x} {} {:x}!", self.addr, self.descr, rv);
93    //}
94    Ok(rv)
95  }
96
97  /// Pulse the specific register, 
98  ///
99  /// This is really no different from writing a 1 in it.
100  /// Pulsing means that the value in the register is non 
101  /// persistent 
102  pub fn pulse_it(&self, bus : &mut IPBus) 
103    -> Result<(), Box<dyn Error>> {
104    self.write(bus, 0x1)
105  }
106
107  // FIXME - basically whenever we have a amsk 
108  // != u32::MAX we need rmw
109  fn write(&self, bus : &mut IPBus, value : u32)
110    -> Result<(), Box<dyn Error>> {
111      let masked_value = self.mask & value;
112      //println!("Writing ... {:x}", masked_value);
113      Ok(bus.write(self.addr, masked_value)?)
114  }
115  
116  fn read_all(&self, bus : &mut IPBus)
117    -> Result<u32, Box<dyn Error>> {
118    let value = bus.read(self.addr)?;
119    Ok(value)
120  }
121
122  fn read(&self, bus : &mut IPBus)
123    -> Result<u32, Box<dyn Error>> {
124    let mut value = bus.read(self.addr)?;
125    value = value & self.mask; 
126    //println!("Read all .. {:?}", self.read_all(bus));
127    if self.mask > 255 {
128      //println!("...shifting by {}", self.mask.trailing_zeros());
129      value = value >> self.mask.trailing_zeros();
130    }
131    Ok(value)
132  }
133  
134  /// Read-modify-write
135  fn rmw(&self, bus : &mut IPBus, value : u32)
136    -> Result<(), Box<dyn Error>> {
137    let mut data = self.read_all(bus)?;
138    //println!("step 1 ..{}",data);
139    // leave everything else the same, but zero out
140    // the masked part
141    data         = data & !self.mask;
142    //println!("step 2 ..{}",data);
143    // reset the masked part and write again
144    //println!("step 3 ..{}", value << self.mask.trailing_zeros());
145    data         = data | (value << self.mask.trailing_zeros()); 
146    //println!("step 4 ..{}",data);
147    Ok(bus.write(self.addr, data)?)
148  }
149}
150
151impl fmt::Display for MTBRegister<'_> {
152  fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
153    let mut rmw_str  = "R/W";
154    if self.rmw {
155      rmw_str = "R/RMW"
156    }
157    if self.ro {
158      rmw_str = "RO"
159    }
160    if self.pulse {
161      rmw_str = "pulse"
162    }
163    let mut repr = format!("<MTBRegister [{}]:", rmw_str);
164    repr += &(format!("\n  address : {:x}" , self.addr));
165    repr += &(format!("\n  mask    : {:x}" , self.mask));
166    repr += &(format!("\n  descr   : {}>", self.descr));
167    write!(f, "{}", repr)
168  }
169}
170
171/////////////////////////////////////////////////////////////////////
172
173/////////////////////////////////////////////////////////////////////
174
175// Module MT adr = 0x0
176//
177// Implements various control and monitoring functions of the DRS Logic
178
179/// FPGA System clock rate
180/// CLOCK_RATE      0x1     0x4     \[31:0\]    r   system clock frequency
181pub const CLOCK_RATE : MTBRegister<'static> = MTBRegister {
182  addr    : 0x1,
183  mask    : 0xffffffff,
184  descr   : "System clock frequency",
185  rmw     : false,
186  ro      : true,
187  pulse   : false,
188};
189
190///Prescale value for the GAPS trigger. 0 == 0% (off), 2**32-1 == 100%
191/// GAPS_TRIG_PRESCALE 0x248 0x920 \[31:0\] rw 0xffffffff
192pub const GAPS_TRIG_PRESCALE : MTBRegister<'static> = MTBRegister {
193  addr    : 0x248,
194  mask    : 0xffffffff,
195  descr   : "Prescale value for the GAPS trigger. 0 == 0% (off), 2**32-1 == 100%",
196  rmw     : true,
197  ro      : false,
198  pulse   : false,
199};
200
201
202/// SWAP_RB_LINK_IDS 0x247 0x91c 1 rw 0x1
203pub const SWAP_RB_LINK_IDS : MTBRegister<'static> = MTBRegister { 
204  addr  : 0x247,
205  mask  : 0x00000002,
206  descr : "Swaps rb link ids within a RAT",
207  rmw   : true,
208  ro    : false,
209  pulse : false,
210};
211
212/// Force a trigger (has to be previously set)
213/// FORCE_TRIGGER   0x8     0x20    0   w   Pulse   Write 1 to generate a trigger
214pub const FORCE_TRIGGER : MTBRegister<'static> = MTBRegister {
215  addr  : 0x8,
216  mask  : 0xffffffff,
217  descr : "Force the readout and issue a one-time trigger",
218  rmw   : false,
219  ro    : false,
220  pulse : true,
221};
222
223/// Check if the TIU link is bad
224/// TIU_BAD 	0xf 	0x3c 	0 	r 		1 means that the tiu link is not working
225pub const TIU_BAD : MTBRegister<'static> = MTBRegister {
226  addr  : 0xf,
227  mask  : 0x00000001,
228  descr : "Check if the TIU link is bad",
229  rmw   : false,
230  ro    : true,
231  pulse : false
232};
233
234/// Read out how many clock cycles the NTB has been busy because of the TIU busy signal
235/// TIU_EMU_BUSY_CNT 	0xe 	0x38 	\[31:14\] 	rw 	0xC350 	Number of 10 ns clock cyles that the emulator will remain busy
236pub const TIU_EMU_BUSY_CNT : MTBRegister<'static> = MTBRegister {
237  addr  : 0xe,
238  mask  : 0xffffc000,
239  descr : "Read out emulated TIU busy time (in 10ns clock cycles)",
240  rmw   : true,
241  ro    : false,
242  pulse : false
243};
244
245/// Enable cyclic trigger
246/// TRIG_CYCLIC_EN 0x240 0x900 0 rw 0x0
247pub const TRIG_CYCLIC_EN : MTBRegister<'static> = MTBRegister {
248  addr  : 0x240,
249  mask  : 0x00000001,
250  descr : "Enable the use of a cyclic trigger",
251  rmw   : true, 
252  ro    : false,
253  pulse : false
254};
255
256/// Set cyclic trigger interval (in # clock cycles, 1 clock cycle ~ 10 ns)
257/// TRIG_CYCLIC_INTERVAL 0x241 0x904 \[31:0\] rw 0x0
258pub const TRIG_CYCLIC_INTERVAL : MTBRegister<'static> = MTBRegister {
259  addr   : 0x241,
260  mask   : 0xffffffff,
261  descr  : "Set the cyclic trigger interval in # clock cycles (int only) --> ie if desire trigger every 20 nsec, set interval = 2",
262  rmw    : true,
263  ro     : false, 
264  pulse  : false
265};
266
267/// Toggle on/off LTBs 0-9
268/// DSI 0 RX Link Enable 0x242 0x908 \[9:0\] rw 0x3FF
269pub const LT_LINK_EN0 : MTBRegister<'static> = MTBRegister {
270  addr    : 0x242,
271  mask    : 0x000003ff,
272  descr   : "Enable DSI link for LTBs 0-9",
273  rmw     : true,
274  ro      : false,
275  pulse   : false
276};
277/// Toggle on/off LTBs 10-19
278/// DSI 1 RX Link Enable 0x243 0x90c \[9:0\] rw 0x3FF
279pub const LT_LINK_EN1 : MTBRegister<'static> = MTBRegister {
280  addr    : 0x243,
281  mask    : 0x000003ff,
282  descr   : "Enable DSI link for LTBs 10-19",
283  rmw     : true,
284  ro      : false,
285  pulse   : false
286};
287/// Toggle on/off LTBs 20-29
288/// DSI 2 RX Link Enable 0x244 0x910 \[9:0\] rw 0x3FF
289pub const LT_LINK_EN2 : MTBRegister<'static> = MTBRegister {
290  addr    : 0x244,
291  mask    : 0x000003ff,
292  descr   : "Enable DSI link for LTBs 20-29",
293  rmw     : true,
294  ro      : false,
295  pulse   : false
296};
297/// Toggle on/off LTBs 30-39
298/// DSI 3 RX Link Enable 0x245 0x914 \[9:0\] rw 0x3FF
299pub const LT_LINK_EN3 : MTBRegister<'static> = MTBRegister {
300  addr    : 0x245,
301  mask    : 0x000003ff,
302  descr   : "Enable DSI link for LTBs 30-39",
303  rmw     : true,
304  ro      : false,
305  pulse   : false
306};
307/// Toggle on/off LTBs 40-49
308/// DSI 4 RX Link Enable 0x246 0x918 \[9:0\] rw 0x3FF
309pub const LT_LINK_EN4 : MTBRegister<'static> = MTBRegister {
310  addr    : 0x246,
311  mask    : 0x000003ff,
312  descr   : "Enable DSI link for LTBs 40-49",
313  rmw     : true,
314  ro      : false,
315  pulse   : false
316};
317///Toggle on/off LTB Automasking
318/// LT_LINK_AUTOMASK 0x247 0x91c 0 rw 0x1
319/// 1 to enable automatic LT link masking
320pub const LT_LINK_AUTOMASK : MTBRegister<'static> = MTBRegister {
321  addr    : 0x247,
322  mask    : 0x00000001,
323  descr   : "Enable LT Automasking -> 1 to enable LTB link masking",
324  rmw     : true,
325  ro      : false,
326  pulse   : false,
327};
328
329/// Set/Unset the TIU emulation mode
330/// TIU_EMULATION_MODE  0xe     0x38    0   rw  0x0     1 to emulate the TIU
331pub const TIU_EMULATION_MODE : MTBRegister<'static> = MTBRegister {
332  addr  : 0xe,
333  mask  : 0x00000001,
334  descr : "Set/Unset the TIU emulation mode",
335  rmw   : true,
336  ro    : false,
337  pulse : false
338};
339
340/// The length of the tiu busy signal 
341/// TIU_BUSY_LENGTH 	0x11f 	0x47c 	\[31:0\] 	r 		Length in 10ns cycles of the last TIU busy flag
342pub const TIU_BUSY_LENGTH : MTBRegister<'static> = MTBRegister {
343  addr  : 0x11f,
344  mask  : 0xffffffff,
345  descr : "The length of the tiu busy signal in clock cycles [10ns/cycle]",
346  rmw   : false,
347  ro    : true,
348  pulse : false
349};
350
351/// Read out the whole register 0xf at once and then 
352pub const TIU_LT_AND_RB_MULT : MTBRegister<'static> = MTBRegister {
353  addr  : 0xf,
354  mask  : 0x3fff,
355  descr : "Aggregated TIU, LT and RB general information",
356  rmw   : false,
357  ro    : true,
358  pulse : false
359};
360
361/// Check if the TIU BUSY is stuck
362/// TIU_BUSY_STUCK 	0xf 	0x3c 	1 	r 		1 means the TIU has been stuck high for a long time
363pub const TIU_BUSY_STUCK : MTBRegister<'static> = MTBRegister {
364  addr  : 0xf,
365  mask  : 0x2,
366  descr : "Tiu busy stuck high",
367  rmw   : false,
368  ro    : true,
369  pulse : false
370};
371
372/// Set/unset the BUSY_INGORE 
373/// TIU_BUSY_IGNORE 	0xf 	0x3c 	2 	rw 	0x0 	1 means the the MTB should ignore the TIU busy flag (e.g. because it is stuck)
374pub const TIU_BUSY_IGNORE : MTBRegister<'static> = MTBRegister {
375  addr  : 0xf,
376  mask  : 0x4,
377  descr : "Ignore the tiu busy signal",
378  rmw   : true,
379  ro    : false,
380  pulse : false,
381};
382
383///Minimize deadtime by ignoring the TIU module
384///MIN_DEADTIME_MODE    0xf     0x3c    3   rw  0x0 
385pub const MIN_DEADTIME_MODE : MTBRegister<'static> = MTBRegister {
386  addr  : 0xf,
387  mask  : 0x8,
388  descr : "Minimize deadtime by ignoring TIU module, but will use fixed deadtime",
389  rmw   : true,
390  ro    : false,
391  pulse : false,
392};
393
394
395
396/// The global event id
397/// EVENT_CNT   0xd     0x34    \[31:0\]  r       Event Counter
398pub const EVENT_CNT : MTBRegister<'static> = MTBRegister {
399  addr  : 0xd,
400  mask  : 0xffffffff,
401  descr : "Global event counter",
402  rmw   : false,
403  ro    : true,
404  pulse : false
405};
406
407/// Reset the global event id (excecute with caution)
408/// EVENT_CNT_RESET     0xc     0x30    0   w   Pulse   Write 1 to reset the event counter
409pub const EVENT_CNT_RESET : MTBRegister<'static> = MTBRegister {
410  addr  : 0xc,
411  mask  : 0x1,
412  descr : "Reset the event ID",
413  rmw   : false,
414  ro    : false,
415  pulse : true
416};
417
418/// The RB integration window determines how long RBs should be read out 
419/// after the trigger, basically the trigger window + x
420/// RB_INTEGRATION_WINDOW   0xf     0x3c    \[12:8\]  rw  0x1     Number of 100MHz clock cycles to integrate the LTB hits to determine which RBs to read out.
421pub const RB_INTEGRATION_WINDOW : MTBRegister<'static> = MTBRegister {
422  addr  : 0xf,
423  mask  : 0x00000f00,
424  descr : "Determine how long RBs should be read out after the trigger. Default 1.",
425  rmw   : true,
426  ro    : false,
427  pulse : false,
428};
429
430/// This setting is basically the 'trace suppression mode'. When asserted, only RBs for 
431/// fired LTBs in the trigger window + RB_INTEGRATION_WINDOW will be read out.
432/// RB_READ_ALL_CHANNELS    0xf     0x3c    13  rw  0x1     Set to 1 to read all channels from RB for any trigger
433pub const RB_READ_ALL_CHANNELS : MTBRegister<'static> = MTBRegister {
434  addr  : 0xf,
435  mask  : 0x00002000,
436  descr : "Enable/Disable trace suppression mode. 1 = Enable",
437  rmw   : true,
438  ro    : false,
439  pulse : false,
440};
441
442/// Set Readoutboard BUSY behaviour
443/// RB_BLOCK_IF_BUSY_31_TO_0 	0x24a 	0x928 	\[31:0\] 	rw 	0x0 	Bitmask to specify if a readout board is BUSY then do not trigger (RB slots 31:0)
444pub const RB_BLOCK_IF_BUSY_31_TO_0 : MTBRegister<'static> = MTBRegister {
445  addr  : 0x24a,
446  mask  : 0xffffffff,
447  descr : "Define if triggers should suppressed if RBs are busy. 1 bit per board",
448  rmw   : false,
449  ro    : false,
450  pulse : false,
451};
452
453/// Set Readoutboard BUSY behaviour
454/// RB_BLOCK_IF_BUSY_49_TO_32 	0x24b 	0x92c 	\[17:0\] 	rw 	0x0 	Bitmask to specify if a readout board is BUSY then do not trigger (RB slots 49:32)
455pub const RB_BLOCK_IF_BUSY_49_TO_32 : MTBRegister<'static> = MTBRegister {
456  addr  : 0x24b,
457  mask  : 0x0003ffff,
458  descr : "Define if triggers should suppressed if RBs are busy. 1 bit per board",
459  rmw   : false,
460  ro    : false,
461  pulse : false,
462};
463
464
465// MT.EVENT_QUEUE
466// DAQ Buffer
467
468/// Reset the DAQ buffer (this does NOT reset the event ID)
469/// RESET   0x10    0x40    0   w   Pulse   DAQ Buffer Reset
470pub const EVQ_RESET : MTBRegister<'static> = MTBRegister {
471  addr  : 0x10,
472  mask  : 0x00000001,
473  descr : "Reset the DAQ buffer event queue! Will not reset event ID",
474  rmw   : false,
475  ro    : false,
476  pulse : true,
477};
478
479/// The DAQ buffer is full 
480/// FULL 	0x12 	0x48 	0 	r 		DAQ Buffer Full
481pub const EVQ_FULL : MTBRegister<'static> = MTBRegister {
482  addr  : 0x12,
483  mask  : 0x1,
484  descr : "Read FULL bit of the MT.EVENT_QUEUE",
485  rmw   : false,
486  ro    : true,
487  pulse : false,
488};
489
490/// The DAQ buffer is empty
491/// FULL 	0x12 	0x48 	1 	r 		DAQ Buffer Full
492pub const EVQ_EMPTY : MTBRegister<'static> = MTBRegister {
493  addr  : 0x12,
494  mask  : 0x2,
495  descr : "Read EMPTY bit of the MT.EVENT_QUEUE",
496  rmw   : false,
497  ro    : true,
498  pulse : false,
499};
500
501/// DAQ data payload. An event will be broken down into 
502/// multiple u32, which wlll be all accessible through
503/// this register. The EVQ_SIZE register tells how many
504/// times this register hast to be read (the actual value
505/// is twice this number, since internally the MTB operates
506/// on 16bit registers)
507/// DATA    0x11    0x44    \[31:0\]  r       DAQ Read Data
508pub const EVQ_DATA : MTBRegister<'static> = MTBRegister {
509  addr  : 0x11,
510  mask  : 0xffffffff,
511  descr : "DAQ data payload field",
512  rmw   : false,
513  ro    : true,
514  pulse : false
515};
516
517/// DAQ data queue SIZE. This stores twice the number of 
518/// times the EVQ_DATA register has to be read out to 
519/// obtain a complete event
520/// SIZE    0x13    0x4c    \[31:16\]     r       DAQ Buffer Head Event Size
521pub const EVQ_SIZE : MTBRegister<'static> = MTBRegister {
522  addr   : 0x13,
523  mask   : 0xffff0000,
524  descr  : "DAQ buffer data queue size in 16bit words",
525  rmw    : false,
526  ro     : true,
527  pulse  : false,
528};
529
530/// DAQ buffer size (in events)
531/// NUM_EVENTS 	0x13 	0x4c 	\[13:0\] 	r 		DAQ Buffer Number of Event
532pub const EVQ_NUM_EVENTS : MTBRegister<'static> = MTBRegister {
533  addr  : 0x13,
534  mask  : 0x0003fff,
535  descr : "Number of events in DAQ buffer event queue",
536  rmw   : false,
537  ro    : true,
538  pulse : false,
539};
540
541//FULL      0x12    0x48    0   r       DAQ Buffer Full
542//EMPTY     0x12    0x48    1   r       DAQ Buffer Empty
543
544/// Any 2 paddle combination. Can be used with a prescale
545/// factor. If the prescale is 0, then it will be disabled
546/// ANY_TRIG_PRESCALE     0x40    0x100   \[31:0\]  rw  0x0     Prescale value for the ANY trigger. 0 == 0% (off), 2**32-1 == 100%
547pub const ANY_TRIG_PRESCALE : MTBRegister<'static> = MTBRegister {
548  addr  : 0x40,
549  mask  : 0xffffffff,
550  descr : "Set the any trigger with a prescale factor. Prescale of 0 means disabled",
551  rmw   : false,
552  ro    : false,
553  pulse : false
554};
555
556/// More strict condition, requiring a track pattern. Can 
557/// be used with a prescale factor.
558/// If the prescale is 0, then it will be disabled
559/// TRACK_TRIGGER_PRESCALE    0x41    0x104   \[31:0\]  rw  0x0     Prescale value for the Inner + Outer Track Trigger. 0 == 0% (off), 2**32-1 == 100%
560pub const TRACK_TRIG_PRESCALE : MTBRegister<'static> = MTBRegister {
561  addr  : 0x41,
562  mask  : 0xffffffff,
563  descr : "Set the track trigger with a prescale factor. Prescale of 0 means disabled",
564  rmw   : false,
565  ro    : false,
566  pulse : false
567};
568
569/// The central track trigger requires hits in the Umbrella and upper cube.
570/// Can be used with a prescale factor.
571/// If the prescale is 0, then it will be disabled
572/// TRACK_CENTRAL_PRESCALE    0x42    0x108   \[31:0\]  rw  0x0     Prescale value for the Umbrella + Cube Top Track Trigger. 0 == 0% (off), 2**32-1 == 100%
573pub const TRACK_CENTRAL_PRESCALE : MTBRegister<'static> = MTBRegister {
574  addr  : 0x42,
575  mask  : 0xffffffff,
576  descr : "Set the central track trigger with a prescale factor. Prescale of 0 means disabled",
577  rmw   : false,
578  ro    : false,
579  pulse : false
580};
581
582/// PRESCALE_BYPASS set true to ignore prescale setting
583/// PRESCALE_BYPASS     0x44    0x110   0   rw  0x0     1 to bypass prescales
584pub const PRESCALE_BYPASS  : MTBRegister<'static> = MTBRegister {
585  addr  : 0x44, 
586  mask  : 0x1,
587  descr : "Set 1 to bypass the prescale",
588  rmw   : true, 
589  ro    : false, 
590  pulse : false, 
591};
592
593
594/// Prescale factor for the CENTRAL UMBRELLA TRACK trigger
595/// TRACK_UMB_CENTRAL_PRESCALE 	0x249 	0x924 	\[31:0\] 	rw 	0x0 	Prescale value for the Umbrella Center + Cube Top Track Trigger. 0 == 0% (off), 2**32-1 == 100%
596pub const TRACK_UMB_CENTRAL_PRESCALE : MTBRegister<'static> = MTBRegister {
597  addr  : 0x249,
598  mask  : 0xffffffff,
599  descr : "Set the umbrella central track trigger with a prescale factor. Prescale of 0 means disabled",
600  rmw   : false,
601  ro    : false,
602  pulse : false
603};
604
605/// Rate of Track trigger blocked due to prescaler of disable
606/// TRACK_TRIGGER_BLOCKED_RATE  0x250   0x940   \[23:0\]  r   Rate of this trigger blocked due to prescaler or disable
607pub const TRACK_TRIGGER_BLOCKED_RATE : MTBRegister<'static> = MTBRegister {
608  addr  : 0x250,
609  mask  : 0x00ffffff,
610  descr : "Rate of this trigger blocked due to prescaler or disable",
611  rmw   : false,
612  ro    : true, 
613  pulse : false
614};
615
616/// Rate of Any trigger blocked due to prescaler or disable
617/// ANY_TRIGGER_BLOCKED_RATE  0x251   0x944   \[23:0\]    r Rate of this trigger blocked due to
618/// prescaler or disable
619pub const ANY_TRIGGER_BLOCKED_RATE : MTBRegister<'static> = MTBRegister {
620  addr  : 0x251,
621  mask  : 0x00ffffff,
622  descr : "Rate of this trigger blocked due to prescaler or disable",
623  rmw   : false, 
624  ro    : true,
625  pulse : false
626};
627
628/// Rate of Track Central trigger blocked due precaler disable
629/// TRACK_CENTRAL_BLOCKED_RATE  0x252   0x948   \[23:0\]    r
630pub const TRACK_CENTRAL_BLOCKED_RATE : MTBRegister<'static> = MTBRegister {
631  addr  : 0x252,
632  mask  : 0x00ffffff,
633  descr : "Rate of this trigger blocked due to prescaler or disable",
634  rmw   : false,
635  ro    : true,
636  pulse : false
637};
638
639/// Rate of Track Umbrella Central trigger blocked due to prescaler or disable
640/// TRACK_UMB_CENTRAL_BLOCKED_RATE  0x253   0x94c   \[23:0\]    r
641pub const TRACK_UMB_CENTRAL_BLOCKED_RATE : MTBRegister<'static> = MTBRegister {
642  addr  : 0x253,
643  mask  : 0x00ffffff,
644  descr : "Rate of this trigger blocked due to prescaler or disable",
645  rmw   : false, 
646  ro    : true, 
647  pulse : false
648};
649
650/// Rate of TIU asserting busy. Measures the fraction of time the TIU was busy.
651/// TIU_BUSY_RATE   0x254   0x950   \[23:0\]    r   
652pub const TIU_BUSY_RATE : MTBRegister<'static> = MTBRegister {
653  addr  : 0x254,
654  mask  : 0x00ffffff,
655  descr : "FIX: Rate of TIU asserting busy. Measures the fraction of time the TIU was busy",
656  rmw   : false, 
657  ro    : true, 
658  pulse : false
659};
660
661/// Minimum enforced deadtime for TIU triggers. In units of 10 ns. A setting of 105 is the default of 1.05us.
662/// TIU_TIMEOUT_CNT     0x255   0x954   \[19:0\]    rw
663pub const TIU_TIMEOUT_CONST : MTBRegister<'static> = MTBRegister {
664  addr  : 0x255,
665  mask  : 0x000fffff,
666  descr : "Minimum enforced deadtime for TIU. Units are 10ns. A setting of 105 is the default of 1.05us",
667  rmw   : true, 
668  ro    : false, 
669  pulse : false
670};
671
672
673//Implements various control and monitoring functions of the DRS Logic
674
675/// Total inner tof (cube) threshold (nhits)
676///
677/// <div class="warning"> This setting is shared between the triggers and can impact performance of the pre-implmented triggers!!</div>
678///
679/// INNER_TOF_THRESH    0x14    0x50    \[7:0\]   rw  0x3     Inner TOF hit threshold
680pub const INNER_TOF_THRESH : MTBRegister<'static> = MTBRegister {
681  addr  : 0x14,
682  mask  : 0x000000ff,
683  descr : "Set the nhit threshold for the inner TOF (cube)",
684  rmw   : true,
685  ro    : false,
686  pulse : false
687};
688
689
690/// Total outer TOF (cortina + umbrella) threshhold (nhits)
691///
692/// <div class="warning"> This setting is shared between the triggers and can impact performance of the pre-implmented triggers!!</div>
693///
694/// OUTER_TOF_THRESH    0x14    0x50    \[15:8\]  rw  0x3     Outer TOF hit threshold
695pub const OUTER_TOF_THRESH : MTBRegister<'static> = MTBRegister {
696  addr  : 0x14,
697  mask  : 0x0000ff00,
698  descr : "Set the nhit threshold for the outer TOF (cube)",
699  rmw   : true,
700  ro    : false,
701  pulse : false
702};
703
704
705/// Total TOF (cube + cortina + umbrella) threshhold (nhits)
706///
707/// <div class="warning"> This setting is shared between the triggers and can impact performance of the pre-implmented triggers!!</div>
708///
709/// TOTAL_TOF_THRESH    0x14    0x50    \[23:16\]     rw  0x8     Total TOF hit threshold
710pub const TOTAL_TOF_THRESH : MTBRegister<'static> = MTBRegister {
711  addr  : 0x14,
712  mask  : 0x00ff0000,
713  descr : "Set the nhit threshold for the entire TOF (nhit)",
714  rmw   : true,
715  ro    : false,
716  pulse : false
717};
718
719/// Enable the Gaps (antiparticle) trigger
720/// GAPS_TRIGGER_EN     0x14    0x50    24  rw  0x0     Enable the gaps trigger.
721pub const GAPS_TRIGGER_EN : MTBRegister<'static> = MTBRegister {
722  addr  : 0x14,
723  mask  : 0x01000000,
724  descr : "Set the GAPS antiparticle trigger (on/off)",
725  rmw   : true,
726  ro    : false,
727  pulse : false
728};
729
730
731/// Require beta condition for the Gaps (antiparticle) trigger
732/// REQUIRE_BETA    0x14    0x50    25  rw  0x1     Require beta in the gaps trigger
733pub const REQUIRE_BETA : MTBRegister<'static> = MTBRegister {
734  addr  : 0x14,
735  mask  : 0x02000000,
736  descr : "Enable beta condition for the Gaps (antiparticle) trigger",
737  rmw   : true,
738  ro    : false,
739  pulse : false
740};
741
742/// Enable the configurable trigger (has to be enable for any fine-grained threshhold
743/// setting to come into effect)
744/// CONFIGURABLE_TRIGGER_EN     0x14    0x50    31  rw  0x0     Enable the configurable trigger
745pub const CONFIGURABLE_TRIGGER_EN : MTBRegister<'static> = MTBRegister {
746  addr  : 0x14,
747  mask  : 0x10000000,
748  descr : "Enable the configurable trigger. This allows to use the individual thresholds",
749  rmw   : true,
750  ro    : false,
751  pulse : false,
752};
753
754
755/// Set the (nhit) threshold for the cube side panesl
756///
757/// <div class="warning"> Requires the configurable trigger to be enabled!</div>
758///
759/// CUBE_SIDE_THRESH    0x15    0x54    \[7:0\]   rw  0x0     Threshold for the hit bitmap. Threshold must be > this number.
760pub const CUBE_SIDE_THRESH : MTBRegister<'static> = MTBRegister {
761  addr  : 0x15,
762  mask  : 0x000000ff,
763  descr : "Set the nhit threshold for the cube sides. Needs configurable trigger enabled to be in effect.",
764  rmw   : true,
765  ro    : false,
766  pulse : false
767};
768
769/// Set the (nhit) threshold for the cube top panesl
770///
771/// <div class="warning"> Requires the configurable trigger to be enabled!</div>
772///
773/// CUBE_TOP_THRESH   0x15    0x54    \[15:8\]  rw  0x0     Threshold for the hit bitmap. Threshold must be > this number.
774pub const CUBE_TOP_THRESH : MTBRegister<'static> = MTBRegister {
775  addr  : 0x15,
776  mask  : 0x0000ff00,
777  descr : "Set the nhit threshold for the cube top. Needs configurable trigger enabled to be in effect.",
778  rmw   : true,
779  ro    : false,
780  pulse : false
781};
782
783/// Set the (nhit) threshold for the cube bottom panesl
784///
785/// <div class="warning"> Requires the configurable trigger to be enabled!</div>
786///
787/// CUBE_BOT_THRESH   0x15    0x54    \[23:16\]     rw  0x0     Threshold for the hit bitmap. Threshold must be > this number.
788pub const CUBE_BOT_THRESH : MTBRegister<'static> = MTBRegister {
789  addr  : 0x15,
790  mask  : 0x00ff0000,
791  descr : "Set the nhit threshold for the cube top. Needs configurable trigger enabled to be in effect.",
792  rmw   : true,
793  ro    : false,
794  pulse : false
795};
796
797
798/// Set the (nhit) threshold for the cube bottom panesl
799///
800/// <div class="warning"> Requires the configurable trigger to be enabled!</div>
801///
802/// CUBE_CORNER_THRESH    0x15    0x54    \[31:24\]     rw  0x0     Threshold for the hit bitmap. Threshold must be > this number.
803pub const CUBE_CORNER_THRESH : MTBRegister<'static> = MTBRegister {
804  addr  : 0x15,
805  mask  : 0xff000000,
806  descr : "Set the nhit threshold for the cube corners. Needs configurable trigger enabled to be in effect.",
807  rmw   : true,
808  ro    : false,
809  pulse : false
810};
811
812/// Set the (nhit) threshold for the cube bottom panesl
813///
814/// <div class="warning"> Requires the configurable trigger to be enabled!</div>
815///
816/// UMBRELLA_THRESH   0x16    0x58    \[7:0\]   rw  0x0     Threshold for the hit bitmap. Threshold must be > this number.
817pub const UMBRELLA_THRESH : MTBRegister<'static> = MTBRegister {
818  addr  : 0x16,
819  mask  : 0x000000ff,
820  descr : "Set the nhit threshold for the complete umbrella. Needs configurable trigger enabled to be in effect.",
821  rmw   : true,
822  ro    : false,
823  pulse : false
824};
825
826/// Set the (nhit) threshold for the umbrealla center
827///
828/// <div class="warning"> Requires the configurable trigger to be enabled!</div>
829///
830/// UMBRELLA_CENTER_THRESH    0x16    0x58    \[15:8\]  rw  0x0     Threshold for the hit bitmap. Threshold must be > this number.
831pub const UMBRELLA_CENTER_THRESH : MTBRegister<'static> = MTBRegister {
832  addr  : 0x16,
833  mask  : 0x0000ff00,
834  descr : "Set the nhit threshold for the umbrella center. Needs configurable trigger enabled to be in effect.",
835  rmw   : true,
836  ro    : false,
837  pulse : false
838};
839
840/// Set the (nhit) threshold for the cortina panesl
841///
842/// <div class="warning"> Requires the configurable trigger to be enabled!</div>
843///
844/// CORTINA_THRESH    0x16    0x58    \[23:16\]     rw  0x0     Threshold for the hit bitmap. Threshold must be > this number.
845pub const CORTINA_THRESH : MTBRegister<'static> = MTBRegister {
846  addr  : 0x16,
847  mask  : 0x00ff0000,
848  descr : "Set the nhit threshold for the cortina. Needs configurable trigger enabled to be in effect.",
849  rmw   : true,
850  ro    : false,
851  pulse : false
852};
853
854/// Set the (nhit) threshold for the cortina panesl
855///
856/// <div class="warning"> Requires the configurable trigger to be enabled!</div>
857///
858/// LOST_TRIGGER_RATE     0x18    0x60    \[23:0\]  r       Rate of lost triggers in Hz
859pub const LOST_TRIGGER_RATE : MTBRegister<'static> = MTBRegister {
860  addr  : 0x18,
861  mask  : 0x00ffffff,
862  descr : "Get lost trigger rate in Hz",
863  rmw   : false,
864  ro    : true,
865  pulse : false
866};
867
868
869/// The lost trigger rate due to "tracker busy" signals
870/// received by the TIU
871/// TIU_LOST_TRIGGER_RATE 	0x24d 	0x934 	\[23:0\]
872pub const TIU_LOST_TRIGGER_RATE : MTBRegister<'static> = MTBRegister {
873  addr  : 0x24d,
874  mask  : 0x00ffffff,
875  descr : "Get tiu lost trigger rate in Hz",
876  rmw   : false,
877  ro    : true,
878  pulse : false
879};
880
881///Rate of lost triggers due to MTB internal trigger block deadtime (in Hz)
882///TRG_LOST_TRIGGER_RATE   0x24e    0x938   \[23:0\]  r
883pub const TRG_LOST_TRIGGER_RATE : MTBRegister<'static> = MTBRegister {
884  addr  : 0x24e,
885  mask  : 0x00ffffff,
886  descr : "Rate of lost triggers due to MTB internal trigger block deadtime (in Hz)",
887  rmw   : false,
888  ro    : true,
889  pulse : false
890};
891
892///Rate of GAPS trigger blocked due to prescaler or disable
893///GAPS_TRIGGER_BLOCKED_RATE    0x24f   0x93c   \[23:0\]
894pub const GAPS_TRIGGER_BLOCKED_RATE : MTBRegister<'static> = MTBRegister {
895  addr  : 0x24f,
896  mask  : 0x00ffffff,
897  descr : "Rate of GAPS trigger blocked due to prescaler or disable",
898  rmw   : false,
899  ro    : true, 
900  pulse : false
901};
902
903/// The lost trigger rate due to RB busy timeouts
904/// RB_LOST_TRIGGER_RATE 	0x24c 	0x930 	\[23:0\]
905pub const RB_LOST_TRIGGER_RATE : MTBRegister<'static> = MTBRegister {
906  addr  : 0x24c,
907  mask  : 0x00ffffff,
908  descr : "Get RB lost trigger rate in Hz",
909  rmw   : false,
910  ro    : true,
911  pulse : false
912};
913
914//Node  Adr     Adr8    Bits    Perm    Def     Description
915//HIT_THRESH    0x14    0x50    [29:28]     rw  0x0     Threshold for the hit bitmap. Threshold must be > this number.
916
917/// The global trigger rate in Hz
918/// TRIGGER_RATE    0x17    0x5c    \[23:0\]  r       Rate of triggers in Hz
919pub const TRIGGER_RATE : MTBRegister<'static> = MTBRegister {
920  addr  : 0x17,
921  mask  : 0x00ffffff,
922  descr : "Get the global trigger rate in Hz",
923  rmw   : false,
924  ro    : true,
925  pulse : false,
926};
927
928// LTB Hit counter readout
929// MT.HIT_COUNTERS
930//
931// Counters
932
933/// LTB link 0 available and ready to receive data
934//LT_LINK_READY0    0x1a    0x68    \[9:0\]   r       DSI 0 RX Link OK
935pub const LT_LINK_READY0 : MTBRegister<'static> = MTBRegister {
936  addr  : 0x1a,
937  mask  : 0x1ff,
938  descr : "LT link 0 ready",
939  rmw   : false,
940  ro    : true,
941  pulse : false,
942};
943
944/// LTB link 1 available and ready to receive data
945//LT_LINK_READY1    0x1b    0x6c    \[9:0\]   r       DSI 1 RX Link OK
946pub const LT_LINK_READY1 : MTBRegister<'static> = MTBRegister {
947  addr  : 0x1b,
948  mask  : 0x1ff,
949  descr : "LT link 1 ready",
950  rmw   : false,
951  ro    : true,
952  pulse : false,
953};
954
955/// LTB link 2 available and ready to receive data
956//LT_LINK_READY2    0x1c    0x70    \[9:0\]   r       DSI 2 RX Link OK
957pub const LT_LINK_READY2 : MTBRegister<'static> = MTBRegister {
958  addr  : 0x1c,
959  mask  : 0x1ff,
960  descr : "LT link 2 ready",
961  rmw   : false,
962  ro    : true,
963  pulse : false,
964};
965
966/// LTB link 3 available and ready to receive data
967//LT_LINK_READY3    0x1d    0x74    \[9:0\]   r       DSI 3 RX Link OK
968pub const LT_LINK_READY3 : MTBRegister<'static> = MTBRegister {
969  addr  : 0x1d,
970  mask  : 0x1ff,
971  descr : "LT link 3 ready",
972  rmw   : false,
973  ro    : true,
974  pulse : false,
975};
976
977/// LTB link 4 available and ready to receive data
978//LT_LINK_READY4    0x1e    0x78    \[9:0\]   r       DSI 4 RX Link OK
979pub const LT_LINK_READY4 : MTBRegister<'static> = MTBRegister {
980  addr  : 0x1e,
981  mask  : 0x1ff,
982  descr : "LT link 4 ready",
983  rmw   : false,
984  ro    : true,
985  pulse : false,
986};
987
988/// LTB Hit counter for slot 0
989//LT0   0x20    0x80    \[23:0\]  r       hit count on LT=0
990pub const LT0 : MTBRegister<'static> = MTBRegister {
991  addr  : 0x20,
992  mask  : 0x00ffffff,
993  descr : "Hit count on LT=0",
994  rmw   : false,
995  ro    : true,
996  pulse : false,
997};
998
999/// LTB Hit counter for slot 1
1000//LT1   0x21    0x80    \[23:0\]  r       hit count on LT=1
1001pub const LT1 : MTBRegister<'static> = MTBRegister {
1002  addr  : 0x21,
1003  mask  : 0x00ffffff,
1004  descr : "Hit count on LT=1",
1005  rmw   : false,
1006  ro    : true,
1007  pulse : false,
1008};
1009
1010/// LTB Hit counter for slot 2
1011//LT2   0x22    0x80    \[23:0\]  r       hit count on LT=2
1012pub const LT2 : MTBRegister<'static> = MTBRegister {
1013  addr  : 0x22,
1014  mask  : 0x00ffffff,
1015  descr : "Hit count on LT=2",
1016  rmw   : false,
1017  ro    : true,
1018  pulse : false,
1019};
1020
1021/// LTB Hit counter for slot 3
1022//LT3   0x23    0x80    \[23:0\]  r       hit count on LT=3
1023pub const LT3 : MTBRegister<'static> = MTBRegister {
1024  addr  : 0x23,
1025  mask  : 0x00ffffff,
1026  descr : "Hit count on LT=3",
1027  rmw   : false,
1028  ro    : true,
1029  pulse : false,
1030};
1031
1032/// LTB Hit counter for slot 4
1033//LT4   0x24    0x80    \[23:0\]  r       hit count on LT=4
1034pub const LT4 : MTBRegister<'static> = MTBRegister {
1035  addr  : 0x24,
1036  mask  : 0x00ffffff,
1037  descr : "Hit count on LT=4",
1038  rmw   : false,
1039  ro    : true,
1040  pulse : false,
1041};
1042
1043/// LTB Hit counter for slot 5
1044//LT5   0x20    0x80    \[23:0\]  r       hit count on LT=5
1045pub const LT5 : MTBRegister<'static> = MTBRegister {
1046  addr  : 0x25,
1047  mask  : 0x00ffffff,
1048  descr : "Hit count on LT=5",
1049  rmw   : false,
1050  ro    : true,
1051  pulse : false,
1052};
1053
1054/// LTB Hit counter for slot 6
1055/// LT6     0x26    0x80    \[23:0\]  r       hit count on LT=6
1056pub const LT6 : MTBRegister<'static> = MTBRegister {
1057  addr  : 0x26,
1058  mask  : 0x00ffffff,
1059  descr : "Hit count on LT=6",
1060  rmw   : false,
1061  ro    : true,
1062  pulse : false,
1063};
1064
1065/// LTB Hit counter for slot 7
1066/// LT7     0x27    0x80    \[23:0\]  r       hit count on LT=7
1067pub const LT7 : MTBRegister<'static> = MTBRegister {
1068  addr  : 0x27,
1069  mask  : 0x00ffffff,
1070  descr : "Hit count on LT=7",
1071  rmw   : false,
1072  ro    : true,
1073  pulse : false,
1074};
1075
1076
1077/// LTB Hit counter for slot 8
1078/// LT8     0x28    0x80    \[23:0\]  r       hit count on LT=8
1079pub const LT8 : MTBRegister<'static> = MTBRegister {
1080  addr  : 0x28,
1081  mask  : 0x00ffffff,
1082  descr : "Hit count on LT=8",
1083  rmw   : false,
1084  ro    : true,
1085  pulse : false,
1086};
1087
1088
1089/// LTB Hit counter for slot 9
1090/// LT8     0x29    0x80    \[23:0\]  r       hit count on LT=9
1091pub const LT9 : MTBRegister<'static> = MTBRegister {
1092  addr  : 0x29,
1093  mask  : 0x00ffffff,
1094  descr : "Hit count on LT=9",
1095  rmw   : false,
1096  ro    : true,
1097  pulse : false,
1098};
1099
1100
1101/// LTB Hit counter for slot 10
1102/// LT10     0x2a    0x80    \[23:0\]  r       hit count on LT=10
1103pub const LT10 : MTBRegister<'static> = MTBRegister {
1104  addr  : 0x2a,
1105  mask  : 0x00ffffff,
1106  descr : "Hit count on LT=10",
1107  rmw   : false,
1108  ro    : true,
1109  pulse : false,
1110};
1111
1112
1113/// LTB Hit counter for slot 11
1114/// LT11     0x2b    0x80    \[23:0\]  r       hit count on LT=11
1115pub const LT11 : MTBRegister<'static> = MTBRegister {
1116  addr  : 0x2b,
1117  mask  : 0x00ffffff,
1118  descr : "Hit count on LT=11",
1119  rmw   : false,
1120  ro    : true,
1121  pulse : false,
1122};
1123
1124
1125/// LTB Hit counter for slot 12
1126/// LT12     0x2c    0x80    \[23:0\]  r       hit count on LT=12
1127pub const LT12 : MTBRegister<'static> = MTBRegister {
1128  addr  : 0x2c,
1129  mask  : 0x00ffffff,
1130  descr : "Hit count on LT=12",
1131  rmw   : false,
1132  ro    : true,
1133  pulse : false,
1134};
1135
1136/// LTB Hit counter for slot 13
1137/// LT13     0x2d    0x80    \[23:0\]  r       hit count on LT=13
1138pub const LT13 : MTBRegister<'static> = MTBRegister {
1139  addr  : 0x2d,
1140  mask  : 0x00ffffff,
1141  descr : "Hit count on LT=13",
1142  rmw   : false,
1143  ro    : true,
1144  pulse : false,
1145};
1146
1147/// LTB Hit counter for slot 14
1148/// LT14     0x2e    0x80    \[23:0\]  r       hit count on LT=14
1149pub const LT14 : MTBRegister<'static> = MTBRegister {
1150  addr  : 0x2e,
1151  mask  : 0x00ffffff,
1152  descr : "Hit count on LT=14",
1153  rmw   : false,
1154  ro    : true,
1155  pulse : false,
1156};
1157
1158/// LTB Hit counter for slot 15
1159/// LT15     0x2f    0x80    \[23:0\]  r       hit count on LT=15
1160pub const LT15 : MTBRegister<'static> = MTBRegister {
1161  addr  : 0x2f,
1162  mask  : 0x00ffffff,
1163  descr : "Hit count on LT=15",
1164  rmw   : false,
1165  ro    : true,
1166  pulse : false,
1167};
1168
1169/// LTB Hit counter for slot 16
1170/// LT16     0x30    0x80    \[23:0\]  r       hit count on LT=16
1171pub const LT16 : MTBRegister<'static> = MTBRegister {
1172  addr  : 0x30,
1173  mask  : 0x00ffffff,
1174  descr : "Hit count on LT=16",
1175  rmw   : false,
1176  ro    : true,
1177  pulse : false,
1178};
1179
1180/// LTB Hit counter for slot 17
1181/// LT17     0x31    0x80    \[23:0\]  r       hit count on LT=17
1182pub const LT17 : MTBRegister<'static> = MTBRegister {
1183  addr  : 0x31,
1184  mask  : 0x00ffffff,
1185  descr : "Hit count on LT=17",
1186  rmw   : false,
1187  ro    : true,
1188  pulse : false,
1189};
1190
1191/// LTB Hit counter for slot 18
1192/// LT18     0x32    0x80    \[23:0\]  r       hit count on LT=18
1193pub const LT18 : MTBRegister<'static> = MTBRegister {
1194  addr  : 0x32,
1195  mask  : 0x00ffffff,
1196  descr : "Hit count on LT=18",
1197  rmw   : false,
1198  ro    : true,
1199  pulse : false,
1200};
1201
1202/// LTB Hit counter for slot 19
1203/// LT19     0x33    0x80    \[23:0\]  r       hit count on LT=19
1204pub const LT19 : MTBRegister<'static> = MTBRegister {
1205  addr  : 0x33,
1206  mask  : 0x00ffffff,
1207  descr : "Hit count on LT=19",
1208  rmw   : false,
1209  ro    : true,
1210  pulse : false,
1211};
1212
1213
1214/// LTB Hit counter for slot 20
1215/// LT20     0x34    0x80    \[23:0\]  r       hit count on LT=20
1216pub const LT20 : MTBRegister<'static> = MTBRegister {
1217  addr  : 0x34,
1218  mask  : 0x00ffffff,
1219  descr : "Hit count on LT=20",
1220  rmw   : false,
1221  ro    : true,
1222  pulse : false,
1223};
1224
1225/// LTB Hit counter for slot 0
1226/// LT21     0x35    0x80    \[23:0\]  r       hit count on LT=21
1227pub const LT21 : MTBRegister<'static> = MTBRegister {
1228  addr  : 0x35,
1229  mask  : 0x00ffffff,
1230  descr : "Hit count on LT=21",
1231  rmw   : false,
1232  ro    : true,
1233  pulse : false,
1234};
1235
1236/// LTB Hit counter for slot 22
1237/// LT22     0x36    0x80    \[23:0\]  r       hit count on LT=22
1238pub const LT22 : MTBRegister<'static> = MTBRegister {
1239  addr  : 0x36,
1240  mask  : 0x00ffffff,
1241  descr : "Hit count on LT=22",
1242  rmw   : false,
1243  ro    : true,
1244  pulse : false,
1245};
1246
1247/// LTB Hit counter for slot 23
1248/// LT23     0x37    0x80    \[23:0\]  r       hit count on LT=23
1249pub const LT23 : MTBRegister<'static> = MTBRegister {
1250  addr  : 0x37,
1251  mask  : 0x00ffffff,
1252  descr : "Hit count on LT=23",
1253  rmw   : false,
1254  ro    : true,
1255  pulse : false,
1256};
1257
1258/// LTB Hit counter for slot 24
1259/// LT24     0x38    0x80    \[23:0\]  r       hit count on LT=38
1260pub const LT24 : MTBRegister<'static> = MTBRegister {
1261  addr  : 0x38,
1262  mask  : 0x00ffffff,
1263  descr : "Hit count on LT=24",
1264  rmw   : false,
1265  ro    : true,
1266  pulse : false,
1267};
1268
1269/// LTB Hit counter reset
1270/// RESET     0x39    0xe4    0   w   Pulse   Write 1 to reset hit counters.
1271pub const LT_HIT_CNT_RESET : MTBRegister<'static> = MTBRegister {
1272  addr  : 0x39,
1273  mask  : 0x00000001,
1274  descr : "Reset LT HIT counters 0-24",
1275  rmw   : false,
1276  ro    : false,
1277  pulse : true,
1278};
1279
1280/// LTB Hit counter snap
1281/// SNAP  0x3a    0xe8    0   rw  0x1     1 to snap the hit counters.
1282pub const LT_HIT_CNT_SNAP : MTBRegister<'static> = MTBRegister {
1283  addr  : 0x3a,
1284  mask  : 0x00000001,
1285  descr : "Snap LT HIT counters 0-24",
1286  rmw   : true,
1287  ro    : false,
1288  pulse : false,
1289};
1290
1291/// LTB channel mask, set 1 to a channel to mask (deactivate it)
1292///
1293/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1294/// one bit per channel
1295/// LT0 	0x50 	0x140 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=0
1296pub const LT0_CHMASK : MTBRegister<'static> = MTBRegister {
1297  addr  : 0x50,
1298  mask  : 0x000000f,
1299  descr : "Channel mask for LT=0",
1300  rmw   : true,
1301  ro    : false,
1302  pulse : false,
1303};
1304
1305/// LT1 channel mask, set 1 to a channel to mask (deactivate it)
1306///
1307/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1308/// one bit per channel
1309/// LT1 	0x51 	0x144 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=1
1310pub const LT1_CHMASK : MTBRegister<'static> = MTBRegister {
1311  addr  : 0x51,
1312  mask  : 0x000000f,
1313  descr : "Channel mask for LT=1",
1314  rmw   : true,
1315  ro    : false,
1316  pulse : false,
1317};
1318
1319/// LT2 channel mask, set 1 to a channel to mask (deactivate it)
1320///
1321/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1322/// one bit per channel
1323/// LT2 	0x52 	0x148 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=2
1324pub const LT2_CHMASK : MTBRegister<'static> = MTBRegister {
1325  addr  : 0x52,
1326  mask  : 0x000000f,
1327  descr : "Channel mask for LT=2",
1328  rmw   : true,
1329  ro    : false,
1330  pulse : false,
1331};
1332
1333/// LT3 channel mask, set 1 to a channel to mask (deactivate it)
1334///
1335/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1336/// one bit per channel
1337/// LT3 	0x53 	0x14c 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=3
1338pub const LT3_CHMASK : MTBRegister<'static> = MTBRegister {
1339  addr  : 0x53,
1340  mask  : 0x000000f,
1341  descr : "Channel mask for LT=3",
1342  rmw   : true,
1343  ro    : false,
1344  pulse : false,
1345};
1346
1347/// LT4 channel mask, set 1 to a channel to mask (deactivate it)
1348///
1349/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1350/// one bit per channel
1351/// LT4 	0x54 	0x150 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=4
1352pub const LT4_CHMASK : MTBRegister<'static> = MTBRegister {
1353  addr  : 0x54,
1354  mask  : 0x000000f,
1355  descr : "Channel mask for LT=4",
1356  rmw   : true,
1357  ro    : false,
1358  pulse : false,
1359};
1360
1361/// LT5 channel mask, set 1 to a channel to mask (deactivate it)
1362///
1363/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1364/// one bit per channel
1365/// LT5 	0x55 	0x154 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=5
1366pub const LT5_CHMASK : MTBRegister<'static> = MTBRegister {
1367  addr  : 0x55,
1368  mask  : 0x000000f,
1369  descr : "Channel mask for LT=5",
1370  rmw   : true,
1371  ro    : false,
1372  pulse : false,
1373};
1374
1375/// LT6 channel mask, set 1 to a channel to mask (deactivate it)
1376///
1377/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1378/// one bit per channel
1379/// LT6 	0x56 	0x158 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=6
1380pub const LT6_CHMASK : MTBRegister<'static> = MTBRegister {
1381  addr  : 0x56,
1382  mask  : 0x000000f,
1383  descr : "Channel mask for LT=6",
1384  rmw   : true,
1385  ro    : false,
1386  pulse : false,
1387};
1388
1389/// LT7 channel mask, set 1 to a channel to mask (deactivate it)
1390///
1391/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1392/// one bit per channel
1393/// LT7 	0x57 	0x15c 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=7
1394pub const LT7_CHMASK : MTBRegister<'static> = MTBRegister {
1395  addr  : 0x57,
1396  mask  : 0x000000f,
1397  descr : "Channel mask for LT=7",
1398  rmw   : true,
1399  ro    : false,
1400  pulse : false,
1401};
1402
1403/// LT8 channel mask, set 1 to a channel to mask (deactivate it)
1404///
1405/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1406/// one bit per channel
1407/// LT8 	0x58 	0x160 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=8
1408pub const LT8_CHMASK : MTBRegister<'static> = MTBRegister {
1409  addr  : 0x58,
1410  mask  : 0x000000f,
1411  descr : "Channel mask for LT=8",
1412  rmw   : true,
1413  ro    : false,
1414  pulse : false,
1415};
1416
1417/// LT9 channel mask, set 1 to a channel to mask (deactivate it)
1418///
1419/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1420/// one bit per channel
1421/// LT9 	0x59 	0x164 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=9
1422pub const LT9_CHMASK : MTBRegister<'static> = MTBRegister {
1423  addr  : 0x59,
1424  mask  : 0x000000f,
1425  descr : "Channel mask for LT=9",
1426  rmw   : true,
1427  ro    : false,
1428  pulse : false,
1429};
1430
1431/// LT10 channel mask, set 1 to a channel to mask (deactivate it)
1432///
1433/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1434/// one bit per channel
1435/// LT10 	0x5a 	0x168 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=10
1436pub const LT10_CHMASK : MTBRegister<'static> = MTBRegister {
1437  addr  : 0x5a,
1438  mask  : 0x000000f,
1439  descr : "Channel mask for LT=10",
1440  rmw   : true,
1441  ro    : false,
1442  pulse : false,
1443};
1444
1445/// LT11 channel mask, set 1 to a channel to mask (deactivate it)
1446///
1447/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1448/// one bit per channel
1449/// LT11 	0x5b 	0x16c 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=11
1450pub const LT11_CHMASK : MTBRegister<'static> = MTBRegister {
1451  addr  : 0x5b,
1452  mask  : 0x000000f,
1453  descr : "Channel mask for LT=11",
1454  rmw   : true,
1455  ro    : false,
1456  pulse : false,
1457};
1458
1459/// LT12 channel mask, set 1 to a channel to mask (deactivate it)
1460///
1461/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1462/// one bit per channel
1463/// LT12 	0x5c 	0x170 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=12
1464pub const LT12_CHMASK : MTBRegister<'static> = MTBRegister {
1465  addr  : 0x5c,
1466  mask  : 0x000000f,
1467  descr : "Channel mask for LT=12",
1468  rmw   : true,
1469  ro    : false,
1470  pulse : false,
1471};
1472
1473/// LT13 channel mask, set 1 to a channel to mask (deactivate it)
1474///
1475/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1476/// one bit per channel
1477/// LT13 	0x5d 	0x174 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=13
1478pub const LT13_CHMASK : MTBRegister<'static> = MTBRegister {
1479  addr  : 0x5d,
1480  mask  : 0x000000f,
1481  descr : "Channel mask for LT=13",
1482  rmw   : true,
1483  ro    : false,
1484  pulse : false,
1485};
1486
1487/// LT14 channel mask, set 1 to a channel to mask (deactivate it)
1488///
1489/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1490/// one bit per channel
1491/// LT14 	0x5e 	0x178 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=14
1492pub const LT14_CHMASK : MTBRegister<'static> = MTBRegister {
1493  addr  : 0x5e,
1494  mask  : 0x000000f,
1495  descr : "Channel mask for LT=14",
1496  rmw   : true,
1497  ro    : false,
1498  pulse : false,
1499};
1500
1501/// LT15 channel mask, set 1 to a channel to mask (deactivate it)
1502///
1503/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1504/// one bit per channel
1505/// LT15 	0x5f 	0x17c 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=15
1506pub const LT15_CHMASK : MTBRegister<'static> = MTBRegister {
1507  addr  : 0x5f,
1508  mask  : 0x000000f,
1509  descr : "Channel mask for LT=15",
1510  rmw   : true,
1511  ro    : false,
1512  pulse : false,
1513};
1514
1515/// LT16 channel mask, set 1 to a channel to mask (deactivate it)
1516///
1517/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1518/// one bit per channel
1519/// LT16 	0x60 	0x180 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=16
1520pub const LT16_CHMASK : MTBRegister<'static> = MTBRegister {
1521  addr  : 0x60,
1522  mask  : 0x000000f,
1523  descr : "Channel mask for LT=16",
1524  rmw   : true,
1525  ro    : false,
1526  pulse : false,
1527};
1528
1529/// LT17 channel mask, set 1 to a channel to mask (deactivate it)
1530///
1531/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1532/// one bit per channel
1533/// LT17 	0x61 	0x184 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=17
1534pub const LT17_CHMASK : MTBRegister<'static> = MTBRegister {
1535  addr  : 0x61,
1536  mask  : 0x000000f,
1537  descr : "Channel mask for LT=17",
1538  rmw   : true,
1539  ro    : false,
1540  pulse : false,
1541};
1542
1543/// LT18 channel mask, set 1 to a channel to mask (deactivate it)
1544///
1545/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1546/// one bit per channel
1547/// LT18 	0x62 	0x188 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=18
1548pub const LT18_CHMASK : MTBRegister<'static> = MTBRegister {
1549  addr  : 0x62,
1550  mask  : 0x000000f,
1551  descr : "Channel mask for LT=18",
1552  rmw   : true,
1553  ro    : false,
1554  pulse : false,
1555};
1556
1557/// LT19 channel mask, set 1 to a channel to mask (deactivate it)
1558///
1559/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1560/// one bit per channel
1561/// LT19 	0x63 	0x18c 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=19
1562pub const LT19_CHMASK : MTBRegister<'static> = MTBRegister {
1563  addr  : 0x63,
1564  mask  : 0x000000f,
1565  descr : "Channel mask for LT=19",
1566  rmw   : true,
1567  ro    : false,
1568  pulse : false,
1569};
1570
1571/// LT20 channel mask, set 1 to a channel to mask (deactivate it)
1572///
1573/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1574/// one bit per channel
1575/// LT20 	0x64 	0x190 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=20
1576pub const LT20_CHMASK : MTBRegister<'static> = MTBRegister {
1577  addr  : 0x64,
1578  mask  : 0x000000f,
1579  descr : "Channel mask for LT=20",
1580  rmw   : true,
1581  ro    : false,
1582  pulse : false,
1583};
1584
1585/// LT21 channel mask, set 1 to a channel to mask (deactivate it)
1586///
1587/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1588/// one bit per channel
1589/// LT21 	0x65 	0x194 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=21
1590pub const LT21_CHMASK : MTBRegister<'static> = MTBRegister {
1591  addr  : 0x65,
1592  mask  : 0x000000f,
1593  descr : "Channel mask for LT=21",
1594  rmw   : true,
1595  ro    : false,
1596  pulse : false,
1597};
1598
1599/// LT22 channel mask, set 1 to a channel to mask (deactivate it)
1600///
1601/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1602/// one bit per channel
1603/// LT22 	0x66 	0x198 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=22
1604pub const LT22_CHMASK : MTBRegister<'static> = MTBRegister {
1605  addr  : 0x66,
1606  mask  : 0x000000f,
1607  descr : "Channel mask for LT=22",
1608  rmw   : true,
1609  ro    : false,
1610  pulse : false,
1611};
1612
1613/// LT23 channel mask, set 1 to a channel to mask (deactivate it)
1614///
1615/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1616/// one bit per channel
1617/// LT23 	0x67 	0x19c 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=23
1618pub const LT23_CHMASK : MTBRegister<'static> = MTBRegister {
1619  addr  : 0x67,
1620  mask  : 0x000000f,
1621  descr : "Channel mask for LT=23",
1622  rmw   : true,
1623  ro    : false,
1624  pulse : false,
1625};
1626
1627/// LT24 channel mask, set 1 to a channel to mask (deactivate it)
1628///
1629/// Sets the mask for all channels 0-7 for this LTB simultaneously,
1630/// one bit per channel
1631/// LT24 	0x68 	0x1a0 	\[7:0\] 	rw 	0x0 	1 to mask a channel of LT=24
1632pub const LT24_CHMASK : MTBRegister<'static> = MTBRegister {
1633  addr  : 0x68,
1634  mask  : 0x000000f,
1635  descr : "Channel mask for LT=24",
1636  rmw   : true,
1637  ro    : false,
1638  pulse : false,
1639};
1640
1641
1642//MT.RB_READOUT_CNTS
1643//
1644//Counters
1645
1646/// Readout counter on RB=0
1647/// CNTS_0    0xf2    0x3c8   \[7:0\]   r       Readout count on RB=0
1648pub const RB0_CNTS : MTBRegister<'static> = MTBRegister {
1649  addr  : 0xf2,
1650  mask  : 0x000000ff,
1651  descr : "Counts on RB0/(link id?)",
1652  rmw   : false,
1653  ro    : true,
1654  pulse : false,
1655};
1656
1657/// Readout counter on RB=1
1658/// CNTS_1    0xf2    0x3c8   \[15:8\]  r       Readout count on RB=1
1659pub const RB1_CNTS : MTBRegister<'static> = MTBRegister {
1660  addr  : 0xf2,
1661  mask  : 0x0000ff00,
1662  descr : "Counts on RB1/(link id?)",
1663  rmw   : false,
1664  ro    : true,
1665  pulse : false,
1666};
1667
1668/// Readout counter on RB=2
1669/// CNTS_2    0xf2    0x3c8   \[23:16\]     r       Readout count on RB=2
1670pub const RB2_CNTS : MTBRegister<'static> = MTBRegister {
1671  addr  : 0xf2,
1672  mask  : 0x00ff0000,
1673  descr : "Counts on RB2/(link id?)",
1674  rmw   : false,
1675  ro    : true,
1676  pulse : false,
1677};
1678
1679/// Readout counter on RB=3
1680/// CNTS_3    0xf2    0x3c8   \[31:24\]     r       Readout count on RB=3
1681pub const RB3_CNTS : MTBRegister<'static> = MTBRegister {
1682  addr  : 0xf2,
1683  mask  : 0xff000000,
1684  descr : "Counts on RB3/(link id?)",
1685  rmw   : false,
1686  ro    : true,
1687  pulse : false,
1688};
1689
1690/// Readout counter on RB=4
1691/// CNTS_4    0xf3    0x3cc   \[7:0\]   r       Readout count on RB=4
1692pub const RB4_CNTS : MTBRegister<'static> = MTBRegister {
1693  addr  : 0xf3,
1694  mask  : 0x000000ff,
1695  descr : "Counts on RB4/(link id?)",
1696  rmw   : false,
1697  ro    : true,
1698  pulse : false,
1699};
1700
1701/// Readout counter on RB=5
1702/// CNTS_5    0xf3    0x3cc   \[15:8\]  r       Readout count on RB=5
1703pub const RB5_CNTS : MTBRegister<'static> = MTBRegister {
1704  addr  : 0xf3,
1705  mask  : 0x0000ff00,
1706  descr : "Counts on RB5/(link id?)",
1707  rmw   : false,
1708  ro    : true,
1709  pulse : false,
1710};
1711
1712/// Readout counter on RB=6
1713/// CNTS_6    0xf3    0x3cc   \[23:16\]     r       Readout count on RB=6
1714pub const RB6_CNTS : MTBRegister<'static> = MTBRegister {
1715  addr  : 0xf3,
1716  mask  : 0x00ff0000,
1717  descr : "Counts on RB6/(link id?)",
1718  rmw   : false,
1719  ro    : true,
1720  pulse : false,
1721};
1722
1723/// Readout counter on RB=7
1724/// CNTS_7    0xf3    0x3cc   \[31:24\]     r       Readout count on RB=7
1725pub const RB7_CNTS : MTBRegister<'static> = MTBRegister {
1726  addr  : 0xf3,
1727  mask  : 0xff000000,
1728  descr : "Counts on RB7/(link id?)",
1729  rmw   : false,
1730  ro    : true,
1731  pulse : false,
1732};
1733
1734/// Readout counter on RB=8
1735/// CNTS_8    0xf4    0x3d0   \[7:0\]   r       Readout count on RB=8
1736pub const RB8_CNTS : MTBRegister<'static> = MTBRegister {
1737  addr  : 0xf4,
1738  mask  : 0x000000ff,
1739  descr : "Counts on RB8/(link id?)",
1740  rmw   : false,
1741  ro    : true,
1742  pulse : false,
1743};
1744
1745/// Readout counter on RB=9
1746/// CNTS_9    0xf4    0x3d0   \[15:8\]  r       Readout count on RB=9
1747pub const RB9_CNTS : MTBRegister<'static> = MTBRegister {
1748  addr  : 0xf4,
1749  mask  : 0x0000ff00,
1750  descr : "Counts on RB9/(link id?)",
1751  rmw   : false,
1752  ro    : true,
1753  pulse : false,
1754};
1755
1756/// Readout counter on RB=10
1757/// CNTS_10   0xf4    0x3d0   \[23:16\]     r       Readout count on RB=10
1758pub const RB10_CNTS : MTBRegister<'static> = MTBRegister {
1759  addr  : 0xf4,
1760  mask  : 0x00ff0000,
1761  descr : "Counts on RB10/(link id?)",
1762  rmw   : false,
1763  ro    : true,
1764  pulse : false,
1765};
1766
1767/// Readout counter on RB=11
1768/// CNTS_11   0xf4    0x3d0   \[31:24\]     r       Readout count on RB=11
1769pub const RB11_CNTS : MTBRegister<'static> = MTBRegister {
1770  addr  : 0xf4,
1771  mask  : 0xff000000,
1772  descr : "Counts on RB11/(link id?)",
1773  rmw   : false,
1774  ro    : true,
1775  pulse : false,
1776};
1777
1778/// Readout counter on RB=12
1779/// CNTS_12   0xf5    0x3d4   \[7:0\]   r       Readout count on RB=12
1780pub const RB12_CNTS : MTBRegister<'static> = MTBRegister {
1781  addr  : 0xf5,
1782  mask  : 0x000000ff,
1783  descr : "Counts on RB12/(link id?)",
1784  rmw   : false,
1785  ro    : true,
1786  pulse : false,
1787};
1788
1789/// Readout counter on RB=13
1790/// CNTS_13   0xf5    0x3d4   \[15:8\]  r       Readout count on RB=13
1791pub const RB13_CNTS : MTBRegister<'static> = MTBRegister {
1792  addr  : 0xf5,
1793  mask  : 0x0000ff00,
1794  descr : "Counts on RB13/(link id?)",
1795  rmw   : false,
1796  ro    : true,
1797  pulse : false,
1798};
1799
1800/// Readout counter on RB=14
1801/// CNTS_14   0xf5    0x3d4   \[23:16\]     r       Readout count on RB=14
1802pub const RB14_CNTS : MTBRegister<'static> = MTBRegister {
1803  addr  : 0xf5,
1804  mask  : 0x00ff0000,
1805  descr : "Counts on RB14/(link id?)",
1806  rmw   : false,
1807  ro    : true,
1808  pulse : false,
1809};
1810
1811/// Readout counter on RB=15
1812/// CNTS_15   0xf5    0x3d4   \[31:24\]     r       Readout count on RB=15
1813pub const RB15_CNTS : MTBRegister<'static> = MTBRegister {
1814  addr  : 0xf5,
1815  mask  : 0xff000000,
1816  descr : "Counts on RB15/(link id?)",
1817  rmw   : false,
1818  ro    : true,
1819  pulse : false,
1820};
1821
1822/// Readout counter on RB=16
1823/// CNTS_16   0xf6    0x3d8   \[7:0\]   r       Readout count on RB=16
1824pub const RB16_CNTS : MTBRegister<'static> = MTBRegister {
1825  addr  : 0xf6,
1826  mask  : 0x000000ff,
1827  descr : "Counts on RB16/(link id?)",
1828  rmw   : false,
1829  ro    : true,
1830  pulse : false,
1831};
1832
1833/// Readout counter on RB=17
1834/// CNTS_17   0xf6    0x3d8   \[15:8\]  r       Readout count on RB=17
1835pub const RB17_CNTS : MTBRegister<'static> = MTBRegister {
1836  addr  : 0xf6,
1837  mask  : 0x0000ff00,
1838  descr : "Counts on RB14/(link id?)",
1839  rmw   : false,
1840  ro    : true,
1841  pulse : false,
1842};
1843
1844/// Readout counter on RB=18
1845/// CNTS_18   0xf6    0x3d8   \[23:16\]     r       Readout count on RB=18
1846pub const RB18_CNTS : MTBRegister<'static> = MTBRegister {
1847  addr  : 0xf6,
1848  mask  : 0x00ff0000,
1849  descr : "Counts on RB18/(link id?)",
1850  rmw   : false,
1851  ro    : true,
1852  pulse : false,
1853};
1854
1855/// Readout counter on RB=19
1856/// CNTS_19   0xf6    0x3d8   \[31:24\]     r       Readout count on RB=19
1857pub const RB19_CNTS : MTBRegister<'static> = MTBRegister {
1858  addr  : 0xf6,
1859  mask  : 0xff000000,
1860  descr : "Counts on RB19/(link id?)",
1861  rmw   : false,
1862  ro    : true,
1863  pulse : false,
1864};
1865
1866/// Readout counter on RB=20
1867/// CNTS_20   0xf7    0x3dc   \[7:0\]   r       Readout count on RB=20
1868pub const RB20_CNTS : MTBRegister<'static> = MTBRegister {
1869  addr  : 0xf7,
1870  mask  : 0x000000ff,
1871  descr : "Counts on RB20/(link id?)",
1872  rmw   : false,
1873  ro    : true,
1874  pulse : false,
1875};
1876
1877/// Readout counter on RB=21
1878/// CNTS_21   0xf7    0x3dc   \[15:8\]  r       Readout count on RB=21
1879pub const RB21_CNTS : MTBRegister<'static> = MTBRegister {
1880  addr  : 0xf7,
1881  mask  : 0x0000ff00,
1882  descr : "Counts on RB21/(link id?)",
1883  rmw   : false,
1884  ro    : true,
1885  pulse : false,
1886};
1887
1888/// Readout counter on RB=22
1889/// CNTS_22   0xf7    0x3dc   \[23:16\]     r       Readout count on RB=22
1890pub const RB22_CNTS : MTBRegister<'static> = MTBRegister {
1891  addr  : 0xf7,
1892  mask  : 0x00ff0000,
1893  descr : "Counts on RB22/(link id?)",
1894  rmw   : false,
1895  ro    : true,
1896  pulse : false,
1897};
1898
1899/// Readout counter on RB=23
1900/// CNTS_23   0xf7    0x3dc   \[31:24\]     r       Readout count on RB=23
1901pub const RB23_CNTS : MTBRegister<'static> = MTBRegister {
1902  addr  : 0xf7,
1903  mask  : 0xff000000,
1904  descr : "Counts on RB23/(link id?)",
1905  rmw   : false,
1906  ro    : true,
1907  pulse : false,
1908};
1909
1910/// Readout counter on RB=24
1911/// CNTS_24   0xf8    0x3e0   \[7:0\]   r       Readout count on RB=24
1912pub const RB24_CNTS : MTBRegister<'static> = MTBRegister {
1913  addr  : 0xf8,
1914  mask  : 0x000000ff,
1915  descr : "Counts on RB24/(link id?)",
1916  rmw   : false,
1917  ro    : true,
1918  pulse : false,
1919};
1920
1921/// Readout counter on RB=25
1922/// CNTS_25   0xf8    0x3e0   \[15:8\]  r       Readout count on RB=25
1923pub const RB25_CNTS : MTBRegister<'static> = MTBRegister {
1924  addr  : 0xf8,
1925  mask  : 0x0000ff00,
1926  descr : "Counts on RB25/(link id?)",
1927  rmw   : false,
1928  ro    : true,
1929  pulse : false,
1930};
1931
1932/// Readout counter on RB=26
1933/// CNTS_26   0xf8    0x3e0   \[23:16\]     r       Readout count on RB=26
1934pub const RB26_CNTS : MTBRegister<'static> = MTBRegister {
1935  addr  : 0xf8,
1936  mask  : 0x00ff0000,
1937  descr : "Counts on RB26/(link id?)",
1938  rmw   : false,
1939  ro    : true,
1940  pulse : false,
1941};
1942
1943/// Readout counter on RB=27
1944/// CNTS_27   0xf8    0x3e0   \[31:24\]     r       Readout count on RB=27
1945pub const RB27_CNTS : MTBRegister<'static> = MTBRegister {
1946  addr  : 0xf8,
1947  mask  : 0xff000000,
1948  descr : "Counts on RB27/(link id?)",
1949  rmw   : false,
1950  ro    : true,
1951  pulse : false,
1952};
1953
1954/// Readout counter on RB=28
1955/// CNTS_28   0xf9    0x3e4   \[7:0\]   r       Readout count on RB=28
1956pub const RB28_CNTS : MTBRegister<'static> = MTBRegister {
1957  addr  : 0xf9,
1958  mask  : 0x000000ff,
1959  descr : "Counts on RB28/(link id?)",
1960  rmw   : false,
1961  ro    : true,
1962  pulse : false,
1963};
1964
1965/// Readout counter on RB=29
1966/// CNTS_29   0xf9    0x3e4   \[15:8\]  r       Readout count on RB=29
1967pub const RB29_CNTS : MTBRegister<'static> = MTBRegister {
1968  addr  : 0xf9,
1969  mask  : 0x0000ff00,
1970  descr : "Counts on RB29/(link id?)",
1971  rmw   : false,
1972  ro    : true,
1973  pulse : false,
1974};
1975
1976/// Readout counter on RB=30
1977/// CNTS_30   0xf9    0x3e4   \[23:16\]     r       Readout count on RB=30
1978pub const RB30_CNTS : MTBRegister<'static> = MTBRegister {
1979  addr  : 0xf9,
1980  mask  : 0x00ff0000,
1981  descr : "Counts on RB30/(link id?)",
1982  rmw   : false,
1983  ro    : true,
1984  pulse : false,
1985};
1986
1987/// Readout counter on RB=31
1988/// CNTS_31   0xf9    0x3e4   \[31:24\]     r       Readout count on RB=31
1989pub const RB31_CNTS : MTBRegister<'static> = MTBRegister {
1990  addr  : 0xf9,
1991  mask  : 0xff000000,
1992  descr : "Counts on RB31/(link id?)",
1993  rmw   : false,
1994  ro    : true,
1995  pulse : false,
1996};
1997
1998/// Readout counter on RB=32
1999/// CNTS_32   0xfa    0x3e8   \[7:0\]   r       Readout count on RB=32
2000pub const RB32_CNTS : MTBRegister<'static> = MTBRegister {
2001  addr  : 0xfa,
2002  mask  : 0x000000ff,
2003  descr : "Counts on RB32/(link id?)",
2004  rmw   : false,
2005  ro    : true,
2006  pulse : false,
2007};
2008
2009/// Readout counter on RB=33
2010/// CNTS_33   0xfa    0x3e8   \[15:8\]  r       Readout count on RB=33
2011pub const RB33_CNTS : MTBRegister<'static> = MTBRegister {
2012  addr  : 0xfa,
2013  mask  : 0x0000ff00,
2014  descr : "Counts on RB33/(link id?)",
2015  rmw   : false,
2016  ro    : true,
2017  pulse : false,
2018};
2019
2020/// Readout counter on RB=34
2021/// CNTS_34   0xfa    0x3e8   \[23:16\]     r       Readout count on RB=34
2022pub const RB34_CNTS : MTBRegister<'static> = MTBRegister {
2023  addr  : 0xfa,
2024  mask  : 0x00ff0000,
2025  descr : "Counts on RB34/(link id?)",
2026  rmw   : false,
2027  ro    : true,
2028  pulse : false,
2029};
2030
2031/// Readout counter on RB=35
2032/// CNTS_35   0xfa    0x3e8   \[31:24\]     r       Readout count on RB=35
2033pub const RB35_CNTS : MTBRegister<'static> = MTBRegister {
2034  addr  : 0xfa,
2035  mask  : 0xff000000,
2036  descr : "Counts on RB35/(link id?)",
2037  rmw   : false,
2038  ro    : true,
2039  pulse : false,
2040};
2041
2042/// Readout counter on RB=36
2043/// CNTS_36   0xfb    0x3ec   \[7:0\]   r       Readout count on RB=36
2044pub const RB36_CNTS : MTBRegister<'static> = MTBRegister {
2045  addr  : 0xfb,
2046  mask  : 0x000000ff,
2047  descr : "Counts on RB36/(link id?)",
2048  rmw   : false,
2049  ro    : true,
2050  pulse : false,
2051};
2052
2053/// Readout counter on RB=37
2054/// CNTS_37   0xfb    0x3ec   \[15:8\]  r       Readout count on RB=37
2055pub const RB37_CNTS : MTBRegister<'static> = MTBRegister {
2056  addr  : 0xfb,
2057  mask  : 0x0000ff00,
2058  descr : "Counts on RB37/(link id?)",
2059  rmw   : false,
2060  ro    : true,
2061  pulse : false,
2062};
2063
2064/// Readout counter on RB=38
2065/// CNTS_38   0xfb    0x3ec   \[23:16\]     r       Readout count on RB=38
2066pub const RB38_CNTS : MTBRegister<'static> = MTBRegister {
2067  addr  : 0xfb,
2068  mask  : 0x00ff0000,
2069  descr : "Counts on RB38/(link id?)",
2070  rmw   : false,
2071  ro    : true,
2072  pulse : false,
2073};
2074
2075/// Readout counter on RB=39
2076/// CNTS_39   0xfb    0x3ec   \[31:24\]     r       Readout count on RB=39
2077pub const RB39_CNTS : MTBRegister<'static> = MTBRegister {
2078  addr  : 0xfb,
2079  mask  : 0xff000000,
2080  descr : "Counts on RB39/(link id?)",
2081  rmw   : false,
2082  ro    : true,
2083  pulse : false,
2084};
2085
2086/// Readout counter on RB=40
2087/// CNTS_40   0xfc    0x3f0   \[7:0\]   r       Readout count on RB=40
2088pub const RB40_CNTS : MTBRegister<'static> = MTBRegister {
2089  addr  : 0xfc,
2090  mask  : 0x000000ff,
2091  descr : "Counts on RB40/(link id?)",
2092  rmw   : false,
2093  ro    : true,
2094  pulse : false,
2095};
2096
2097/// Readout counter on RB=41
2098/// CNTS_41   0xfc    0x3f0   \[15:8\]  r       Readout count on RB=41
2099pub const RB41_CNTS : MTBRegister<'static> = MTBRegister {
2100  addr  : 0xfc,
2101  mask  : 0x0000ff00,
2102  descr : "Counts on RB41/(link id?)",
2103  rmw   : false,
2104  ro    : true,
2105  pulse : false,
2106};
2107
2108/// Readout counter on RB=42
2109/// CNTS_42   0xfc    0x3f0   \[23:16\]     r       Readout count on RB=42
2110pub const RB42_CNTS : MTBRegister<'static> = MTBRegister {
2111  addr  : 0xfc,
2112  mask  : 0x00ff0000,
2113  descr : "Counts on RB42/(link id?)",
2114  rmw   : false,
2115  ro    : true,
2116  pulse : false,
2117};
2118
2119/// Readout counter on RB=43
2120/// CNTS_43   0xfc    0x3f0   \[31:24\]     r       Readout count on RB=43
2121pub const RB43_CNTS : MTBRegister<'static> = MTBRegister {
2122  addr  : 0xfc,
2123  mask  : 0xff000000,
2124  descr : "Counts on RB43/(link id?)",
2125  rmw   : false,
2126  ro    : true,
2127  pulse : false,
2128};
2129
2130/// Readout counter on RB=44
2131/// CNTS_44   0xfd    0x3f4   \[7:0\]   r       Readout count on RB=44
2132pub const RB44_CNTS : MTBRegister<'static> = MTBRegister {
2133  addr  : 0xfd,
2134  mask  : 0x000000ff,
2135  descr : "Counts on RB44/(link id?)",
2136  rmw   : false,
2137  ro    : true,
2138  pulse : false,
2139};
2140
2141/// Readout counter on RB=45
2142/// CNTS_45   0xfd    0x3f4   \[15:8\]  r       Readout count on RB=45
2143pub const RB45_CNTS : MTBRegister<'static> = MTBRegister {
2144  addr  : 0xfd,
2145  mask  : 0x0000ff00,
2146  descr : "Counts on RB45/(link id?)",
2147  rmw   : false,
2148  ro    : true,
2149  pulse : false,
2150};
2151
2152/// Readout counter on RB=46
2153/// CNTS_46   0xfd    0x3f4   \[23:16\]     r       Readout count on RB=46
2154pub const RB46_CNTS : MTBRegister<'static> = MTBRegister {
2155  addr  : 0xfd,
2156  mask  : 0x00ff0000,
2157  descr : "Counts on RB46/(link id?)",
2158  rmw   : false,
2159  ro    : true,
2160  pulse : false,
2161};
2162
2163
2164/// Readout counter on RB=47
2165/// CNTS_47   0xfd    0x3f4   \[31:24\]     r       Readout count on RB=47
2166pub const RB47_CNTS : MTBRegister<'static> = MTBRegister {
2167  addr  : 0xfd,
2168  mask  : 0xff000000,
2169  descr : "Counts on RB47/(link id?)",
2170  rmw   : false,
2171  ro    : true,
2172  pulse : false,
2173};
2174
2175
2176/// Readout counter on RB=48
2177/// CNTS_48   0xfe    0x3f8   \[7:0\]   r       Readout count on RB=48
2178pub const RB48_CNTS : MTBRegister<'static> = MTBRegister {
2179  addr  : 0xfe,
2180  mask  : 0x000000ff,
2181  descr : "Counts on RB48/(link id?)",
2182  rmw   : false,
2183  ro    : true,
2184  pulse : false,
2185};
2186
2187/// Readout counter on RB=49
2188/// CNTS_49   0xfe    0x3f8   \[15:8\]  r       Readout count on RB=49
2189pub const RB49_CNTS : MTBRegister<'static> = MTBRegister {
2190  addr  : 0xfe,
2191  mask  : 0x0000ff00,
2192  descr : "Counts on RB49/(link id?)",
2193  rmw   : false,
2194  ro    : true,
2195  pulse : false,
2196};
2197
2198/// Reset RB counters 0-49
2199/// RESET     0xff    0x3fc   0   w   Pulse   Write 1 to reset hit counters.
2200pub const RB_CNTS_RESET : MTBRegister<'static> = MTBRegister {
2201  addr  : 0xff,
2202  mask  : 0x00000001,
2203  descr : "Reset RB counters 1-49",
2204  rmw   : false,
2205  ro    : false,
2206  pulse : true,
2207};
2208
2209/// Snap RB counters 0-49
2210/// SNAP  0x100   0x400   0   rw  0x1     1 to snap the hit counters.
2211pub const RB_CNTS_SNAP : MTBRegister<'static> = MTBRegister {
2212  addr  : 0x100,
2213  mask  : 0x00000001,
2214  descr : "Snap RB counters 1-49",
2215  rmw   : true,
2216  ro    : false,
2217  pulse : false,
2218};
2219
2220/// Set fire bits for LTB Ch 0-24
2221/// CH_0_24     0x101   0x404   \[24:0\]    rw  0x0
2222pub const CH_0_24  : MTBRegister<'static> = MTBRegister  {
2223  addr  : 0x101,
2224  mask  : 0x1ffffff,
2225  descr : "Set fire bits for LTB ch 0-24",
2226  rmw   : true, 
2227  ro    : false,
2228  pulse : false,
2229};
2230
2231/// CH_25_49    0x102   0x408   \[24:0\]    rw 0x0
2232pub const CH_25_49  : MTBRegister<'static> = MTBRegister  {
2233  addr  : 0x102,
2234  mask  : 0x1ffffff,
2235  descr : "Set fire bit for LTB ch 25-49",
2236  rmw   : true, 
2237  ro    : false, 
2238  pulse : false, 
2239};
2240
2241/// CH_50_74    0x103   0x40c   rw  \[24:0\]    0x0
2242pub const CH_50_74  : MTBRegister<'static>  = MTBRegister  {
2243  addr  : 0x103,
2244  mask  : 0x1ffffff,
2245  descr : "Set fire bit for LTB ch 50-74",
2246  rmw   : true, 
2247  ro    : false, 
2248  pulse : false
2249};
2250
2251/// CH_75_99    0x104   0x410   
2252pub const CH_75_99  :  MTBRegister<'static> = MTBRegister  {
2253  addr  : 0x104,
2254  mask  : 0x1ffffff,
2255  descr : "Set fire bit for LTB ch 75-99",
2256  rmw   : true,
2257  ro    : false, 
2258  pulse : false,
2259};
2260
2261/// CH_100_124  0x105   0x414
2262pub const CH_100_124  : MTBRegister<'static> = MTBRegister  {
2263  addr  : 0x105,
2264  mask  : 0x1ffffff,
2265  descr : "Set fire bit for DSI ch 100-124",
2266  rmw   : true, 
2267  ro    : false, 
2268  pulse : false
2269};
2270
2271/// CH_125_149  0x106   0x418   
2272pub const CH_125_149  :  MTBRegister<'static> = MTBRegister  {
2273  addr  : 0x106,
2274  mask  : 0x1ffffff,
2275  descr : "Set fire bit for DSI ch 125-149",
2276  rmw   : true,
2277  ro    : false, 
2278  pulse : false
2279};
2280
2281/// CH_150_174  0x107
2282pub const CH_150_174  : MTBRegister<'static> = MTBRegister {
2283  addr  : 0x107,
2284  mask  : 0x1ffffff,
2285  descr : "Set fire bit for DSI ch 150-174",
2286  rmw   : true, 
2287  ro    : false, 
2288  pulse : false
2289};
2290
2291///CH 175-199    0x108
2292pub const CH_175_199  :  MTBRegister<'static> = MTBRegister  {
2293  addr  : 0x108, 
2294  mask  : 0x1ffffff,
2295  descr : "Set fire bit for DSI ch 175-199",
2296  rmw   : true, 
2297  ro    : false, 
2298  pulse : false
2299};
2300
2301/// Add the central track trigger to all triggers
2302/// TRACK_CENTRAL_IS_GLOBAL   0xb     0x2c    2   rw  0x0     1 makes the TRACK central read all paddles.
2303pub const TRACK_CENTRAL_IS_GLOBAL : MTBRegister<'static> = MTBRegister {
2304  addr  : 0xb,
2305  mask  : 0x4,
2306  descr : "1 makes the TRACK central read all paddles",
2307  rmw   : true,
2308  ro    : false,
2309  pulse : false,
2310};
2311
2312/// Add the umbrella central track trigger to all triggers
2313/// TRACK_UMB_CENTRAL_IS_GLOBAL 	0xb 	0x2c 	3 	rw 	0x0 	1 makes the TRACK UMB central read all paddles.
2314pub const TRACK_UMB_CENTRAL_IS_GLOBAL : MTBRegister<'static> = MTBRegister {
2315  addr  : 0xb,
2316  mask  : 0x8,
2317  descr : "1 makes the TRACK UMB CENTRAL trigger read all paddles",
2318  rmw   : true,
2319  ro    : false,
2320  pulse : false,
2321};
2322
2323/// Add the track trigger to all triggers
2324/// TRACE_TRIG_IS_GLOBAL 0xb 0x2c 1 rw 0x0
2325pub const TRACK_TRIG_IS_GLOBAL : MTBRegister<'static> = MTBRegister {
2326  addr  : 0xb,
2327  mask  : 0x2,
2328  descr : "1 makes the TRACK trigger read all paddles",
2329  rmw   : true,
2330  ro    : false,
2331  pulse : false,
2332};
2333
2334/// Add any trigger to all triggers
2335/// ANY_TRIG_IS_GLOBAL 0xb 0x2c 0 rw 0x0
2336pub const ANY_TRIG_IS_GLOBAL : MTBRegister<'static> = MTBRegister {
2337  addr  : 0xb,
2338  mask  : 0x1,
2339  descr : "1 makes the ANY trigger read all paddles",
2340  rmw   : true,
2341  ro    : false,
2342  pulse : false,
2343};
2344
2345/// Choose between the 2 different TIU links
2346/// 1 for J11, 0 for J3
2347/// 0xe     0x38    1   rw  0x0     1 to use J11; 0 to use J3
2348pub const TIU_USE_AUX_LINK : MTBRegister<'static> = MTBRegister {
2349  addr  : 0xe,
2350  mask  : 0x2,
2351  descr : "Choose between the 2 tiu links",
2352  rmw   : true,
2353  ro    : false,
2354  pulse : false,
2355};
2356
2357///TRIG_GEN_RATE     0x9     0x24    \[31:0\]  rw  0x0     Rate of generated triggers f_trig = (1/clk_period) * rate/0xffffffff
2358/// Set a random forced trigger
2359pub const TRIG_GEN_RATE : MTBRegister<'static> = MTBRegister {
2360  addr  : 0x9,
2361  mask  : 0xffffffff,
2362  descr : "Set a forced trigger (1/clk_period) * rate/0xffffffff",
2363  rmw   : false,
2364  ro    : false,
2365  pulse : false,
2366};
2367
2368///ETH_RX_BAD_FRAME_CNT     0x3d    0xf4    \[15:0\]    Ethernet MAC bad frame error
2369pub const ETH_RX_BAD_FRAME_CNT  : MTBRegister<'static> = MTBRegister {
2370  addr  : 0x3d,
2371  mask  : 0xffff,
2372  descr : "Ethernet MAC bad frame error",
2373  rmw   : false,
2374  ro    : true, 
2375  pulse : false,
2376};
2377
2378///ETH_RX_BAD_FCS_CNT   0x3d    0xf4    \[31:16\]   Ethernet MAC bad fcs
2379pub const ETH_RX_BAD_FCS_CNT  : MTBRegister<'static> = MTBRegister {
2380  addr  : 0x3d,
2381  mask  : 0xffff0000,
2382  descr : "Ethernet MAC bad fcs", 
2383  rmw   : false,
2384  ro    : true, 
2385  pulse : false,
2386};
2387
2388/// RESYNC    0xa     0x28    0   w   Pulse   Write 1 to resync
2389/// This will synchronize the RB and MTB clocks and should be issued 
2390/// at run start.
2391pub const RESYNC  : MTBRegister<'static> = MTBRegister {
2392  addr  : 0xa,
2393  mask  : 0x00000001,
2394  descr : "Write 1 to RESYNC RB clocks",
2395  rmw   : false, 
2396  ro    : false, 
2397  pulse : true,
2398};
2399// All the trigger settings
2400
2401// .... WIP!!! So many are not implemented yet....
2402
2403//LOOPBACK  0x0     0x0     [31:0]  rw  0x0     Loopback register
2404//CLOCK_RATE    0x1     0x4     [31:0]  r       System clock frequency
2405//FB_CLOCK_RATE_0   0x2     0x8     [31:0]  r       Feedback clock frequency
2406//FB_CLOCK_RATE_1   0x3     0xc     [31:0]  r       Feedback clock frequency
2407//FB_CLOCK_RATE_2   0x4     0x10    [31:0]  r       Feedback clock frequency
2408//FB_CLOCK_RATE_3   0x5     0x14    [31:0]  r       Feedback clock frequency
2409//FB_CLOCK_RATE_4   0x6     0x18    [31:0]  r       Feedback clock frequency
2410//DSI_ON    0x7     0x1c    [4:0]   rw  0x1F    Bitmask 1 = enable DSI
2411//RESYNC    0xa     0x28    0   w   Pulse   Write 1 to resync
2412//ANY_TRIG_IS_GLOBAL    0xb     0x2c    0   rw  0x0     1 makes the ANY trigger read all paddles.
2413//TRACK_TRIG_IS_GLOBAL  0xb     0x2c    1   rw  0x0     1 makes the TRACK trigger read all paddles.
2414//TRACK_CENTRAL_IS_GLOBAL   0xb     0x2c    2   rw  0x0     1 makes the TRACK central read all paddles.
2415//TRACK_CENTRAL_IS_GLOBAL   0xb     0x2c    2   rw  0x0     1 makes the TRACK central read all paddles.
2416//TIU_EMU_BUSY_CNT  0xe     0x38    [31:14]     rw  0xC350  Number of 10 ns clock cyles that the emulator will remain busy
2417//TIU_BAD   0xf     0x3c    0   r       1 means that the tiu link is not working
2418//LT_INPUT_STRETCH  0xf     0x3c    [7:4]   rw  0xF     Number of clock cycles to stretch the LT inputs by
2419//MT.EVENT_QUEUE
2420//
2421//DAQ Buffer
2422//Node  Adr     Adr8    Bits    Perm    Def     Description
2423//RESET     0x10    0x40    0   w   Pulse   DAQ Buffer Reset
2424//DATA  0x11    0x44    [31:0]  r       DAQ Read Data
2425//FULL  0x12    0x48    0   r       DAQ Buffer Full
2426//EMPTY     0x12    0x48    1   r       DAQ Buffer Empty
2427//SIZE  0x13    0x4c    [31:16]     r       DAQ Buffer Head Event Size
2428//
2429//MT
2430//
2431//
2432//MT.HIT_COUNTERS
2433//
2434//Counters
2435//Node  Adr     Adr8    Bits    Perm    Def     Description
2436//LT0   0x20    0x80    [23:0]  r       hit count on LT=0
2437//LT1   0x21    0x84    [23:0]  r       hit count on LT=1
2438//LT2   0x22    0x88    [23:0]  r       hit count on LT=2
2439//LT3   0x23    0x8c    [23:0]  r       hit count on LT=3
2440//LT4   0x24    0x90    [23:0]  r       hit count on LT=4
2441//LT5   0x25    0x94    [23:0]  r       hit count on LT=5
2442//LT6   0x26    0x98    [23:0]  r       hit count on LT=6
2443//LT7   0x27    0x9c    [23:0]  r       hit count on LT=7
2444//LT8   0x28    0xa0    [23:0]  r       hit count on LT=8
2445//LT9   0x29    0xa4    [23:0]  r       hit count on LT=9
2446//LT10  0x2a    0xa8    [23:0]  r       hit count on LT=10
2447//LT11  0x2b    0xac    [23:0]  r       hit count on LT=11
2448//LT12  0x2c    0xb0    [23:0]  r       hit count on LT=12
2449//LT13  0x2d    0xb4    [23:0]  r       hit count on LT=13
2450//LT14  0x2e    0xb8    [23:0]  r       hit count on LT=14
2451//LT15  0x2f    0xbc    [23:0]  r       hit count on LT=15
2452//LT16  0x30    0xc0    [23:0]  r       hit count on LT=16
2453//LT17  0x31    0xc4    [23:0]  r       hit count on LT=17
2454//LT18  0x32    0xc8    [23:0]  r       hit count on LT=18
2455//LT19  0x33    0xcc    [23:0]  r       hit count on LT=19
2456//LT20  0x34    0xd0    [23:0]  r       hit count on LT=20
2457//LT21  0x35    0xd4    [23:0]  r       hit count on LT=21
2458//LT22  0x36    0xd8    [23:0]  r       hit count on LT=22
2459//LT23  0x37    0xdc    [23:0]  r       hit count on LT=23
2460//LT24  0x38    0xe0    [23:0]  r       hit count on LT=24
2461//RESET     0x39    0xe4    0   w   Pulse   Write 1 to reset hit counters.
2462//SNAP  0x3a    0xe8    0   rw  0x1     1 to snap the hit counters.
2463//
2464//MT
2465//
2466//Implements various control and monitoring functions of the DRS Logic
2467//Node  Adr     Adr8    Bits    Perm    Def     Description
2468//ETH_RX_BAD_FRAME_CNT  0x3d    0xf4    [15:0]  r       Ethernet MAC bad frame error
2469
2470
2471//ETH_RX_BAD_FCS_CNT   0x3d    0xf4    [31:16]     r       Ethernet MAC bad fcs
2472//
2473//MT.CHANNEL_MASK
2474//
2475//1 to mask a channel
2476//Node  Adr     Adr8    Bits    Perm    Def     Description
2477//LT0   0x50    0x140   [7:0]   rw  0x0     1 to mask a channel of LT=0
2478//LT1   0x51    0x144   [7:0]   rw  0x0     1 to mask a channel of LT=1
2479//LT2   0x52    0x148   [7:0]   rw  0x0     1 to mask a channel of LT=2
2480//LT3   0x53    0x14c   [7:0]   rw  0x0     1 to mask a channel of LT=3
2481//LT4   0x54    0x150   [7:0]   rw  0x0     1 to mask a channel of LT=4
2482//LT5   0x55    0x154   [7:0]   rw  0x0     1 to mask a channel of LT=5
2483//LT6   0x56    0x158   [7:0]   rw  0x0     1 to mask a channel of LT=6
2484//LT7   0x57    0x15c   [7:0]   rw  0x0     1 to mask a channel of LT=7
2485//LT8   0x58    0x160   [7:0]   rw  0x0     1 to mask a channel of LT=8
2486//LT9   0x59    0x164   [7:0]   rw  0x0     1 to mask a channel of LT=9
2487//LT10  0x5a    0x168   [7:0]   rw  0x0     1 to mask a channel of LT=10
2488//LT11  0x5b    0x16c   [7:0]   rw  0x0     1 to mask a channel of LT=11
2489//LT12  0x5c    0x170   [7:0]   rw  0x0     1 to mask a channel of LT=12
2490//LT13  0x5d    0x174   [7:0]   rw  0x0     1 to mask a channel of LT=13
2491//LT14  0x5e    0x178   [7:0]   rw  0x0     1 to mask a channel of LT=14
2492//LT15  0x5f    0x17c   [7:0]   rw  0x0     1 to mask a channel of LT=15
2493//LT16  0x60    0x180   [7:0]   rw  0x0     1 to mask a channel of LT=16
2494//LT17  0x61    0x184   [7:0]   rw  0x0     1 to mask a channel of LT=17
2495//LT18  0x62    0x188   [7:0]   rw  0x0     1 to mask a channel of LT=18
2496//LT19  0x63    0x18c   [7:0]   rw  0x0     1 to mask a channel of LT=19
2497//LT20  0x64    0x190   [7:0]   rw  0x0     1 to mask a channel of LT=20
2498//LT21  0x65    0x194   [7:0]   rw  0x0     1 to mask a channel of LT=21
2499//LT22  0x66    0x198   [7:0]   rw  0x0     1 to mask a channel of LT=22
2500//LT23  0x67    0x19c   [7:0]   rw  0x0     1 to mask a channel of LT=23
2501//LT24  0x68    0x1a0   [7:0]   rw  0x0     1 to mask a channel of LT=24
2502//
2503//MT.COARSE_DELAYS
2504//Node  Adr     Adr8    Bits    Perm    Def     Description
2505//LT0   0xc0    0x300   [3:0]   rw  0x0     Integer clock delay of LT LINK 0
2506//LT1   0xc1    0x304   [3:0]   rw  0x0     Integer clock delay of LT LINK 1
2507//LT2   0xc2    0x308   [3:0]   rw  0x0     Integer clock delay of LT LINK 2
2508//LT3   0xc3    0x30c   [3:0]   rw  0x0     Integer clock delay of LT LINK 3
2509//LT4   0xc4    0x310   [3:0]   rw  0x0     Integer clock delay of LT LINK 4
2510//LT5   0xc5    0x314   [3:0]   rw  0x0     Integer clock delay of LT LINK 5
2511//LT6   0xc6    0x318   [3:0]   rw  0x0     Integer clock delay of LT LINK 6
2512//LT7   0xc7    0x31c   [3:0]   rw  0x0     Integer clock delay of LT LINK 7
2513//LT8   0xc8    0x320   [3:0]   rw  0x0     Integer clock delay of LT LINK 8
2514//LT9   0xc9    0x324   [3:0]   rw  0x0     Integer clock delay of LT LINK 9
2515//LT10  0xca    0x328   [3:0]   rw  0x0     Integer clock delay of LT LINK 10
2516//LT11  0xcb    0x32c   [3:0]   rw  0x0     Integer clock delay of LT LINK 11
2517//LT12  0xcc    0x330   [3:0]   rw  0x0     Integer clock delay of LT LINK 12
2518//LT13  0xcd    0x334   [3:0]   rw  0x0     Integer clock delay of LT LINK 13
2519//LT14  0xce    0x338   [3:0]   rw  0x0     Integer clock delay of LT LINK 14
2520//LT15  0xcf    0x33c   [3:0]   rw  0x0     Integer clock delay of LT LINK 15
2521//LT16  0xd0    0x340   [3:0]   rw  0x0     Integer clock delay of LT LINK 16
2522//LT17  0xd1    0x344   [3:0]   rw  0x0     Integer clock delay of LT LINK 17
2523//LT18  0xd2    0x348   [3:0]   rw  0x0     Integer clock delay of LT LINK 18
2524//LT19  0xd3    0x34c   [3:0]   rw  0x0     Integer clock delay of LT LINK 19
2525//LT20  0xd4    0x350   [3:0]   rw  0x0     Integer clock delay of LT LINK 20
2526//LT21  0xd5    0x354   [3:0]   rw  0x0     Integer clock delay of LT LINK 21
2527//LT22  0xd6    0x358   [3:0]   rw  0x0     Integer clock delay of LT LINK 22
2528//LT23  0xd7    0x35c   [3:0]   rw  0x0     Integer clock delay of LT LINK 23
2529//LT24  0xd8    0x360   [3:0]   rw  0x0     Integer clock delay of LT LINK 24
2530//LT25  0xd9    0x364   [3:0]   rw  0x0     Integer clock delay of LT LINK 25
2531//LT26  0xda    0x368   [3:0]   rw  0x0     Integer clock delay of LT LINK 26
2532//LT27  0xdb    0x36c   [3:0]   rw  0x0     Integer clock delay of LT LINK 27
2533//LT28  0xdc    0x370   [3:0]   rw  0x0     Integer clock delay of LT LINK 28
2534//LT29  0xdd    0x374   [3:0]   rw  0x0     Integer clock delay of LT LINK 29
2535//LT30  0xde    0x378   [3:0]   rw  0x0     Integer clock delay of LT LINK 30
2536//LT31  0xdf    0x37c   [3:0]   rw  0x0     Integer clock delay of LT LINK 31
2537//LT32  0xe0    0x380   [3:0]   rw  0x0     Integer clock delay of LT LINK 32
2538//LT33  0xe1    0x384   [3:0]   rw  0x0     Integer clock delay of LT LINK 33
2539//LT34  0xe2    0x388   [3:0]   rw  0x0     Integer clock delay of LT LINK 34
2540//LT35  0xe3    0x38c   [3:0]   rw  0x0     Integer clock delay of LT LINK 35
2541//LT36  0xe4    0x390   [3:0]   rw  0x0     Integer clock delay of LT LINK 36
2542//LT37  0xe5    0x394   [3:0]   rw  0x0     Integer clock delay of LT LINK 37
2543//LT38  0xe6    0x398   [3:0]   rw  0x0     Integer clock delay of LT LINK 38
2544//LT39  0xe7    0x39c   [3:0]   rw  0x0     Integer clock delay of LT LINK 39
2545//LT40  0xe8    0x3a0   [3:0]   rw  0x0     Integer clock delay of LT LINK 40
2546//LT41  0xe9    0x3a4   [3:0]   rw  0x0     Integer clock delay of LT LINK 41
2547//LT42  0xea    0x3a8   [3:0]   rw  0x0     Integer clock delay of LT LINK 42
2548//LT43  0xeb    0x3ac   [3:0]   rw  0x0     Integer clock delay of LT LINK 43
2549//LT44  0xec    0x3b0   [3:0]   rw  0x0     Integer clock delay of LT LINK 44
2550//LT45  0xed    0x3b4   [3:0]   rw  0x0     Integer clock delay of LT LINK 45
2551//LT46  0xee    0x3b8   [3:0]   rw  0x0     Integer clock delay of LT LINK 46
2552//LT47  0xef    0x3bc   [3:0]   rw  0x0     Integer clock delay of LT LINK 47
2553//LT48  0xf0    0x3c0   [3:0]   rw  0x0     Integer clock delay of LT LINK 48
2554//LT49  0xf1    0x3c4   [3:0]   rw  0x0     Integer clock delay of LT LINK 49
2555//
2556//MT.RB_READOUT_CNTS
2557//
2558//Counters
2559//Node  Adr     Adr8    Bits    Perm    Def     Description
2560//CNTS_0    0xf2    0x3c8   [7:0]   r       Readout count on RB=0
2561//CNTS_1    0xf2    0x3c8   [15:8]  r       Readout count on RB=1
2562//CNTS_2    0xf2    0x3c8   [23:16]     r       Readout count on RB=2
2563//CNTS_3    0xf2    0x3c8   [31:24]     r       Readout count on RB=3
2564//CNTS_4    0xf3    0x3cc   [7:0]   r       Readout count on RB=4
2565//CNTS_5    0xf3    0x3cc   [15:8]  r       Readout count on RB=5
2566//CNTS_6    0xf3    0x3cc   [23:16]     r       Readout count on RB=6
2567//CNTS_7    0xf3    0x3cc   [31:24]     r       Readout count on RB=7
2568//CNTS_8    0xf4    0x3d0   [7:0]   r       Readout count on RB=8
2569//CNTS_9    0xf4    0x3d0   [15:8]  r       Readout count on RB=9
2570//CNTS_10   0xf4    0x3d0   [23:16]     r       Readout count on RB=10
2571//CNTS_11   0xf4    0x3d0   [31:24]     r       Readout count on RB=11
2572//CNTS_12   0xf5    0x3d4   [7:0]   r       Readout count on RB=12
2573//CNTS_13   0xf5    0x3d4   [15:8]  r       Readout count on RB=13
2574//CNTS_14   0xf5    0x3d4   [23:16]     r       Readout count on RB=14
2575//CNTS_15   0xf5    0x3d4   [31:24]     r       Readout count on RB=15
2576//CNTS_16   0xf6    0x3d8   [7:0]   r       Readout count on RB=16
2577//CNTS_17   0xf6    0x3d8   [15:8]  r       Readout count on RB=17
2578//CNTS_18   0xf6    0x3d8   [23:16]     r       Readout count on RB=18
2579//CNTS_19   0xf6    0x3d8   [31:24]     r       Readout count on RB=19
2580//CNTS_20   0xf7    0x3dc   [7:0]   r       Readout count on RB=20
2581//CNTS_21   0xf7    0x3dc   [15:8]  r       Readout count on RB=21
2582//CNTS_22   0xf7    0x3dc   [23:16]     r       Readout count on RB=22
2583//CNTS_23   0xf7    0x3dc   [31:24]     r       Readout count on RB=23
2584//CNTS_24   0xf8    0x3e0   [7:0]   r       Readout count on RB=24
2585//CNTS_25   0xf8    0x3e0   [15:8]  r       Readout count on RB=25
2586//CNTS_26   0xf8    0x3e0   [23:16]     r       Readout count on RB=26
2587//CNTS_27   0xf8    0x3e0   [31:24]     r       Readout count on RB=27
2588//CNTS_28   0xf9    0x3e4   [7:0]   r       Readout count on RB=28
2589//CNTS_29   0xf9    0x3e4   [15:8]  r       Readout count on RB=29
2590//CNTS_30   0xf9    0x3e4   [23:16]     r       Readout count on RB=30
2591//CNTS_31   0xf9    0x3e4   [31:24]     r       Readout count on RB=31
2592//CNTS_32   0xfa    0x3e8   [7:0]   r       Readout count on RB=32
2593//CNTS_33   0xfa    0x3e8   [15:8]  r       Readout count on RB=33
2594//CNTS_34   0xfa    0x3e8   [23:16]     r       Readout count on RB=34
2595//CNTS_35   0xfa    0x3e8   [31:24]     r       Readout count on RB=35
2596//CNTS_36   0xfb    0x3ec   [7:0]   r       Readout count on RB=36
2597//CNTS_37   0xfb    0x3ec   [15:8]  r       Readout count on RB=37
2598//CNTS_38   0xfb    0x3ec   [23:16]     r       Readout count on RB=38
2599//CNTS_39   0xfb    0x3ec   [31:24]     r       Readout count on RB=39
2600//CNTS_40   0xfc    0x3f0   [7:0]   r       Readout count on RB=40
2601//CNTS_41   0xfc    0x3f0   [15:8]  r       Readout count on RB=41
2602//CNTS_42   0xfc    0x3f0   [23:16]     r       Readout count on RB=42
2603//CNTS_43   0xfc    0x3f0   [31:24]     r       Readout count on RB=43
2604//CNTS_44   0xfd    0x3f4   [7:0]   r       Readout count on RB=44
2605//CNTS_45   0xfd    0x3f4   [15:8]  r       Readout count on RB=45
2606//CNTS_46   0xfd    0x3f4   [23:16]     r       Readout count on RB=46
2607//CNTS_47   0xfd    0x3f4   [31:24]     r       Readout count on RB=47
2608//CNTS_48   0xfe    0x3f8   [7:0]   r       Readout count on RB=48
2609//CNTS_49   0xfe    0x3f8   [15:8]  r       Readout count on RB=49
2610//RESET     0xff    0x3fc   0   w   Pulse   Write 1 to reset hit counters.
2611//SNAP  0x100   0x400   0   rw  0x1     1 to snap the hit counters.
2612//
2613//MT.PULSER
2614//
2615//LTB Channel Pulser
2616//Node  Adr     Adr8    Bits    Perm    Def     Description
2617//FIRE  0x100   0x400   0   w   Pulse   Write 1 to Fire the Pulser.
2618//CH_0_24   0x101   0x404   [24:0]  rw  0x0     Set fire bits for channels 0 to 24
2619//CH_25_49  0x102   0x408   [24:0]  rw  0x0     Set fire bits for channels 25 to 49
2620//CH_50_74  0x103   0x40c   [24:0]  rw  0x0     Set fire bits for channels 50 to 74
2621//CH_75_99  0x104   0x410   [24:0]  rw  0x0     Set fire bits for channels 75 to 99
2622//CH_100_124    0x105   0x414   [24:0]  rw  0x0     Set fire bits for channels 100 to 124
2623//CH_125_149    0x106   0x418   [24:0]  rw  0x0     Set fire bits for channels 125 to 149
2624//CH_150_174    0x107   0x41c   [24:0]  rw  0x0     Set fire bits for channels 150 to 174
2625//CH_175_199    0x108   0x420   [24:0]  rw  0x0     Set fire bits for channels 175 to 199
2626//
2627//MT.XADC
2628//
2629//Zynq XADC
2630//Node  Adr     Adr8    Bits    Perm    Def     Description
2631//CALIBRATION   0x120   0x480   [11:0]  r       XADC Calibration
2632//VCCPINT   0x120   0x480   [27:16]     r       XADC vccpint
2633//VCCPAUX   0x121   0x484   [11:0]  r       XADC Calibration
2634//VCCODDR   0x121   0x484   [27:16]     r       XADC vccoddr
2635//TEMP  0x122   0x488   [11:0]  r       XADC Temperature
2636//VCCINT    0x122   0x488   [27:16]     r       XADC vccint
2637//VCCAUX    0x123   0x48c   [11:0]  r       XADC VCCAUX
2638//VCCBRAM   0x123   0x48c   [27:16]     r       XADC vccbram
2639//
2640//MT.HOG
2641//
2642//HOG Parameters
2643//Node  Adr     Adr8    Bits    Perm    Def     Description
2644//GLOBAL_DATE   0x200   0x800   [31:0]  r       HOG Global Date
2645//GLOBAL_TIME   0x201   0x804   [31:0]  r       HOG Global Time
2646//GLOBAL_VER    0x202   0x808   [31:0]  r       HOG Global Version
2647//GLOBAL_SHA    0x203   0x80c   [31:0]  r       HOG Global SHA
2648//TOP_SHA   0x204   0x810   [31:0]  r       HOG Top SHA
2649//TOP_VER   0x205   0x814   [31:0]  r       HOG Top Version
2650//HOG_SHA   0x206   0x818   [31:0]  r       HOG SHA
2651//HOG_VER   0x207   0x81c   [31:0]  r       HOG Version
2652//Module SPI adr = 0x1000
2653//
2654//SPI
2655//Node  Adr     Adr8    Bits    Perm    Def     Description
2656//d0    0x1000  0x4000  [31:0]  rw  ~~  Data reg 0
2657//d1    0x1001  0x4004  [31:0]  rw  ~~  Data reg 1
2658//d2    0x1002  0x4008  [31:0]  rw  ~~  Data reg 2
2659//d3    0x1003  0x400c  [31:0]  rw  ~~  Data reg 3
2660//ctrl  0x1004  0x4010  [31:0]  rw  ~~  Control reg
2661//divider   0x1005  0x4014  [31:0]  rw  ~~  Clock divider reg
2662//ss    0x1006  0x4018  [31:0]  rw  ~~  Slave select reg
2663//Module I2C adr = 0x1100
2664//
2665//I2C master controller
2666//
2667//I2C
2668//
2669//I2C master controller
2670//Node  Adr     Adr8    Bits    Perm    Def     Description
2671//ps_lo     0x1100  0x4400  [7:0]   rw  ~~  Prescale low byte
2672//ps_hi     0x1101  0x4404  [7:0]   rw  ~~  Prescale low byte
2673//ctrl  0x1102  0x4408  [7:0]   rw  ~~  Control
2674//data  0x1103  0x440c  [7:0]   rw  ~~  Data
2675//cmd_stat  0x1104  0x4410  [7:0]   rw  ~~  Command / status
2676
2677
2678