1 FESA architecture v.1.0 Timing-related aspects 21 st November 2003
Jan 12, 2016
1
FESA architecture v.1.0
Timing-related aspects21st November 2003
2
Outline
1. Functional view2. Conceptual view3. Code view4. Execution view
3
Notations and color codingClass
Package «executable»Component
Class
Package «executable»Component
Class
Package «executable»Component
Class
Package «executable»Component
Class
Package «executable»Component
Generic framework
Configuration
Generated code
Custom code
External
multithreading
Object1 Object2Object3
Message1
Message2
4
1. Functional view
5
Event-generation hierarchy
Timing distribution system Equipment Software
Real-timehandling services
Real-timesynchronization
«uses»
-generates local events
*
Synchronize all FEC
<<actor>>Central timing module
-generates accelerator events
1 -notifies accelerator events*
<<actor>>Local timing module
PIX
.FW
900
PE
X.W
20
PIX
.FP
OW
PE
X.W
20-T
EJ
PE
X.W
BS
W16
PTIM out local events
PTIM in key events
6
PPM device access
**
<<actor>>HW interface module
<<actor>>Hardware Device
«uses»
Equipment Software
Real-timehandling services
Real-timesynchronization
«uses»
-generates local events
*
<<actor>>Local Timing Module
Hardware access
-read/write
*
-read/write *
Device abstractionmanagement
«uses»
Software device
Embeds telegram (cycle…)
-read/write *
PPM Deviceabstraction management
«uses»
-read/write
* -read/write
*
Software device@ cycle #3
Software device@ cycle #2
Software device@ cycle #1
7
Support services summary
Synchronization with central timing eventsManagement of PPM device access
Timing exception handling Notification of real-time activity over-run. Protection against occurrence of unknown cycles (discard,
access reserved data slot for unknown cycle or switch to emergency mode!)
8
Specify timing modelfor equipment class
Equipment Specialist Timing Specialist
-requests -proposes
*
*
Specify localevents' static timing
Specify local events'identifiers on per-FEC
basis
«uses» «uses»
Specify local events'dynamic parameters
«uses»
Timing “contract”
Fesa framework-configures
Configure anequipment's class timing
Code PTIM access forlocal timing's parameters'
tuning
Configure event-actionmap on a per-FEC basis
«uses»«uses»
Timing system
Configure timingsystem
-configures
Configure CentralTiming Module (a.k.a. CTIM)
Configure PeripheralTiming Module for FEC (a.k.a.
PTIM)
«uses»«uses»
May remove dependencyif event identifiers hadclass scope
Not supportedyet
9
FESA-side timing-configuration
Declare resident and not resident cycles per timing domain
Deploy
Configure software
Define public interface
Initialize PPM attributes per cycle name
Define anticipated, instantaneous & delayed actions
Declare supported timing domains for class
Attach devices to a timing domain (device attribute)
Declare PPM attributes in scopes "device/class user stored/nonstored"
Define sources and event-action map per FEC (scheduling)
Declare supported timing domains for class
Define sources and event-action map per FEC (scheduling)
Attach devices to a timing domain (device attribute)
Initialize PPM attributes per cycle name
Define anticipated, instantaneous & delayed actions
TestCode Configure
Deliver (vX.0)
Deploy (vX.0) on test FEC
Declare class
Define public interface
Generate code
Code actions
Install environment
Instantiate devicesConfigure software
Declare PPM attributes in scopes "device/class user stored/nonstored"
10
Development services summary
Timing system selectionPPM device configurationAction time-shift configuration
Potentially accommodates for time-shifts on a per-device basis in case the action is associated to a device selector condition (logical test on any attribute, not restricted to the PPM flag)
Timing simulation Programmed-sequence time source (e.g. allows
preliminary tests for fast-cycling booster, shutdown development work…)
11
2. Conceptual view
12
Timing-events classes
FesaEvent
FesaEvent(eventName : const string&, : const FesaEventSource *)setName( : string) : voidgetCpuTimeStamp() : FesaTime &getName() : string &getSourcePtr() : FesaEventSource *getSourceTimeStamp() : FesaTime &
(from C++ reversed engineered)
FesaSPSMtgEventSource
FesaSPSMtgEventSource(timingDomain : int)connectToLegacyEventCode( : const char *) : voidconsume( : FesaEvent *) : voidsetResidentCycles(cycleList : vector <string>) : voidwait() : FesaEvent*checkIsCycleResident(cycleName : string) : bool
(from C++ reversed engineered) FesaMtgEvent
getCycleName() : string &getNextCycleName() : string &getPreviousCycleName() : string &FesaMtgEvent( : const char *, : FesaEventSource *)
(from C++ reversed engineered)
FesaPsMtgEventSource
connectedItCollection : vector <int>
FesaPsMtgEventSource(timingDomain : int)connectLogicalIt( : int) : voidconsume(pEv : FesaEvent *) : voidsetResidentCycles(cycleList : vector <string>) : voidstart() : voidwait() : FesaEvent *checkIsCycleResident(cycleName : string) : boolinitial izeTgm(timingDomain : int) : void
(from C++ reversed engineered)
-pSingleMtgEventInstance
FesaEventSource
<<abstract>> consume( : FesaEvent *) : void<<abstract>> wait() : FesaEvent *<<virtual>> start() : void<<virtual>> stop() : void
(from C++ reversed engineered)
FesaCompositeEventSource
conditionVariableQueue : pthread_cond_teventQueue : queue < FesaEvent * >mutexQueue : pthread_mutex_tl iveEvSourceCollection : vector < LiveEventSource * >
addSource( : FesaEventSource*) : voidconsume( : FesaEvent *) : voidstart() : voidwait() : FesaEvent *
(from C++ reversed engineered)
LiveEventSource
tid : pthread_t
run() : void<<static>> startThread(arg : void*) : void*
(from FesaCompositeEventSource)
<<friend permission>>
<<friend permission>> for non-resident cycles event renamed "corrupted"
13
Event production-consumption
anEventSource theCompositeEventSource
theEventTemplate
theScheduler
Event * fesaWaitEventwait
POSIX pthread_cond_signal
POSIX pthread_cond_wait
creation
Event * pEventschedule
set template attributes
consume( pEvent )
EventSource * pSource = getSource()
consume( pEvent )
setFlag( INVALID )
wake-up
wake-up
wait
CompositeEventQueue
queue( &theEventTemplate)
Event queueing / de-queueing protectedby POSIX pthread_mutex_lock
dequeue( pEvent )
setFlag ( VALID )
init
( VALID / INVALID ) flagprotected by POSIXpthread_mutex_lock
14
PPM-aware classesFesaAction
mtgTimeShift
FesaAction(actionName : const string&)setMtgTimeShift(mts : mtgTimeShift_t) : void<<abstract>> execute(pEvent : FesaEvent *) : Outcome
(from C++ reversed engineered)
FesaDevice
deviceCollection : map< string, FesaDevice * >workCycleName : string
FesaDevice( : const string&)getWorkCycleName() : string &<<abstract>> setWorkCycle(cycleName : string &) : void
(from C++ reversed engineered)
FesaShM
retrieveCycleIndex(cycleName : const char *) : int
(from C++ reversed engineered)-pShM
Attributes and operations not related to cycle-multiplexing omitted.ConcreteDevice
setWorkCycle( : string &) : void
(from Generated code reversed C++)
ShMproxy
instrClassUserNonStoredDesc : SharedCfgDesc_tinstrClassUserStoredDesc : SharedCfgDesc_tinstrDeviceUserNonStoredDesc : SharedCfgDesc_tinstrDeviceUserStoredDesc : SharedCfgDesc_t
fillRecordPtrsFromIndex( : int) : int
(from Generated code reversed C++)
-zeeShM
15
anRtActiontheScheduler aDeviceanMtgEventSource
for ever
anMtgEvent
select an appropriate action
setActionContext( MtgEvent *)
for all devices in collection
execute(MtgEvent *)
device loop
access attribute (R/W)
theShm
consume()
theDeviceClass
setWorkCycle(name )
execute(Event *)
setDeviceCollectionWorkCycle
could be calledwithin RtBaseAction
cycleName set accordingto action's "time-shift".
access @ cycle
Collection assumesshared cycle.
Event * pEv
aShmProxy
retreiveCycleId
fillRecordPtrsFromId
set previous / current / next cycle names
fesaWaitEvent
PPM device access
pDev->setAmplitude( 7.0 )
16
3. Code structure view
17
Adaptation to legacy layers
FesaFramework
Generic Layer
«library»dscRtLib
Real-time task
«library»tgm
PS legacylayer
SPS legacylayer
Standard servicesTool
DBMS
18
4. Execution view
19
Deployment diagram on PS
FEC
startupSequence
ShMRestore
createShM
PTIMDeviceShM tg8BuildInfo
NFS Server
tg8InfoFile
«create»
«create»«create»
«create»
«create»«call»
tg8Driver
«create»
«library»dscRtLib
«system call»
3
2
1
4
5
aCLASS RTTask
«call»
IOConfigLib
6
7
«create»
IOConfigInstall
«create»
IOConfigShM
«create»
«executable»tgmTg8
«system call»
«table»tgmShM
«library»Fesa
«call»
dmcrpls (?)
dtm server
dtm receiver
-End5
20
Deployment diagram on SPS
FEC
«driver»tg8Driver
«executable»aCLASS RTTask
«call»
«library»Fesa
«call»
«library»FesaLib
MsQ per Class
«executable»aCLASS Dispatcher
MsQ per FEC
«executable»SPS GMT Handler
«call»
«library»SPS GMT Library
«call»
21
References
TIMING. FESA Interface Specification. Version 1.2. 12 June 2003: https://edms.cern.ch/file/382127/1.1/FesaInterTiming.pdf
Reference site for all timing information:http://ab-div-co-ht.web.cern.ch/ab-div-co-ht/