Running Altera Quartus II Web Edition under Linux

To generate the firmware for the altera Cyclone FPGA on the usrp from the usrp verilog sourcecode you need Quartus II Web Edition version 5.1 or later.
Unfortunately this is not opensource, but there is a free download with from the altera website.

You also need to get a free license.

Download Quartus II Web edition

This is windows-only software.

At the time of this writing, version 5.1SP1 and version 6.0 seems to work fine for the usrp verilog code.
I don't think the 5.1SP1 version is still available for download (the 6.0SPx version is)
The files I downloaded and tested were:
quartusii_51_sp1_web_edition.exe
quartusii_60_sp1_web_edition.exe

There are several ways to run this software under linux.


Method 1 Quartus using Wine:

Install Wine version 0.9.19 or later (a recent cvs version will probably also work).
(Older versions do not work, believe me, I tried. I even tried cxoffice.)
Now make sure you set the emulated operating system to windows 98.
(run winecfg and set Applicatios\default settings Windows to windows98)
If you emulate windows 2000 it will not work.
The problem is mainly that the licensing copy protection crashes.
I have allways found it strange that you need to install a very invasive kernel_mode licensing/copyprotection tool to install software which is free to download with a license that is free and forever renewable.

If you want to get rid of any old wine settings and applications you can just move ~/.wine to something else and run winecfg. It will generate a clean .wine folder including default registry settings for you.

Now run the quartus installer.
make sure you select at least the quartus core component and the cyclone device, the tutorials are also probably handy.
All other devices are not needed for the usrp.

You don't really need the extra options you get when you select the talkback feature, so you can disable it.
If you want to do timing analysis and stuff you should keep it selected.
Quartus Ii 5.1SP1 should run to completion without any trouble.
It might hang on the last screen. If you nothing happens for a very long time you can savely kill it with CRTL-C in the console which started wine.

Now you need to get and install the (free) license.
You can request it on the altera website.

To request a license you need your NIC ID.
NIC ID
The NIC ID is a 12-character hexadecimal string embedded in the
network interface card that Altera uses to uniquely identify the PC where
the software is installed.

Wine should present your real NIC ID without alteration towine which will pas it to quartus.
(beware, this is not the case for all emulators)
There are multiple ways of getting this ID.
Linux: Type /sbin/ifconfig eth0 at a command prompt.
nldudok1@quarkdeb:/$ /sbin/ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:B0:D0:AB:CC:BA
inet addr:192.168.0.1 Bcast:10.0.0.255 Mask:255.255.255.0
inet6 addr: fe80::213:ffff:aabb:ccdd/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16137 errors:0 dropped:0 overruns:0 frame:0
TX packets:10640 errors:0 dropped:0 overruns:0 carrier:0
collisions:2 txqueuelen:1000
RX bytes:20428079 (19.4 MiB) TX bytes:898048 (877.0 KiB)
Interrupt:58 Base address:0xe400

NIC ID is the ID to the right of HWaddr, without the colons, e.g.,
00B0D0ABCCBA. To be sure wine sees exactly the same ID you can also use lmutil.exe which installed with quartus
Do the following.
/$ cd ~/.wine/drive_c/altera/quartusXXX/win/
~/.wine/drive_c/altera/quartusXXX/win$ wine lmutil.exe hostid
Invoking /usr/lib/wine/wine.bin lmutil.exe hostid ...
lmutil - Copyright (c) 1989-2003 by Macrovision Corporation. All rights reserved.
The FLEXlm host ID of this machine is ""00b0d0abccba 001122334455""
Only use ONE from the list of hostids.
Wine exited with a successful status

In this case only use the first number (00b0d0abccba in the example above)

Now you have the right NIC ID you can request a license on the altera website:
Go back to the quatus download page and click "Get Web Edition License"
Download Quartus and get web edition license

Fill out the form, including the NIC ID and a valid emailadres.
You should now get a licensefile by email.
Save the license file somewhere on you wine C-drive
for example:
~/.wine/drive_c/altera/

