elasticai.creator.ir2vhdl#
Package Contents#
Classes#
Represents an entity that we can/want instantiate. |
|
Automatically creates Instances from VhdlNodes based on their |
|
PluginLoader for Ir2Vhdl passes. |
|
Find the entity in vhdl code and make its name available as a template paramter. |
|
Find a value definition and make it settable via a template parameter. |
|
Functions#
Data#
API#
- class elasticai.creator.ir2vhdl.Ir2Vhdl[source]#
Initialization
- __call__(root: elasticai.creator.hdl_ir.DataGraph, registry: elasticai.creator.hdl_ir.Registry, default_root_name='root') collections.abc.Iterable[elasticai.creator.hdl_ir.Code][source]#
- register_static(name: str | None, fn: collections.abc.Callable[[], str]) collections.abc.Callable[[], str][source]#
- class elasticai.creator.ir2vhdl.Signal[source]#
Bases:
abc.ABC- types: set[type[elasticai.creator.ir2vhdl.language.Signal]]#
‘set(…)’
- abstract property name: str#
- classmethod from_code(code: str) elasticai.creator.ir2vhdl.language.Signal[source]#
- classmethod register_type(t: type[elasticai.creator.ir2vhdl.language.Signal]) None[source]#
- abstractmethod make_instance_specific(instance: str) elasticai.creator.ir2vhdl.language.Signal[source]#
- class elasticai.creator.ir2vhdl.Instance(node: elasticai.creator.hdl_ir.Node, generic_map: dict[str, str], port_map: dict[str, elasticai.creator.ir2vhdl.language.Signal])[source]#
Represents an entity that we can/want instantiate.
The aggregates all the knowledge that is necessary to instantiate and use the corresponding entity programmatically, when generating vhdl code.
Initialization
- property input_shape: elasticai.creator.hdl_ir.Shape#
- property output_shape: elasticai.creator.hdl_ir.Shape#
- property name: str#
- property implementation: str#
- elasticai.creator.ir2vhdl.factory#
‘IrFactory(…)’
- class elasticai.creator.ir2vhdl.InstanceFactory[source]#
Automatically creates Instances from VhdlNodes based on their
typefield.- register(type: str | None, fn: collections.abc.Callable[[elasticai.creator.hdl_ir.Node], elasticai.creator.ir2vhdl.language.Instance]) collections.abc.Callable[[elasticai.creator.hdl_ir.Node], elasticai.creator.ir2vhdl.language.Instance][source]#
- class elasticai.creator.ir2vhdl.LogicSignal(name: str)[source]#
Bases:
elasticai.creator.ir2vhdl.language.Signal- property name: str#
- classmethod from_code(code: str) elasticai.creator.ir2vhdl.language.Signal[source]#
- make_instance_specific(instance: str) elasticai.creator.ir2vhdl.language.Signal[source]#
- class elasticai.creator.ir2vhdl.LogicVectorSignal(name: str, width: int)[source]#
Bases:
elasticai.creator.ir2vhdl.language.Signal- property name: str#
- property width: int#
- classmethod from_code(code: str) elasticai.creator.ir2vhdl.language.Signal[source]#
- make_instance_specific(instance: str) elasticai.creator.ir2vhdl.language.Signal[source]#
- class elasticai.creator.ir2vhdl.NullDefinedLogicSignal(name)[source]#
Bases:
elasticai.creator.ir2vhdl.language.Signal- property name: str#
- classmethod from_code(code: str) elasticai.creator.ir2vhdl.language.Signal[source]#
- make_instance_specific(instance: str) elasticai.creator.ir2vhdl.language.Signal[source]#
- class elasticai.creator.ir2vhdl.PluginLoader(lowering: elasticai.creator.ir2vhdl.ir2vhdl.Ir2Vhdl)[source]#
Bases:
elasticai.creator.plugin.PluginLoaderBasePluginLoader for Ir2Vhdl passes.
Initialization
- filter_plugin_dicts(plugins: collections.abc.Iterable[dict[str, Any]]) collections.abc.Iterable[dict[str, Any]][source]#
- get_symbols(specs: collections.abc.Iterable[elasticai.creator.ir2vhdl.ir2vhdl.PluginSpec]) collections.abc.Iterable[elasticai.creator.ir2vhdl.ir2vhdl.PluginSymbol][source]#
- load_symbol(symbol: elasticai.creator.ir2vhdl.ir2vhdl.PluginSymbol) None[source]#
- class elasticai.creator.ir2vhdl.PluginSpec[source]#
Bases:
elasticai.creator.plugin.PluginSpec- generated: tuple[str, ...]#
None
- static_files: tuple[str, ...]#
None
- class elasticai.creator.ir2vhdl.PluginSymbol[source]#
Bases:
typing.Protocol- load_vhdl(receiver: elasticai.creator.ir2vhdl.ir2vhdl.Ir2Vhdl) None[source]#
- class elasticai.creator.ir2vhdl.PortMap(map: dict[str, elasticai.creator.ir2vhdl.language.Signal])[source]#
Initialization
- classmethod from_dict(data: dict[str, str]) elasticai.creator.ir2vhdl.language.PortMap[source]#
- elasticai.creator.ir2vhdl.type_handler(name: str | None, fn: elasticai.creator.hdl_ir.NonIterableTypeHandler) elasticai.creator.hdl_ir.NonIterableTypeHandler[source]#
- elasticai.creator.ir2vhdl.type_handler_iterable(name: str | None, fn: elasticai.creator.hdl_ir.TypeHandler) elasticai.creator.hdl_ir.TypeHandler[source]#
- class elasticai.creator.ir2vhdl.EntityTemplateParameter[source]#
Bases:
elasticai.creator.template.AnalysingTemplateParameterFind the entity in vhdl code and make its name available as a template paramter.
Assumes that there is only one entity in the provided prototype.
NOTE: Will only replace occurences where
nameis followed and preceded by a non-word character, ie. for an entity named'skeleton'the occurence'architecture rtl of skeleton is'will be replaced by'architecture rtl of $entity is'but the occurences'skeleton_pkg','skeleton;','skeleton-'orskeleton.will remain unaltered. IMPORTANT: This detail is likely to change in the future.Initialization
- class elasticai.creator.ir2vhdl.ValueTemplateParameter(name: str)[source]#
Bases:
elasticai.creator.template.TemplateParameterFind a value definition and make it settable via a template parameter.
Searches for vhdl value definitions of the form
identifier : typeoridentifier : type :=and transforms them intoidentifier : type := $identifier.Essentially allows to replace generics as well as variable or signal initializations.
Initialization
- class elasticai.creator.ir2vhdl.EntityTemplateDirector[source]#
Initialization
- set_prototype(prototype: str) elasticai.creator.ir2vhdl.vhdl_template.EntityTemplateDirector[source]#
- add_generic(name: str) elasticai.creator.ir2vhdl.vhdl_template.EntityTemplateDirector[source]#