HOWTO: Usage of White Rabbit based Timing

Since FESA 2.0.1 its is technically possible to use White Rabbit based timing in the FESA software.

Instance-File

The timing system that is used can be defined in a instantiation per frontend. To do so select FAIR as the timing domain and select a WhiteRabbit based timing driven accelerator for your device instance. According to your needs, a device can be multiplexed per BeamProcess (BP), per Sequence(SEQ) or not multiplexed at all (NONE). Please note that you cannot mix multiplexing per BeamProcess and per Sequence in the same instance-file.
<device-instance name="myDeviceNomenklatur">
   <configuration>
      <description value="This is a WhiteRabbitDevice" />
      <accelerator value="CRYRING-YRS1#200" />
      <timingDomain value="FAIR" />
      <mainMuxCriterion value="BP" />
   </configuration>
...

Currently FESA supports the BPID's 0 ... 1023 and the SEQID's 0 ... 63. If you e.g. choose 'BP' as mainMuxCriterion, each setting-field which is marked as 'multiplexed' in the design, will be duplicated x1024. Each of these duplication can be indexed by providing the correct BPID in the MultiplexingContext.

In order to save memory, per default multiplexed acquisition-fields use a rolling-buffer to store values. You can configure the depth of this buffer in the instance-file.

In the events-mapping you can choose one (or more) of the events. The events for WhiteRabbit based timing start with EVT_
<events-mapping>
   <myLogicalEvent>
      <event-configuration name="MyEventConfig">
         <Timing>
            <hardware-event name="EVT_BP_START#256" />
            <hardware-event name="EVT_BEAM_ON#6" />
         </Timing>
      </event-configuration>
      <event-configuration name="MyEventConfig2">
         <Timing>
            <hardware-event name="EVT_BEAM_ON#6" />
         </Timing>
...
A list of all valid WR-Events can be found on the development cluster(asl73x) in: /common/usr/timing/groupsAndEvents/TimingConfigurationWR.xml

Source Code

Take a look into the code snippets to work with the payload of the WhiteRabbit-event in the RT-Action.

If needed, you can add a table-entry in the ECA-table to directly trigger hardware on an incoming event by using the method TimingEventSourceWR::registerHardwareTrigger(...)
/*!
* \brief This method tells the ECA to to sent interrupts to a specific hardware-channel if the event specified by "eventFilter" is triggered.
* \param eventFilter filter in order to specify on which events the hardware should be triggered
* \param offset offset between ECA-event-trigger and hardware-trigger
* \param channel hardware-channel to trigger
* \param relevantFilterBits mask to specify which bits of eventFilter should be taken into account
* \param hwBitMask The bitMask to set to the specified I/O channel when the event is received
*        The first 16Bits describe which bits to raise
*        The second 16Bits describe which bits to lower
*/
static void registerHardwareTrigger( const GSI_ECA::Event& eventFilter, const GSI_ECA::Time& offset, const GSI_ECA::Channel& channel, uint8_t relevantFilterBits, GSI_ECA::Tag hwBitMask );
For more information, take a look at the example implementation.

Run the Binary

  • A 64-bit front-end will launch the FESA software automatically via a daemon if the expected structure is met. The daemon automatically detects in the instantiation document whether the parameters for usage of White Rabbit based timing have to be used to launch the deploy-unit or not. If the FESA deploy-unit is launched somewhere else manually the following parameters have to be applied: "-usrArgs -WR". Example:
    ./startManually_&lt;deploy-unit name&gt;.sh -f "-usrArgs -WR"
  • Trigger local-event on the ECA for testing purposes:
    [root@scul022]$ eca-ctl dev/wbm0 send 0x1ec0b0400000002 0x12343456 0xabd +0.1
    0x1ec0b04000000002 translates to: trigger event Timing::WhiteRabbit-CycleStart#44 with sequence ID 1024, beam process ID 0, group ID 492, format  ID 0, sequence counter 2  
In order to simplify the usage, feel free to copy the method WRTimingTestFixture::executeWREvent !

Client Interaction

The FesaExplorer does not yet support cycle-selectors for WR-Timing. Therefore you need to make use of the C++ Client API Valid cycle-selectors, in order to address the correct data-field (in case of multiplexing) are:
  • FAIR.BP.# for multiplexing per BeamProcess
  • FAIR.SEQ.# for multiplexing per Sequence
where # has to be replaced by the correct id which you want to address. Currently FESA supports the BPID's 0 ... 1023 and the SEQID's 0 ... 63. If you want to e.g. subscribe to all id's, you as well can provide an empty cycle-selector.
Topic revision: r2 - 23 Apr 2015, AlexanderSchwinn
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback