Skip to content

Commit

Permalink
build/lattice/radiant: allow use of Windows-side (.exe) radiant toolc…
Browse files Browse the repository at this point in the history
…hain under WSL2
  • Loading branch information
josuah committed Sep 3, 2023
1 parent 36a0db0 commit cb79ce2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions litex/build/lattice/radiant.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ def build_script(self):
if self._synth_mode == "yosys":
script_contents += self._yosys.get_yosys_call(target="script") + "\n"

# Radiant installed on Windows, executed from WSL2
if "microsoft-standard" in uname().release and which("pnmainc.exe") is not None:
tool = "pnmainc.exe"

script_contents += "{tool} {tcl_script}{fail_stmt}\n".format(
tool = tool,
tcl_script = self._build_name + ".tcl",
Expand All @@ -232,6 +236,10 @@ def run_script(self, script):
shell = ["bash"]
tool = "radiantc"

# Radiant installed on Windows, executed from WSL2
if "microsoft-standard" in uname().release and which("pnmainc.exe") is not None:
tool = "pnmainc.exe"

if which(tool) is None:
msg = "Unable to find Radiant toolchain, please:\n"
msg += "- Add Radiant toolchain to your $PATH."
Expand Down

0 comments on commit cb79ce2

Please sign in to comment.