Last active
March 24, 2019 22:56
-
-
Save gojimmypi/7b65583f32434186dd002f35e26c1644 to your computer and use it in GitHub Desktop.
Makefile gtkwave sim and xserver recipes for WSL FPGA programming
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROJ = ulx3s_adda | |
sim: | |
rm -f $(PROJ).vcd | |
iverilog -o $(PROJ).vvp $(PROJ).v $(PROJ)_tb.v | |
vvp $(PROJ).vvp | |
export DISPLAY=:0 | |
## if we are running in WSL, we need a bit of help for GUI XWindows | |
## and sometimes the WSL username is not the same as the Windows username & we need the *windows* user path. | |
## this is the Windows %USER% environment variable when called from makefile: $(shell cmd.exe /c "echo $$USER") | |
@if [ "$(shell grep Microsoft /proc/version)" != "" ]; then \ | |
cp /mnt/c/cygwin64/home/$(shell cmd.exe /c "echo $$USER")/.Xauthority ~/.Xauthority; \ | |
fi | |
(gtkwave $(PROJ).vcd $(PROJ)_savefile.gtkw)& | |
xserver: | |
## launch the Windows cygwin64 startxwin when WSL is detected | |
@if [ "$(shell grep Microsoft /proc/version)" != "" ]; then \ | |
echo "Launching Windows XServer from WSL..."; \ | |
(/mnt/c/cygwin64/bin/run.exe --quote /usr/bin/bash.exe -l -c " exec /usr/bin/startxwin -- -listen tcp -nowgl")& \ | |
else \ | |
echo "Not launching WSL XServer!" ; \ | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment