Skip to content

Snitch runtime

snitch_runtime

tx_id = i32 module-attribute

slice_t_begin = i64 module-attribute

slice_t_end = i64 module-attribute

SnitchRuntime = Dialect('snrt', [GlobalCoreBaseHartidOp, GlobalCoreIdxOp, GlobalCoreNumOp, GlobalComputeCoreIdxOp, GlobalComputeCoreNumOp, GlobalDmCoreNumOp, ClusterCoreIdxOp, ClusterCoreNumOp, ClusterComputeCoreIdxOp, ClusterComputeCoreNumOp, ClusterDmCoreIdxOp, ClusterDmCoreNumOp, ClusterIdxOp, ClusterNumOp, IsComputeCoreOp, IsDmCoreOp, ClusterHwBarrierOp, ClusterSwBarrierOp, GlobalBarrierOp, BarrierRegPtrOp, GlobalMemoryOp, ClusterMemoryOp, ZeroMemoryOp, DmaStart1DWideptrOp, DmaStart1DOp, DmaStart2DWideptrOp, DmaStart2DOp, DmaWaitOp, DmaWaitAllOp, SsrLoop1dOp, SsrLoop2dOp, SsrLoop3dOp, SsrLoop4dOp, SsrRepeatOp, SsrEnableOp, SsrDisableOp, SsrReadOp, SsrWriteOp, FpuFenceOp], []) module-attribute

SnitchRuntimeBaseOperation dataclass

Bases: IRDLOperation, ABC

A base class for ops in the Snitch Runtime dialect. The Snitch Runtime dialect models the snitch runtime which contains low level routines to manage system level aspects of snitch systems.

This dialect is modeled after: https://github.com/pulp-platform/snitch_cluster/tree/main/sw/snRuntime

Source code in xdsl/dialects/snitch_runtime.py
class SnitchRuntimeBaseOperation(IRDLOperation, ABC):
    """
    A base class for ops in the Snitch Runtime dialect.
    The Snitch Runtime dialect models the snitch runtime which contains low level
    routines to manage system level aspects of snitch systems.

    This dialect is modeled after:
    https://github.com/pulp-platform/snitch_cluster/tree/main/sw/snRuntime
    """

    pass

SnitchRuntimeGetInfo

Bases: SnitchRuntimeBaseOperation, ABC

A base class for snitch runtime functions that get a certain value at runtime

Source code in xdsl/dialects/snitch_runtime.py
class SnitchRuntimeGetInfo(SnitchRuntimeBaseOperation, ABC):
    """
    A base class for snitch runtime functions that get a certain value at runtime
    """

    result = result_def(i32)

    traits = traits_def(NoMemoryEffect())

    def __init__(
        self,
    ):
        super().__init__(result_types=[i32])

result = result_def(i32) class-attribute instance-attribute

traits = traits_def(NoMemoryEffect()) class-attribute instance-attribute

__init__()

Source code in xdsl/dialects/snitch_runtime.py
def __init__(
    self,
):
    super().__init__(result_types=[i32])

SnitchRuntimeGetInfoBool

Bases: SnitchRuntimeBaseOperation, ABC

A base class for snitch runtime functions that get a certain value at runtime

Source code in xdsl/dialects/snitch_runtime.py
class SnitchRuntimeGetInfoBool(SnitchRuntimeBaseOperation, ABC):
    """
    A base class for snitch runtime functions that get a certain value at runtime
    """

    result = result_def(i1)

    traits = traits_def(NoMemoryEffect())

    def __init__(
        self,
    ):
        super().__init__(result_types=[i1])

result = result_def(i1) class-attribute instance-attribute

traits = traits_def(NoMemoryEffect()) class-attribute instance-attribute

__init__()

Source code in xdsl/dialects/snitch_runtime.py
def __init__(
    self,
):
    super().__init__(result_types=[i1])

NoOperandNoResultBaseOperation

Bases: SnitchRuntimeBaseOperation, ABC

A base class for operations with no operands nor results

Source code in xdsl/dialects/snitch_runtime.py
class NoOperandNoResultBaseOperation(SnitchRuntimeBaseOperation, ABC):
    """
    A base class for operations with no operands nor results
    """

    def __init__(
        self,
    ):
        super().__init__()

__init__()

Source code in xdsl/dialects/snitch_runtime.py
def __init__(
    self,
):
    super().__init__()

