Lattice Modelsim on Linux/Ubuntu 20.04

Lattice/Modelsim simulations on Linux

How to setup Lattice/Modelsim on Linux (Ubuntu 20.04)

Its a well known fact that verification by simulation (and of course other methods such as formal tools etc.) are highly recommended in order to validate an RTL design before it even hits the lab bench.

Lattice Semiconductor in their latest update of the Radiant toolchain bundled the Modelsim tools and removed support for Aldec. While Modelsim ran with no issues on Windows, I had to jump through a few hoops to get it to work on Linux. This blog covers the incantations required to successfully run Modelsim on Linux.

The open source tools such as Icarus Verilog are excellent and free. However, they are also somewhat limited as far as SystemVerilog support goes. Also, there are sometimes crashes of the simulator that left me frustrated trying to find out what caused the crash. Another very good reason to use Modelsim is the need to use a commercial simulator that can decrypt IP cores distributed with the Lattice tools. These cannot be simulated by the open source tools.


  • Lattice tools ship with the 32 bit Modelsim version
  • Lattice and Modelsim directory structures differ
  • Modelsim license settings need to be tweaked

Initial Setup

Download the Radiant tools from the Lattice website after registering for an account. The tools can be installed in the users home directory or in a more usual place like /usr/local. I chose to install the Lattice tools in my home directory, this is probably poor Linux practice!) The Modelsim files are located at:  /lscc/radiant/2.2/modeltech/linuxloem

This is not where the Modelsim scripts located at ~/lscc/radiant/2.2/modeltech/bin expect it to be.

I created a soft link:
cd ~/lscc/radiant/2.2/modeltech/; ln -sf linuxloem linux_x86_64;

OK, next, the vcom refused to run and complained about 32 bit libraries. I had a 64 bit install. Lets see what kind of file it is:


file vcom
vcom: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/, for GNU/Linux 2.6.18, BuildID[sha1]=86e420fbff866af1daddc6baa53f93f07c313849, stripped

Lets install the 32 bit libraries it wants:

sudo apt-get install lib32z1

$ ./vsim
./vish: error while loading shared libraries: cannot open shared object file: No such file or directory

apt-file search
libxext6: /usr/lib/x86_64-linux-gnu/
libxext6: /usr/lib/x86_64-linux-gnu/
libxext6-dbg: /usr/lib/debug/usr/lib/x86_64-linux-gnu/

$ ldd vsim (0xf7eec000) => /lib32/ (0xf7ece000) => /lib32/ (0xf7dca000) => /lib32/ (0xf7da7000) => /lib32/ (0xf7bbc000)
/lib/ (0xf7eee000)

$ export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
vrangan@ravana:~/lscc/radiant/2.2/modeltech/linux_x86_64$ echo $LD_LIBRARY_PATH
vrangan@ravana:~/lscc/radiant/2.2/modeltech/linux_x86_64$ ./vsim
./vish: error while loading shared libraries: wrong ELF class: ELFCLASS64

$ sudo apt-get install libxext6:i386
$ ls /usr/lib/i386-linux-gnu/libX*
/usr/lib/i386-linux-gnu/ /usr/lib/i386-linux-gnu/
/usr/lib/i386-linux-gnu/ /usr/lib/i386-linux-gnu/
/usr/lib/i386-linux-gnu/ /usr/lib/i386-linux-gnu/
/usr/lib/i386-linux-gnu/ /usr/lib/i386-linux-gnu/

$ export LD_LIBRARY_PATH=/usr/lib/i386-linux-gnu
vrangan@ravana:~/lscc/radiant/2.2/modeltech/linux_x86_64$ ./vsim
./vish: error while loading shared libraries: cannot open shared object file: No such file or directory'

$ apt search libXft
Sorting... Done
Full Text Search... Done
libxft-dev/focal 2.3.3-0ubuntu1 amd64

$ sudo apt-get install libxft-dev:i386


Running simulations:

vsim -c -warning vsim-3009 -t ps -do "run -all; quit" work.tb_cpi -L lifcl
Reading pref.tcl

# 2020.3

# vsim -c -warning vsim-3009 -t ps -do "run -all; quit" work.tb_cpi -L lifcl
# Start time: 10:20:52 on Mar 16,2021
# ** License Issue: License request for latticemsim feature failed
# ** License Issue: No such feature exists. (/home/vrangan/lscc/radiant/2.2/modeltech/linuxloem/mgls/etc/cust/mgc/mgc.licenses)
# ** Error: Failure to obtain a Verilog simulation license. Unable to checkout any of these license features: 'latticemsim' or 'alteramtivlog'.
# Error loading design
Error loading design

Looks like the lattice license files isnt visible:
Lets copy the latticemsim line from the Lattice license file to the Modelsim License file and see if that works:



Lets do this the right way:

export LM_LICENSE_FILE=$HOME/lscc/radiant/2.2/license/license.dat


Now everything seems right and works, Yay!

Back to blog

Leave a comment