Skip to content

Integer type object

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

A CTF integer type.

See also: Type object.

Properties

Property Type Description Required? Default value
class String Set to int or integer Required N/A
size Integer (positive) Size (bits) (1 to 64) Required N/A
align Integer (positive) Alignment (bits) (power of two) Optional 8 if size property is a multiple of 8, else 1
signed Boolean Signedness Optional false (unsigned)
base Integer Display radix, amongst:
  • bin: binary
  • oct: octal
  • dec: decimal
  • hex: hexadecimal
Optional dec
byte-order String Byte order, amongst:
  • le: little-endian
  • be: big-endian
Optional Native byte order defined in the Trace object
property-mappings Array of property mapping objects Property mappings of this integer type Optional N/A

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

The property-mappings array property currently accepts only one element.

Example

class: int
size: 12
signed: false
base: oct
byte-order: le
property-mappings:
  - type: clock
    name: my_clock
    property: value

Generated C type

  • Unsigned: uint8_t, uint16_t, uint32_t, or uint64_t, depending on the size property
  • Signed: int8_t, int16_t, int32_t, or int64_t, depending on the size property

Property mapping object

A property mapping object associates an integer type with a stateful object's property. When the integer type is decoded from a CTF binary stream, the associated object's property is updated.

Currently, the only available stateful object's property is the current value of a given clock.

Properties

Property Type Description Required? Default value
type String Object type (always clock) Required N/A
name String Clock name Required N/A
property String Clock property name (always value) Required N/A

Example

type: clock
name: my_clock
property: value