Snitch
snitch
This dialect provides operations to target features of the Snitch[1] streaming architecture based on custom extensions to the RISC-V ISA. This dialect works on 'riscv' types directly as all arguments are of 'riscv.reg<>' type and it is meant to be as close as possible to the asm that aims at generating.
[1] https://pulp-platform.github.io/snitch/publications
Snitch = Dialect('snitch', [SsrSetDimensionBoundOp, SsrSetDimensionStrideOp, SsrSetDimensionSourceOp, SsrSetDimensionDestinationOp, SsrSetStreamRepetitionOp, SsrEnableOp, SsrDisableOp], [ReadableStreamType, WritableStreamType])
module-attribute
ReadableStreamType
dataclass
Bases: ParametrizedAttribute, TypeAttribute, ContainerType[_StreamTypeElement], Generic[_StreamTypeElement]
Source code in xdsl/dialects/snitch.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
name = 'snitch.readable'
class-attribute
instance-attribute
element_type: _StreamTypeElement
instance-attribute
get_element_type() -> _StreamTypeElement
Source code in xdsl/dialects/snitch.py
59 60 | |
constr(element_type: AttrConstraint[_StreamTypeElement] = AnyAttr()) -> ParamAttrConstraint[ReadableStreamType[_StreamTypeElement]]
staticmethod
Source code in xdsl/dialects/snitch.py
62 63 64 65 66 67 68 | |
WritableStreamType
dataclass
Bases: ParametrizedAttribute, TypeAttribute, ContainerType[_StreamTypeElement], Generic[_StreamTypeElement]
Source code in xdsl/dialects/snitch.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
name = 'snitch.writable'
class-attribute
instance-attribute
element_type: _StreamTypeElement
instance-attribute
get_element_type() -> _StreamTypeElement
Source code in xdsl/dialects/snitch.py
82 83 | |
constr(element_type: AttrConstraint[_StreamTypeElement] = AnyAttr()) -> ParamAttrConstraint[WritableStreamType[_StreamTypeElement]]
staticmethod
Source code in xdsl/dialects/snitch.py
85 86 87 88 89 90 91 | |
SnitchResources
dataclass
Bounds for resources provided by the Snitch architecture.
Source code in xdsl/dialects/snitch.py
94 95 96 97 98 99 100 101 | |
dimensions: int = 4
class-attribute
instance-attribute
__init__(dimensions: int = 4) -> None
SsrSetDimensionConfigOperation
Bases: IRDLOperation, ABC
A base class for Snitch operations that set a configuration value for a specific dimension handled by a streamer.
Source code in xdsl/dialects/snitch.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
value = operand_def(IntRegisterType)
class-attribute
instance-attribute
dm = attr_def(IntAttr)
class-attribute
instance-attribute
dimension = attr_def(IntAttr)
class-attribute
instance-attribute
__init__(value: Operation | SSAValue, dm: IntAttr, dimension: IntAttr)
Source code in xdsl/dialects/snitch.py
114 115 116 117 118 119 120 121 122 123 124 125 126 | |
verify_() -> None
Source code in xdsl/dialects/snitch.py
128 129 130 131 132 133 | |
SsrSetStreamConfigOperation
Bases: IRDLOperation, ABC
A base class for Snitch operations that set a configuration value for a streamer.
Source code in xdsl/dialects/snitch.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | |
value = operand_def(IntRegisterType)
class-attribute
instance-attribute
dm = attr_def(IntAttr)
class-attribute
instance-attribute
__init__(value: Operation | SSAValue, dm: IntAttr)
Source code in xdsl/dialects/snitch.py
145 146 147 148 149 150 151 | |
SsrSetDimensionBoundOp
dataclass
Bases: SsrSetDimensionConfigOperation
Set the bound for one of the dimensions handled by a specific streamer.
Source code in xdsl/dialects/snitch.py
154 155 156 157 158 159 160 161 | |
name = 'snitch.ssr_set_dimension_bound'
class-attribute
instance-attribute
SsrSetDimensionStrideOp
dataclass
Bases: SsrSetDimensionConfigOperation
Set the stride for one of the dimensions handled by a specific streamer.
Source code in xdsl/dialects/snitch.py
164 165 166 167 168 169 170 171 | |
name = 'snitch.ssr_set_dimension_stride'
class-attribute
instance-attribute
SsrSetDimensionSourceOp
dataclass
Bases: SsrSetDimensionConfigOperation
Set the data source for one of the dimensions handled by a specific streamer.
Source code in xdsl/dialects/snitch.py
174 175 176 177 178 179 180 181 | |
name = 'snitch.ssr_set_dimension_source'
class-attribute
instance-attribute
SsrSetDimensionDestinationOp
dataclass
Bases: SsrSetDimensionConfigOperation
Set the data destination for one of the dimensions handled by a specific streamer.
Source code in xdsl/dialects/snitch.py
184 185 186 187 188 189 190 191 | |
name = 'snitch.ssr_set_dimension_destination'
class-attribute
instance-attribute
SsrSetStreamRepetitionOp
dataclass
Bases: SsrSetStreamConfigOperation
Setup repetition count for a specific data mover.
Source code in xdsl/dialects/snitch.py
194 195 196 197 198 199 200 | |
name = 'snitch.ssr_set_stream_repetition'
class-attribute
instance-attribute
SsrEnableOp
Bases: IRDLOperation
Enable stream semantics.
Source code in xdsl/dialects/snitch.py
203 204 205 206 207 208 209 210 211 212 213 214 | |
name = 'snitch.ssr_enable'
class-attribute
instance-attribute
streams = var_result_def(ReadableStreamType.constr() | WritableStreamType.constr())
class-attribute
instance-attribute
__init__(stream_types: Sequence[Attribute])
Source code in xdsl/dialects/snitch.py
213 214 | |
SsrDisableOp
Bases: IRDLOperation
Disable stream semantics.
Source code in xdsl/dialects/snitch.py
217 218 219 220 221 222 223 224 225 226 | |
name = 'snitch.ssr_disable'
class-attribute
instance-attribute
__init__()
Source code in xdsl/dialects/snitch.py
225 226 | |