Skip to content

Instantly share code, notes, and snippets.

@bkw777
Last active July 21, 2024 23:15
Show Gist options
  • Save bkw777/a6a2888f482802f2e520165858268cd3 to your computer and use it in GitHub Desktop.
Save bkw777/a6a2888f482802f2e520165858268cd3 to your computer and use it in GitHub Desktop.
Quartus 13.0 & ModelSim on Ubuntu 24

Quartus 13.0 on Ubuntu 23

Following commands create a shared system-wide install in /opt/q13

Install "Quartus II Web Edition Design Software 13.0sp1"

The last version that supports MAX7000 (and thus ATF15xx) is 13.0sp1
https://www.intel.com/content/www/us/en/software-kit/711790/intel-quartus-ii-web-edition-design-software-version-13-0sp1-for-linux.html

The variables $Q and $M will be set at the top here but used throughout,
so only paste these commands in the same session where Q and M are set!

$ export Q=/opt/q13
$ export M=${Q}/modelsim_ase
$ wget https://downloads.intel.com/akdlm/software/acdsinst/13.0sp1/232/ib_tar/Quartus-web-13.0.1.232-linux.tar
$ mkdir -v t
$ tar -C t -xvf Quartus-web-13.0.1.232-linux.tar
$ sudo t/setup.sh --mode unattended --unattendedmodeui minimal --installdir $Q
$ rm -rf t

Replace the bundled libpng

https://silverdrs.wordpress.com/2020/11/24/running-older-altera-quartus-on-modern-64bit-gnu-linux/

$ wget http://security.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1.1_amd64.deb
$ sudo dpkg-deb -xv libpng12-0_1.2.54-1ubuntu1.1_amd64.deb t
$ sudo cp -vaf t/lib/x86_64-linux-gnu/* ${Q}/quartus/linux64/
$ sudo rm -rf t

Replace the bundled libtbb

https://zkre.xyz/posts/quartus/

$ wget http://old-releases.ubuntu.com/ubuntu/pool/universe/t/tbb/libtbb2_4.1~20130613-1.2_amd64.deb
$ sudo dpkg-deb -xv libtbb2_4.1~20130613-1.2_amd64.deb t
$ sudo cp -vaf t/usr/lib/* ${Q}/quartus/linux64/
$ sudo rm -rf t

install a wrapper script to run quartus

$ sudo cat >/usr/local/bin/q13 <<%EOF
#!/bin/bash
QUARTUS_DIR="${Q}/quartus"
export PATH+=":\${QUARTUS_DIR}/bin" QUARTUS_64BIT=1
exec quartus "\$@"
%EOF
$ sudo chmod 755 /usr/local/bin/q13

run it

$ q13

or load project

$ cd ~/src/REX_ATF/HDL
$ ls *.qpf
rexbrd.qpf
$ q13 rexbrd

ModelSim

Create a dir for libraries we don't want to install in the main system
sudo mkdir -p ${M}/lib

Broken top-level wrapper script

sudo sed -i 's/MTI_VCO_MODE:-""/MTI_VCO_MODE:-"32"/g' ${M}/vco
sudo sed -i 's/linux_rh60/linux/g' ${M}/vco
sudo sed -i '/^dir=/a export LD_LIBRARY_PATH=${dir}/lib' ${M}/vco

libXft2
sudo apt install libxft2:i386

ncurses5

$ wget http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.4-2ubuntu0.1_i386.deb
$ wget http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.4-2ubuntu0.1_i386.deb
$ sudo dpkg-deb -xv libncurses5_6.4-2ubuntu0.1_i386.deb t
$ sudo dpkg-deb -xv libtinfo5_6.4-2ubuntu0.1_i386.deb t
$ sudo cp -vaf t/lib/*/* ${M}/lib/
$ sudo rm -rf t

libpng

$ wget http://security.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1.1_i386.deb
$ sudo dpkg-deb -xv libpng12-0_1.2.54-1ubuntu1.1_i386.deb t
$ sudo cp -vaf t/lib/*/* ${M}/lib/
$ sudo rm -rf t

libfreetype
(arch pkg because the oldest ubuntu package is 2.5.2, too new and vsim segfaults)
https://github.com/dzamlo/quartus-free-130/blob/master/PKGBUILD

$ wget https://archive.archlinux.org/packages/l/lib32-freetype2/lib32-freetype2-2.5.0.1-1-x86_64.pkg.tar.xz
$ mkdir t
$ sudo tar -C t -xvf lib32-freetype2-2.5.0.1-1-x86_64.pkg.tar.xz
$ sudo cp -vaf t/usr/lib32/*.so* ${M}/lib/
$ sudo rm -rf t

At this point vsim should be runnable by itself outside of Quartus.
Run it via the bin/vsim symlink,
which runs the top level wrapper vco,
which will set LD_LIBRARY_PATH and run the actual binary linux/vsim
$ ${M}/bin/vsim

To get ModelSim working from within Quartus requires a little more...

add LD_LIBRARY_PATH to quartus/adm/qenv.sh
https://gist.github.com/robodhruv/e2c0945cc78006b00d4206846bdb7657?permalink_comment_id=3311682#gistcomment-3311682

sudo sed -i '/^export LD_LIBRARY_PATH=/a LD_LIBRARY_PATH=${QUARTUS_ROOTDIR}/../modelsim_ase/lib:$LD_LIBRARY_PATH' ${Q}/quartus/adm/qenv.sh

Launch Quartus and set the path to modelsim in EDA Tool Options
Tools -> Options -> EDA Tool Options -> ModelSim-Altera: /opt/q13/modelsim_ase/linuxaloem

Test it from within Quartus:
$ q13
Tools -> Run Simulation Tool -> Gate Level Simulation

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