-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathevr_cPCI-230.subs
353 lines (322 loc) · 17.3 KB
/
evr_cPCI-230.subs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
file "$(mrfioc2_TEMPLATES=db)/evr-cpci-230.db"
{
{
## Global settings
ExtInhib-Sel=0, #0 = Use Inhibit, 1 = Always permitt : Use HW trigger inhibit (EVRTG only)
Link-Clk-SP=124.916, #45-150 : Event Link speed (MHz)
Time-Src-Sel=0, #0 = Event clk, 1 = Mapped codes, 2 = DBus4 : Source for timestamping clock.
Time-Clock-SP=0.0, #50-150 : Timestamp tick rate (MHz)
## Prescalers
PS0-Div-SP=2, #2-4294967295 :Integer divisor between the Event Clock and the sub-unit output.
PS1-Div-SP=2, #2-4294967295 :Integer divisor between the Event Clock and the sub-unit output.
PS2-Div-SP=2, #2-4294967295 :Integer divisor between the Event Clock and the sub-unit output.
## Pulsers
Pul0-Name-I="Pulser 0" #Description of the pulser. Maximum 40 characters allowed!
Pul0-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
Pul0-Ena-Sel=1, #0 = Disabled, 1 = Enabled
Pul0-Polarity-Sel=0, #0 = Active High, 1 = Active Low
Pul0-Delay-SP=100, #Pulse delay in us (range depends on prescaler selection and event clock)
Pul0-Width-SP=10, #Pulse width in us (range depends on prescaler selection and event clock)
Pul0-Prescaler-SP=1, #0-65535 : Pulser prescaler
Pul1-Name-I="Pulser 1" #Description of the pulser. Maximum 40 characters allowed!
Pul1-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
Pul1-Ena-Sel=1, #0 = Disabled, 1 = Enabled
Pul1-Polarity-Sel=0, #0 = Active High, 1 = Active Low
Pul1-Delay-SP=0, #Pulse delay in us (range depends on prescaler selection and event clock)
Pul1-Width-SP=10, #Pulse width in us (range depends on prescaler selection and event clock)
Pul1-Prescaler-SP=1, #0-65535 : Pulser prescaler
Pul2-Name-I="Pulser 2" #Description of the pulser. Maximum 40 characters allowed!
Pul2-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
Pul2-Ena-Sel=1, #0 = Disabled, 1 = Enabled
Pul2-Polarity-Sel=0, #0 = Active High, 1 = Active Low
Pul2-Delay-SP=0, #Pulse delay in us (range depends on prescaler selection and event clock)
Pul2-Width-SP=0, #Pulse width in us (range depends on prescaler selection and event clock)
Pul2-Prescaler-SP=1, #0-65535 : Pulser prescaler
Pul3-Name-I="Pulser 3" #Description of the pulser. Maximum 40 characters allowed!
Pul3-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
Pul3-Ena-Sel=1, #0 = Disabled, 1 = Enabled
Pul3-Polarity-Sel=0, #0 = Active High, 1 = Active Low
Pul3-Delay-SP=0, #Pulse delay in us (range depends on prescaler selection and event clock)
Pul3-Width-SP=0, #Pulse width in us (range depends on prescaler selection and event clock)
Pul3-Prescaler-SP=1, #0-65535 : Pulser prescaler
Pul4-Name-I="Pulser 4" #Description of the pulser. Maximum 40 characters allowed!
Pul4-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
Pul4-Ena-Sel=1, #0 = Disabled, 1 = Enabled
Pul4-Polarity-Sel=0, #0 = Active High, 1 = Active Low
Pul4-Delay-SP=0, #Pulse delay in us
Pul4-Width-SP=0, #0-65535 : Width in us
Pul5-Name-I="Pulser 5" #Description of the pulser. Maximum 40 characters allowed!
Pul5-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
Pul5-Ena-Sel=1, #0 = Disabled, 1 = Enabled
Pul5-Polarity-Sel=0, #0 = Active High, 1 = Active Low
Pul5-Delay-SP=0, #Pulse delay in us
Pul5-Width-SP=0, #0-65535 : Width in us
Pul6-Name-I="Pulser 6" #Description of the pulser. Maximum 40 characters allowed!
Pul6-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
Pul6-Ena-Sel=1, #0 = Disabled, 1 = Enabled
Pul6-Polarity-Sel=0, #0 = Active High, 1 = Active Low
Pul6-Delay-SP=0, #Pulse delay in us
Pul6-Width-SP=0, #0-65535 : Width in us
Pul7-Name-I="Pulser 7" #Description of the pulser. Maximum 40 characters allowed!
Pul7-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
Pul7-Ena-Sel=1, #0 = Disabled, 1 = Enabled
Pul7-Polarity-Sel=0, #0 = Active High, 1 = Active Low
Pul7-Delay-SP=0, #Pulse delay in us
Pul7-Width-SP=0, #0-65535 : Width in us
Pul8-Name-I="Pulser 8" #Description of the pulser. Maximum 40 characters allowed!
Pul8-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
Pul8-Ena-Sel=1, #0 = Disabled, 1 = Enabled
Pul8-Polarity-Sel=0, #0 = Active High, 1 = Active Low
Pul8-Delay-SP=0, #Pulse delay in us
Pul8-Width-SP=0, #0-65535 : Width in us
Pul9-Name-I="Pulser 9" #Description of the pulser. Maximum 40 characters allowed!
Pul9-Name-I.DESC="" #Secondary description of the pulser. Maximum 40 characters allowed!
Pul9-Ena-Sel=1, #0 = Disabled, 1 = Enabled
Pul9-Polarity-Sel=0, #0 = Active High, 1 = Active Low
Pul9-Delay-SP=0, #Pulse delay in us
Pul9-Width-SP=0, #0-65535 : Width in us
## Front panel inputs
FPIn0-Lvl-Sel=1, #0 = Active Low, 1 = Active High : Active Level
FPIn0-Edge-Sel=1, #0 = Active Falling, 1 = Active Rising: Active Edge
FPIn0-Trig-Ext-Sel=0, #0 = Off, 1 = Level, 2 = Edge : External mode trigger type
FPIn0-Code-Ext-SP=0, #0-255 : Event code that triggers this input
FPIn0-Trig-Back-Sel=0, #0 = Off, 1 = Level, 2 = Edge : Backwards mode trigger type
FPIn0-Code-Back-SP=0, #0-255 : Event code that triggers this input
FPIn0-DBus-Sel=0, #1 = Bit 0, 2 = Bit 1, 4 = Bit 2, 8 = Bit 3, 16 = Bit 4, 32 = Bit 5, 64 = Bit 6, 128 = Bit 7 : DBus bits are OR-ed with this value and sent out
FPIn1-Lvl-Sel=1, #0 = Active Low, 1 = Active High : Active Level
FPIn1-Edge-Sel=1, #0 = Active Falling, 1 = Active Rising: Active Edge
FPIn1-Trig-Ext-Sel=0, #0 = Off, 1 = Level, 2 = Edge : External mode trigger type
FPIn1-Code-Ext-SP=0, #0-255 : Event code that triggers this input
FPIn1-Trig-Back-Sel=0, #0 = Off, 1 = Level, 2 = Edge : Backwards mode trigger type
FPIn1-Code-Back-SP=0, #0-255 : Event code that triggers this input
FPIn1-DBus-Sel=0, #1 = Bit 0, 2 = Bit 1, 4 = Bit 2, 8 = Bit 3, 16 = Bit 4, 32 = Bit 5, 64 = Bit 6, 128 = Bit 7 : DBus bits are OR-ed with this value and sent out
## Front panel outputs
# Available -Src-SP choices:
# 0 Pulser 0
# 1 Pulser 1
# 2 Pulser 2
# 3 Pulser 3
# 4 Pulser 4
# 5 Pulser 5
# 6 Pulser 6
# 7 Pulser 7
# 8 Pulser 8
# 9 Pulser 9
# 10 Pulser 10
# 11 Pulser 11
# 12 Pulser 12
# 13 Pulser 13
# 14 Pulser 14
# 15 Pulser 15
# 32 DBus 0
# 33 DBus 1
# 34 DBus 2
# 35 DBus 3
# 36 DBus 4
# 37 DBus 5
# 38 DBus 6
# 39 Dbus 7
# 40 Prescaler 0
# 41 Prescaler 1
# 42 Prescaler 2
# 63 Force Low
# 62 Force High
# Universal outputs, Slot 0
FrontUnivOut0-Name-I="" # Description of the output. Maximum 40 characters allowed!
FrontUnivOut0-Name-I.DESC="" # Secondary description of the output. Maximum 40 characters allowed!
FrontUnivOut0-Ena-SP=1, # Default to enabled
FrontUnivOut0-Src-SP=63, # Defaults to Force low (if enabled -> Ena-SP)
FrontUnivOut1-Name-I="" # Description of the output. Maximum 40 characters allowed!
FrontUnivOut1-Name-I.DESC="" # Secondary description of the output. Maximum 40 characters allowed!
FrontUnivOut1-Ena-SP=1, # Default to enabled
FrontUnivOut1-Src-SP=63, # Defaults to Force low (if enabled -> Ena-SP)
# Universal outputs, Slot 1
FrontUnivOut2-Name-I="" # Description of the output. Maximum 40 characters allowed!
FrontUnivOut2-Name-I.DESC="" # Secondary description of the output. Maximum 40 characters allowed!
FrontUnivOut2-Ena-SP=1, # Default to enabled
FrontUnivOut2-Src-SP=63, # Defaults to Force low (if enabled -> Ena-SP)
FrontUnivOut3-Name-I="" # Description of the output. Maximum 40 characters allowed!
FrontUnivOut3-Name-I.DESC="" # Secondary description of the output. Maximum 40 characters allowed!
FrontUnivOut3-Ena-SP=1, # Default to enabled
FrontUnivOut3-Src-SP=63, # Defaults to Force low (if enabled -> Ena-SP)
}
}
## Mapping between hardware event code and a software (EPICS) database event
## In addition to firing an EPICS database event on each occurance of hardware event, a counter for the specific EVT is increased.
#
# Macros:
# SYS = System name (auto expanded by parent)
# DEVICE = Event receiver / timing card name (same as mrmEvrSetupVME()) Eg. EVR0. (auto expanded by parent)
# EVT = Event code (hardware). Set EVT=0 to disable.
# CODE = EPICS database event number (software)
# FLNK = If provided, forward links to the record after all records from this template are processed
#
file "$(mrfioc2_TEMPLATES=db)/evr-softEvent.template"{
pattern { EVT, CODE, FLNK }
{ "1", "1", "" }
{ "2", "2", "" }
{ "3", "3", "" }
}
# If you want to enable measuring the jitter on received events comment out the previous substitution and use this one instead
#
# Additinal macros:
# HIST_LEN = number of histogram bins created from frequency measurements. Default 200.
# HIST_ULIM = histogram upper limit. Default 12.
# HIST_LLIM = histogram lower limit. Default 8.
#
# NOTE: make sure your system supports the 'histogram' record before using this template!
#
#file "$(mrfioc2_TEMPLATES=db)/evr-softEvent-measure.template"{
#pattern { EVT, CODE, FLNK }
# { "1", "1", "" }
# { "2", "2", "" }
# { "3", "3", "" }
#}
# This templates stores pulse ID and event received/not received information in two waveforms.
# This way the user can inspect event arrival corelated to pulse IDs.
#
#
# Mandatory macros:
# SYS = System name
# DEVICE = Event receiver / timing card name (same as mrmEvrSetupVME()) Eg. EVR0
#
# EVT = event number we are interested in. Eg. 6 for RF OFF beam event
#
# Optional macros:
# TRIGER_ACQUISITION = Timing event number, which is fired when we want to capture event status and pulse ID.
# Usually this is near the end of the event sequence. Eg. BS read event. Default: 28
# N_SAMPLES = Number of samples the buffer for event statuses and pulse IDs will hold. Default: 200
# DISABLE = Disables (1) or enables (0) acquisition of event statuses and pulse IDs. Default 0 (enabled)
#
# Important records:
# $(SYS)-$(DEVICE):PTRN-$(EVT)-EVTBUF -> A buffer with event statuses.
# Each entry corresponds to one acquisition triggered by $(SYS)-$(DEVICE):PTRN-$(EVT)-EVT-TRIG record.
# Event arrival is signaled by $(SYS)-$(DEVICE):PTRN-$(EVT)-EVT-TRIG record.
# Value 0 means event event EVT did not arrive in the time between last and this acquisition was triggered
# Value 1 means event event EVT did arrive in the time between last and this acquisition was triggered
# $(SYS)-$(DEVICE):PTRN-$(EVT)-PIDBUF -> Stores the current Pulse ID each time acquisition is triggered. Entry in this record can be compared to
# entries in $(SYS)-$(DEVICE):PTRN-$(EVT)-EVTBUF to see if event did or did not arrive in this pulse ID.
# $(SYS)-$(DEVICE):PTRN-$(EVT)-EVT-TRIG -> Processed when EVT event is received.
# $(SYS)-$(DEVICE):PTRN-$(EVT)-TRIG -> Processed when TRIGER_ACQUISITION event is received.
# $(SYS)-$(DEVICE):PTRN-$(EVT)-DISABLE -> see description for optional macro DISABLE.
#
file "$(mrfioc2_TEMPLATES=db)/evr-eventPatternCheck.template"{
pattern { EVT, TRIGER_ACQUISITION, N_SAMPLES, DISABLE }
{ "6", "28", "200", "1" } # RF OFF event
{ "11", "28", "200", "1" } # Laser OFF event
{ "15", "28", "200", "1" } # BPM event
}
## Mapping between hardware event code and a special function of the EVR
## Each event can be mapped only to one function!
## There are some default events, that allways trigger specific functions!
## Available functions:
## - Blink : An LED on the EVRs front panel will blink when the code is received.
## - Forward : The received code will be immediately retransmitted on the upstream event link.
## - Stop Log (default event 121): Freeze the circular event log buffer. An CPU interrupt will be raised which will cause the buffer to be downloaded. This might be a useful action to map to a fault event.
## - Log : Include this event code in the circular event log.
## - Heartbeat (default event 122): This event resets the heartbeat timeout timer.
## - Reset PS (default event 123): Resets the phase of all prescalers.
## - TS reset (default event 124): Transfers the seconds timestamp from the shift register and zeros the sub-seconds part.
## - TS tick (default event 125): When the timestamp source is 'Mapped code' then any event with this mapping will cause the sub-seconds part of the timestamp to increment.
## - Shift 1 (default event 113): Shifts the current value of the seconds timestamp shift register up by one bit and sets the low bit to 1.
## - Shift 0 (default event 112): Shifts the current value of the seconds timestamp shift register up by one bit and sets the low bit to 0.
## - FIFO : Bypass the automatic allocation mechanism and always include this code in the event FIFO.
#
# Macros:
# SYS = System name (auto expanded by parent)
# DEVICE = Event receiver / timing card name (same as mrmEvrSetupVME()) Eg. EVR0. (auto expanded by parent)
# EVT = Event code (hardware). Set EVNT=0 to disable.
# FUNC = Function to be mapped
# Choices are: "FIFO", "Latch TS", "Blink", "Forward",
# "Stop Log", "Log", "Heartbeat", "Reset PS",
# "TS reset", "TS tick", "Shift 1", "Shift 0",
#
file "$(mrfioc2_TEMPLATES=db)/evr-specialFunctionMap.template"{
pattern { EVT, FUNC }
{"1", "Blink"}
}
## Control for mapping a pulse geneator to an event code in hardware.
## Each pulser-function combination can be mapped to multiple events.
## Available functions:
## - Trig : causes a received event to trigger a pulser. A pulse based on pulser polarity, delay and width will be outputted.
## - Set : causes a received event to force a pulser into set state(based on pulser polarity).
## - Reset: causes a received event to force a pulser into reset state(based on pulser polarity).
#
## Pulser polarity defines the pulser set and reset state:
## - Active high: Output is logic high in set state and logic low in reset state
## - Active low: Output is logic low in set state and logic high in reset state
#
# Macros:
# SYS = system name (auto expanded by parent)
# DEVICE = Event receiver / timing card name (same as mrmEvrSetupVME()) Eg. EVR0. (auto expanded by parent)
# PID = Pulser ID #
# F = Pulse generator function
# Choices are: "Trig", "Set", "Reset"
# EVT = Initial event code
# ID = Mappings must have unique ID for each PID-F combination.
# Only mappings with ID=0 are displayed in the GUI
#
file "$(mrfioc2_TEMPLATES=db)/evr-pulserMap.template"{
pattern {PID F, EVT, ID}
{0, Trig, 1, 0 }
{1, Trig, 0, 0 }
{2, Trig, 0, 0 }
{3, Trig, 0, 0 }
{4, Trig, 0, 0 }
{5, Trig, 0, 0 }
{6, Trig, 0, 0 }
{7, Trig, 0, 0 }
{8, Trig, 0, 0 }
{9, Trig, 0, 0 }
{0, Set, 2, 0 }
{1, Set, 0, 0 }
{2, Set, 0, 0 }
{3, Set, 0, 0 }
{4, Set, 0, 0 }
{5, Set, 0, 0 }
{6, Set, 0, 0 }
{7, Set, 0, 0 }
{8, Set, 0, 0 }
{9, Set, 0, 0 }
{0, Reset, 3, 0 }
{1, Reset, 0, 0 }
{2, Reset, 0, 0 }
{3, Reset, 0, 0 }
{4, Reset, 0, 0 }
{5, Reset, 0, 0 }
{6, Reset, 0, 0 }
{7, Reset, 0, 0 }
{8, Reset, 0, 0 }
{9, Reset, 0, 0 }
}
## UNIV-LVPECL-DLY Delay module
## This delay module can be inserted in one of the two available UNIV slots.
## This module will delay any signal from the FrontUnivOut output. The delay can be configired from 2200ps to 12430ps, with 10ps resolution.
## When the delay module is inserted, uncomment bottom macro substitutions for the appropriate slot.
#
# Macros:
# SYS = System name (auto expanded by parent)
# DEVICE = Event receiver / timing card name (same as mrmEvrSetupVME()) Eg. EVR0. (auto expanded by parent)
# SLOT = Slot where module is inserted.
# FrontUnivOut0 is the first and FrontUnivOut1 is the second output of slot 0, where
# FrontUnivOut2 is the first and FrontUnivOut3 is the second output of slot 1.
# Enabled = Enable or disable the module. When disabled, both outputs are pulled to logic low.
# Delay0 = The delay (in ns) of the first output
# Delay1 = The delay (in ns) of the second output
#
#file "$(mrfioc2_TEMPLATES=db)/evr-delayModule.template"
#{
# { SLOT = 0, # 0 = Slot 0, 1 = Slot 1
#
# Enabled = 1, # 0 = Both outputs disabled(logic low), 1 = Both outputs enabled
# Delay0 = 2.2, # 2.2ns - 12.43ns: The delay of the first output
# Delay1 = 2.2, # 2.2ns - 12.43ns: The delay of the second output
# }
#
# { SLOT = 1, # 0 = Slot 0, 1 = Slot 1
#
# Enabled = 1, # 0 = Both outputs disabled(logic low), 1 = Both outputs enabled
# Delay0 = 2.2, # 2.2ns - 12.43ns: The delay of the first output
# Delay1 = 2.2, # 2.2ns - 12.43ns: The delay of the second output
# }
#}