qat.experimental.dialect.q1.ir.imm_desc module

Semantic immediate attribute types for the QBlox Q1 ISA dialect.

Each subclass of Q1Imm is a Data [int] attribute that enforces hardware-specific value constraints at construction time. Invalid values raise VerifyException immediately and cannot exist in the IR.

The types cover all distinct operand semantics in the Q1 instruction set: boolean flags, small unsigned fields, durations, gains/offsets, NCO phase, waveform / acquisition indices, jump addresses, and generic 32-bit values.

AddressImm

alias of UI14Imm

class BoolImm(value)

Bases: Q1Imm

Boolean immediate: {0, 1}.

data: DataElement
name: ClassVar[str] = 'q1.bool_imm'

The attribute name should be a static field in the attribute classes.

class DurationImm(value)

Bases: Q1Imm

RT-instruction duration in ns: [4, 65535].

The minimum value of 4 ns matches the Q1 Real-Time core clock cycle.

data: DataElement
name: ClassVar[str] = 'q1.duration_imm'

The attribute name should be a static field in the attribute classes.

class NcoPhaseImm(value)

Bases: Q1Imm

NCO phase / phase-offset immediate: [0, 1_000_000_000] (inclusive).

data: DataElement
name: ClassVar[str] = 'q1.nco_phase_imm'

The attribute name should be a static field in the attribute classes.

class Q1Imm(value)

Bases: Data[int]

Base class for all Q1 immediate value attributes.

Subclasses set _MIN and _MAX (inclusive) and inherit the construction-time and IR-level validation. They may also override _validate() to add extra constraints (e.g. alignment, enum membership).

classmethod parse_parameter(parser)

Parse the attribute parameter.

Return type:

int

print_parameter(printer)

Print the attribute parameter.

Return type:

None

verify()

Check that the attribute parameters satisfy the expected invariants. Raise a VerifyException otherwise.

Return type:

None

class SI16Imm(value)

Bases: Q1Imm

16-bit signed immediate: [-32768, 32767].

data: DataElement
name: ClassVar[str] = 'q1.si16_imm'

The attribute name should be a static field in the attribute classes.

class SI32Imm(value)

Bases: Q1Imm

32-bit signed immediate: [-2^31, 2^31 - 1].

data: DataElement
name: ClassVar[str] = 'q1.si32_imm'

The attribute name should be a static field in the attribute classes.

class SU32Imm(value)

Bases: Q1Imm

32-bit signed-or-unsigned immediate: [-2^31, 2^32 - 1].

Used by Q1 instructions whose immediate operand accepts either signed or unsigned 32-bit representation (e.g. move, not, generic ALU).

data: DataElement
name: ClassVar[str] = 'q1.su32_imm'

The attribute name should be a static field in the attribute classes.

class UI10Imm(value)

Bases: Q1Imm

10-bit unsigned immediate: [0, 1023].

data: DataElement
name: ClassVar[str] = 'q1.ui10_imm'

The attribute name should be a static field in the attribute classes.

class UI14Imm(value)

Bases: Q1Imm

14-bit unsigned immediate: [0, 16383].

data: DataElement
name: ClassVar[str] = 'q1.ui14_imm'

The attribute name should be a static field in the attribute classes.

class UI16Imm(value)

Bases: Q1Imm

16-bit unsigned immediate: [0, 65535].

data: DataElement
name: ClassVar[str] = 'q1.ui16_imm'

The attribute name should be a static field in the attribute classes.

class UI24Imm(value)

Bases: Q1Imm

24-bit unsigned immediate: [0, 16_777_215].

data: DataElement
name: ClassVar[str] = 'q1.ui24_imm'

The attribute name should be a static field in the attribute classes.

class UI2Imm(value)

Bases: Q1Imm

2-bit unsigned immediate: [0, 3].

data: DataElement
name: ClassVar[str] = 'q1.ui2_imm'

The attribute name should be a static field in the attribute classes.

class UI32Imm(value)

Bases: Q1Imm

32-bit unsigned immediate: [0, 2^32 - 1].

data: DataElement
name: ClassVar[str] = 'q1.ui32_imm'

The attribute name should be a static field in the attribute classes.

class UI3Imm(value)

Bases: Q1Imm

3-bit unsigned immediate: [0, 7].

data: DataElement
name: ClassVar[str] = 'q1.ui3_imm'

The attribute name should be a static field in the attribute classes.

class UI4Imm(value)

Bases: Q1Imm

4-bit unsigned immediate: [0, 15].

data: DataElement
name: ClassVar[str] = 'q1.ui4_imm'

The attribute name should be a static field in the attribute classes.

class UI5Imm(value)

Bases: Q1Imm

5-bit unsigned immediate: [0, 31].

data: DataElement
name: ClassVar[str] = 'q1.ui5_imm'

The attribute name should be a static field in the attribute classes.

class UI6Imm(value)

Bases: Q1Imm

6-bit unsigned immediate: [0, 63].

data: DataElement
name: ClassVar[str] = 'q1.ui6_imm'

The attribute name should be a static field in the attribute classes.

class UI7Imm(value)

Bases: Q1Imm

7-bit unsigned immediate: [0, 127].

data: DataElement
name: ClassVar[str] = 'q1.ui7_imm'

The attribute name should be a static field in the attribute classes.

class UI8Imm(value)

Bases: Q1Imm

8-bit unsigned immediate: [0, 255].

data: DataElement
name: ClassVar[str] = 'q1.ui8_imm'

The attribute name should be a static field in the attribute classes.