GlobalCoreBaseHartidOp dataclass

Bases: SnitchRuntimeGetInfo

Get the current core's global base Hart ID

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class GlobalCoreBaseHartidOp(SnitchRuntimeGetInfo):
    """
    Get the current core's global base Hart ID
    """

    name = "snrt.global_core_base_hartid"

name = 'snrt.global_core_base_hartid' class-attribute instance-attribute

GlobalCoreIdxOp dataclass

Bases: SnitchRuntimeGetInfo

Regardless of core type, return global core index, equal to the Hart ID of the current core - global base Hart ID of the cluster

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class GlobalCoreIdxOp(SnitchRuntimeGetInfo):
    """
    Regardless of core type, return global core index, equal to the Hart ID of the
    current core - global base Hart ID of the cluster
    """

    name = "snrt.global_core_idx"

name = 'snrt.global_core_idx' class-attribute instance-attribute

GlobalCoreNumOp dataclass

Bases: SnitchRuntimeGetInfo

Return total amount of cores including DMA cores per cluster

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class GlobalCoreNumOp(SnitchRuntimeGetInfo):
    """
    Return total amount of cores including DMA cores per cluster
    """

    name = "snrt.global_core_num"

name = 'snrt.global_core_num' class-attribute instance-attribute

GlobalComputeCoreIdxOp dataclass

Bases: SnitchRuntimeGetInfo

For compute core, return global core index

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class GlobalComputeCoreIdxOp(SnitchRuntimeGetInfo):
    """
    For compute core, return global core index
    """

    name = "snrt.global_compute_core_idx"

name = 'snrt.global_compute_core_idx' class-attribute instance-attribute

GlobalComputeCoreNumOp dataclass

Bases: SnitchRuntimeGetInfo

Return total amount of compute cores per cluster

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class GlobalComputeCoreNumOp(SnitchRuntimeGetInfo):
    """
    Return total amount of compute cores per cluster
    """

    name = "snrt.global_compute_core_num"

name = 'snrt.global_compute_core_num' class-attribute instance-attribute

GlobalDmCoreNumOp dataclass

Bases: SnitchRuntimeGetInfo

Return total amount of DMA cores

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class GlobalDmCoreNumOp(SnitchRuntimeGetInfo):
    """
    Return total amount of DMA cores
    """

    name = "snrt.global_dm_core_num"

name = 'snrt.global_dm_core_num' class-attribute instance-attribute

ClusterCoreIdxOp dataclass

Bases: SnitchRuntimeGetInfo

Return cluster identifier

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class ClusterCoreIdxOp(SnitchRuntimeGetInfo):
    """
    Return cluster identifier
    """

    name = "snrt.cluster_core_idx"

name = 'snrt.cluster_core_idx' class-attribute instance-attribute

ClusterCoreNumOp dataclass

Bases: SnitchRuntimeGetInfo

Return total amount of cores for the current cluster

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class ClusterCoreNumOp(SnitchRuntimeGetInfo):
    """
    Return total amount of cores for the current cluster
    """

    name = "snrt.cluster_core_num"

name = 'snrt.cluster_core_num' class-attribute instance-attribute

ClusterComputeCoreIdxOp dataclass

Bases: SnitchRuntimeGetInfo

For compute cores return core ID within a cluster

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class ClusterComputeCoreIdxOp(SnitchRuntimeGetInfo):
    """
    For compute cores return core ID within a cluster
    """

    name = "snrt.cluster_compute_core_idx"

name = 'snrt.cluster_compute_core_idx' class-attribute instance-attribute

ClusterComputeCoreNumOp dataclass

Bases: SnitchRuntimeGetInfo

Return number of compute cores for the current cluster

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class ClusterComputeCoreNumOp(SnitchRuntimeGetInfo):
    """
    Return number of compute cores for the current cluster
    """

    name = "snrt.cluster_compute_core_num"

name = 'snrt.cluster_compute_core_num' class-attribute instance-attribute

ClusterDmCoreIdxOp dataclass

Bases: SnitchRuntimeGetInfo

For DMA cores, return core ID within a cluster, currently hardcoded to number of all cores - 1

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class ClusterDmCoreIdxOp(SnitchRuntimeGetInfo):
    """
    For DMA cores, return core ID within a cluster, currently hardcoded to number of all cores - 1
    """

    name = "snrt.cluster_dm_core_idx"

