TIMING Module Documentation

This module is responsible for generating trigger pulses / strobes for the application from various input sources. Each trigger channel can be sourced in four different ways.

  • Input clock of the TIMING module

  • Manual trigger from the PCIe register (eg. using QtHardMon)

  • External trigger sources (eg. Backplane MLVDS Lines or Harlink Connector on SIS8300L2 or Whiterabbit signal)

  • Loopback → The users can route one of the generated trigger channels as an input source to any other trigger channel After the source is selected user can define a division value to reduce the frequency of the trigger channel

Each trigger channel can be further delayed. Delay value corresponds to the number of clock cycles. Users can select either to use the normal trigger channel or the delayed version of it on run-time.

Each generated channel can later be synchronized to the following sources: (Reset the counter value so the phase is fixed to a particular channel)

  • No sync (Free running counter)

  • One of the generated triggers (loopback)

There are no synchronizers for the external trigger inputs for TIMING module. This means external triggers must be already synchronized to application clock domain. Each external trigger (also manual trigger) goes through edge detector to have reliable source.

TIMING block diagram

1. Register Descriptions

Most of the registers lengths gets configured through how many trigger outputs are configured for the Timing Module. (determined by a constant C_TRG_CNT). This parameters currently gets fetched through appconfig.

Name Register Width Number of Elements RO/RW Description

ID

32

1

RO

LSB 8 bits shows number of output channels, next LSB 8 bits shows the number of external trigger channels that TIMING module is configured for

VERSION

32

1

RO

Shows the git revision number

ENABLE

C_TRG_CNT

1

RW

Enable the output of the particular trigger channel

SOURCE_SEL

8

C_TRG_CNT

RW

Select the source for trigger generation. These numbers are application dependent. e.g. Single Cavity Regulation (7 Trigger channels with 8 external trigger sources, values are an integer!)

0 ⇒ Use Application Clock
1 ⇒ Manual Trigger using WORD_MANUAL_TRG
2 ⇒ Use Backplane Port 17-R
3 ⇒ Use Backplane Port 17-T
4 ⇒ Use Backplane Port 18-R
5 ⇒ Use Backplane Port 18-T
6 ⇒ Use Backplane Port 19-R
7 ⇒ Use Backplane Port 19-T
8 ⇒ Use Backplane Port 20-R
9 ⇒ Use Backplane Port 20-T
10 ⇒ Use Loopback Trigger Channel 0
11 ⇒ Use Loopback Trigger Channel 1
12 ⇒ Use Loopback Trigger Channel 2
13 ⇒ Use Loopback Trigger Channel 3
14 ⇒ Use Loopback Trigger Channel 4
15 ⇒ Use Loopback Trigger Channel 5
16 ⇒ Use Loopback Trigger Channel 6

SYNC_SEL

8

C_TRG_CNT

RW

Select synchronization input for the particular trigger channel

0 ⇒ No synchronization (Free running)
1 ⇒ Use Loopback Trigger Channel 0
2 ⇒ Use Loopback Trigger Channel 1
3 ⇒ Use Loopback Trigger Channel 2
4 ⇒ Use Loopback Trigger Channel 3
5 ⇒ Use Loopback Trigger Channel 4
6 ⇒ Use Loopback Trigger Channel 5
7 ⇒ Use Loopback Trigger Channel 6

DIVIDER_VALUE

32

C_TRG_CNT

RW

Divider value for the particular trigger channel. eg. If you want to divide by 2 write 1

TRIGGER_CNT

32

C_TRG_CNT

RO

Counter for each generated trigger channel ( (!) It counts even if the output is disabled (!) )

EXT_TRIGGER_CNT

32

C_TRG_CNT

RO

Counter for each external trigger coming into the Timing Module ( (!) Gets effected by WORD_DIVIDER_VALUE (!) )

DELAY_ENABLE

C_TRG_CNT

1

RW

Enables the delayed version for that particular trigger channel

DELAY_VALUE

32

C_TRG_CNT

RW

Delay value for that particular trigger channel

MANUAL_TRG

1

C_TRG_CNT

RW

Manually triggering a particular trigger channel. Writing 1 to a particular channel will trigger that channel once. (If the divider is set to 0)

…​

2. Known Issues

  • TIMING module can only produce maximum 32 trigger channels. This is because limitation with the address space. If any user requests this please contact firmware team.

3. HDL Dependencies

The Timing Module depends on the following packages:

Registers are generated using DesyRDL. (pypi.org/project/desyrdl/)