From 2e6ddd9dd95665829a17922fa4cdcf2b3d12d5ca Mon Sep 17 00:00:00 2001 From: Josuah Demangeon Date: Tue, 8 Aug 2023 20:39:46 +0200 Subject: [PATCH] build/lattice/radiant: allow use of Windows-side (.exe) radiant toolchain under WSL2 --- litex/build/lattice/radiant.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/litex/build/lattice/radiant.py b/litex/build/lattice/radiant.py index 433c2758f..b211e88f4 100644 --- a/litex/build/lattice/radiant.py +++ b/litex/build/lattice/radiant.py @@ -209,6 +209,10 @@ class LatticeRadiantToolchain(GenericToolchain): 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", @@ -232,6 +236,10 @@ class LatticeRadiantToolchain(GenericToolchain): 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."