Skip to content

Commit

Permalink
Fix yosys_template option
Browse files Browse the repository at this point in the history
  • Loading branch information
olofk committed Mar 28, 2023
1 parent 1b08fee commit 573b1f0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
11 changes: 5 additions & 6 deletions edalize/tools/yosys.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,11 @@ def setup(self, edam):

def write_config_files(self):
yosys_template = self.tool_options.get("yosys_template")
if not yosys_template:
self.render_template(
"edalize_yosys_procs.tcl.j2",
"edalize_yosys_procs.tcl",
self.template_vars,
)
self.render_template(
"edalize_yosys_procs.tcl.j2",
"edalize_yosys_procs.tcl",
self.template_vars,
)

if not yosys_template:
self.render_template(
Expand Down
12 changes: 12 additions & 0 deletions tests/test_tool_yosys.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,15 @@ def test_tool_yosys_tags(tool_fixture):

tf.tool.configure()
tf.compare_config_files(["edalize_yosys_template.tcl", "edalize_yosys_procs.tcl"])


def test_tool_yosys_template(tool_fixture):
import os

tool_options = {"arch": "ice40", "yosys_template": "some_file.tcl"}

tf = tool_fixture("yosys", tool_options=tool_options, ref_subdir="template")

tf.tool.configure()
tf.compare_config_files(["edalize_yosys_procs.tcl"])
assert not os.path.exists(tf.tool.work_root / "edalize_yosys_template.tcl")

0 comments on commit 573b1f0

Please sign in to comment.