Skip to content

Instantly share code, notes, and snippets.

@makestuff
Last active February 13, 2018 09:55
Show Gist options
  • Save makestuff/7486988 to your computer and use it in GitHub Desktop.
Save makestuff/7486988 to your computer and use it in GitHub Desktop.
Build FPGALink and the cksum VHDL example, and use flcli to write data to an Atlys board, and then read data back from it.
---------------------------------------------------------------------------------------------------
Building FPGALink & the cksum example VHDL for Digilent Atlys on Linux:
# Install prerequisites:
sudo apt-get install build-essential libreadline-dev libusb-1.0-0-dev python-yaml
mkdir $HOME/20140524
cd $HOME/20140524
wget -qO- http://tiny.cc/msbil | tar zxf -
# Fetch and build flcli:
cd makestuff/apps
../scripts/msget.sh makestuff/flcli/20140524
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 atlys -p fpga
# Load FPGALink firmware into the Atlys:
../../../../../../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 Atlys & 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/20140524
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 atlys -p fpga
# Load FPGALink firmware into the Atlys (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
@adrian0921
Copy link

Hi!!!....i need some help, when i go to the 79 line, the program says
hdlmake.py:error:unrecognized arguments: -p fpga

then in the next step its says
bash: ../../../../../../apps/flcli/msvc.x86/rel/flcli :no such file or directory..

so, what can i do???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment