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