-
Notifications
You must be signed in to change notification settings - Fork 80
Add windows support #227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add windows support #227
Conversation
This change adds ability to compile test software, synthesize and simulate on windows platform through WSL2.
|
||
# Symlink proj for easy access and build tracking, ensuring its update | ||
file delete -force ${project_root}/out.xci | ||
file link -symbolic ${project_root}/out.xci $xci |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Windows, Vivado can't create symbolic links (hard links only).
Because of that, symlink creation moved to xilinx.mk
This makes script to be independent of import Windows PATH variable.
Looks pretty good at first sight 👍 I will need to find some time to play with this on a Windows system. An open point is if we can perhaps set up some Github runners to test Windows support as much as possible without commercial tools (mostly the build steps), as I'd hate to break it with a silly typo down the road and not notice. I will also look into this. |
Sure, take your time! The documentation with WSL configuration specifics is in the linked PR. |
If it helps: WSL2 is available in the |
It turned out that even when using I was able to write a build workflow ported for the Windows platform, but it includes some workarounds. The issue is that GitHub Actions are applied to the host itself, and I'm not aware of a way to apply them inside WSL on that host. Because of this, existing actions like Currently, the build completes successfully, but there is a problem with the
Additionally, the current check effectively tests parts of the repository that are unchanged by this pull request, since all my modifications are tied to targets depending on commercial CAD tools. Effectively, it just verifies that the build flow sw/hw/sim -all on the Windows platform via WSL2 completes without errors. It might make sense to verify that commands for Vivado by, for example, correctly expanding them to the expected text outputs. However, I'm not sure how to implement that without hardcoding paths in the checks. This is my first workflow, so it might not be perfectly written, but I hope you'll find it useful: name: build
on: [push, pull_request, workflow_dispatch]
jobs:
build:
strategy:
matrix:
target: [sw, hw, sim]
fail-fast: false
runs-on: windows-2025
steps:
- name: Setup WSL
uses: vedantmgoyal9/setup-wsl2@main
with:
distro: Ubuntu
- name: Set custom WSL mount root
run: |
wsl bash -c "echo -e '[automount]\nroot = /' | sudo tee /etc/wsl.conf"
wsl --shutdown
- name: Install Dependencies
run: |
wsl bash -c "set -e; sudo apt update; for i in {1..5}; do sudo apt install -y python3 python3-pip python3-venv unzip gdisk && break; echo 'APT failed, retrying (\$i)...'; sleep 10; done"
- name: Install Bender
run: |
wsl bash -c 'curl -f -sSL https://github.com/pulp-platform/bender/releases/download/v0.27.1/bender-0.27.1-x86_64-linux-gnu-ubuntu22.04.tar.gz -o $HOME/bender.tar.gz'
wsl bash -c 'tar -xzf $HOME/bender.tar.gz -C $HOME'
wsl bash -c 'chmod +x $HOME/bender'
- name: Install RISC-V GCC toolchain
run: |
wsl curl -f -sSL https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2023.03.14/riscv64-elf-ubuntu-22.04-nightly-2023.03.14-nightly.tar.gz -o toolchain.tar.gz
wsl bash -c 'mkdir -p $HOME/riscv'
wsl bash -c 'tar -xzf toolchain.tar.gz -C $HOME/riscv --strip-components=1'
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Python requirements
run: wsl pip3 install -r requirements.txt
- name: Build target
run: |
wsl bash -c 'export CHS_SW_GCC_BINROOT=$HOME/riscv/bin BENDER=$HOME/bender && make ${{ matrix.target }}-all'
- name: Check whether clean
run: |
wsl echo "* text=auto" >> .gitattributes
wsl git add --renormalize .
wsl rm .gitattributes
wsl git status
wsl bash -c 'test -z "$(git status --porcelain --ignore-submodules)"' |
This PR adds the ability to compile test software, synthesize and simulate on windows platform through WSL2.