Installing Lattice iCEcube2 and Lattice Diamond in Debian
Last updated: Dec 18, 2023
Installing Lattice FPGA software onto Debian
The problem
Installing Lattice’s FPGA design software: iCEcube2 and Diamond onto Debian was a struggle. Learn from my mistakes.
Summary
With a couple of tricks, the Lattice software will run on Debian. However, I’ve ditched Lattice’s software when using the iCE40 FPGAs for the for the open source suite: https://github.com/devantech/iceFUN. Save yourself time and angst and consider the open-source software.
Installing Lattice iCEcube2
Download the Linux installation from: https://www.latticesemi.com/iCEcube2
Get a licence through the website link. I made a beginners mistake later on and tried to install the Diamond licence for the iCEcube software as I installed both packages. D’oh.
To get the iCEcube2 licence, you have to supply your IP address. You get this by running the command:
ip a
Problem 1: The licence IP address must be associated with ’eth0'
The generated licence looks for the IP address associated with ’eth0’. Modern Debians may not give your connection the name ’eth0’. You must change the connection name to be ’eth0'.
Instructions on how to change the IP address connection name at:
Create a udev rule e.g.
/etc/udev/rules.d/10-net-naming.rules
Containing:
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="aa:bb:cc:dd:ee:ff", NAME="eth0"
Sustitute {address} for the NIC address used to get the license.
I needed to reboot to get this to take effect. Tried various solutions to avoid rebooting which did not work.
Problem 2: Error while loading shared libraries: libpng12.so.0
Led to a solution from:
https://stackoverflow.com/a/47927532/7222588
Fix: install 32 bit libpng16.
To find the installation:
aptitude search libpng16
installed: libpng16-16:i386
sudo aptitude install libpng16-16:i386
Need to soft link the existing libpng12.so.0 to the 32-bit libpng16.
In /usr/local/lib:
sudo ln -s /usr/lib/i386-linux-gnu/libpng16.so.16.37.0 libpng12.so.0
Installing Lattice Diamond or Lattice Diamond standalone programmer
The Lattice Diamond software or the standalong programmer can be downloaded here:
https://www.latticesemi.com/LatticeDiamond
Both packages are .rpm files, which are not designed for Debian. I tried using the ‘Alien’ installation which is designed to enable rpm files to be trasmogrified to .deb files. This didn’t work. I found a working solution at:
https://retroramblings.net/?p=1917
sudo apt install cpio rpm2cpio
Use the rpm2cpio to extract files from the .rpm package. This extracts all of the files to a new subdirectory called /usr.
For the Lattice Diamond software:
rpm2cpio /path/to/diamond_3_12-base-240-2-x86_64-linux.rpm | cpio -idmv
extract all .tar.gz files:
for a in `find . -iname \*.tar.gz`; do bash -c "cd $(dirname $a); tar -xzvf $(basename $a)"; done
The Lattice Diamond software needs a licence installed, which is obtained through the website. Copy license.dat to the license directory under ./usr
./usr/local/diamond/3.13/bin/lin64/diamond
Select license.dat and click the ‘start’ button.
End thoughts
It took a lot of time to get the Lattice software to install on Debian. To be fair, the site does state that iCEcube2 is supported by Ubuntu and Diamond by RHEL. The iCEcube2 software often freezes when the window loses focus. I’m glad I made the effort to try them out as I’d have always assumed that the Lattice software has more to offer than the open-source software. For the iCE FPGAs that I’m using at the moment, the open-source software seems fine. Of course, if I move away from the FPGAs that are supported by the open-source software, I’ll look at using the Lattice software again.