Skip to content

Commit

Permalink
vivado cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
jgoeders committed Nov 29, 2023
1 parent eb83588 commit 099ae59
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bfasst/ninja_tools/common/vivado_rules.ninja.mustache
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rule vivado
command = export tempjou=$$(mktemp); export templog=$$(mktemp); cd $cwd && bfasst/ninja_utils/retry.sh {{ vivado_path }} -mode batch -journal $$tempjou -log $$templog -source $in >&- && mv $$tempjou $journal && mv $$templog $log
command = export tempjou=$$(mktemp); export templog=$$(mktemp); cd $cwd && {{ utils_path }}/retry.sh {{ vivado_path }} -mode batch -journal $$tempjou -log $$templog -source $in >&- && mv $$tempjou $journal && mv $$templog $log
description = vivado $in

{{#in_context}}
Expand Down
7 changes: 3 additions & 4 deletions bfasst/ninja_tools/impl/vivado_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
import pathlib
from bfasst import config
from bfasst.ninja_tools.impl.impl_tool import ImplTool
from bfasst.paths import (
COMMON_TOOLS_PATH,
NINJA_UTILS_PATH,
)
from bfasst.paths import COMMON_TOOLS_PATH, NINJA_UTILS_PATH
from bfasst.utils.general import json_write_if_changed


Expand Down Expand Up @@ -48,6 +45,7 @@ def create_build_snippets(self):
"synth_output": self.build_path.parent / ("synth" if not self.ooc else "synth_ooc"),
"impl_library": self._my_dir_path,
"top": self.design_props.top,
"cwd": self.build_path,
},
)

Expand All @@ -56,6 +54,7 @@ def create_rule_snippets(self):
__file__,
{
"vivado_path": config.VIVADO_BIN_PATH,
"utils_path": NINJA_UTILS_PATH,
},
COMMON_TOOLS_PATH / "vivado_rules.ninja.mustache",
)
Expand Down
2 changes: 2 additions & 0 deletions bfasst/ninja_tools/synth/vivado_synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def create_rule_snippets(self):
{
"vivado_path": config.VIVADO_BIN_PATH,
"in_context": not self.ooc,
"utils_path": NINJA_UTILS_PATH,
},
COMMON_TOOLS_PATH / "vivado_rules.ninja.mustache",
)
Expand Down Expand Up @@ -57,6 +58,7 @@ def create_build_snippets(self):
"top": self.design_props.top,
"verilog": self.verilog,
"system_verilog": self.system_verilog,
"cwd": self.build_path,
},
)

Expand Down
2 changes: 2 additions & 0 deletions bfasst/ninja_tools/synth/vivado_synth_build.ninja.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ build {{ synth_output }}/{{ top }}.xdc: vivado_ioparse {{ synth_output }}/report
build {{ synth_output }}/viv_synth.edf {{ synth_output }}/synth.dcp {{#in_context}}{{ synth_output }}/report_io.txt{{/in_context}}: vivado {{ synth_output }}/synth.tcl | {{#verilog}}{{ . }} {{/verilog}} {{#system_verilog}}{{ . }} {{/system_verilog}}
journal = {{ synth_output }}/vivado.jou
log = {{ synth_output }}/vivado.log
cwd = {{ cwd }}


4 changes: 2 additions & 2 deletions bfasst/ninja_tools/synth/vivado_synth_tcl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pathlib
from bfasst import config
from bfasst.ninja_tools.tool import Tool
from bfasst.paths import COMMON_TOOLS_PATH
from bfasst.paths import COMMON_TOOLS_PATH, NINJA_UTILS_PATH


class VivadoSynthFromTcl(Tool):
Expand All @@ -17,7 +17,7 @@ def __init__(self, flow, design_tcl_path):
def create_rule_snippets(self):
self._append_rule_snippets_default(
__file__,
{"vivado_path": config.VIVADO_BIN_PATH},
{"vivado_path": config.VIVADO_BIN_PATH, "utils_path": NINJA_UTILS_PATH},
COMMON_TOOLS_PATH / "vivado_rules.ninja.mustache",
)

Expand Down

0 comments on commit 099ae59

Please sign in to comment.