Skip to content

Clock object

Philippe Proulx edited this page Sep 10, 2020 · 2 revisions

A CTF clock.

Clock objects are used in the clocks property of the metadata object.

Properties

Property Type Description Required? Default value
freq Integer (positive) Frequency (Hz) Optional 1000000000
description String Description Optional No description
uuid String (UUID canonical format) UUID (unique identifier of this clock) Optional No UUID
error-cycles Integer (zero or positive) Error (uncertainty) of clock in clock cycles Optional 0
offset Clock offset object Offset Optional Default clock offset object
absolute Boolean Clock offset is from Unix epoch Optional false
$return-ctype String Return C type of the associated clock callback Optional uint32_t
$include (Including external YAML files) String or array of strings Include base properties from external YAML file(s) Optional []

All the properties which have a default value can also be set to null to force this default value. This is especially useful when including external YAML files.

The $return-ctype property must be set to a valid C integer type (or valid type definition). This is not currently validated by barectf itself, but the C compiler will fail to compile the generated C code if the clock's return type is not a valid C integer type.

Example

freq: 2450000000
description: CCLK/A2 (System clock, A2 clock domain)
uuid: 184883f6-6b6e-4bfd-bcf7-1e45c055c56a
error-cycles: 23
offset:
  seconds: 1434072888
  cycles: 2003912
absolute: false
$return-ctype: unsigned long long

Clock offset object

An offset in seconds and clock cycles from the Unix epoch.

Properties

Property Type Description Required? Default value
seconds Integer (zero or positive) Seconds since reference Optional 0
cycles Integer (zero or positive) Clock cycles since reference plus the value of the seconds property Optional 0

Example

seconds: 1435617321
cycles: 194570