ICP  1
env_period_registers_dae3.h
Go to the documentation of this file.
1 #ifndef ENV_PERIOD_REGISTERS_DAE3_H
2 #define ENV_PERIOD_REGISTERS_DAE3_H
3 
5 {
6 protected:
7  static const std::string env_period_policy_name;
8 //static const unsigned ECMEMSTART = 0x0;
9 
10 static const unsigned FCOUNTR = 0x00;
11 static const unsigned FCOUNTG = 0x04;
12 static const unsigned PCOUNTR0 = 0x08;
13 static const unsigned PCOUNTR1 = 0x0C;
14 static const unsigned PCOUNTG0 = 0x10;
15 static const unsigned PCOUNTG1 = 0x14;
16 static const unsigned SCHPULSE = 0x18;
17 
18 static const unsigned FIFOVETFRM = 0x100;
19 static const unsigned SMPVETFRM = 0x104;
20 static const unsigned INTVETFRM = 0x108;
21 static const unsigned TS2PVETFRM = 0x110;
22 static const unsigned WPULVETFRM = 0x114;
23 static const unsigned HZ50VETFRM = 0x118;
24 static const unsigned MSMVETFRM = 0x11C;
25 static const unsigned EXTPEROVFVC = 0x120;
26 
27 static const unsigned EXT0VETFRM = 0x130;
28 static const unsigned EXT1VETFRM = 0x134;
29 static const unsigned EXT2VETFRM = 0x138;
30 static const unsigned EXT3VETFRM = 0x13C;
31 
32 static const unsigned FC0VETFRM = 0x150;
33 static const unsigned FC1VETFRM = 0x154;
34 static const unsigned FC2VETFRM = 0x158;
35 static const unsigned FC3VETFRM = 0x15C;
36 
37 // get 210 ns for free
38 // must have at least 1 us delay
39 static const unsigned FSDELAY = 0x200;
40 
41 // these are for the MAPS fast fermi chopper veto
42 // all widths and delays are in 20ns steps
43 // all registers are 32 bit, big endian
44 static const unsigned FC0WINDLY = 0x204;
45 static const unsigned FC0WINWTH = 0x208;
46 static const unsigned FC1WINDLY = 0x20C;
47 static const unsigned FC1WINWTH = 0x210;
48 static const unsigned FC2WINDLY = 0x214;
49 static const unsigned FC2WINWTH = 0x218;
50 static const unsigned FC3WINDLY = 0x21C;
51 static const unsigned FC3WINWTH = 0x220;
52 
53 // This pair form a 64bit counter running continuously at 50Mz (20ns steps)
54 // In event mode, this value is sent to each detector card for storage in frame header
55 static const unsigned FRAMETIME0 = 0x248;
56 static const unsigned FRAMETIME1 = 0x24C;
57 
58 
59 static const unsigned RVETO = 0x40080;
60 // veto enable register (40080) bits
61 static const unsigned RVFIFO = (1 << 0);
62 static const unsigned RVSMP = (1 << 1);
63 static const unsigned RVINT = (1 << 2);
64 static const unsigned RVFCHOP0 = (1 << 3);
65 static const unsigned RVTS2P = (1 << 4);
66 //static const unsigned RVWP = (1 << 5); ///< wrong pulse
67 static const unsigned RVHZ50 = (1 << 6);
68 static const unsigned RVMSM = (1 << 7);
69 //static const unsigned RVEXTPOVF = (1 << 8); ///< external period overflow
70 static const unsigned RVEXT0 = (1 << 12);
71 static const unsigned RVEXT1 = (1 << 13);
72 static const unsigned RVEXT2 = (1 << 14);
73 static const unsigned RVEXT3 = (1 << 15);
74 static const unsigned RVFCHOP1 = (1 << 21);
75 static const unsigned RVFCHOP2 = (1 << 22);
76 static const unsigned RVFCHOP3 = (1 << 23);
77 
78 static const unsigned RCONTROL = 0x40084;
79 
80 // run control register bits (RCONTROL 40084)
81 // All are active high
82 static const unsigned RCSTART = (1 << 0);
83 static const unsigned RCFCLEAR = (1 << 1);
84 static const unsigned RCPCLEAR = (1 << 2);
85 static const unsigned RCPERSZEQZERO = (1 << 3);
86 static const unsigned RCEVENTMODE = (1 << 4);
87 
88 static const unsigned RCFSSEL0 = (1 << 16);
89 static const unsigned RCFSSEL1 = (1 << 17);
90 static const unsigned RCFSSEL2 = (1 << 18);
91 
92 static const unsigned RCDELFSFIFORS = (1 << 14);
93 static const unsigned RCRESET = (1 << 15);
94 static const unsigned RCFSENABLEOUT = (1 << 20);
95 
96 static const unsigned RCFSSCH2 = (1 << 21);
97 
98 // frame sync select
99 static const unsigned RCFSSEL = (RCFSSEL0 | RCFSSEL1 | RCFSSEL2);
100 static const unsigned RCFSINT = (0);
101 static const unsigned RCFSSMP = (RCFSSEL0);
102 static const unsigned RCFSTOF = (RCFSSEL1);
103 static const unsigned RCFSMUONCK = (RCFSSEL0 | RCFSSEL1);
104 static const unsigned RCFSMUONMS = (RCFSSEL2);
105 static const unsigned RCFSTOF1P = (RCFSSEL0 | RCFSSEL1 | RCFSSEL2);
106 
107 
109 {
110  const char* name;
111  unsigned mask;
112  unsigned counter_addr;
113  bool pc_only; // veto counter only present on period card
114 };
115 
116 
117 static const veto_detail veto_details[];
118 
119 static const unsigned MAX_NUM_PERIODS = (16*1024);
120 
124 
125 
126 // all 32 bit aligned addresses
127 // first period is number 0
128 static const unsigned MPCNT = 0x300;
129 static const unsigned MPLIM = 0x304;
130 static const unsigned PSCNT = 0x308;
131 static const unsigned PSLR = 0x30C;
132 static const unsigned PERINCTOT = 0x310;
133 //static const unsigned I50HZVC0 0x78; ///< isis not at 50Hz veto count low (16 bit, RO)
134 //static const unsigned I50HZVC1 0x7C; ///< isis not at 50Hz veto count high (16 bit, RO)
135 //static const unsigned EXTPTRANVC0 0x80; ///< external period transition veto counter low (16 bit, RO)
136 //static const unsigned EXTPTRANVC1 0x84; ///< external period transition veto counter high (16 bit, RO)
137 static const unsigned PEROUTDEL = 0x314;
139 static const unsigned PCREG = 0x40088;
140 //static const unsigned EXTPERREG 0x4008c ///< external periods register (16bit, RW) - see below
141 static const unsigned ALT1SFV = 0x7FFF8;
142 
143 static const unsigned PERLUTSTART = 0x20000000;
144 static const unsigned PERLUTSIZE = (16*1024);
145 static const unsigned PERLUTEND = (PERLUTSTART + 4*PERLUTSIZE);
146 static const unsigned OUTLUTSTART = 0x22000000;
147 static const unsigned OUTLUTSIZE = (16*1024);
148 static const unsigned OUTLUTEND = (OUTLUTSTART + 4*OUTLUTSIZE);
149 static const unsigned OUTLUTMASK = 0xffffffff;
150 static const unsigned RFCNT0START = 0x24000000;
151 static const unsigned RFCNT0SIZE = (16*1024);
152 static const unsigned GFCNT0START = 0x25000000;
153 static const unsigned GFCNT0SIZE = (16*1024);
154 static const unsigned RPCNT0START = 0x26000000;
155 static const unsigned RPCNT0SIZE = (16*1024);
156 static const unsigned GPCNT0START = 0x27000000;
157 static const unsigned GPCNT0SIZE = (16*1024);
158 static const unsigned RPCNT1START = 0xffffffff;
159 static const unsigned RPCNT1SIZE = 0;
160 static const unsigned GPCNT1START = 0xffffffff;
161 static const unsigned GPCNT1SIZE = 0;
162 static const unsigned SPARE0START = 0xffffffff;
163 static const unsigned SPARE0SIZE = 0;
164 static const unsigned SPARE1START = 0xffffffff;
165 static const unsigned SPARE1SIZE = 0;
166 typedef uint64_t ppp_memory_t;
167 
168 // bits for lookup table access register (LOOKTAR, 0x40000)
169 // All are active high and allow writing to area
170 static const unsigned TARPERLUT = (1 << 0);
171 static const unsigned TAROUTLUT = (1 << 1);
172 //static const unsigned TARCNT0 (1 << 2) ///< access Counts0 enable bit, RW
173 //static const unsigned TARBCT1 (1 << 3); ///< access Counts1 enable bit, RW
174 
175 // bits for period control register (PCREG, 0x40088)
176 // All are active high
177 static const unsigned PCENDAFTER = (1 << 1);
178 static const unsigned PCSEQCOMP = (1 << 2);
179 static const unsigned PCENDSEQCOMP = (1 << 3);
180 static const unsigned PCENAB = (1 << 4);
181 static const unsigned PCEXTENAB = (1 << 5);
182 static const unsigned PCMULENAB = (1 << 6);
183 static const unsigned PCMULCOMP = (1 << 7);
184 //static const unsigned PCEXTPERCLK (1 << 8); ///< internal/external period clock mode enable (RW)
185 //static const unsigned PC50HZENAB (1 << 9); ///< isis not at 50 Hz veto enable (RW)
186 //static const unsigned PCEXTTRIG (1 << 10); ///< extract trigger veto enable (RW)
187 static const unsigned PCMSM = (1 << 11);
188 //static const unsigned PCCLRVETO (1 << 12); ///< clear veto counters (RW)
189 static const unsigned PCCLRPC = (1 << 13);
190 static const unsigned PCRESET = (1 << 15);
191 
192 // bits for perlut
193 static const unsigned PERLUTTYPE = (1U << 31);
194 
195 };
196 
197 
198 #endif /* ENV_PERIOD_REGISTERS_DAE3_H */
static const unsigned GPCNT0SIZE
static const unsigned RVTS2P
ts2 pulse veto
static const unsigned RVEXT1
external veto 1
static const unsigned SPARE0SIZE
static const unsigned PCMSM
enable Muon MS mode
static const unsigned PCOUNTR1
raw proton count high 16 bits
static const unsigned PEROUTDEL
period output delay in us (18 bit, RW)
static const unsigned FC1VETFRM
veto count
static const unsigned ALT1SFV
Alt1 Sub Firmware version register (8bit, RO)
static const unsigned RVMSM
ms mode
static const unsigned RCSTART
start data acquisition
static const unsigned RVFCHOP0
fast chopper 0, also bit 20
static const unsigned PERLUTEND
unused_t
Definition: dae_policy.h:4
static const unsigned FC0VETFRM
veto count
static const unsigned SCHPULSE
muon cerenkov pulses recived (only ion MS mode)
static const unsigned OUTLUTEND
static const unsigned RVEXT0
external veto 0
static const unsigned RCFSINT
0
static const unsigned GPCNT0START
good proton counters(16k x 64 bit, RW) in counts0
static const unsigned PSLR
period sequence limit register (32 bit, RW)
static const unsigned PCSEQCOMP
period sequence complete monitor bit (RO)
static const unsigned PCMULENAB
single/multi period sequence control mode enable (RW)
static const unsigned RPCNT0SIZE
static const unsigned RCFSSEL2
frame sync select bit 2
static const unsigned RCFCLEAR
clear frame and veto counters
static const unused_t LOOKTAR
lookup table access register (4bit, RW) - see below
static const unsigned FC2WINWTH
window width
static const unsigned RVSMP
static const unsigned FC3WINWTH
window width
static const unsigned SPARE1START
invalid address, not used
static const unsigned RCPCLEAR
clear proton counters
static const unsigned FC0WINWTH
window width
static const unsigned OUTLUTMASK
outlut is 32 bit
static const unsigned GFCNT0SIZE
static const unsigned FRAMETIME1
high 32 bits
static const unsigned RCRESET
reset run controller
static const unsigned GPCNT1SIZE
static const unsigned OUTLUTSTART
period switching output lookup table (16k x 32 bit RW)
static const unsigned RCFSSEL1
frame sync select bit 1
static const unsigned FC3WINDLY
window delay
static const unsigned RCFSTOF
2
static const unsigned EXT0VETFRM
static const unsigned RPCNT1SIZE
static const unsigned MAX_NUM_PERIODS
should be same of OUTLUT and PERLUT sizes
static const unsigned EXTPEROVFVC
external period overflow veto counter (RO)
static const unsigned FRAMETIME0
low 32 bits
static const unsigned PERLUTSIZE
static const unsigned PCCLRPC
clear period counters (RW) need to assert &amp; deassert
static const unsigned RCFSSEL0
frame sync select bit 0
static const unsigned FCOUNTG
good frame count 32 bits
static const unsigned SPARE0START
invalid address, not used
static const unsigned PCREG
period control register (16 bit, RW) - see below
static const unsigned PCEXTENAB
internal/external periods control mode enable (RW)
static const unsigned OUTLUTSIZE
static const unsigned GPCNT1START
invalid address, not used
static const unsigned RVFCHOP3
fast chopper 3
static const unsigned FC3VETFRM
veto count
static const unsigned EXT3VETFRM
static const unsigned SPARE1SIZE
static const unsigned RFCNT0START
raw frame counters(16k x 32 bit, RW) in counts0
static const unsigned PSCNT
period sequence counter (32 bit, RO)
static const unsigned INTVETFRM
Internal veto frame count (RO, 32 bit) period card only.
static const unsigned RCDELFSFIFORS
delay frame sync fifo reset out (assert and deassert)
static const unsigned TAROUTLUT
access OUTLUT enable bit, RW
static const unsigned EXT2VETFRM
static const unsigned FC1WINWTH
window width
static const unsigned FC1WINDLY
window delay
static const unsigned SMPVETFRM
static const unsigned FIFOVETFRM
FIFO veto, number of frames vetoo.
static const unsigned RCFSENABLEOUT
frame sync enable out
static const unsigned RCFSSEL
static const unsigned RPCNT1START
invalid address, not used
static const unsigned PCENDAFTER
end run after period sequence completes control bit (RW)
static const unsigned MPLIM
main period (DAQ + Dwell) limit register (14 bit, RW)
static const unsigned RVETO
veto enable register
static const unsigned RVFIFO
static const unsigned MSMVETFRM
ms mode vetoed frames
static const veto_detail veto_details[]
static const unsigned WPULVETFRM
wrong pulse veto veto, number of frames vetoo
static const unsigned PCOUNTG1
good proton count high 16 bits
static const unsigned RVEXT2
external veto 2
static const unsigned FC0WINDLY
window delay
static const unsigned PCRESET
period card reset control bit(RW) need to assert &amp; deassert
static const unsigned RCFSSCH2
frame sync schenchoff pulse (0=use first, 1=use second)
static const unsigned PERLUTSTART
period lookup table (16k x 32 bit RW)
static const unsigned FSDELAY
frame syn lower 18 bits 1us increments
static const unsigned PCOUNTG0
good proton count low 32 bits
static const unsigned RCFSSMP
1
static const unsigned HZ50VETFRM
ISIS not at 50 Hz.
static const unsigned PERINCTOT
total number of period increments (RO)
static const unsigned RCONTROL
run control
static const unsigned RCFSTOF1P
5 first isis ts1 pulse after ts2 gap (so 10hz)
static const unsigned EXT1VETFRM
static const unsigned RCPERSZEQZERO
0=external/harware periods, 1 = normal (start straight away)
static const unsigned RVHZ50
isis not at 50 Hz
static const std::string env_period_policy_name
static const unsigned FC2VETFRM
veto count
static const unsigned RVINT
static const unsigned FCOUNTR
raw frame count 32 bits
static const unsigned RVFCHOP1
fast chopper 1
static const unsigned RCFSMUONCK
3 muon cerenkov
static const unsigned RCFSMUONMS
4 muon MS mode
static const unsigned RPCNT0START
raw proton counters(16k x 64 bit, RW) in counts0
static const unsigned PCENAB
normal/period mode enable (RW)
static const unsigned TARPERLUT
access PERLUT enable bit, RW
static const unsigned PCENDSEQCOMP
run ended and period sequence complete monitor bit (RO)
static const unsigned PERLUTTYPE
bit of perlut used to decide if dwell or daq period
static const unsigned PCOUNTR0
raw proton count low 32 bits
static const unsigned TS2PVETFRM
TS2 pulse veto.
static const unsigned GFCNT0START
good frame counters(16k x 32 bit, RW) in counts0
static const unsigned RFCNT0SIZE
static const unsigned RCEVENTMODE
enable event mode - send environment information to detector cards
static const unsigned MPCNT
Period card functionality.
static const unsigned RVEXT3
external veto 3
static const unsigned PCMULCOMP
multiple period sequence completed monitor bit (RO)
static const unsigned FC2WINDLY
window delay
static const unsigned RVFCHOP2
fast chopper 2