elasticai.creator.hdl_ir#

Module Contents#

Classes#

Shape

Node

Extending ir.core.Node to an hdl specific node.

NodeImpl

Edge

EdgeImpl

DataGraph

DataGraphImpl

IrFactory

Functions#

API#

elasticai.creator.hdl_ir.is_shape_tuple(values) TypeGuard[elasticai.creator.hdl_ir.ShapeTuple][source]#
class elasticai.creator.hdl_ir.Shape(*values: int)[source]#

Initialization

values are interpreted as one of the following:

  • width

  • depth, width

  • depth, width, height

Usually width is kernel_size, depth is channels

classmethod from_tuple(values: elasticai.creator.hdl_ir.ShapeTuple | list[int]) elasticai.creator.hdl_ir.Shape[source]#
to_tuple() elasticai.creator.hdl_ir.ShapeTuple[source]#
to_list() list[int][source]#
__getitem__(item)[source]#
size() int[source]#
ndim() int[source]#
property depth: int#
__eq__(other)[source]#
property width: int#
property height: int#
__repr__() str[source]#
class elasticai.creator.hdl_ir.Node[source]#

Bases: elasticai.creator.ir.ir_v2.Node, typing.Protocol

Extending ir.core.Node to an hdl specific node.

This node contains all knowledge that we need to create and use an instance of an hdl component. However, this becomes a little bit complicated because vhdl differentiates between

Attributes:

implementation:: The name of the implementation, e.g., entity name in vhdl or module name for verilog, will be used to derive the architecture name. E.g., if the implementation is "adder", we will instantiate the entity work.adder(rtl). CAUTION: This behaviour is subject to change. Future versions might require the full entity name

property implementation: str#
property input_shape: elasticai.creator.hdl_ir.Shape#
property output_shape: elasticai.creator.hdl_ir.Shape#
class elasticai.creator.hdl_ir.NodeImpl(name: str, attributes: elasticai.creator.ir.attribute.AttributeMapping)[source]#

Bases: elasticai.creator.ir.ir_v2.NodeImpl

property implementation: str#
property input_shape: elasticai.creator.hdl_ir.Shape#
property output_shape: elasticai.creator.hdl_ir.Shape#
class elasticai.creator.hdl_ir.Edge[source]#

Bases: elasticai.creator.ir.ir_v2.Edge, typing.Protocol

property src_dst_indices: tuple[tuple[int | str, int | str], ...]#
class elasticai.creator.hdl_ir.EdgeImpl(src: str, dst: str, attributes: elasticai.creator.ir.attribute.AttributeMapping)[source]#

Bases: elasticai.creator.ir.ir_v2.EdgeImpl

property src_dst_indices: tuple[tuple[int | str, int | str], ...]#
class elasticai.creator.hdl_ir.DataGraph[source]#

Bases: elasticai.creator.ir.ir_v2.DataGraph[elasticai.creator.hdl_ir.Node, elasticai.creator.hdl_ir.Edge], typing.Protocol

property name: str#
property type: str#
class elasticai.creator.hdl_ir.DataGraphImpl(/, factory: elasticai.creator.ir.attribute.AttributeMapping, attributes: elasticai.creator.ir.graph.Graph[str, elasticai.creator.ir.attribute.AttributeMapping], graph: elasticai.creator.ir.attribute.AttributeMapping, node_attributes)[source]#

Bases: elasticai.creator.ir.ir_v2.DataGraphImpl[elasticai.creator.hdl_ir.Node, elasticai.creator.hdl_ir.Edge]

property name: str#
property type: str#
class elasticai.creator.hdl_ir.IrFactory[source]#
node(name: str, attributes: elasticai.creator.ir.ir_v2.AttributeMapping = ir.AttributeMapping(), /, type: str | None = None, input_shape: elasticai.creator.hdl_ir.Shape | None = None, output_shape: elasticai.creator.hdl_ir.Shape | None = None, implementation: str | None = None) elasticai.creator.hdl_ir.Node[source]#
edge(src: str, dst: str, attributes: elasticai.creator.ir.ir_v2.AttributeMapping = ir.AttributeMapping(), /, src_dst_indices: collections.abc.Iterable[tuple[int, int]] | tuple[str, str] = tuple()) elasticai.creator.hdl_ir.Edge[source]#
graph(attributes: elasticai.creator.ir.ir_v2.AttributeMapping = ir.AttributeMapping(), *, type: str | None = None, name: str | None = None, other: elasticai.creator.ir.ir_v2.DataGraph[elasticai.creator.ir.ir_v2.Node, elasticai.creator.ir.ir_v2.Edge] | None = None) elasticai.creator.hdl_ir.DataGraph[source]#