The ModelSim version that comes with Intel Quartus Prime Lite Edition is a good alternative if you want to try out VHDL simulation on your home computer. The software is available for both Windows and Linux, but Intel only supports Red Hat-based distros like CentOS Linux.
Fortunately, you are just a few hacks away from ModelSim working nicely on your Ubuntu box.
The video below shows how I did it on a fresh Ubuntu 20.04 virtual machine. For reference, I followed the procedure from PrieureDeSion’s GitHub gist, with a few changes to make it work with Ubuntu 20.04.
Where to download the ModelSim-Intel FPGA Edition for Linux
Go to Intel’s Download Center for FPGAs to obtain the installer.
Choose the Lite Edition for Linux, and click the Individual Files tab on the same page. Select the ModelSim-Intel FPGA Edition (includes Starter Edition) option, as shown in the image below.
These are the commands for making ModelSim work in Ubuntu 20.04
# Start with ModelSimSetup-*-linux in your home directory # Open a terminal in your home directory # Update your system sudo apt update; sudo apt upgrade # Run the installer ./ModelSimSetup-*-linux.run # Make the vco script writable chmod u+w ~/intelFPGA/*.*/modelsim_ase/vco # Make a backup of the vco file (cd ~/intelFPGA/*.*/modelsim_ase/ && cp vco vco_original) # Edit the vco script manually, or with these commands: sed -i 's/linux\_rh[[:digit:]]\+/linux/g' \ ~/intelFPGA/*.*/modelsim_ase/vco sed -i 's/MTI_VCO_MODE:-""/MTI_VCO_MODE:-"32"/g' \ ~/intelFPGA/*.*/modelsim_ase/vco sed -i '/dir=`dirname "$arg0"`/a export LD_LIBRARY_PATH=${dir}/lib32' \ ~/intelFPGA/*.*/modelsim_ase/vco # Check that the correct lines have changed diff ~/intelFPGA/*.*/modelsim_ase/vco \ ~/intelFPGA/*.*/modelsim_ase/vco_original # Download the 32-bit libraries and build essentials sudo dpkg --add-architecture i386 sudo apt update sudo apt install build-essential sudo apt install gcc-multilib g++-multilib lib32z1 \ lib32stdc++6 lib32gcc1 libxt6:i386 libxtst6:i386 expat:i386 \ fontconfig:i386 libfreetype6:i386 libexpat1:i386 libc6:i386 \ libgtk-3-0:i386 libcanberra0:i386 libice6:i386 libsm6:i386 \ libncurses5:i386 zlib1g:i386 libx11-6:i386 libxau6:i386 \ libxdmcp6:i386 libxext6:i386 libxft2:i386 libxrender1:i386 # Download the old 32-bit version of libfreetype wget download.savannah.gnu.org/releases/freetype/freetype-2.4.12.tar.bz2 tar xjf freetype-2.4.12.tar.bz2 # Compile libfreetype cd freetype-2.4.12/ ./configure --build=i686-pc-linux-gnu "CFLAGS=-m32" \ "CXXFLAGS=-m32" "LDFLAGS=-m32" make clean make cd ~/intelFPGA/*.*/modelsim_ase/ mkdir lib32 cp ~/freetype-2.4.12/objs/.libs/libfreetype.so* lib32/ # Run the vsim script to start ModelSim cd ~/intelFPGA/*.*/modelsim_ase/bin/vsim
Output from the diff between ‘vco’ and ‘vco_original’
13c13 < mode=${MTI_VCO_MODE:-"32"} --- > mode=${MTI_VCO_MODE:-""} 51d50 < export LD_LIBRARY_PATH=${dir}/lib32 211c210 < *) vco="linux" ;; --- > *) vco="linux_rh60" ;;
Where to get support
Ubuntu is officially unsupported by Intel, so there’s no point in asking them. But there are a few threads about the subject on the FPGA Design Tools forum on the Intel Community Forum (formerly Altera Forum).
Another option is to make a post in VHDLwhiz’ private Facebook group: VHDL for FPGA Engineers. In fact, you should join it even if you’re not experiencing problems. It’s a growing community for everyone interested in FPGA design using VHDL.
Install Lattice iCEcube2 on Ubuntu
To complete the VHDL and FPGA development environment on your Ubuntu box, you may want to check out this tutorial:
Make Lattice iCEcube2 work on Ubuntu 20.04 and program the iCEstick FPGA board
With iCEcube2, ModelSim, and Project IceStorm installed, you can do VHDLwhiz’ beginner Fast-Track course and the advanced Dot Matrix course on your Ubuntu box!
In my experience Intel’s download page can be very slow and unstable from time to time. So you could also add the direct download link: “http://download.altera.com/akdlm/software/acdsinst/19.1std/670/ib_tar/Quartus-lite-19.1.0.670-linux.tar”
Thanks for the link. I had some trouble downloading from Thailand, where I live. I switched on my VPN and connected to the US. That worked a lot better.
I see. Here, back in Norway, I’ve had much better success with the direct link than their website. Never tried using a VPN to the US though.
Hello have you tried installing this on WSL? I tried this on Ubuntu-18.04 and it fails while installing fontconfig:i386. I tried on a fresh installation of Ubuntu-20.04 and it fails on libc6:i386 with the following error:
dpkg: error processing package libc6:i386 (–configure):
installed libc6:i386 package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of libgpg-error0:i386:
libgpg-error0:i386 depends on libc6 (>= 2.28); however:No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
Package libc6:i386 is not configured yet.
dpkg: error processing package libgpg-error0:i386 (–configure):
dependency problems – leaving unconfigured
dpkg: dependency problems prevent configuration of libgcrypt20:i386:
libgcrypt20:i386 depends on libc6 (>= 2.28); however:
Package libc6:i386 is not configured yet.
libgcrypt20:i386 depends on libgpg-error0 (>= 1.25); however:
Package libgpg-error0:i386 is not configured yet.
dpkg: error processing package libgcrypt20:i386 (–configure):
dependency problems – leaving unconfigured
dpkg: dependency problems prevent configuration of liblz4-1:i386:
liblz4-1:i386 depends on libc6 (>= 2.4); however:
Package libc6:i386 is not configured yet.
dpkg: error processing package liblz4-1:i386 (–configure):
dependency problems – leaving unconfigured
dpkg: dependency problems prevent configuration of liblzma5:i386:
liblzma5:i386 depends on libc6 (>= 2.17); however:
E: Sub-process /usr/bin/dpkg returned an error code (1)
have you seen anything similar?
Thanks for any hint
I suppose you have good reasons for trying to run ModelSim in WSL because it would be simpler to download the ModelSim-Intel FPGA Edition for Windows.
If you must have ModelSim working in WSL, it seems that the libc6:i386 package is missing or has the wrong version. Refer to the commands listed in the blog post above for how to install it.
You can use the “apt list” command to check which version you currently have installed. This is the output from the Ubuntu VMWare box that I used in the tutorial:
Note that the 32-bit (i386) version in the listing above is newer than the 2.28 that your error message is complaining about. Perhaps you haven’t done the steps from “sudo dpkg –add-architecture i386” and onward?
Or maybe you have a too old version installed and need to do a “sudo apt update; sudo apt upgrade”.
Please reply if you find the solution to help other googlers who arrive at this blog post with a similar problem. ?
Hi Jonas,
Thanks for your answer. I was able to successfully install Modelsim 19.4 on my WSL system (Ubuntu 18.04). I migrated my system to WSL2 in the meantime and I wonder if that could have helped. Before migration, installation of fontconfig:i386 was constantly failing.
I do have modelsim running in Windows, however, since most of my development is done in WSL, I do not like switching back and forth. Moreover, for the sake of running regressions and creating a “decent” flow, I do prefer to be able to run it in WSL.
Thanks once again for the detailed instructions. That was very helpful
Interesting! I’ve got to try to get ModelSim working in WSL when I have the time. Thanks for checking in with the update.
Thanks for the instructions, certainly saved me some headache! In order to launch ModelSim from Quartus (18.1) I also had to add the freetype lib path to quartus/adm/qenv.sh. I was lazy and just used the same path made following your instructions, so make quartus/adm/qenv.sh writeable and add “export LD_LIBRARY_PATH=/home/USER/intelFPGA/modelsim_ase/lib32:$LD_LIBRARY_PATH”. The font in ModelSim was also unreadably tiny but fixed by https://stackoverflow.com/a/41698839
Hello, Dennis. Thanks for the heads-up. I was able to make the fonts larger by going to Tools->Edit Preferences->Fonts. That was one of the suggestions from the StackOverflow article.
Thank you for this. For Ubuntu 20.1, lib32gcc-s1 is replaced with lib32gcc-s1 (according to apt). That was the only change I made and it seems to work well!
Thank you for sharing the update!
(base) harish@harish:~$ sed -i ‘s/linux\_rh[[:digit:]]\+/linux/g’ \
> ~/intelFPGA/20.1/modelsim_ase/vco
sed: can’t read ~/intelFPGA/20.1/modelsim_ase/vco: No such file or directory
(base) harish@harish:~$ sed -i ‘s/MTI_VCO_MODE:-“”/MTI_VCO_MODE:-“32″/g’ \
> ~/intelFPGA/20.1/modelsim_ase/vco
sed: can’t read ~/intelFPGA/20.1/modelsim_ase/vco: No such file or directory
(base) harish@harish:~$ sed -i ‘/dir=`dirname “$arg0″`/a export LD_LIBRARY_PATH=${dir}/lib32’ \
> ~/intelFPGA/20.1/modelsim_ase/vco
sed: can’t read ~/intelFPGA/20.1/modelsim_ase/vco: No such file or directory
It seems that your installation path is different from what my script expects. You have to find out what the path to the ‘vco’ file is and adjust the script.
Try searching for it like this:
Thanks! its really useful. I appreciate your efforts.
…
Aamir Sohail Nagra
Hardware Engineer
I’m glad to hear that you liked it. ?