timinglibs is a repository containing a collection of DUNE DAQ modules, which together form the timing control and monitoring DAQ application.
The DUNE DAQ modules in timnglibs can be split in two groups:
- DAQ mdoules which provide the control, configuration, and monitoring interface to the
HDtiming system - DAQ modules which provide
HSIfunctionality, i.e. emulation and readout
timinglibs also provides a set of python scripts to generate the necessary json configuration files to run the aforementioned DUNE DAQ modules.
Each of the different aspects of timinglibs are described in more detail in the following sections.
The general principle of the modules providing the timing CCM interface is that there is one hardware interface module which handles all interactions between CCM and the timing hardware. This hardware interface module receives its low level commands from controller modules, which receive higher level commands from CCM, and translate them into the low level instructions consumed by the hardware interface. Each controller module is responsible for indepdently managing a particular logical entity within the timng system, e.g. timing master, timing partition, or timing endpoint. An illustration of the envisioned timing software stack can be found below.
A diagram of the connections between timinglibs DUNE DAQ modules inside of an example timing control application is shown below.
A list of the currently implemented control mdoules, along with their function, can be found below.
It receives hardware commands from timing controller modules, and makes the appropriate calls to PD-I timing hardware over IPBus. The interface to the timing hardware is provided by the timing package. It is also responsible for extracting operational monitoring information from timing devices, e.g. timing master, timing HSI, timing endpoint.
The module currently supports the following timing firmware and hardware combinations.
- Master designs
BoreasonTLUBoreasonFMCOverlordonTLUOverlordonFMC
- Endpoint designs
EndpointonFMC
controller module providing an interface to timing master devices. It receives commands from an external source, e.g. a timing system operator or CCM, and translates those commands to timing hardware commands which are then sent to the hardware interface module. Each instance of this module is responsible for managing one particular physical timing master. The commands currently supported by the module are:
- master_io_reset
- master_set_timestamp
- master_print_status
It receives timing partition commands from an external source, e.g. a timing system operator or CCM, and translates those commands to timing hardware commands which are then sent to the hardware interface module. Each instance of this module is responsible for managing one particular logical timing partition. The commands currently supported by the module are:
- partition_configure
- partition_enable
- partition_disable
- partition_start
- partition_stop
- partition_enable_triggers
- partition_disable_triggers
- partition_print_status
It receives timing endpoint commands from an external source, e.g. a timing system operator or CCM, and translates those commands to timing hardware commands which are then sent to the hardware interface module. The endpoint hardware commands issued by this module are addressed endpoint 0 on the timing endpint device. The commands currently supported by the module are:
- endpoint_io_reset
- endpoint_enable
- endpoint_disable
- endpoint_reset
- endpoint_print_status
A module for controlling the HD timing implementation of an HSI. The HSI may or may not be in the same physical device as the timing master. The controller current accepts the following timing commands:
- hsi_io_reset
- hsi_endpoint_enable
- hsi_endpoint_disable
- hsi_endpoint_reset
- hsi_reset
- hsi_configure
- hsi_start
- hsi_stop
- hsi_print_status
A DUNE DAQ module for reading HSIEvent from HSI hardware. The module periodically polls the HSI firmware, and checks if there are complete events in the buffer. If there is at least one such event, the event is read out, a dfmessages::HSIEvent is constructed and sent out on the HSIEvent output queue. The interval between polls is configurable via the parameter readout_period.
In the absence of real HSI hardware, this module can be used to emululate an HSI, and act as a source of HSIEvents. The timestamp of the emulated HSIEvents is obtained from timestamp estimates provided by TimestampEstimator. The distribution of signals in the HSIEvent bitmap along with their rate are configurable via the following parameters.
-
clock_frequency: Assumed clock frequency in Hz (for current-timestamp estimation); default:62500000 -
timestamp_offset: Offset for HSIEvent timestamps in units of clock ticks. Positive offset increases timestamp estimate; default:0 -
event_period: Period between HSIEvent generation [ns]; default:1e9 -
hsi_device_id: HSI device ID for emulated HSIEvent messages; default:1 -
mean_signal_multiplicity: Mean number of edges expected per signal. Used when signal emulation mode is 1; default:1 -
enabled_signals: Which signals or bit of the 32 bit signal bit map are enabled, i.e. could produce an emulated signal; default:0 -
signal_emulation_mode: Signal bit map emulation mode; default:00: enabled signals always on1: enabled signals are emulated (independently) according to a Poisson with mean mean_signal_multiplicity; signal map generated with uniform distr. enabled signals only
The timinglibs/python/timinglibs/timing_app_confgen.py script generates a json configuration file for instantiation of timing control and monitoring application. The script takes in one argument which is the name of the produced json file. The default file name is timing_app.json. The script is also able to accept the following command line options:
-
-ror--run-numberRun number parameter for the
startrccommand. Not used in any particular way by the current "timing" modules. Default:333. -
-gor--gather-intervalPeriod (in us) between queries to timing firmware+hardware for "essential" (i.e. level 1) operational monitoring information. Default:
1e6(us). -
-dor--gather-interval-debugPeriod (in us) between queries to timing firmware+hardware for "debug" (i.e. level > 1) operational monitoring information. Default:
10e6(us).N.B. This querying involves I2C transactions, setting too short a period may lead to software instability.
-
-mor--master-device-nameDevice name of the
timing masterto be monitored and controlled by the timing application. If the string supplied here is non-empty, aTimingMasterControllernamedtmc0, and aTimingPartitionControllernamedtpc0will be instantiated.tpc0managestiming partition0on thetiming masterdevice specified by-m. Default:PROD_MASTER. -
--master-clock-fileClock configuration file to be used with
master_io_resetcommands issued bytmc0. Default:""(empty) -
--part-trig-mask,Partition trigger mask which is used by the
partition_configurecommands issued bytpc0. Default:0xff -
--part-spill-gate',Partition spill gate enabled flag which is used by the
partition_configurecommands issued bytpc0. Default:True -
--part-rate-controlPartition rate control enabled flag which is used by the
partition_configurecommands issued bytpc0. Default:True -
-eor--endpoint-device-nameDevice name of an FMC based
timing endpointto be monitored and controlled by the timing application. If the string supplied here is non-empty, aTimingEndpointControllernamedtec0will be instantiated. Default:"" -
--endpoint-clock-fileClock configuration file to be used with
endpoint_io_resetcommands issued bytec0. Default:""(empty) -
--endpoint-addressEndpoint address to be used by
endpoint_enableanendpoint_resetcommands issued bytec0. Default:0 -
-hor--hsi-device-name, default="")Device name of the
HSIto be monitored and controlled by the timing application. If the string supplied here is non-empty, aHSIControllernamedhsi0will be instantiated. Default:""(empty). -
--hsi-clock-fileClock configuration file to be used with
hsi_io_resetcommands issued byhsi0. Default:""(empty) -
--hsi-endpoint-addressEndpoint address to be used with
hsi_endpoint_enableandhsi_endpoint_resetcommands tohsi0. Default:0 -
--hsi-endpoint-partitionEndpoint partition to be used with
hsi_endpoint_enableandhsi_endpoint_resetcommands tohsi0. Default:0 -
--hsi-re-maskBit mask controlling whether the HSI triggers on the rising edges of the different incoming signals. Used with
hsi_configurecommands sent byhsi0. Default:0 -
--hsi-fe-maskBit mask controlling whether the HSI triggers on the failling edges of the different incoming signals. Used with
hsi_configurecommands sent byhsi0. Default:0 -
--hsi-inv-maskBit mask controlling whether the HSI inverts the edges of the different incoming signals. Used with
hsi_configurecommands sent byhsi0. Default:0 -
--hsi-sourceInterger controlling the source of signals coming into the
HSI. Used withhsi_configurecommands sent byhsi0. Default:0-
0: signals are taken from the physical interface of theHSIdevice -
1: signals are taken to be bits39-8of theHSIendpoint timestamp. This isemulation mode, a constant rate ofHSItriggers are generated according to the configuredre,fe, andinvmasks.
-
-
-uor--uhal-log-levelString to control the uhal logging level. Possible values are:
fatal, error, warning, notice, info, debug. Default:notice. -
-oor--output-pathPath of the output
jsonfile. Default:.(current directory).

