Last active
December 27, 2015 16:49
-
-
Save makestuff/7357925 to your computer and use it in GitHub Desktop.
FPGALink on the Digilent FMC-carrier-S6 board.
This file contains 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
--------------------------------------------------------------------------------------------------- | |
Building FPGALink & the cksum example VHDL for Digilent FMC-S6 on Linux: | |
# Install prerequisites: | |
sudo apt-get install build-essential libreadline-dev libusb-1.0-0-dev python-yaml | |
mkdir $HOME/20140330 | |
cd $HOME/20140330 | |
wget -qO- http://tiny.cc/msbil | tar zxf - | |
# Fetch and build flcli: | |
cd makestuff/apps | |
../scripts/msget.sh makestuff/flcli/20140330 | |
cd flcli | |
make deps | |
cd ../../ | |
# Fetch and build the VHDL version of the cksum example: | |
scripts/msget.sh makestuff/hdlmake | |
cd hdlmake/apps | |
../bin/hdlmake.py -g makestuff/swled | |
cd makestuff/swled/cksum/vhdl | |
../../../../../bin/hdlmake.py -t ../../templates/fx2all/vhdl -b fmc-s6 -p fpga | |
# Load FPGALink firmware into the FMC-S6: | |
../../../../../../apps/flcli/lin.x64/rel/flcli -v 1d50:602b:0002 -i 1443:0007 | |
# Program the FPGA: | |
../../../../../../apps/flcli/lin.x64/rel/flcli -v 1d50:602b:0002 -p J:D0D2D3D4:fpga.xsvf | |
# Write 64KiB of random data to the board: | |
dd if=/dev/urandom of=random.dat bs=1024 count=64 | |
../../../../../../apps/flcli/lin.x64/rel/flcli -v 1d50:602b:0002 -a 'w0 "random.dat";r1;r2' -b | |
# And now read 64KiB (0x10000 bytes) back from the board and save it as "out.dat": | |
../../../../../../apps/flcli/lin.x64/rel/flcli -v 1d50:602b:0002 -a 'r0 10000 "out.dat"' | |
--------------------------------------------------------------------------------------------------- | |
Alternatively, on Windows: | |
1) Install the Windows SDK: | |
http://download.microsoft.com/download/A/6/A/A6AC035D-DA3F-4F0C-ADA4-37C8E5D34E3D/winsdk_web.exe | |
2) For x86, install this (choose "install just for me"): | |
http://www.python.org/ftp/python/2.7.6/python-2.7.6.msi | |
Alternatively for x64, install this (choose "install just for me"): | |
http://www.python.org/ftp/python/2.7.6/python-2.7.6.amd64.msi | |
3) Install: | |
http://pyyaml.org/download/pyyaml/PyYAML-3.10.win32-py2.7.exe | |
4) Download this and uncompress it to C:\makestuff: | |
http://tiny.cc/msbiw | |
5) Run C:\makestuff\setup.exe, select the C/C++ compiler, Xilinx ISE and Python 2.7 and click | |
"Create Shortcut". | |
6) Launch the new desktop shortcut & continue at the shell-prompt (hint: you can paste into the | |
console window using the right mouse button). | |
# Connect the FMC-S6 & use Zadig to replace the Digilent driver with a new WinUSB driver: | |
zadig.sh | |
# Fetch and build flcli: | |
cd $HOME/apps | |
msget.sh makestuff/flcli/20140330 | |
cd flcli | |
make deps | |
cd ../../ | |
# Fetch and build the VHDL version of the cksum example: | |
msget.sh makestuff/hdlmake | |
cd hdlmake/apps | |
../bin/hdlmake.py -g makestuff/swled | |
cd makestuff/swled/cksum/vhdl | |
../../../../../bin/hdlmake.py -t ../../templates/fx2all/vhdl -b fmc-s6 -p fpga | |
# Load FPGALink firmware into the FMC-S6 (you can press Ctrl-C after Windows detects the new device): | |
../../../../../../apps/flcli/msvc.x64/rel/flcli -v 1d50:602b:0002 -i 1443:0007 # x64 | |
../../../../../../apps/flcli/msvc.x86/rel/flcli -v 1d50:602b:0002 -i 1443:0007 # x86 | |
# Run Zadig again & install a new WinUSB driver for the newly-added FPGALink device (1D50:602B): | |
zadig.sh | |
# Program the FPGA: | |
../../../../../../apps/flcli/msvc.x64/rel/flcli -v 1d50:602b:0002 -p J:D0D2D3D4:fpga.xsvf # x64 | |
../../../../../../apps/flcli/msvc.x86/rel/flcli -v 1d50:602b:0002 -p J:D0D2D3D4:fpga.xsvf # x86 | |
# Write 64KiB of random data to the board: | |
dd if=/dev/urandom of=random.dat bs=1024 count=64 | |
../../../../../../apps/flcli/msvc.x64/rel/flcli -v 1d50:602b:0002 -a 'w0 "random.dat";r1;r2' # x64 | |
../../../../../../apps/flcli/msvc.x86/rel/flcli -v 1d50:602b:0002 -a 'w0 "random.dat";r1;r2' # x86 | |
# And now read 64KiB (0x10000 bytes) back from the board and save it as "out.dat": | |
../../../../../../apps/flcli/msvc.x64/rel/flcli -v 1d50:602b:0002 -a 'r0 10000 "out.dat"' # x64 | |
../../../../../../apps/flcli/msvc.x86/rel/flcli -v 1d50:602b:0002 -a 'r0 10000 "out.dat"' # x86 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment