-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(translation): refactor autowiring for sequential network module
- Loading branch information
Showing
29 changed files
with
733 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from ._abstract_base_template import AbstractBaseTemplate | ||
from .abstract_base_template import AbstractBaseTemplate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from elasticai.creator.hdl.code_generation.code_generation import ( | ||
calculate_address_width, | ||
) | ||
from elasticai.creator.hdl.design_base import std_signals as _signals | ||
from elasticai.creator.hdl.design_base.design import Port | ||
|
||
|
||
def create_port_for_base_design(x_width: int, y_width: int): | ||
return Port( | ||
incoming=[ | ||
_signals.enable(), | ||
_signals.clock(), | ||
_signals.x(x_width), | ||
], | ||
outgoing=[_signals.y(y_width)], | ||
) | ||
|
||
|
||
def create_port_for_buffered_design( | ||
x_width: int, y_width: int, x_count: int, y_count: int | ||
) -> Port: | ||
in_signals = [ | ||
_signals.enable(), | ||
_signals.clock(), | ||
_signals.x(x_width), | ||
_signals.y_address(calculate_address_width(y_count)), | ||
] | ||
out_signals = [ | ||
_signals.done(), | ||
_signals.y(y_width), | ||
_signals.x_address(calculate_address_width(x_count)), | ||
] | ||
return Port(incoming=in_signals, outgoing=out_signals) |
10 changes: 0 additions & 10 deletions
10
elasticai/creator/hdl/vhdl/code_files/network_component.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from .code_generation import create_instance, signal_definition | ||
from .code_generation import create_instance, signal_definition, to_vhdl_hex_string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
from typing import Iterator | ||
from elasticai.creator.hdl.code_generation.abstract_base_template import ( | ||
TemplateConfig, | ||
TemplateExpander, | ||
) | ||
|
||
from elasticai.creator.hdl.code_generation import AbstractBaseTemplate | ||
from elasticai.creator.resource_utils import read_text | ||
|
||
|
||
class Template(AbstractBaseTemplate): | ||
def _read_raw_template(self) -> Iterator[str]: | ||
return read_text( | ||
self._template_package, f"{self._template_name}{self._template_file_suffix}" | ||
class Template: | ||
def __init__( | ||
self, | ||
base_name: str, | ||
package: str = "elasticai.creator.hdl.vhdl.template_resources", | ||
suffix: str = ".tpl.vhd", | ||
): | ||
self._template_name = base_name | ||
self._internal_template = TemplateExpander( | ||
TemplateConfig( | ||
file_name=f"{base_name}{suffix}", package=package, parameters=dict() | ||
) | ||
) | ||
|
||
_template_package = "elasticai.creator.hdl.vhdl.template_resources" | ||
_template_file_suffix = ".tpl.vhd" | ||
|
||
def __init__(self, base_name: str, **parameters: str | tuple[str] | list[str]): | ||
super().__init__(**parameters) | ||
self._template_name = base_name | ||
self._saved_raw_template: list[str] = [] | ||
def update_parameters(self, **parameters: str | list[str]): | ||
self._internal_template.config.parameters.update(parameters) | ||
|
||
@property | ||
def name(self) -> str: | ||
return f"{self._template_name}{self._template_file_suffix}" | ||
def lines(self) -> list[str]: | ||
return self._internal_template.lines() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.