Está en la página 1de 6

Para instalar el Quartus:

sudo apt-get install libsm6:i386 libxft2:i386 libxext6:i386 libncurses5:i386 tcsh


sudo dpkg --add-architecture i386
sudo dpkg-reconfigure dash (dash no debe ser el shell por defecto)

Para correguir problemas para ejecutar el Modelsim:

Aquí se supondrá que el quartus fue instalado en /opt/altera, corregir en caso


necesario.
Información tomada de http://mattaw.blogspot.com/2014/05/making-modelsim-altera-
starter-edition.html
https://sites.google.com/site/longphanwiki/basic-skills/modelsim-doesn-t-work-with-
linux-kernel-3-x

Ejecutar esto:

sudo dpkg --add-architecture i386

sudo apt-get update

sudo apt-get install build-essential

sudo apt-get install gcc-multilib g++-multilib \


lib32z1 lib32stdc++6 lib32gcc1 \
expat:i386 fontconfig:i386 libfreetype6:i386 libexpat1:i386 libc6:i386 libgtk-3-
0:i386 \
libcanberra0:i386 libpng12-0:i386 libice6:i386 libsm6:i386 libncurses5:i386
zlib1g:i386 \
libx11-6:i386 libxau6:i386 libxdmcp6:i386 libxext6:i386 libxft2:i386
libxrender1:i386 \
libxt6:i386 libxtst6:i386

Podría ser suficiente, pero si al ejecutar el ModelSim


(/opt/altera/13.0sp1/modelsim_ase/bin/vsim) se obtiene:

** Fatal: Read failure in vlm process (0,0)


Segmentation fault (core dumped)

Entonces hay que reemplazar las fuentes freetype. Para que esto funcione se deben
haber instalado las herramientas indicadas inicialmente. Hay que descargar las
fuentes de:

http://download.savannah.gnu.org/releases/freetype/freetype-2.4.12.tar.bz2

Ahora, suponiendo que el archivo quedó descargado en la carpeta Descargas (y que se


tienen las dependencias de freetype, ver http://mattaw.blogspot.com/2014/05/making-
modelsim-altera-starter-edition.html):

cd ~/Descargas
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

Ahora hay que ir a la carpera del Modelsim:

cd /opt/altera/13.0sp1/modelsim_ase
sudo mkdir lib32
cp ~/Descargas/freetype-2.4.12/objs/.libs/libfreetype.so* ./lib32
Finalmente hay que editar el script vsim:

sudo nano /opt/altera/13.0sp1/modelsim_ase/bin/vsim

Buscar la línea:

dir=`dirname $arg0`

Y hay que dejarla así:

dir=`dirname $arg0`
export LD_LIBRARY_PATH=${dir}/lib32

Luego, si se tiene un kernel versión 4.X, hay que buscar en el mismo archivo:

case $utype in
2.4.[7-9]*) vco="linux" ;;
2.4.[1-9][0-9]*) vco="linux" ;;
2.[5-9]*) vco="linux" ;;
2.[1-9][0-9]*) vco="linux" ;;
3.[0-9]*) vco="linux" ;;
*) vco="linux_rh60" ;;

Y se cambia el 3.[0-9]* por 4.[0-9]* (o se añade la línea 4.[0-9]*)

Se corre el Modelsim ejecutando el archivo


/opt/altera/13.0sp1/modelsim_ase/bin/vsim

Para que Quartus abra el Modelsim hay que ir a Tools -> Options -> EDA Tools
Options -> ModelSim-Altera y cambiar la dirección
/opt/altera/13.0sp1/modelsim_ase/linuxaloem por
/opt/altera/13.0sp1/modelsim_ase/bin/vsim

***********************************************************************************
******************

Para el USB Blaster

http://fpgaadvocate.blogspot.com/2014/07/altera-usb-blaster-install-on-ubuntu.html
***********************************************************************************
******************
Altera USB Blaster install on Ubuntu 14.04
Recently I had some trouble installing the Altera USB blaster on Ubuntu 14.04.

First, make sure you have created the an 'Altera USB Blaster' rules file in
/etc/udev/rules.d

The file should contain the following :

# USB-Blaster
BUS=="usb", SYSFS{idVendor}=="09fb", SYSFS{idProduct}=="6001", MODE="0666"
BUS=="usb", SYSFS{idVendor}=="09fb", SYSFS{idProduct}=="6002", MODE="0666"
BUS=="usb", SYSFS{idVendor}=="09fb", SYSFS{idProduct}=="6003", MODE="0666"

