Update WSL to ensure either (1) WSL1 with X-Server or (2) WSL2 with WSLg is available. From an admin prompt:
C:\Users\gojimmypi>wsl --update
Checking for updates.
Updating Windows Subsystem for Linux to version: 2.6.3.
See the prior blog WSL GUI - Using Cygwin X-Server for Graphical Interface as well as the updated Setup Cygwin Xwin X-Windows server for WSL1
The versions encountered in Windows/DOS:
C:\Users\gojimmypi>wsl --version
WSL version: 2.6.3.0
Kernel version: 6.6.87.2-1
WSLg version: 1.0.71
MSRDC version: 1.2.6353
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.26100.7462
Version in WSL:
sudo apt update
# sudo apt install verilator # See below
sudo apt install -y help2man
A newer version of Verilator is needed than the one from apt install verilator
cd ~/workspace
# or
cd /mnt/c/workspace
git clone https://github.com/verilator/verilator
cd verilator
git checkout stable
autoconf
./configure
make -j"$(nproc)"
# If verilator was installed with apt
sudo apt-get remove verilator
hash -r
# Will fail on WSL:
# make test
sudo make install
# Verify:
which verilator
verilator --version
z8086
cd ~/workspace
# or
cd /mnt/c/workspace
git clone https://github.com/nand2mario/z8086.git
# or your fork
git clone https://github.com/$USER/z8086.git z8086-$USER
cd z8086-$USER
Run tests
# from /mnt/c/workspace/z8086-gojimmypi
cd tests
make -s build
wget https://github.com/nand2mario/z8086/releases/download/v0.1/8088.tar.gz
tar xzf 8088.tar.gz
make sim
The output should be something like:
./obj_dir/Vtb_z8086
[TB] stop_after_first=1
TB RESP ad=ffff0 bytes=34 b8 din=34b8
More importantly, there should be a new file: wave.fst
ls wave.fst
gtkwave wave.fst
CMake 3.25 or better needed. WSL1 is currently CMake 3.22.1. To update in /usr/local
cd /tmp
wget https://github.com/Kitware/CMake/releases/download/v3.29.6/cmake-3.29.6-linux-x86_64.sh
chmod +x cmake-3.29.6-linux-x86_64.sh
sudo ./cmake-3.29.6-linux-x86_64.sh --skip-license --prefix=/usr/local
The boost headers are needed.
sudo apt update
sudo apt install -y libboost-all-dev
Installed Cygwin.
yosys -p "read_verilog -sv -DULX3S \
boards/ULX3S/top_ulx3s.sv \
boards/ULX3S/vram_ecp5.sv \
boards/ULX3S/pll_black_box.sv \
boards/ULX3S/pll27.sv \
boards/ULX3S/pll74.sv \
boards/ULX3S/ecp5_io_blackbox.sv \
boards/ULX3S/obufds_blackbox.sv \
src/z8086/alu.sv \
src/z8086/z8086.sv \
src/soc_hdmi/z8086hdmi.sv \
src/soc_hdmi/z8086soc.sv \
src/soc_hdmi/uart_simple.sv \
src/soc_hdmi/spram.sv \
src/soc_hdmi/sprom.sv \
src/soc_hdmi/hdmi/hdmi.sv \
src/soc_hdmi/hdmi/tmds_channel.sv \
src/soc_hdmi/hdmi/serializer.sv \
src/soc_hdmi/hdmi/packet_assembler.sv \
src/soc_hdmi/hdmi/packet_picker.sv \
src/soc_hdmi/hdmi/audio_sample_packet.sv \
src/soc_hdmi/hdmi/audio_info_frame.sv \
src/soc_hdmi/hdmi/audio_clock_regeneration_packet.sv \
src/soc_hdmi/hdmi/auxiliary_video_information_info_frame.sv \
src/soc_hdmi/hdmi/source_product_description_info_frame.sv ; \
synth_ecp5 -top top_ulx3s -json build/top.json"
nextpnr-ecp5 --package CABGA381 --json build/top.json --lpf boards/ULX3S/ulx3s_v20.lpf --textcfg top.config --85k
ecppack top.config top.bit
fujprog
sudo apt-get update
sudo apt-get install -y pkg-config libftdi1-dev libusb-1.0-0-dev
sudo apt-get install -y libftdi1-dev libusb-dev cmake make build-essential
cd /mnt/c/workspace/
git clone https://github.com/gojimmypi/fujprog.git fujprog-gojimmypi
cd fujprog-gojimmypi
git checkout Visual-Studio-Build
mkdir build
cd build
cmake ..
make
sudo make install
$ ./fujprog-v48-win64.exe "c:\workspace\z8086-gojimmypi\top.bit"
ULX2S / ULX3S JTAG programmer v4.8 (git 96ebb45 built Oct 7 2020 22:42:00)
Copyright (C) Marko Zec, EMARD, gojimmypi, kost and contributors
Using USB cable: ULX3S FPGA 12K v3.0.3
Found LFE5U-85F device, but the bitstream is for LFE5U-45F.
Failed.
Make sure the --85k was passed to nextpnr-ecp5:
nextpnr-ecp5 --package CABGA381 --json build/top.json --lpf boards/ULX3S/ulx3s_v20.lpf --textcfg top.config --85k