[[ubuntu_virtual_cae_system]]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
ubuntu_virtual_cae_system [2019/03/27 15:01]
beckmanf
ubuntu_virtual_cae_system [2019/03/27 15:05]
beckmanf Install on Lubuntu 18.04 LTS
Line 1: Line 1:
-__false__+===== Ubuntu Virtual CAE System =====
  
 +The Ubuntu(r) virtual CAE System is an Ubuntu Linux(r) based CAE environment based on Altera(r), Quartus(r), Modelsim(r) and a MIPS(r) Cross compiler. The idea is to run Ubuntu Linux in a virtual machine.
 +
 +==== Preconfigured VirtualBox virtual machine ====
 +
 +Hans Färber has build a [[https://​www.hs-augsburg.de/​homes/​haf/​php/​dokuwiki/​doku.php?​id=public:​praktikum_digitaltechnik:​cae-virtual-machine:​caevm-install|preconfigured virtual cae machine]] based on Lubuntu.
 +
 +===== Install on Lubuntu 18.04 LTS =====
 +
 +[[vcae-lubuntu-18.04|Install on Lubuntu 18.04]]
 +
 +===== Build your own from scratch (Ubuntu 12.04) =====
 +
 +Here is the description how the virtual machine is build from scratch. There are specific instructions for [[ubuntu_virtual_cae_system#​Installing on Ubuntu 14.04]]. ​
 + 
 +==== Virtual Machine ====
 +
 +There are different virtual machine environments. ​
 +
 +== VMWare ==
 +
 +VMWare(r) provides a commercial version VMWare Fusion for Mac OS(r). This has a very good integration in MacOS and I use
 +it with MacOS 10.8.3 (Mountain Lion). It is not free. For Windows(r) there is the VMWare Player. The VMWare Player is free. I have not tested it. 
 +
 +== VirtualBox ==
 +
 +VirtualBox(r) is available for Windows, Linux and Mac OS. It is free. From my experience with MacOS it is not as good integrated as VMWare Fusion. The following description targets Virtualbox as this is free of charge. ​
 +
 +=== Get the virtual machine ===
 +
 +Download and install the the virtual machine software from [[https://​www.virtualbox.org|https://​www.virtualbox.org]]
 +
 +=== Get the Ubuntu install image ===
 +
 +Download the ISO file for the 32 Bit Ubuntu 12.04 LTS Desktop version. You can download the image from here:
 +
 +[[http://​de.releases.ubuntu.com/​precise/​ubuntu-12.04.5-desktop-amd64.iso]]
 +
 +=== Install Ubuntu in the virtual machine ===
 +
 +You can mount the ISO Image as CDROM in the virtual machine and boot from the virtual CDROM. Then you install to your disk. Configure the virtual machine with the following parameters. ​
 +
 +  * fixed vmdk disk with 30 GByte size
 +  * depending on your RAM choose minimum 1 GByte RAM for the virtual machine
 +  * In the Graphics section give 128 MB Ram to the graphics system ​
 +  * Enable 2D or 3D acceleration (On my MacBook(r) 3D is proposed)
 +
 +To mount the virtual CDROM do: 
 +
 +Choose Devices->​CD/​DVD Devices -> Choose a virtual CD/DVD disk file
 +
 +Then select the Ubuntu Install Image ISO file that you downloaded in the previous section. You now have the virtually inserted the CDROM. Now reboot the virtual machine. The settings should result in booting from the CDROM and from there you install Ubuntu to the virtual disk drive. Just select location and language as appropriate. ​
 +
 +=== Post install ===
 +
 +After installing Ubuntu you need to install guest applications from virtual box.  ​
 +
 +== Problem: low-res graphics ==
 +Problem: The graphical userinterface does not start because it cannot identify the screen resolution. Whatever you do you end in a textual shell. ​
 +Solution: You need to install the virtualbox guest additions. ​
 +
 +From the textual shell login to the system and run the following ​
 +
 +<​code>​
 +sudo apt-get install dkms
 +</​code>​
 +
 +Virtually insert the VirtualBox Guest additions CD by selecting Devices->​Install Guest Additions in Virtualbox application. That will virtually insert a CDROM in the drive. Now you need to mount the cdrom in ubuntu, change to the cdrom directory and run the installation script. ​
 +
 +<​code>​
 +sudo mount /dev/cdrom /media
 +cd /media
 +sudo ./​VBoxLinuxAdditions.run ​
 +</​code>​
 +
 +Now you can reboot and the graphical user interface should start. ​
 +
 +<​code>​
 +sudo shutdown -r now
 +</​code>​
 +
 +After reboot open a shell (terminal) and update the ubuntu system ​
 +
 +<​code>​
 +sudo apt-get update
 +sudo apt-get upgrade
 +</​code>​
 +==== Install Altera Quartus and Modelsim ====
 +
 +Description for 64Bit Linux installation is here [[Quartus_on_64bit_linux]]
 +
 +Go to the tmp directory and download und untar the installation package. Then start the setup
 +
 +<​code>​
 +cd /tmp
 +mkdir quartus
 +cd quartus
 +wget http://​www.hs-augsburg.de/​~beckmanf/​public/​Quartus-web-13.0.1.232-linux.tar
 +tar -xvf Quartus-web-13.0.1.232-linux.tar
 +./setup.sh
 +</​code>​
 +
 +Modelsim does not display the fonts very nicely. To have better fonts do 
 +
 +<​code>​
 +sudo apt-get install xfonts-75dpi
 +</​code>​
 +
 +In order to be able to start the binaries from the commandline,​ the path for the binaries has to be in the PATH environment variable. For that you have to modify the .profile file in your home directory. Append the following snippet to the .profile file: 
 +
 +<code bash .profile>​
 +# Include the ALTERA fpga software
 +PATH="​$PATH:​$HOME/​altera/​13.0sp1/​quartus/​bin"​
 +# Include the ALTERA Modelsim VHDL simulator
 +PATH="​$PATH:​$HOME/​altera/​13.0sp1/​modelsim_ase/​linuxaloem"​
 +</​code>​
 +
 +To make the new fonts active and to see the changes in the PATH variable, you have to logout and login again. After that you can already start modelsim and quartus (see below). To check the setting of the PATH variable do: 
 +
 +<code bash>
 +fritz@fritz-VirtualBox:​~$ echo $PATH
 +/​home/​fritz/​site/​bin:/​usr/​lib/​lightdm/​lightdm:/​usr/​local/​sbin:/​usr/​local/​bin:/​usr/​sbin:/​usr/​bin:/​sbin:/​bin:/​usr/​games:/​home/​fritz/​altera/​13.0sp1/​modelsim_ase/​linuxaloem:/​home/​fritz/​altera/​13.0sp1/​quartus/​bin
 +fritz@fritz-VirtualBox:​~$ ​
 +</​code> ​
 +
 +You can see that the altera directories are now part of the PATH variable. ​
 +
 +The following steps are required to actually program the devices. If you do not need or want to do that, you can continues with starting modelsim and quartus.
 +
 +==== USB Settings ==== 
 +
 +For the USB programming via the USB Blaster(tm),​ the port permissions have to be set correctly. For that you have to add the file "​51-usbblaster.rules"​ to the directory "/​etc/​udev/​rules.d"​ and reboot. See also [[http://​www.altera.com/​download/​drivers/​dri-usb_b-lnx.html]] but notice that the rules shown at Altera are different and do not work with ubuntu.
 +
 +<​code>​
 +/​etc/​udev/​rules.d/​51-usbblaster.rules
 +</​code>​
 +
 +<code bash 51-usbblaster.rules>​
 +# Altera USB-Blaster for Quartus FPGA Software
 +SUBSYSTEMS=="​usb",​ ATTR{idVendor}=="​09fb",​ ATTR{idProduct}=="​6001",​ MODE="​0666"​
 +SUBSYSTEMS=="​usb",​ ATTR{idVendor}=="​09fb",​ ATTR{idProduct}=="​6002",​ MODE="​0666"​
 +SUBSYSTEMS=="​usb",​ ATTR{idVendor}=="​09fb",​ ATTR{idProduct}=="​6003",​ MODE="​0666"​
 +# USB-Blaster II
 +SUBSYSTEMS=="​usb",​ ATTR{idVendor}=="​09fb",​ ATTR{idProduct}=="​6010",​ MODE="​0666"​
 +SUBSYSTEMS=="​usb",​ ATTR{idVendor}=="​09fb",​ ATTR{idProduct}=="​6810",​ MODE="​0666"​
 +</​code>​
 +
 +For the following test you need to attach the Altera Board to your computer. Notice that you have to attach the usb device to the virtual machine with Devices->​USB Devices->​Altera USB-Blaster. Then you should be able to see the device in the usb device list with lsusb. ​
 +
 +<​code>​
 +fritz@fritz-VirtualBox:/​etc/​udev/​rules.d$ lsusb
 +Bus 001 Device 002: ID 80ee:0021 VirtualBox USB Tablet
 +Bus 001 Device 003: ID 09fb:6001 Altera Blaster
 +Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
 +fritz@fritz-VirtualBox:/​etc/​udev/​rules.d$
 +</​code>​
 +
 +You can see the permissions for the devices with ls. See the rw rights for "​others"​ for the device 003 which is
 +the usb blaster. That is a result of the rules file. 
 +
 +<​code>​
 +fritz@fritz-VirtualBox:/​etc/​udev/​rules.d$ ls -l /​dev/​bus/​usb/​001/​
 +insgesamt 0
 +crw-rw-r-- 1 root root 189, 0 Mai  7 16:35 001
 +crw-rw-r-- 1 root root 189, 1 Mai  7 16:35 002
 +crw-rw-rw- 1 root root 189, 2 Mai  7 16:38 003
 +</​code>​
 +
 +If your permissions for the usb port are correct, then you should be able to scan the jtag chain
 +with jtagconfig. ​
 +
 +<​code>​
 +fritz@fritz-VirtualBox:/​etc/​udev/​rules.d$ jtagconfig --enum
 +1) USB-Blaster [1-2]                          ​
 +  020B30DD ​  ​EP2C(15|20)
 +
 +fritz@fritz-VirtualBox:/​etc/​udev/​rules.d
 +</​code>​
 +
 +=== Start Modelsim ===
 +
 +<​code>​
 +vsim
 +</​code>​
 +
 +=== Start Quartus ===
 +
 +<​code>​
 +quartus
 +</​code>​
 +
 +==== Install qfsm ====
 +
 +[[http://​qfsm.sourceforge.net|QFSM]] ist the state chart editor used in the lab. First you need to install some required packages. ​
 +
 +<​code>​
 +sudo apt-get install cmake qt4-dev-tools libgraphviz-dev
 +</​code>​
 +
 +Then you can build and install qfsm. 
 +<​code>​
 +cd
 +mkdir qfsm
 +cd qfsm
 +wget http://​sourceforge.net/​projects/​qfsm/​files/​qfsm/​qfsm-0.52/​qfsm-0.52.0-Source.tar.bz2/​download -O qfsm.tar.bz2
 +bunzip2 qfsm.tar.bz2
 +tar -xvf qfsm.tar
 +mkdir build
 +cd build
 +cmake ../​qfsm-0.52.0-Source
 +make
 +sudo make install
 +</​code>​
 +
 +===== Installing on Ubuntu 14.04 =====
 +
 +  * Ubuntu 14.04 LTS 64 Bit
 +  * Altera Quartus II Web Edition Version 13.0sp1 (13.0.1 build 232)
 +  * Modelsim Altera Starter Edition Version 10.1d (included in 13.0sp1)
 +
 +The ISO Image for the Ubuntu 14.04 is here: 
 +
 +[[http://​de.releases.ubuntu.com/​trusty/​ubuntu-14.04.2-desktop-amd64.iso]]
 +
 +I installed on VMWare on my Macbook running OSX 10.9.3 with VMWare 6.03. I did not install any VMWare add ons. 
 +==== Installing Quartus ====
 +
 +Add the following to your .profile in your home directory. You need to logout and login to make the changes active. ​
 +
 +<code bash .profile>​
 +# Include the ALTERA fpga software
 +PATH="​$PATH:​$HOME/​altera/​13.0sp1/​quartus/​bin"​
 +# Include the ALTERA Modelsim VHDL simulator
 +PATH="​$PATH:​$HOME/​altera/​13.0sp1/​modelsim_ase/​bin"​
 +</​code>​
 +
 +Follow the instructions to modify the [[ubuntu_virtual_cae_system#​USB Settings]]. ​
 +
 +Enable multiple architectures (32 Bit / 64 Bit)
 +
 +<​code>​
 +sudo dpkg --add-architecture i386
 +sudo apt-get update
 +</​code>​
 +
 +Install the 32Bit libraries
 +
 +<​code>​
 +sudo apt-get install libc6:i386 libpng12-0:​i386 libfreetype6:​i386 libsm6:i386 libxrender1:​i386 libfontconfig1:​i386 libxext6:​i386 libxft2:​i386 libncurses5:​i386
 +</​code>​
 +
 +
 +Modelsim does not display the fonts very nicely. To have better fonts do 
 +
 +<​code>​
 +sudo apt-get install xfonts-75dpi
 +</​code>​
 +
 +Get and install the Quartus/​Modelsim package: ​
 +
 +<​code>​
 +cd /tmp
 +mkdir quartus
 +cd quartus
 +wget http://​www.hs-augsburg.de/​~beckmanf/​public/​Quartus-web-13.0.1.232-linux.tar
 +tar -xvf Quartus-web-13.0.1.232-linux.tar
 +./setup.sh
 +</​code>​
 +
 +During the setup you can deselect all device specific packages (Arria...) except CycloneII. ​
 +
 +Quartus should now run. 
 +
 +==== Modelsim incompatible libfreetype ====
 +
 +If you start vsim after the installation it will crash with a segmentation fault. The reason is that modelsim is not compatible with a newer version of libfreetype. I followed the instructions here [[http://​mattaw.blogspot.de/​2014/​05/​making-modelsim-altera-starter-edition.html]]. The following should work for the ubuntu install. ​
 +
 +=== Compile a new libfreetype ===
 +<​code>​
 +cd /tmp
 +sudo apt-get install libc6-dev-i386
 +sudo apt-get build-dep -a i386 libfreetype6
 +wget http://​download.savannah.gnu.org/​releases/​freetype/​freetype-2.4.12.tar.bz2
 +tar -xjvf freetype-2.4.12.tar.bz2
 +cd freetype-2.4.12
 +./configure --build=i686-pc-linux-gnu "​CFLAGS=-m32"​ "​CXXFLAGS=-m32"​ "​LDFLAGS=-m32"​
 +make -j8
 +</​code>​
 +
 +=== Modify the modelsim Installation ===
 +
 +<​code>​
 +cd ~/​altera/​13.0sp1/​modelsim_ase/​
 +mkdir lib32
 +cp /​tmp/​freetype-2.4.12/​objs/​.libs/​libfreetype.so* ./lib32
 +chmod u+w vco
 +</​code>​
 +
 +Now edit the file "​~/​altera/​13.0sp1/​modelsim_ase/​vco"​. ​
 +
 +<​code>​
 +gedit ~/​altera/​13.0sp1/​modelsim_ase/​vco
 +</​code>​
 +
 +Find the line
 +
 +<​code>​
 +dir=`dirname $arg0`
 +</​code>​
 +
 +and add
 +
 +<​code>​
 +export LD_LIBRARY_PATH=/​home/​fritz/​altera/​13.0sp1/​modelsim_ase/​lib32
 +</​code>​
 +
 +just below that line. You need to adapt the path to the name of your installation. ​
 +
 +Now 
 +
 +<​code>​
 +vsim
 +</​code>​
 +
 +should work. 
 +===== Download and build the mips toolchain =====
 +
 +The MIPS Cross Compiler is only needed for the patterson project. ​
 +
 +Follow the instructions in [[mips_cross_compiler|MIPS Cross Compiler build]]
 +
 +===== Test the installation =====
 +
 +Install git
 +
 +<​code>​
 +sudo apt-get install git
 +</​code>​
 +
 +Download the "​Digitaltechnikpraktikum"​ from the git server: [[https://​git.etech.fh-augsburg.de/​friedrich.beckmann/​digitaltechnikpraktikum]]
 +
 +<​code>​
 +cd
 +mkdir projects
 +cd projects
 +git clone https://​git.etech.fh-augsburg.de/​friedrich.beckmann/​digitaltechnikpraktikum.git
 +</​code>​
 +
 +Now start a Modelsim simulation
 +
 +<​code>​
 +cd digitaltechnikpraktikum
 +cd sim
 +cd ledcomb
 +make sim
 +</​code>​
 +
 +To run a synthesis
 +
 +<​code>​
 +cd digitaltechnikpraktikum
 +cd pnr
 +cd ledcomb
 +make compile
 +make quartus
 +</​code>​
 +
 +If you have a [[altera_boards|FPGA Board]], you can download and test the design. ​
 +
 +<​code>​
 +make prog
 +</​code>​
 +
 +==== Trademarks ====
 +
 +MIPS(r) and MIPS I(tm) are trademarks of  [[http://​www.mips.com|MIPS Technologies Inc.]]. See [[http://​www.mips.com/​media/​files/​mips_trademark.pdf|Mips Trademark usage]] ​
 +
 +Altera(r), Quartus(r), Nios(r), Cyclone(r), USB-Blaster(tm),​ SignalTap(tm) are trademarks of [[http://​www.altera.com|Altera Corporation]]. See [[http://​www.altera.com/​common/​trademark-guidelines.html|Altera Trademark Usage Guidelines]]
 +
 +VMWare(r) is a trademark of [[http://​www.vmware.com|VMWare Inc.]]
 +
 +Apple(r), Mac OS(r), MacBook(r) and Mac(r) are trademarks of [[https://​www.apple.com|Apple Inc.]]
 +
 +Windows(r) is a trademark of [[https://​www.microsoft.com|Microsoft Corporation]].
 +
 +VirtualBox(r) is a trademark of [[http://​www.oracle.com|Oracle Corporation]].
 +
 +ModelSim(r) is a trademark of [[http://​www.mentor.com|Mentor Graphices Corporation]]
 +
 +Linux(r) is a trademark of [[http://​www.linuxfoundation.org/​programs/​legal/​trademark|Linus Torvald]]
 +
 +Ubuntu(r) is a trademark of [[http://​www.ubuntu.com|Canonical Ltd.]]
 +
 +This is an independent publication and is not affiliated with, nor has it been authorized, sponsored, or otherwise approved by any of these companies. ​
 +
 +
 +
 +
 +
 +  ​
  • ubuntu_virtual_cae_system.txt
  • Last modified: 2022/03/15 11:22
  • by beckmanf