elasticai.creator.ir2vhdl.vhdl_template#

Module Contents#

Classes#

EntityTemplateParameter

Find the entity in vhdl code and make its name available as a template paramter.

ValueTemplateParameter

Find a value definition and make it settable via a template parameter.

EntityTemplateDirector

API#

class elasticai.creator.ir2vhdl.vhdl_template.EntityTemplateParameter[source]#

Bases: elasticai.creator.template.AnalysingTemplateParameter

Find 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 name is 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-' or skeleton. will remain unaltered. IMPORTANT: This detail is likely to change in the future.

Initialization

analyse(m: dict[str, str]) None[source]#
replace(m: dict[str, str]) str[source]#
class elasticai.creator.ir2vhdl.vhdl_template.ValueTemplateParameter(name: str)[source]#

Bases: elasticai.creator.template.TemplateParameter

Find a value definition and make it settable via a template parameter.

Searches for vhdl value definitions of the form identifier : type or identifier : type := and transforms them into identifier : type := $identifier.

Essentially allows to replace generics as well as variable or signal initializations.

Initialization

replace(match: dict[str, str]) str[source]#
class elasticai.creator.ir2vhdl.vhdl_template.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]#
build() string.Template[source]#