enjoy-digital / litex

Build your hardware, easily!
Other
2.77k stars 538 forks source link

WSL2 Debian Gowin Toolchain Path #1858

Open mlg556 opened 6 months ago

mlg556 commented 6 months ago

on wsl2 Debian under windows 11, even though the Gowin executable "gw_sh" is under my $PATH, litex can't find it. the issue seems to come from gowin.py#L168-L169:

if os.uname().release.find("WSL") > 0:
    gw_sh += ".exe"

I don't understand why an executable under wsl debian would have an .exe extension. and my system doesn't, maybe others do? If I delete this condition which appends ".exe" to "gw_sh", litex manages to successfully build my soc. maybe we should just remove this condition? I can make a pull request, but I first probably have to understand why it's there in the first place :)

See screenshot for environment details:

Screenshot for environment details.

exitrip commented 2 months ago

Conversely, I am using WSL2 for Litex builds and have Gowin IDE installed in Windows natively, with my PATH pointing to the native bin folder. The EXE check is needed for my setup to work.

linhz0hz commented 2 months ago

Conversely, I am using WSL2 for Litex builds and have Gowin IDE installed in Windows natively, with my PATH pointing to the native bin folder. The EXE check is needed for my setup to work.

Does WSL2 allow interfacing with windows installed Gowin? I tried this and it gets Cannot open Verilog file 'C:\mnt\c\fpga\litex\litex_demo\build\top.v'

kamejoko80 commented 1 month ago

Export PATH environment variable below:

export PATH=$PATH:/mnt/c/Gowin/Gowin_V1.9.9.03_x64/IDE/bin

It works for me.

stek29 commented 1 month ago

I just symlinked gw_sh.exe to gw_sh, thanks for finding this, took me a while to realize why it won't see my toolchain.

cd IDE/bin
ln -s gw_sh gw_sh.exe

would it be acceptable to have some way to adjust this? what if it tries to look for gw_sh on WSL2 too, and only looks for gw_sh.exe if gw_sh isn't found? or only look for gw_sh.exe on wsl1 and not wsl2

@exitrip are you using wsl2 or wsl1?

exitrip commented 1 month ago

Wal!

On Mon, Jun 3, 2024, 18:26 Viktor Oreshkin @.***> wrote:

I just symlinked gw_sh.exe to gw_sh, thanks for finding this, took me a while to realize why it won't see my toolchain.

cd IDE/bin ln -s gw_sh gw_sh.exe

would it be acceptable to have some way to adjust this? what if it tries to look for gw_sh on WSL2 too, and only looks for gw_sh.exe if gw_sh isn't found? or only look for gw_sh.exe on wsl1 and not wsl2

@exitrip https://github.com/exitrip are you using wsl2 or wsl1?

— Reply to this email directly, view it on GitHub https://github.com/enjoy-digital/litex/issues/1858#issuecomment-2146230147, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABL37D6T5UROQKKMEXZ2RSLZFTUPPAVCNFSM6AAAAABBA5UOEOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBWGIZTAMJUG4 . You are receiving this because you were mentioned.Message ID: @.***>