qat.experimental.dialect.q1_scf.ir.attrs module

Attributes for the q1_scf structured control flow dialect.

The dialect reuses the q1_cf predicate enumerations for its conditions (see qat.experimental.dialect.q1_cf.ir.attrs) and defines one attribute of its own:

  • IterDomainAttr is optional metadata on ForOp describing the linear iteration domain of a counted loop. It records the start, stop and step of the varied quantity, the integer count of iterations, and an IterParameter tag naming the varied quantity and its unit. The attribute carries no control-flow semantics.

Reference: https://docs.qblox.com/en/main/products/qblox_instruments/q1/index.html

class IterDomainAttr(start, stop, step, count, parameter)

Bases: IterDomainAttr

Linear iteration domain of a ForOp.

The domain is the affine sequence start, start + step, ... truncated to count points, all measured in the unit implied by parameter. It records the physical meaning of a counted loop and does not alter its control-flow semantics.

Parameters:
  • start (float) – First value of the varied quantity.

  • stop (float) – Exclusive upper bound of the varied quantity.

  • step (float) – Increment between successive iterations; must be non-zero.

  • count (int) – Number of loop iterations, which must equal ceil((stop - start) / step).

  • parameter (IterParameter) – The varied quantity and, implicitly, its unit.

count: IntAttr = <xdsl.irdl.attributes._ParameterDef object>
classmethod get_irdl_definition()

Get the IRDL attribute definition.

name: ClassVar[str] = 'q1_scf.iter_domain'

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

parameter: IterParameterAttr = <xdsl.irdl.attributes._ParameterDef object>
start: FloatAttr = <xdsl.irdl.attributes._ParameterDef object>
step: FloatAttr = <xdsl.irdl.attributes._ParameterDef object>
stop: FloatAttr = <xdsl.irdl.attributes._ParameterDef object>
verify()

Verify the domain is a well-formed linear iteration.

Raises:

VerifyException – If step is zero, if count is negative, or if count does not equal ceil((stop - start) / step).

Return type:

None

class IterParameter(value)

Bases: StrEnum

The quantity varied across iterations, which also fixes the domain unit.

duration = 'duration'
frequency = 'frequency'
gain = 'gain'
phase = 'phase'
class IterParameterAttr(data)

Bases: EnumAttribute[IterParameter], SpacedOpaqueSyntaxAttribute

Attribute wrapper carrying an IterParameter.

data: DataElement
enum_type

alias of IterParameter

name: ClassVar[str] = 'q1_scf.iter_parameter'

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