IRON  1.0
Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes | List of all members
iron.worker.Worker Class Reference
Inheritance diagram for iron.worker.Worker:
Inheritance graph
[legend]
Collaboration diagram for iron.worker.Worker:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, Callable|None core_fn, list fn_args=[], PlacementTile|None placement=AnyComputeTile, bool while_true=True)
 
None place (self, Tile tile)
 
list[ObjectFifoHandlefifos (self)
 
list[GlobalBufferbuffers (self)
 
None resolve (self, ir.Location|None loc=None, ir.InsertionPoint|None ip=None)
 
- Public Member Functions inherited from iron.placeable.Placeable
def __init__ (self, PlacementTile|None tile)
 
PlacementTile|None tile (self)
 

Public Attributes

 core_fn
 
 fn_args
 
 link_with
 

Static Public Attributes

 current_core_placement
 

Private Attributes

 _tile
 
 _while_true
 
 _fifos
 
 _buffers
 

Detailed Description

_summary_
Worker is an object that takes a `core_fn` and a set of arguments.
A Worker must be placed on a Compute Core.
This variable is the current core if resolving() within the Worker, or None otherwise.

Constructor & Destructor Documentation

◆ __init__()

def iron.worker.Worker.__init__ (   self,
Callable | None  core_fn,
list   fn_args = [],
PlacementTile | None   placement = AnyComputeTile,
bool   while_true = True 
)
Construct a Worker

Args:
    core_fn (Callable | None): The task to run on a core. If None, a busy-loop (`while(true): pass`) core will be generated.
    fn_args (list, optional): Pointers to arguments, which should include all context the core_fn needs to run. Defaults to [].
    placement (PlacementTile | None, optional): The placcement for the Worker. Defaults to AnyComputeTile.
    while_true (bool, optional): If true, will wrap the core_fn in a while(true) loop to ensure it runs until reconfiguration. Defaults to True.

Raises:
    ValueError: Parameters are validated.

Member Function Documentation

◆ buffers()

list[GlobalBuffer] iron.worker.Worker.buffers (   self)
Returns a list of GlobalBuffers given to the Worker via fn_args.

Returns:
    list[GlobalBuffer]: GlobalBuffers used by the Worker.

◆ fifos()

list[ObjectFifoHandle] iron.worker.Worker.fifos (   self)
Returns a list of ObjectFifoHandles given to the Worker via fn_args.

Returns:
    list[ObjectFifoHandle]: ObjectFifoHandles used by the Worker.

◆ place()

None iron.worker.Worker.place (   self,
Tile  tile 
)
Set the placement of the Worker.

Args:
    tile (Tile): The placement location.

Reimplemented from iron.placeable.Placeable.

◆ resolve()

None iron.worker.Worker.resolve (   self,
ir.Location | None   loc = None,
ir.InsertionPoint | None   ip = None 
)

Member Data Documentation

◆ _buffers

iron.worker.Worker._buffers
private

◆ _fifos

iron.worker.Worker._fifos
private

◆ _tile

iron.worker.Worker._tile
private

◆ _while_true

iron.worker.Worker._while_true
private

◆ core_fn

iron.worker.Worker.core_fn

◆ current_core_placement

iron.worker.Worker.current_core_placement
static
Initial value:
= contextvars.ContextVar(
"current_core_placement", default=None
)

◆ fn_args

iron.worker.Worker.fn_args

◆ link_with

iron.worker.Worker.link_with

The documentation for this class was generated from the following file: