Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Config, registers and description files

On startup the PandA server loads its configuration from three files: config, registers, and description. When running the simulation these are loaded from the config_d directory in the build directory; on PandA they are loaded from /opt/share/panda/config_d.

The syntax of each file mirrors the field definitions described in Blocks, fields and attributes. All three files share a common structure: indentation indicates hierarchy, # starts a comment, block names appear in the first column, and fields are indented one level.

FilePurpose
configDefines all blocks, their fields, and each field’s behaviour
registersMaps each block and field to hardware register offsets
descriptionOptionally provides human-readable descriptions

Configuration file config

This file defines all blocks and fields available to this PandA instance and is processed first.

Block definition syntax:

block-name [ "[" count "]" ]
    [ field-definition ]*

A block definition gives the block a name and optionally a repeat count (the number of hardware instances). It is followed by indented field definitions.

Field definition syntax:

field-name field-type [ field-type-data ]

The field-type determines the basic function of the field, what operations are permitted on it, and how it maps to hardware registers.

Field types

Field typeDescription
param subtype [= value]Single 32-bit value written to a register; optional initial value
read subtypeRead-only register
write subtypeWrite-only register (triggers an immediate action)
timeLike param but 64-bit, spanning two registers
bit_outOutput bit
pos_out [scale [offset [units]]]Position bus output; optional default scale/offset/units
ext_out (timestamp | samples | bits group)Extension bus entry needing special treatment
bit_mux [= value]Bit bus input selector; optionally defaults to ONE (129)
pos_muxPosition bus input selector
table [row-words]Long table of numbers with special access methods

ext_out ext-extra values:

ValueDescription
timestampCaptures a 64-bit timestamp
samplesCaptures the sample count for data capture
bits groupCaptures 32 bits of the 128-bit bit bus; group selects which 32-bit slice

Field subtypes

param, read, and write fields require one of the following subtypes:

SubtypeDescription
uint [max-value]Unsigned integer, optionally bounded
intSigned integer
scalar scale [offset [units]]Fixed-point value with scale and optional offset/units
bitSingle bit
actionWrite-only trigger with no data payload
lut5-input lookup table function
enumEnumeration; followed by indented number string pairs
positionPosition value
timeTime value

Register file registers

This file assigns hardware registers to each block and field. Its structure mirrors config but replaces field type specifications with register assignments.

Block definition syntax:

block-name { [ "S" ] block-register | "X" } [ extension-module ]
    [ field-definition ]*

Field register syntax by type:

ClassRegister syntax
paramregister | write-extension
readregister | read-extension
writeregister | write-extension
timelow-register high-register
bit_out(bit-index)N
pos_out(pos-index)N
ext_out timestampext-index ext-index
ext_out otherext-index
bit_muxregister
pos_muxregister
table (short)short size init-reg fill-reg length-reg
table (long/DMA)long 2^size nbuf base-reg length-reg

The notation (...)N means the register number is repeated N times, once per hardware instance of the block.

Extension register syntax

When an extension server is enabled (see Start the PandA server -X option) and an extension module is associated with a block, param, read, and write fields may be redirected to it:

read-extension  = [ read-reg ]* "X" field-spec
write-extension = [ read-reg ]* [ "W" [ write-reg ]* ] "X" field-spec

field-spec is passed to the extension module to bind the field. See Extension server for details on extension fields.

Description file description

The entire file is optional. Its syntax is:

block-name block-description
    field-name field-description

Descriptions are newline-terminated UTF-8 strings.