elasticai.creator.ir2verilog.templates#

Module Contents#

Classes#

TemplateDirector

Director for verilog templates.

VerilogTemplate

API#

class elasticai.creator.ir2verilog.templates.TemplateDirector[source]#

Director for verilog templates.

Most methods correspond to verilog language constructs.

Initialization

reset() Self[source]#
set_prototype(prototype: str) Self[source]#
parameter(name: str) Self[source]#
localparam(name: str) Self[source]#
replace_module_of_instance(module_name: str, new_name: str) Self[source]#
replace_instance_name(module_name: str, new_name: str) Self[source]#
define_scoped_switch(name: str, default: bool) Self[source]#

Add a switch for a define that is scoped to the module name.

The switch will be prefixed with the value that users provide as module_name to the render call.

Parameters:
  • name – String with name of the switch/define name

  • default – Setting switch for defining output state (True=set, False=undefine)

add_module_name() Self[source]#
build() elasticai.creator.ir2verilog.templates.VerilogTemplate[source]#
class elasticai.creator.ir2verilog.templates.VerilogTemplate(template: string.Template, defines: dict[str, bool], module_name: dict[str, str])[source]#

Initialization

substitute(params: Mapping[str, str | bool]) str[source]#