n°1e2889e, Issue 1 - Revision 1c7a496 - 2024-12-27
simulation, simulation modelling platform, ECSS-E-ST-40-07C, kernel
Issue | Date | Changes |
---|---|---|
1 | 2024-12-27 | Document creation |
In this section, the requirements are defined only to link to SMP level clauses subset in order to organize test traceability and provide an overview of the SMP features coverage.
simph.smp.obj |
---|
Simphonie shall provide a concrete class for the Smp::IObject interface. |
simph.smp.comp |
---|
Simphonie shall provide a concrete class for the Smp::IComponent interface. |
simph.sched.1 |
---|
The scheduler shall emit an event named
|
simph.sched.2 |
---|
The scheduler shall emit an event named
|
simph.sched.3 |
---|
The scheduler shall request simulator to hold simulation when there are no more events in the schedule queue. |
Here are defined some extended SMP featured, that are features not defined by the SMP standard but considered to be needed to create a full featured simulator.
simph.esmp.1 |
---|
The extended SMP feature libraries shall not link with the simphonie's kernel library. |
simph.esmp.svc.1 |
---|
The simphonie's Smp:ISimulator implementation shall let the simulator integrator override the simphonie's implementation of the SMP mandatory services with any of its own implementation. |
Of course, such service replacement may alter the way simphonie is working (and that is for that purpose), and the simulator integrator shall be aware of some constraints to keep its simulation system able to run properly:
In the next requirements, the service word shall be understood in the extended way of set of feature. When deriving from Smp::IService is needed, specific requirements will be defined. For a given service, without such explicit requirement, the implementer can choose any of the following design:
The Smp::IModel or Smp::IService derivation shall be preferred for any component to be dynamically loaded through the library loading, factory and component instances creation features of the simulator (see Smp::ISimulator), in order to let the loaded feature being properly published and retrievable through the resolver service.
simph.esmp.hold.1 |
---|
The extended SMP library shall provide a service letting control automatic transition of the simulator to stand by state. |
simph.esmp.hold.2 |
---|
The simulator hold control service shall publish a field named
|
simph.esmp.hold.3 |
---|
The simulator hold control service shall request simulator hold when the simulation time reached the current value of its
|
simph.esmp.datarec.1 |
---|
The extended SMP library shall provide a data recording service able to record in file any data field of the simulator during the simulation. |
simph.esmp.datarec.2 |
---|
The data recording service shall publish a field named
|
simph.esmp.fsched.1 |
---|
Simphonie shall let the simulator integrator define entry point scheduling based on field related events. |
This feature shall let define aperiodic entry points activation. The following event kinds and scheduling policies shall be considered:
The above policy may be refined as more formal requirement in future editions. The main motivation for such feature is to trigger computation only when relevant on external asynchronous and aperiodic stimulation. The SMP discrete event simulation kernel may then handle computation pipelines according to any on-demand strategy similar to the very common observer/observable patterns or publish/subscribe patterns.
The kernel library include an implementation for each of the mandatory SMP services:
The services are created on the simulator construction to ensure availability at the earliest stages of the simulator build.
However those service shall be replaceable
, meaning a user may substitute anyone with its own implementation using theAddService
method. To do so, this method dynamically checks the type of the service to add for each mandatory service type. When it matches a type, the simphonie's default service implementation is deleted and replaced by the new one. This makes the eventual configuration applied to the deleted service be lost. Each mandatory service type is checked in sequence, making a single object implementing many of the mandatory services be properly registered as the right instance for the many services it implements.
This way of doing (creating default services and replace later) has been selected because of the few early simulator building action that may need the availability of such service before any new one can be added. In most case this is without significant effect, since almost nothing is done before the first service addition and services should be added and more specifically published before any other kinds of components can be published.
The bundled resolver parses the pathes to be resolved according the following state diagram.
The scheduler / time keeper coordination relies on a specific event that is not defined in the SMP standard:
Scheduler_PreEventExecute
shall be registered in the event manager sometime during the simulator building phase. Then the follwing policy shall be applied to let the time keeper and scheduler fulfil each its own duty as defined in the SMP standard while being able to remain consistent with each other:
Scheduler_PreEventExecute
to trigger its own simulation time update process according the next scheduled event simulation time.
Scheduler_PreEventExecute
before running each scheduled entry point.
Any alternate scheduler or time keeper service implementation may be used as soon the
Scheduler_PreEventExecute
event is handled appling the policy defined above in this section.
According to the SMP standard, the simulator shall emit events when starting and stopping the simulation:
SMP_LeaveStandby
SMP_EnterExecuting
SMP_LeaveExecuting
SMP_EnterStandby
On start request, the simulator preforms the follwing actions:
SMP_LeaveStandby
event.
SMP_EnterExecuting
event.
The start entry point shall:
The Simulator's Hold method shall stop the simulation according its boolean argument:
To do so, the simulator on Hold request, according the boolean argument, schedules its own stop processing entry point:
Once the stop entry point is scheduled, the Hold method shall wait until the stop entry point is completed (if not triggered by the scheduler thread itself), then it emits the
SMP_EnterStandby
event.
The stop processing entry point shall emit the
SMP_LeaveExecuting
event, then it shall release the Hold caller thread and the simulator shall then switch to standby state emitting the related event.
The scheduler shall:
SMP_EnterExecuting
event to start its own scheduling thread.
SMP_LeaveExecuting
event to change its running status and end itw own scheduling thread once the currently executing entry point is completed.
When an entry point execution is completed, each of its owner's output field Push method is invoked to forward the possibly updated data to each connected input field.
Implementation strategy does not need a specific scheduler. The aperiodic and asynchronous event will synchronized the as fast as possible default scheduler behavior through the following strategy based on two entry points:
In order to let entry point be activated (and consume CPU ressource) only when relevent, that is when the computed output shall be refreshed because of the update of an input, some specific Smp::IField subclass shall be implemented to override the SetValue() method. Then when a value is pushed by a connected output field:
Copyright (c) 2019-2025 Sebastien Devaux, Context: Component simphonie-1.0.0 - Generated: 2025-03-23 16:59:09+01:00 / sdevaux@theia