name = 'snrt.cluster_dm_core_idx' class-attribute instance-attribute

ClusterDmCoreNumOp dataclass

Bases: SnitchRuntimeGetInfo

Return amount of DMA cores in this cluster, in the current runtime, this is hardcoded to 1

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class ClusterDmCoreNumOp(SnitchRuntimeGetInfo):
    """
    Return amount of DMA cores in this cluster, in the current runtime, this is hardcoded to 1
    """

    name = "snrt.cluster_dm_core_num"

name = 'snrt.cluster_dm_core_num' class-attribute instance-attribute

ClusterIdxOp dataclass

Bases: SnitchRuntimeGetInfo

Return i32 identifier for the cluster this core is a part of

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class ClusterIdxOp(SnitchRuntimeGetInfo):
    """
    Return i32 identifier for the cluster this core is a part of
    """

    name = "snrt.cluster_idx"

name = 'snrt.cluster_idx' class-attribute instance-attribute

ClusterNumOp dataclass

Bases: SnitchRuntimeGetInfo

Probe the amount of clusters

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class ClusterNumOp(SnitchRuntimeGetInfo):
    """
    Probe the amount of clusters
    """

    name = "snrt.cluster_num"

name = 'snrt.cluster_num' class-attribute instance-attribute

IsComputeCoreOp dataclass

Bases: SnitchRuntimeGetInfoBool

Return non-zero integer if current snitch core is a compute core

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class IsComputeCoreOp(SnitchRuntimeGetInfoBool):
    """
    Return non-zero integer if current snitch core is a compute core
    """

    name = "snrt.is_compute_core"

name = 'snrt.is_compute_core' class-attribute instance-attribute

IsDmCoreOp dataclass

Bases: SnitchRuntimeGetInfoBool

Return non-zero integer if current snitch core is a DMA core

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class IsDmCoreOp(SnitchRuntimeGetInfoBool):
    """
    Return non-zero integer if current snitch core is a DMA core
    """

    name = "snrt.is_dm_core"

name = 'snrt.is_dm_core' class-attribute instance-attribute

ClusterHwBarrierOp dataclass

Bases: NoOperandNoResultBaseOperation

Synchronize cores in a cluster with a hardware barrier

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class ClusterHwBarrierOp(NoOperandNoResultBaseOperation):
    """
    Synchronize cores in a cluster with a hardware barrier
    """

    name = "snrt.cluster_hw_barrier"

name = 'snrt.cluster_hw_barrier' class-attribute instance-attribute

ClusterSwBarrierOp dataclass

Bases: NoOperandNoResultBaseOperation

Synchronize with compute cores after loading data

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class ClusterSwBarrierOp(NoOperandNoResultBaseOperation):
    """
    Synchronize with compute cores after loading data
    """

    name = "snrt.cluster_sw_barrier"

name = 'snrt.cluster_sw_barrier' class-attribute instance-attribute

GlobalBarrierOp dataclass

Bases: NoOperandNoResultBaseOperation

Synchronize clusters globally with a global software barrier

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class GlobalBarrierOp(NoOperandNoResultBaseOperation):
    """
    Synchronize clusters globally with a global software barrier
    """

    name = "snrt.global_barrier"

name = 'snrt.global_barrier' class-attribute instance-attribute

BarrierRegPtrOp dataclass

Bases: SnitchRuntimeGetInfo

Get pointer to barrier register

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class BarrierRegPtrOp(SnitchRuntimeGetInfo):
    """
    Get pointer to barrier register
    """

    name = "snrt.barrier_reg_ptr"

name = 'snrt.barrier_reg_ptr' class-attribute instance-attribute

GetMemoryInfoBaseOperation

Bases: SnitchRuntimeBaseOperation, ABC

Generic base class for operations returning memory slices

Source code in xdsl/dialects/snitch_runtime.py
class GetMemoryInfoBaseOperation(SnitchRuntimeBaseOperation, ABC):
    """
    Generic base class for operations returning memory slices
    """

    slice_begin = result_def(slice_t_begin)
    slice_end = result_def(slice_t_end)

    traits = traits_def(NoMemoryEffect())

    def __init__(
        self,
    ):
        super().__init__(result_types=[slice_t_begin, slice_t_end])

slice_begin = result_def(slice_t_begin) class-attribute instance-attribute

slice_end = result_def(slice_t_end) class-attribute instance-attribute

traits = traits_def(NoMemoryEffect()) class-attribute instance-attribute