# USB-Blaster II
BUS=="usb", SYSFS{idVendor}=="09fb", SYSFS{idProduct}=="6010", MODE="0666"
BUS=="usb", SYSFS{idVendor}=="09fb", SYSFS{idProduct}=="6810", MODE="0666"

I named the file 99-usbblaster.rules

Next, 14.04 has updated the library 'libudev.so.0' to 'libudev.so.1'. To get


around this issue I just created a symbolic link ...

sudo ln -s libudev.so.1 libudev.so.0

in the /lib/x86_64-linux-gnu/ directory. In my case, I was running 64Bit Quartus.


Some users may need to do the same in the i386 directory for 32bit.

***********************************************************************************
******************

Altera USB-Blaster with Ubuntu 14.04

http://www.fpga-dev.com/altera-usb-blaster-with-ubuntu/

***********************************************************************************
******************

July 22, 2014 carl Altera tools 13 Comments

With some work, I got Alteras on-board USB-Blaster working on my Ubuntu 14.04-64
installation with Quartus II 13.1.0 64-bit. I was connecting to a Terasic SocKit
board. In this article, I'll describe how I got it working.

To facilitate working with the Altera software, I suggest adding the bin/ folder of
the Quartus installation (/opt/altera/13.1/quartus/bin on my system) to $PATH. This
gives command-line access to the commands jtagd and jtagconfig which I use in this
post.
Verify USB connection and check Product ID

At first, connect the cable and make sure the USB device is recognized. These are
the commands I used and the output I got:
$ dmesg|tail
[...]
[16059.962298] usb 2-2: New USB device found, idVendor=09fb, idProduct=6010
[16059.962301] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[16059.962303] usb 2-2: Product: CV SoCKit
[16059.962305] usb 2-2: Manufacturer: Altera
[16059.962307] usb 2-2: SerialNumber: ARCVSC-123-457
$
$ lsusb|grep Altera
Bus 002 Device 007: ID 09fb:6010 Altera

Take note of the Product ID listed - 6010 in the above example.

Fix USB driver permissions

The Quartus software will use the Linux built-in usb_device drivers. By default,
only root has access to these so we must make sure the user is allowed to access
them as well.
jtagd, part of the Quartus tools, is a deamon that provides the interface between
the Altera tool accessing the JTAG chain and the USB driver. If not already
running, jtagd will be startetd automatically when the Quartus software or
jtagconfig is run. You'll usually run these as a user, which means jtagd will also
run as a user. That is why edited permission for the usb_device is necessary.

Create a file /etc/udev/rules.d/51-usbblaster.rules, make sure it has read


permissions for root, and fill it with this content:
# For Altera USB-Blaster permissions.
SUBSYSTEM=="usb",\
ENV{DEVTYPE}=="usb_device",\
ATTR{idVendor}=="09fb",\
ATTR{idProduct}=="6010",\
MODE="0666",\
NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}",\
RUN+="/bin/chmod 0666 %c"

Edit the value for ATTR{idProduct} to match the Product ID determined before.

If you have more than one Product ID you want this to work for, simply repeat the
above lines in the same file and use the other Product IDs for ATTR{idProduct}.

For the changes to take effect, reboot the machine or run:


$ sudo udevadm control --reload
Copy devices data for jtagd

Make sure jtagd has access to the list of devices:


$ sudo cp /opt/altera/13.1/quartus/linux64/pgm_parts.txt /etc/jtagd/jtagd.pgm_parts

Also make sure this file has read access for the user.

This file allows Altera tools to translate Device IDs (left column of terminal
listing below) to device names (right column) for found devices.
Test that it's all working

To test that the connection works, execute jtagconfig and hope for an output giving
the board and the devices:
$ jtagconfig
1) CV SoCKit [2-2]
02D020DD 5CSEBA6(.|ES)/5CSEMA6/..
4BA00477 SOCVHPS

The cable should now be recognized as a valid hardware by the Quartus tools. From
Quartus, select Tools, Programmer, Hardware Setup... and then select the board from
the drop-down list. Now, the Programmer, JTAG Chain Debugger and System console
should all recognize and use the USB-Blaster device.
Trouble-shooting and common error messages

For general problems, start trouble-shooting by making sure jtagd is not started,
then start it as root and then run jtagconfig. This should eliminate all possible
permission problems, and should work also without the udev rights.
$ sudo killall -9 jtagd # Kill jtagd, ...
$ sudo killall -9 jtagd # ...and verify jtagd is indeed not running.
jtagd: no process found # Good, verified.
$ jtagconfig
1) CV SoCKit [2-1]
02D020DD 5CSEBA6(.|ES)/5CSEMA6/..
4BA00477 SOCVHPS
Other trouble-shooting includes verifying that the usb device is found (dmesg|tail
and ps aux|grep Altera). Also check that jtagd runs, and if it runs as user or
root:
$ ps aux|grep jtagd
root 21733 0.0 0.0 25076 1580 ? S 11:05 0:00 /opt/altera/13.1/quartus/linux64/jtagd
# Obviously, jtagd is running, and it's running as root.

