Note: Of course, when I say Linux, I mean Slackware :p
I have started using Altera (an alternative to Xilinx) because that is what I have to use in the course I will be handling next semester. And when I say on Linux, it is more like on Slackware. I run the software on my pure 64-bit Slackware, but in a 32-bit chroot environment.
I will be using Quartus Web Edition 13.0sp1, which is the last version that supports all Cylone FPGAs (low cost ones). Current version is now known as Quartus Prime Lite Edition 15.1.
I use command-line most of the time - this is because I can then use shell scripts to automate my work flow.
quartus_pgm -l | grep '1)' | sed 's/^1)\s\(.*\)$/\1/' quartus_pgm -c usb-blaster -m JTAG --device=1 -o "p;my1fpga.sof"
Additional installation info…
To use the USB blaster (byte-blaster?) cable on Linux, we need to set proper permission and device symlink. Create a udev rule file (something like…) '/etc/udev/rules.d/99-altera-usb.rules' and enter
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6010", GROUP="plugdev", MODE="0666", SYMLINK+="usbblaster"
If not rebooting, do not forget to restart udev service. (e.g. udevadm control –reload-rules
)
Note: idProduct may vary (on Linux, check kernel message i.e. dmesg|tail
) - so, either create multiple entry OR simply write ATTR{idProduct}==“6010|6001”
within the same statement
Run-time issues…
This is exactly like I had previously (I guess I was on 14.1 that time), but the fix is no longer working on 14.2. Just a recap, when trying to run vsim, this error message appears
Error in startup script: Initialization problem, exiting. Initialization problem, exiting. Initialization problem, exiting. while executing "EnvHistory::Reset" (procedure "PropertiesInit" line 3) invoked from within "PropertiesInit" invoked from within "ncFyP12 -+" (file "/home/share/apps/altera-13.0sp1/modelsim_ase/linux/../tcl/vsim/vsim" line 1) ** Fatal: Read failure in vlm process (0,0)
Recompiling freetype-2.4.7 does not fix this. Still looking for a fix…
Another bug has also been found - due to the fact that Slackware 14.2 is on 4.0 kernel version. The vco
script assumes all 'other' versions after 3 is running on RedHat 6. To rectify that
chmod +w vco
sed -i 's|linux_rh60|linux|g' vco
chmod -w vco
Slackware 14.2 has a newer libpng (1.14 and 1.16). So I copied the older version from 14.1 packages (aaa_elflibs) and copied it into /usr/lib
(I'm using 32-bit quartus). Problem solved.
Note: To get that package on my slackware machine, I use my getslackpack
script
ARCH=x86 RELEASE=14.1 getslackpack --reset --slack aaa_elflibs --exec
which will create a sub-folder slackpack-14.1
to store that file.
I had a problem running ModelSim (Altera Edition) and later found that a similar issue has been reported here. So what I did is simply download last known working version of freetype library (2.4.7) from here and compile manually (configure
and make
- notice no install!). I copied the shared library objs/.libs/libfreetype.so.6.7.2
and the two softlinks (libfreetype.so
& libfreetype.so.6
) into a path like /home/share/application/altera-13.0sp1/libfreetype
. Do an
export LD_LIBRARY_PATH=/home/share/application/altera-13.0sp1/libfreetype
before running vsim. Problem solved.
I have a machine running Devuan that I currently use to do some FPGA-related work.
Most tools are still 32-bit. So, as root, setup multi-arch environment on Devuan and install required libraries.
# dpkg --add-architecture i386 # apt update # apt install libc6:i386 libncurses5:i386 libstdc++6:i386 # apt install libxft2:i386 libxext6:i386 # apt install zlib1g-dev:i386 libsm6:i386
I usually install as normal user to a 'shared' location (e.g. /home/share/appx/altera/
) - no need root access for this. I use this script to start work environment.
$ do-exec altera
Quartus needs libpng12
PNG_BASE="https://sourceforge.net/projects/libpng/files" PNG_VERS=1.2.59 PNG_PACK="libpng-${PNG_VERS}.tar.xz" wget ${PNG_BASE}/libpng12/${PNG_VERS}/${PNG_PACK}/download >${PNG_PACK}
$ ./configure $ make CFLAGS+=-m32
.libs/{libpng12.so,libpng12.so.0,libpng12.so.0.59.0}
to quartus/linux/
ModelSim needs older freetype (2.4.7 should be fine)
$ ./configure CFLAGS=-m32 $ make
objs/.libs/{libfreetype.so,libfreetype.so.6,libfreetype.so.6.7.2}
to modelsim_ase/linux/
LD_LIBRARY_PATH=<path to modelsim>/linux/
(in my case, handled by do-exec)