__init__()

Source code in xdsl/dialects/snitch_runtime.py
def __init__(
    self,
):
    super().__init__(result_types=[slice_t_begin, slice_t_end])

GlobalMemoryOp dataclass

Bases: GetMemoryInfoBaseOperation

Get start address of global memory

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class GlobalMemoryOp(GetMemoryInfoBaseOperation):
    """
    Get start address of global memory
    """

    name = "snrt.global_memory"

name = 'snrt.global_memory' class-attribute instance-attribute

ClusterMemoryOp dataclass

Bases: GetMemoryInfoBaseOperation

Get start address of the cluster's TCDM memory

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class ClusterMemoryOp(GetMemoryInfoBaseOperation):
    """
    Get start address of the cluster's TCDM memory
    """

    name = "snrt.cluster_memory"

name = 'snrt.cluster_memory' class-attribute instance-attribute

ZeroMemoryOp dataclass

Bases: GetMemoryInfoBaseOperation

Get start address of the cluster's zero memory

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class ZeroMemoryOp(GetMemoryInfoBaseOperation):
    """
    Get start address of the cluster's zero memory
    """

    name = "snrt.zero_memory"

name = 'snrt.zero_memory' class-attribute instance-attribute

DmaStart1DBaseOperation

Bases: SnitchRuntimeBaseOperation, ABC, Generic[_T]

Initiate an asynchronous 1D DMA transfer

Source code in xdsl/dialects/snitch_runtime.py
class DmaStart1DBaseOperation(SnitchRuntimeBaseOperation, ABC, Generic[_T]):
    """
    Initiate an asynchronous 1D DMA transfer
    """

    dst = operand_def(_T)
    src = operand_def(_T)

    size = operand_def(i32)
    transfer_id = result_def(tx_id)

    def __init__(
        self,
        dst: Operation | SSAValue,
        src: Operation | SSAValue,
        size: Operation | SSAValue,
    ):
        super().__init__(operands=[dst, src, size], result_types=[tx_id])

dst = operand_def(_T) class-attribute instance-attribute

src = operand_def(_T) class-attribute instance-attribute

size = operand_def(i32) class-attribute instance-attribute

transfer_id = result_def(tx_id) class-attribute instance-attribute

__init__(dst: Operation | SSAValue, src: Operation | SSAValue, size: Operation | SSAValue)

Source code in xdsl/dialects/snitch_runtime.py
def __init__(
    self,
    dst: Operation | SSAValue,
    src: Operation | SSAValue,
    size: Operation | SSAValue,
):
    super().__init__(operands=[dst, src, size], result_types=[tx_id])

DmaStart2DBaseOperation

Bases: SnitchRuntimeBaseOperation, ABC, Generic[_T]

Generic base class for starting asynchronous 2D DMA transfers

Source code in xdsl/dialects/snitch_runtime.py
class DmaStart2DBaseOperation(SnitchRuntimeBaseOperation, ABC, Generic[_T]):
    """
    Generic base class for starting asynchronous 2D DMA transfers
    """

    dst = operand_def(_T)
    src = operand_def(_T)
    dst_stride = operand_def(i32)
    src_stride = operand_def(i32)
    size = operand_def(i32)
    repeat = operand_def(i32)
    transfer_id = result_def(tx_id)

    def __init__(
        self,
        dst: Operation | SSAValue,
        src: Operation | SSAValue,
        dst_stride: Operation | SSAValue,
        src_stride: Operation | SSAValue,
        size: Operation | SSAValue,
        repeat: Operation | SSAValue,
    ):
        super().__init__(
            operands=[dst, src, dst_stride, src_stride, size, repeat],
            result_types=[tx_id],
        )

dst = operand_def(_T) class-attribute instance-attribute

src = operand_def(_T) class-attribute instance-attribute

dst_stride = operand_def(i32) class-attribute instance-attribute

src_stride = operand_def(i32) class-attribute instance-attribute

size = operand_def(i32) class-attribute instance-attribute

repeat = operand_def(i32) class-attribute instance-attribute

transfer_id = result_def(tx_id) class-attribute instance-attribute

__init__(dst: Operation | SSAValue, src: Operation | SSAValue, dst_stride: Operation | SSAValue, src_stride: Operation | SSAValue, size: Operation | SSAValue, repeat: Operation | SSAValue)

