Get email delivery of the Cadence blog featured here
I'm overdue to provide an update on how to run Virtual System Platform (VSP) and Incisive on the latest version of Ubuntu. My last article was very helpful to many people and users provided additional insight about what worked for them.
Just before the holiday break we delivered our latest version of the Zynq Virtual Platform to some early beta users. One of the delivery options we have been using is to deliver a Virtual Machine with all of the software pre-installed and configured so it's easy to download and run. This eliminates the need to download and configure additional software such as models and compilers.
Another compelling event was the update of Virtual System Platform to use the infrastructure from the Incisive 11.1 release. For us, "infrastructure" mostly means the supported platforms and for SystemC simulation it means the provided set of GNU compilers for compiling SystemC models. Starting with 11.1 only 64-bit machines are supported (although you can generate and run 32-bit executables). One the reasons the 64-bit machine is important is that the supplied version of g++ only runs on 64-bit machines.
To make a long story short, these modifications required me to provide a new 64-bit Ubuntu Virtual Machine for the Zynq delivery, so I thought this is a good time to update interested readers on using Ubuntu 11.10 with the latest Virtual System Platform and Incisive 11.1. As usual, my work is almost exclusively SystemC Virtual Platforms so I don't use everything in Incisive, but I'm sure much of the information is still relevant. The same information probably also applies to older versions like Ubuntu 10.10, but since it is 2012 now, I thought it was a good time to get caught up and use Ubuntu 11.10 for my daily work.
For anybody new to VirtualBox, the initial setup is always the same:
There are many resources on using VirtualBox so do some reading if you want to learn more about how to do it and how it works.
One additional trick if you want to use shared folders to access the same data from the host and the guest machines; make sure to run usermod to add your user account to the vboxsf group. Without this step you will have permission issues when accessing the shared folders from the Ubuntu guest and may be tempted to try sudo to copy files.
$ sudo usermod -a -G vboxsf <user>
After adding the user account to the vboxsf group you may need to log out and log back in for it to be complete. You can always use the groups command to see which groups a user is part of.
Modifications for Virtual System Platform
Now for the modifications for Virtual System Platform to run on Ubuntu. Some of these are the same as in previous articles and some were provided by user feedback, but I captured them all here so it's easy to tell what still applies.
Virtual System Platform requires csh in various places. Install it using:
$ sudo apt-get install csh
The default sh is dash and breaks some scripts so change sh to be bash NOT dash:
$ sudo dpkg-reconfigure dash
Virtual System Platform currently runs all simulations as 32-bit applications so install 32-bit libraries:
$ sudo apt-get install ia32-libs
This package helps g++ with 32-bit support, without it you may hit compiler and linker errors using the Cadence g++:
$ sudo apt-get install g++-multilib
Recently, some Virtual System Platform users had trouble with FlexLM utilities that are provided as part of the platform. Programs like lmutil just give a strange error:
$ lmutilbash: /home/jasona/VSP11.10-v010/tools/bin/lmutil: No such file or directory
The solution to get these working is to install LSB:
$ sudo apt-get install lsb
As covered before, gdb doesn't work because of a security concern that a debugger can modify a program and open a security hole -- so to enable gdb:
edit /etc/sysctl.d/10-ptrace.conf and change the 1 to 0
Virtual System Platform also requires /tmp to be writable, after install it is not -- so make /tmp writable by anybody using chmod. Depending on your Ubuntu version this may or may not be needed, but it's good to check it.
The biggest challenge if you are using the Cadence provided g++ is to make it work on a platform that has a different library layout than the officially supported Linux distributions. In the case of 64-bit Ubuntu 11.10 the 64-bit libraries are in /lib and 32-bit libraries are in /lib32. A 64-bit Red Hat distribution has 32-bit libraries in /lib and 64-bit libraries in /lib64. These differences require some tweaks to the Cadence g++ to make it work on Ubuntu. There are 2 modifications to make the Cadence supplied compiler work.
Edit `ncroot`/tools/systemc/files/specs/specfile.lnx86.gnu line 59 to look in /usr/lib32 instead of /usr/lib (which has 64-bit libs).
LINKER_SHARED_LIB_OPT = -L/usr/lib32
Edit the `ncroot`/tools/cdsgcc/gcc/bin/cdsgcc wrapper line 143 to add /usr/lib32 without this you will get error linking the crt?.o files.
With these changes you should be able to compile and run SystemC simulations on Ubuntu 11.10. If you have other code that is compiled with the Cadence supplied compiler and you invoke g++ directly make sure to use -m32 if you want 32-bit output. Without this you will get 64-bit output. Programs like irun and ncsc_run will add the -m32 automatically.
One last note, on Ubuntu 11.10 the fonts in SimVision are unattractive. This can be fixed by installing additional fonts:
$ sudo apt-get install ttf-mscorefonts-installer
Make sure to either run the fc-cache program to update the font cache or just reboot and it will update.
Hopefully all of this info will help readers who are interested in running Ubuntu 11.10 and Virtual System Platform or Incisive either natively or inside VirtualBox.
I don't have any big summary of 2011 or predictions for 2012, but I wanted to share a favorite moment from 2011. As with any software development project things get a little crazy when the time comes to ship. We have a team of people working on the Zynq Virtual Platform that is spread across 3 continents, and for me, living in the Central time zone, it means I have nearly zero working time overlap with the India team. This results in a number of late night meetings to talk about and debug various issues, and leads to a general lack of sleep on both sides of the globe.
I couldn't help but start laughing one day last fall when I pulled the Embedded System Design Magazine from my mail box with the title "Avoiding late night debugging". The article didn't help me much, but I admit the cover was pretty appealing. After a two week break in which no late night debugging was done, we are back to work (including late night debugging) and look forward to working with many of you in 2012.
After some heartache I did manage to get Incisive working on Ubuntu 12.04 LTS x64 with INCISIVE121... A couple things....
Jason mentioned the compat systemC libraries which contain crti.o file is only for 32-bit.. Incisive does not ship one for 64bit... The 4.1 gcc environment expects these to exist under /usr/lib64 on the local machine.. You must create a link from /usr/lib64 to /usr/x86_64-linux-gnu.
Next when finishing elaboration and creating files after elaboration, Incisive calls scripts with /bin/sh with command line options... These will fail due to the fact the /bin/sh is a link to /bin/dash in Ubuntu... Dash is a stripped down version of bash... I needed to change the /bin/sh softlink to point to /bin/bash instead to make Incisive happy..
I hope the integration becomes easier in the near future.....
One more tip for VSP users. If you get an error on 64-bit Ubuntu about libelf not being found install it using $ sudo apt-get install libelf1:i386 and then set LD_LIBRARY_PATH to add /usr/lib/i386-linux-gnu and it will be found.
Steve, the issue you are facing is due to a 32-bit Ubuntu guest OS. Some parts of Incisive don't work on 32-bit operating systems any more. Specifically, the GNU compiler shipped with the release only works on 64-bit machines, this is why you get the "Exec format error". the solution is to change to a 64-bit Ubuntu guest OS. My current configuration is 64-bit Ubuntu 12.04.
I am was able to get INCISIVE121 to work on Ubuntu 12.04 installed as a VirtualBox guest on my 64-bit Windows 7 machine using the suggestions above. However, I'd really like to be able to run INCISIVE121 with Ubuntu 12.04 on a 32-bit machine natively. I can get the base SystemVerilog features to work but anytime C code is involved (e.g. UVM) IUS tries to invoke its local 64-bit version of g++. Here's one of the errors:
g++: error trying to exec "/tool/cadence/INCISIV121/tools.lnx86/cdsgcc/gcc/4.4/install/libexec/gcc/x86_64-redhat-linux/4.4.5/cc1plus': exec: Exec format error.
That particular file is a 64-bit file that won't work on this machine. It's not clear to me why IUS is trying to invoke a 64-bit version when the machine doesn't support it. I can see that most of the generated makefiles contain '-m32' but that doesn't do any good when it's trying to pass the value to a 64-bit executable on a 32-bit machine. Any suggestions?
Hi there, I have installed Ubuntu 12.04 LTS x64. I also installed ttf-mscorefonts-installer. But on 12.04, simvision shows with strange fonts. Could you any suggestions?
Yes, you can install Ubuntu without VirtualBox, this is only an option for those people who can't or don't want to re-partition the disk or are forced to use Windows.
Another option I used before is Wubi, the Ubuntu Windows Installer www.ubuntu.com/.../windows-installer
I already have ubuntu 11.10 in different partition . is it necessary to use Virtual box again for installation of ubuntu 11.10 .
Can I install Cadence directly in ubuntu 11.10 without virtual box ?
Thanking You ,
One problem that I had faced when running Zynq virtual box on my laptop was that my laptop bios was not configured for vt-x/AMD-V property. So when I started virtual box I got an error message. After some digging into Google search I found that virtual box needs vt-x/AMD-V enabled in the BIOS of host computer. Once I enabled things flew past smoothly.