Accfg
accfg
¶
ACCFG = Dialect('accfg', [AcceleratorOp, AwaitOp, LaunchOp, ResetOp, SetupOp], [EffectsAttr, StateType, TokenType])
module-attribute
¶
EffectsEnum
¶
Bases: Enum
Specify to explicitly say: * NONE: There are no accfg side-effects to this operation * FULL: There are accfg side-effects to this operation
Source code in xdsl/dialects/accfg.py
EffectsAttr
dataclass
¶
Bases: Data[EffectsEnum]
An Attribute specifying if the marked operation has any effects on accelerator states.
Source code in xdsl/dialects/accfg.py
name = 'accfg.effects'
class-attribute
instance-attribute
¶
parse_parameter(parser: AttrParser) -> EffectsEnum
classmethod
¶
Source code in xdsl/dialects/accfg.py
TokenType
¶
Bases: ParametrizedAttribute, TypeAttribute
Async token type for launched accelerator requests.
Source code in xdsl/dialects/accfg.py
StateType
¶
Bases: ParametrizedAttribute, TypeAttribute
Used to trace an accelerators CSR state through def-use chain
Source code in xdsl/dialects/accfg.py
LaunchOp
¶
Bases: IRDLOperation
Launch an accelerator. This acts as a barrier for CSR values, meaning CSRs can be safely modified after a launch op without interfering with the Accelerator.
Source code in xdsl/dialects/accfg.py
name = 'accfg.launch'
class-attribute
instance-attribute
¶
values = var_operand_def(Attribute)
class-attribute
instance-attribute
¶
The actual values used to set up registers linked to launch
state = operand_def(StateType)
class-attribute
instance-attribute
¶
param_names = prop_def(ArrayAttr[StringAttr])
class-attribute
instance-attribute
¶
Maps the SSA values in values to accelerator launch parameters
accelerator = prop_def(StringAttr)
class-attribute
instance-attribute
¶
token = result_def()
class-attribute
instance-attribute
¶
__init__(vals: Sequence[SSAValue | Operation], param_names: Iterable[str] | Iterable[StringAttr], state: SSAValue | Operation)
¶
Source code in xdsl/dialects/accfg.py
iter_params() -> Iterable[tuple[str, SSAValue]]
¶
verify_() -> None
¶
Source code in xdsl/dialects/accfg.py
AwaitOp
¶
Bases: IRDLOperation
Blocks until the launched operation finishes.
Source code in xdsl/dialects/accfg.py
SetupOp
¶
Bases: IRDLOperation
accfg.setup writes values to a specific accelerators configuration and returns a value representing the currently known state of that accelerator's config.
If accfg.setup is called without any parameters, the resulting state is the "empty" state, that represents a state without known values.
Source code in xdsl/dialects/accfg.py
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | |
name = 'accfg.setup'
class-attribute
instance-attribute
¶
values = var_operand_def(Attribute)
class-attribute
instance-attribute
¶
The actual values used to set up the CSRs
in_state = opt_operand_def(StateType)
class-attribute
instance-attribute
¶
The state produced by a previous accfg.setup
out_state = result_def(StateType)
class-attribute
instance-attribute
¶
The CSR state after the setup op modified it.
param_names = prop_def(ArrayAttr[StringAttr])
class-attribute
instance-attribute
¶
Maps the SSA values in values to accelerator parameter names
accelerator = prop_def(StringAttr)
class-attribute
instance-attribute
¶
Name of the accelerator this setup is for
irdl_options = (AttrSizedOperandSegments(as_property=True),)
class-attribute
instance-attribute
¶
__init__(vals: Sequence[SSAValue | Operation], param_names: Sequence[str] | Sequence[StringAttr], accelerator: str | StringAttr, in_state: SSAValue | Operation | None = None)
¶
Source code in xdsl/dialects/accfg.py
iter_params() -> Iterable[tuple[str, SSAValue]]
¶
verify_() -> None
¶
Source code in xdsl/dialects/accfg.py
print(printer: Printer)
¶
Source code in xdsl/dialects/accfg.py
parse(parser: Parser) -> SetupOp
classmethod
¶
Source code in xdsl/dialects/accfg.py
AcceleratorSymbolOpTrait
dataclass
¶
Bases: SymbolOpInterface
Source code in xdsl/dialects/accfg.py
AcceleratorOp
¶
Bases: IRDLOperation
Declares an accelerator that can be configured, launched, etc.
fields is a dictionary mapping accelerator configuration names to
CSR addresses.
Source code in xdsl/dialects/accfg.py
name = 'accfg.accelerator'
class-attribute
instance-attribute
¶
traits = traits_def(AcceleratorSymbolOpTrait())
class-attribute
instance-attribute
¶
name_prop = prop_def(SymbolRefAttr, prop_name='name')
class-attribute
instance-attribute
¶
fields = prop_def(DictionaryAttr)
class-attribute
instance-attribute
¶
launch_fields = prop_def(DictionaryAttr)
class-attribute
instance-attribute
¶
barrier = prop_def(IntegerAttr[IntegerType])
class-attribute
instance-attribute
¶
__init__(name: str | StringAttr | SymbolRefAttr, fields: dict[str, int] | DictionaryAttr, launch_fields: dict[str, int] | DictionaryAttr, barrier: int | IntegerAttr[IntegerType])
¶
Source code in xdsl/dialects/accfg.py
verify_() -> None
¶
field_names() -> tuple[str, ...]
¶
field_items() -> Iterable[tuple[str, IntegerAttr]]
¶
launch_field_names() -> tuple[str, ...]
¶
ResetOp
¶
Bases: IRDLOperation