Source code in xdsl/dialects/snitch_runtime.py
def __init__(
    self,
    dst: Operation | SSAValue,
    src: Operation | SSAValue,
    dst_stride: Operation | SSAValue,
    src_stride: Operation | SSAValue,
    size: Operation | SSAValue,
    repeat: Operation | SSAValue,
):
    super().__init__(
        operands=[dst, src, dst_stride, src_stride, size, repeat],
        result_types=[tx_id],
    )

DmaStart1DOp dataclass

Bases: DmaStart1DBaseOperation[I32]

Initiate an asynchronous 1D DMA transfer with 32-bits pointers

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class DmaStart1DOp(DmaStart1DBaseOperation[I32]):
    """
    Initiate an asynchronous 1D DMA transfer with 32-bits pointers
    """

    name = "snrt.dma_start_1d"

name = 'snrt.dma_start_1d' class-attribute instance-attribute

DmaStart1DWideptrOp dataclass

Bases: DmaStart1DBaseOperation[I64]

Initiate an asynchronous 1D DMA transfer with 64-bits wide pointers

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class DmaStart1DWideptrOp(DmaStart1DBaseOperation[I64]):
    """
    Initiate an asynchronous 1D DMA transfer with 64-bits wide pointers
    """

    name = "snrt.dma_start_1d_wideptr"

name = 'snrt.dma_start_1d_wideptr' class-attribute instance-attribute

DmaStart2DOp dataclass

Bases: DmaStart2DBaseOperation[I32]

Initiate an asynchronous 2D DMA transfer with 32-bits pointers

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class DmaStart2DOp(DmaStart2DBaseOperation[I32]):
    """
    Initiate an asynchronous 2D DMA transfer with 32-bits pointers
    """

    name = "snrt.dma_start_2d"

name = 'snrt.dma_start_2d' class-attribute instance-attribute

DmaStart2DWideptrOp dataclass

Bases: DmaStart2DBaseOperation[I64]

Initiate an asynchronous 2D DMA transfer with 64-bits wide pointers

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class DmaStart2DWideptrOp(DmaStart2DBaseOperation[I64]):
    """
    Initiate an asynchronous 2D DMA transfer with 64-bits wide pointers
    """

    name = "snrt.dma_start_2d_wideptr"

name = 'snrt.dma_start_2d_wideptr' class-attribute instance-attribute

DmaWaitOp

Bases: SnitchRuntimeBaseOperation

Block until a transfer finishes

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class DmaWaitOp(SnitchRuntimeBaseOperation):
    """
    Block until a transfer finishes
    """

    name = "snrt.dma_wait"
    transfer_id = operand_def(tx_id)

    def __init__(self, transfer_id: Operation | SSAValue):
        super().__init__(operands=[transfer_id])

name = 'snrt.dma_wait' class-attribute instance-attribute

transfer_id = operand_def(tx_id) class-attribute instance-attribute

__init__(transfer_id: Operation | SSAValue)

Source code in xdsl/dialects/snitch_runtime.py
def __init__(self, transfer_id: Operation | SSAValue):
    super().__init__(operands=[transfer_id])

DmaWaitAllOp dataclass

Bases: NoOperandNoResultBaseOperation

Block until all operations on the DMA cease

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class DmaWaitAllOp(NoOperandNoResultBaseOperation):
    """
    Block until all operations on the DMA cease
    """

    name = "snrt.dma_wait_all"

name = 'snrt.dma_wait_all' class-attribute instance-attribute

SsrLoopBaseOp

Bases: SnitchRuntimeBaseOperation, ABC

Configure an SSR data mover for an n-dimensional loop nest. bounds (limits of loop) and strides (increments of size) are ordered from inner-most to outer-most loops.

