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

Public Member Functions

def __init__ (self, type[np.ndarray]|None type=None, np.ndarray|None initial_value=None, str|None name=None, PlacementTile|None placement=None, bool use_write_rtp=False)
 
Sequence[int] shape (self)
 
np.dtype dtype (self)
 
def __getitem__ (self, idx)
 
def __setitem__ (self, idx, source)
 
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)
 
None place (self, Tile tile)
 
PlacementTile|None tile (self)
 

Private Member Functions

int __get_index (cls)
 

Private Attributes

 _initial_value
 
 _name
 
 _op
 
 _arr_type
 
 _use_write_rtp
 

Static Private Attributes

int __gbuf_index = 0
 

Detailed Description

A buffer that is available both to Workers and to the Runtime for operations.
This is often used for Runtime Parameters.
This is used to generate unique names if none is given during construction

Constructor & Destructor Documentation

◆ __init__()

def iron.globalbuffer.GlobalBuffer.__init__ (   self,
type[np.ndarray] | None   type = None,
np.ndarray | None   initial_value = None,
str | None   name = None,
PlacementTile | None   placement = None,
bool   use_write_rtp = False 
)
A GlobalBuffer is a memory region declared at the top-level of the design, allowing it to
be accessed by both Workers and the Runtime.

Args:
    type (type[np.ndarray] | None, optional): The type of the buffer. Defaults to None.
    initial_value (np.ndarray | None, optional): An initial value to set the buffer to. Should be of same datatype and shape as the buffer. Defaults to None.
    name (str | None, optional): The name of the buffer. If none is given, a unique name will be generated. Defaults to None.
    placement (PlacementTile | None, optional): A placement location for the buffer. Defaults to None.
    use_write_rtp (bool, optional): If use_write_rtp, write_rtp/read_rtp operations will be generated. Otherwise, traditional write/read operations will be used. Defaults to False.

Raises:
    ValueError: Arguments are validated.

Member Function Documentation

◆ __get_index()

int iron.globalbuffer.GlobalBuffer.__get_index (   cls)
private

◆ __getitem__()

def iron.globalbuffer.GlobalBuffer.__getitem__ (   self,
  idx 
)

◆ __setitem__()

def iron.globalbuffer.GlobalBuffer.__setitem__ (   self,
  idx,
  source 
)

◆ dtype()

np.dtype iron.globalbuffer.GlobalBuffer.dtype (   self)
The per-element datatype of the buffer.

◆ resolve()

None iron.globalbuffer.GlobalBuffer.resolve (   cls,
ir.Location | None   loc = None,
ir.InsertionPoint | None   ip = None 
)
Resolve the current object into one or more MLIR operations.
Should only be called within an MLIR context.

Args:
    loc (ir.Location | None, optional): Location is used by MLIR object during construction in some cases. Defaults to None.
    ip (ir.InsertionPoint | None, optional): InsertionPoint is used by MLIR object during construction in some cases. Defaults to None.

Reimplemented from iron.resolvable.Resolvable.

◆ shape()

Sequence[int] iron.globalbuffer.GlobalBuffer.shape (   self)
The shape of the buffer

Member Data Documentation

◆ __gbuf_index

int iron.globalbuffer.GlobalBuffer.__gbuf_index = 0
staticprivate

◆ _arr_type

iron.globalbuffer.GlobalBuffer._arr_type
private

◆ _initial_value

iron.globalbuffer.GlobalBuffer._initial_value
private

◆ _name

iron.globalbuffer.GlobalBuffer._name
private

◆ _op

iron.globalbuffer.GlobalBuffer._op
private

◆ _use_write_rtp

iron.globalbuffer.GlobalBuffer._use_write_rtp
private

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