If an Altera tool started jtagd, it will typically be started with some command-
line options:
$ ps aux|grep jtagd
carl 5399 0.0 0.0 25080 1612 ? S 19:37 0:00 /opt/altera/13.1/quartus/linux64/jtagd
--user-start --config /home/carl/.jtagd.conf

For some reason, as can be seen above, the Altera tool has provided a specific
Device ID file as command-line argument, however, even if this file doesn't exist,
at least on my system jtagd will also check /etc/jtagd/jtagd.pgm_parts. It can also
be noted that the Altera tool has started jtagd with a --user-start argument. In
this case, jtagd will terminate two minutes after the last client has disconnected
from it. The next Altera tool needing to use it will simply start it again.

Typical permission problems will yield this message from jtagconfig:


$ jtagconfig
No JTAG hardware available

If you get an error message like Unable to lock chain (Insufficient port
permissions), this is due to the driver permissions.

It can also be useful to try to start jtagd with some debug options for verbose
output:
$ jtagd --foreground --debug
JTAG daemon started
Using config file /etc/jtagd/jtagd.conf
Remote JTAG permitted when password set

(Still, at least on my system, jtagd will also check /etc/jtagd/jtagd.pgm_parts


although it says otherwise in the output above.)

An error message about not being able to bind to port 1309 typically means jtagd is
already running:
$ jtagd --foreground --debug
JTAG daemon started
Using config file /etc/jtagd/jtagd.conf
Remote JTAG permitted when password set
Cant bind to TCP port 1309 - exiting

If jtagconfig indicates that the connection is OK, but using the Quartus Programmer
fails and is giving this message in the Quartus console:
Error (209042): Application SLD HUB CLIENT on 127.0.0.1 is using the
target device

...then restarting jtagd will usually work. This goes for any application occupying
the target device. If the applicatoin in question is System Console, then this is
usually the Nios console window in Eclipse. Terminate its connection to Nios (icon
with red square).
Work-around for driver permission problems

If you don't manage to fix driver permission problems, you can run jtagd as root
instead. This is also an alternative solution to creating the udev rules as
described above. However, you should be aware that this is not typically regarded
as a 'good' solution due to security issues.

If starting jtagd manually, start it as root with sudo jtagd. You must make sure
jtagd is not running in prior to this - if it is, it will continue to run as the
user that started it previously.

For a permanent solution, start jtagd as root at each boot. That can, for example,
be done by adding a call to the jtagd executable in /etc/rc.local. Add the line and
make sure the file has execute permissions (that is for some reason not always the
case for a standard Ubuntu installation). Reboot the machine and check that jtagd
is started, and that it runs as root. (A more correct, but more complicated, way to
do this is to add init.d scripts for jtagd. Then shutdown and restart can also be
handled correctly.)
ModelSim Altera Edition

Most other Altera tools I've used has worked without problems (QuartusII, Qsys,
SBT/Eclipse, Programmer, System Console and others). However, ModelSim typically
won't run without tweaking on Ubuntu 14.

Trying to lauch ModelSim from within Quartus gave the following error message:
Can't launch ModelSim-Altera Simulation software -- make sure the software
is properly installed and the environment variable LM_LICENSE_FILE or
MGLS_LICENSE_FILE points to the correct license file.

However, the problem is not about the licensing in this case. Trying to lauch from
the command line gave a more informative error message:
$ ./vsim
Error while loading shared libraries: libXft.so.2: cannot open shared object
file: No such file or directory.

Remedy: install the 32-bit version of libXft:


$ sudo apt-get install libxft2:i386

When any missing packages are installed, expect a segmentation fault when trying to
launch ModelSim:
$ vsim
** Fatal: Read failure in vlm process (0,0)
Segmentation fault (core dumped)

This is due to ModelSim being incompatible with the latest version of the
libfreetype package.

I got this problem working by following the instructions here:

http://www.hs-augsburg.de/~beckmanf/dokuwiki/doku.php?
id=ubuntu_virtual_cae_system#modelsim_incompatible_libfreetype

The same instructions can also be found here:

http://mattaw.blogspot.se/2014/05/making-modelsim-altera-starter-edition.html

This solved the problems for me and ModelSim is now runnning fine.

También podría gustarte