Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Tuesday, October 5, 2010

Lattice Diamond on Ubuntu 10.04 64 bit

For some reason, Lattice provides its new Diamond GUI for the second most popular Linux distribution instead of Ubuntu, the most popular distribution.

Here is how to fix their mistake :-). Additionally, they only provide 32 bit binaries but I have a 64 bit system. So this how-to solves that problem as well.

Installing the IDE

Step 1: Download Diamond's .rpm located here, and apply for a license.

Step 2: Install "alien", the .rpm to .deb package converter.
sudo apt-get install alien

Step 3: install "getlibs"
This handy script will install the 32-bit version of libraries even if you are running 64-bit Ubuntu. Since Diamond is 32 bit you will have to install some 32 bit stuff.

click here for info (http://ubuntuforums.org/showthread.php?t=474790)

Step 4: Install 32 bit libraries (if on 64 bit Ubuntu)
apt-get install ia-32libs
sudo getlibs -p libmotif3

I am doing this from memory...if you run diamond (later step) and get a missing .so, please run "getlibs -l " to install that library and post a comment so I can update this HOW-TO!

Step 5: Run alien on the diamond RPM.
When the diamond RPM is downloaded, run alien on it:
alien -d diamond_1_0-base-135-i386-linux.rpm

Wait for a very long time. This will ultimately have an error and drop you back to the Linux prompt. It will not hang (be patient). However you will find that it created a subdirectory called "diamond_1_0-base-1.0" off your current directory. Everything we need is in there. I'll copy it to /usr/local so it is accessible:

sudo cp -r diamond_1_0-base-1.0/usr/local /usr/local

Step 6: Copy the license
You should have gotten a license file in your email stream from step 1.
Save that file into the diamond subdirectory: /usr/local/diamond/1.0/license/license.txt

Step 7: Run it!
/usr/local/diamond/1.0/bin/lin/diamond

if you get any missing libraries, please attempt to "getlibs" (see step 4) and post a comment here so others can benefit from your pain :-).


Installing the Lattice USB Programmer

Before you actually program your board, you'll have to install drivers for the programmer dongle.

The Lattice USB programmer uses libusb so that is convenient as no kernel module needs to be built. I think there is another programmer that uses the FTDI 2232 chip that does require drivers to be installed. This how-to won't cover that one, or the parallel port programmer (which I was unable to get working).

Step 1: install libusb
sudo apt-get install libusb-1.0-0

Step 2: Add the USB device to "udev"

sudo emacs /etc/udev/rules.d/10-local.rules

Append this line:
#lattice
BUS=="usb",ACTION=="add",SYSFS{idVendor}=="1134",SYSFS{idProduct}=="8001",MODE=="0660",OWNER=="root",SYMLINK+="lattice-%n"

Step 3: Plug in the USB device programmer

You should see a device in /dev named "lattice":

~$ ls /dev/lat*
/dev/lattice-6


Step 4: Fix permissions.
Shown here is an impermanent fix. Every time you turn off your computer or remove the programmer you'll have to re-run this, since the device is removed and recreated during these events. I'm sure that some of you Ubuntu/Linux wizards can tell me how to make it permanent...

sudo chmod a+rw /dev/lat*

That's it! The ispVM programming tool should auto-detect the cable now.

Have fun and post some OSS designs!