For any other licensing problems see the altera licensing document
Altera Software Licensing

Now it is time to start quartus.
/$ cd ~/.wine/drive_c/altera/quartusXXX/bin/
~/.wine/drive_c/altera/quartusXXX/bin$ wine quartus.exe

Quartus 6.0 will open with a few errors:
error:This program is for windows NT only.
Click on OK.
error:Quartus II is not fully registered, with a list of problems.
Click on OK.
Quartus 5.1SP will not have these errormessage.

message:Quartus II help will only work if you have installed Internet Explorer 4.0 or higher.
I haven't worked on this error yet. It might go away if you install the wine gecko fake IE or find a way to install a real IE.

Quartus should now start with a license options screen.
Choose, "I have a valid license"
And direct it to C:\altera\ (or wherever you put the file) and choose the license file.

You can allways change the license file and options with the Tools menu\License setup.
Here you will also see the NICID you entered earlier.

Now you are ready to compile the usrp verilog code to a usrp????.rbf file.
The easiest way is to open the usrp quartus project file
gnuradiosrcdir/usrp/fpga/toplevel/usrp_std/usrp_std.qpf

(Note with the default wine configuration you Z: drive is the same as /)

If you want you can now try to set back the default settings of wine to windows 2000 and only run quartus.exe and quartus_sh.exe as windows 98.
I have not tried this though.
For this you have to run winecfg again.


Method 2 Quartus using qemu

Warning Untested:

Install a recent Qemu.
Make a new virtual machine and install windows 98 or windows 2000 or windows XP.
Download Quartus II (see above)
Install Quartus within the virtual machine.

Request a license file using the NICID of you virtual machine
In you virtual windows do:
Type ipconfig /all at a commandprompt.
The NIC ID is the physical address without the dashes. If
your PC has more than one network card, you can use any of the
cards’ NIC IDs as long as the selected network card is always
connected to the computer.

Now you have the right NIC ID you can request a license on the altera website:
Go back to the quatus download page and click "Get Web Edition License"
Download Quartus and get web edition license

Fill out the form, including the NIC ID and a valid emailadres.
You should now get a licensefile by email.
Save the license file somewhere on you qemu virtual C-drive.
Run quartus II from the start menu and choose "have valid license"

You could also choose request a license now. (This should work within Qemu if you have networking setup and working)


Method 3: Quartus using VMware

Install some flavour of VMware.
Make a new virtual machine and install windows 2000 or windows XP.
Download Quartus II (see above)
Install Quartus within the virtual machine.

Request a license file using the NICID of you virtual machine
In you virtual windows do:
Type ipconfig /all at a commandprompt.
The NIC ID is the physical address without the dashes. If
your PC has more than one network card, you can use any of the
cards’ NIC IDs as long as the selected network card is always
connected to the computer.

Now you have the right NIC ID you can request a license on the altera website:
Go back to the quatus download page and click "Get Web Edition License"
Download Quartus and get web edition license

Fill out the form, including the NIC ID and a valid emailadres.
You should now get a licensefile by email.
Save the license file somewhere on you vmware virtual C-drive.
Run quartus II from the start menu and choose "have valid license"

You could also choose "request a license now". (This should work within VMware if you have networking setup and working)


I have used the VMware method for a long time now. It works, is stable and the speed is usable.

But I don't like having to install a complete windows inside my linux machine just to run one program.
The same disadvantage goes for Qemu. (although Qemu itself is a very nice opensource product which I can recommend to anyone.)

The wine method doesn't need any microsoft components.
It is less stable though and only works if you emulate windows 98, which is not supported anymore by quartus II 6.0 and later.
I had a few crashes already, but also succesfull compiles (both with version 5.1SP1 and 6.0SP1)

I hope this is of help to others trying to develop opensource verilog code but who are forced to running closed-source windows programs.

Martin




注:Quartus Under Linux(原文出处,翻译整理仅供参考!)