for example: for (i = 0; i < 5; i++) { //bounds[1] = 5 and strides[1] = 1 for (j = 0; j < 6; j+=2) { //bounds[0] = 6 and strides[0] = 2 ... } }

Source code in xdsl/dialects/snitch_runtime.py
class SsrLoopBaseOp(SnitchRuntimeBaseOperation, ABC):
    """
    Configure an SSR data mover for an n-dimensional loop nest.
    bounds (limits of loop) and strides (increments of size) are ordered from inner-most to outer-most loops.

    for example:
    for (i = 0; i < 5; i++) { //bounds[1] = 5 and strides[1] = 1
        for (j = 0; j < 6; j+=2) { //bounds[0] = 6 and strides[0] = 2
            ...
        }
    }
    """

    data_mover = operand_def(i32)
    bounds = var_operand_def(IndexType)
    strides = var_operand_def(IndexType)
    irdl_options = (AttrSizedOperandSegments(),)

    def verify_(self) -> None:
        if len(self.bounds) != len(self.strides):
            raise VerifyException(
                f"the length of bounds ({len(self.bounds)}) and strides ({len(self.strides)}) must be equal."
            )
        if len(self.strides) != self.num:
            raise VerifyException(
                f"Epected {self.num} bounds and strides, got {len(self.strides)}"
            )

    def __init__(
        self,
        data_mover: Operation | SSAValue,
        bounds: Sequence[Operation | SSAValue],
        strides: Sequence[Operation | SSAValue],
    ):
        super().__init__(operands=[data_mover, bounds, strides])

    @property
    @abstractmethod
    def num(self) -> int:
        raise NotImplementedError()

data_mover = operand_def(i32) class-attribute instance-attribute

bounds = var_operand_def(IndexType) class-attribute instance-attribute

strides = var_operand_def(IndexType) class-attribute instance-attribute

irdl_options = (AttrSizedOperandSegments(),) class-attribute instance-attribute

num: int abstractmethod property

verify_() -> None

Source code in xdsl/dialects/snitch_runtime.py
def verify_(self) -> None:
    if len(self.bounds) != len(self.strides):
        raise VerifyException(
            f"the length of bounds ({len(self.bounds)}) and strides ({len(self.strides)}) must be equal."
        )
    if len(self.strides) != self.num:
        raise VerifyException(
            f"Epected {self.num} bounds and strides, got {len(self.strides)}"
        )

__init__(data_mover: Operation | SSAValue, bounds: Sequence[Operation | SSAValue], strides: Sequence[Operation | SSAValue])

Source code in xdsl/dialects/snitch_runtime.py
def __init__(
    self,
    data_mover: Operation | SSAValue,
    bounds: Sequence[Operation | SSAValue],
    strides: Sequence[Operation | SSAValue],
):
    super().__init__(operands=[data_mover, bounds, strides])

SsrLoop1dOp dataclass

Bases: SsrLoopBaseOp

Configure an SSR data mover for a 1D loop nest.

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class SsrLoop1dOp(SsrLoopBaseOp):
    """
    Configure an SSR data mover for a 1D loop nest.
    """

    name = "snrt.ssr_loop_1d"

    @property
    def num(self) -> int:
        return 1

name = 'snrt.ssr_loop_1d' class-attribute instance-attribute

num: int property

SsrLoop2dOp dataclass

Bases: SsrLoopBaseOp

Configure an SSR data mover for a 2D loop nest.

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class SsrLoop2dOp(SsrLoopBaseOp):
    """
    Configure an SSR data mover for a 2D loop nest.
    """

    name = "snrt.ssr_loop_2d"

    @property
    def num(self) -> int:
        return 2

name = 'snrt.ssr_loop_2d' class-attribute instance-attribute

num: int property

SsrLoop3dOp dataclass

Bases: SsrLoopBaseOp

Configure an SSR data mover for a 3D loop nest.

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class SsrLoop3dOp(SsrLoopBaseOp):
    """
    Configure an SSR data mover for a 3D loop nest.
    """

    name = "snrt.ssr_loop_3d"

    @property
    def num(self) -> int:
        return 3

name = 'snrt.ssr_loop_3d' class-attribute instance-attribute

num: int property

SsrLoop4dOp dataclass

Bases: SsrLoopBaseOp

Configure an SSR data mover for a 4D loop nest.

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class SsrLoop4dOp(SsrLoopBaseOp):
    """
    Configure an SSR data mover for a 4D loop nest.
    """

    name = "snrt.ssr_loop_4d"

    @property
    def num(self) -> int:
        return 4

name = 'snrt.ssr_loop_4d' class-attribute instance-attribute

num: int property

SsrRepeatOp

Bases: SnitchRuntimeBaseOperation, ABC

Configure the repetition count for a stream.

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class SsrRepeatOp(SnitchRuntimeBaseOperation, ABC):
    """
    Configure the repetition count for a stream.
    """

    name = "snrt.ssr_repeat"
    dm = prop_def(IntegerAttr[IntegerType])
    count = operand_def(i32)

    def __init__(
        self,
        dm: int | IntegerAttr[IntegerType],
        count: Operation | SSAValue,
    ):
        if isinstance(dm, int):
            dm = IntegerAttr(dm, i32)

        super().__init__(operands=[count], properties={"dm": dm})

name = 'snrt.ssr_repeat' class-attribute instance-attribute

dm = prop_def(IntegerAttr[IntegerType]) class-attribute instance-attribute

count = operand_def(i32) class-attribute instance-attribute

__init__(dm: int | IntegerAttr[IntegerType], count: Operation | SSAValue)

Source code in xdsl/dialects/snitch_runtime.py
def __init__(
    self,
    dm: int | IntegerAttr[IntegerType],
    count: Operation | SSAValue,
):
    if isinstance(dm, int):
        dm = IntegerAttr(dm, i32)

    super().__init__(operands=[count], properties={"dm": dm})

SsrEnableOp dataclass

Bases: NoOperandNoResultBaseOperation

Enable SSR.

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class SsrEnableOp(NoOperandNoResultBaseOperation):
    """
    Enable SSR.
    """

    name = "snrt.ssr_enable"

name = 'snrt.ssr_enable' class-attribute instance-attribute

SsrDisableOp dataclass

Bases: NoOperandNoResultBaseOperation

Disable SSR.

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class SsrDisableOp(NoOperandNoResultBaseOperation):
    """
    Disable SSR.
    """

    name = "snrt.ssr_disable"

name = 'snrt.ssr_disable' class-attribute instance-attribute

SsrReadWriteBaseOperation

Bases: SnitchRuntimeBaseOperation, ABC

Source code in xdsl/dialects/snitch_runtime.py
class SsrReadWriteBaseOperation(SnitchRuntimeBaseOperation, ABC):
    dm = prop_def(IntegerAttr[IntegerType])
    dim = prop_def(IntegerAttr[IntegerType])
    ptr = operand_def(i32)

    def __init__(
        self,
        dm: int | IntegerAttr[IntegerType],
        dim: int | IntegerAttr[IntegerType],
        ptr: Operation | SSAValue,
    ):
        if isinstance(dm, int):
            dm = IntegerAttr(dm, i32)

        if isinstance(dim, int):
            dim = IntegerAttr(dim, i32)

        super().__init__(
            operands=[ptr],
            properties={
                "dm": dm,
                "dim": dim,
            },
        )

dm = prop_def(IntegerAttr[IntegerType]) class-attribute instance-attribute

dim = prop_def(IntegerAttr[IntegerType]) class-attribute instance-attribute

ptr = operand_def(i32) class-attribute instance-attribute

__init__(dm: int | IntegerAttr[IntegerType], dim: int | IntegerAttr[IntegerType], ptr: Operation | SSAValue)

Source code in xdsl/dialects/snitch_runtime.py
def __init__(
    self,
    dm: int | IntegerAttr[IntegerType],
    dim: int | IntegerAttr[IntegerType],
    ptr: Operation | SSAValue,
):
    if isinstance(dm, int):
        dm = IntegerAttr(dm, i32)

    if isinstance(dim, int):
        dim = IntegerAttr(dim, i32)

    super().__init__(
        operands=[ptr],
        properties={
            "dm": dm,
            "dim": dim,
        },
    )

SsrReadOp dataclass

Bases: SsrReadWriteBaseOperation

Start a streaming read with a given dimensionality.

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class SsrReadOp(SsrReadWriteBaseOperation):
    """
    Start a streaming read with a given dimensionality.
    """

    name = "snrt.ssr_read"

name = 'snrt.ssr_read' class-attribute instance-attribute

SsrWriteOp dataclass

Bases: SsrReadWriteBaseOperation

Start a streaming write with a given dimensionality.

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class SsrWriteOp(SsrReadWriteBaseOperation):
    """
    Start a streaming write with a given dimensionality.
    """

    name = "snrt.ssr_write"

name = 'snrt.ssr_write' class-attribute instance-attribute

FpuFenceOp dataclass

Bases: NoOperandNoResultBaseOperation

Synchronize the integer and float pipelines.

Source code in xdsl/dialects/snitch_runtime.py
@irdl_op_definition
class FpuFenceOp(NoOperandNoResultBaseOperation):
    """
    Synchronize the integer and float pipelines.
    """

    name = "snrt.fpu_fence"

name = 'snrt.fpu_fence' class-attribute instance-attribute