Difference between revisions of "Diamond"

From ArmadeusWiki
Jump to: navigation, search
(USB rights)
(USB rights)
 
Line 85: Line 85:
 
</pre>
 
</pre>
  
To avoid it, just add udev rules in etc config :
+
* To avoid it, just add udev rules in etc config :
 
<pre>
 
<pre>
$ sudo vim /etc/udev/rules.d/90-lattice-usb.rules
+
$ sudo vim /etc/udev/rules.d/10-lattice.rules
 
</pre>
 
</pre>
  
And add this line :
+
* And add this line :
 
<pre>
 
<pre>
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="0403", MODE="0666", GROUP="plugdev"
+
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="0666", SYMLINK+="ftdi-%n", RUN+="/bin/sh -c 'basename $(dirname $(realpath /sys%p/device)) > /sys/bus/usb/drivers/ftdi_sio/unbind'",RUN+="/root/ftdi_fixer.py"
 
</pre>
 
</pre>
  
Then re-launch udev with :
+
* create a python script in  /root/ftdi_fixer.py
 +
<pre>
 +
$ sudo vim /root/ftdi_fixer.py
 +
</pre>
 +
 
 +
* And write the [[ftdi_fixer.py | following]] sources.
 +
 
 +
* then give the rights :
 +
<pre>
 +
sudo chmod +x /root/ftdi_fixer.py 
 +
</pre>
 +
 
 +
* Then re-launch udev with :
 
<pre>
 
<pre>
 
sudo udevadm control --reload-rules
 
sudo udevadm control --reload-rules
</pre>or<pre>
 
sudo service udev restart
 
 
</pre>
 
</pre>
  
See the explanation [https://www.developpez.net/forums/blogs/213571-aiigl59/b1132/installation-drivers-necessaires-lattice-diamond-sous-linux-ubuntu-14/ here].
+
See the explanation [https://ycnrg.org/lattice-diamond-on-ubuntu-16-04/ here].
  
 
==== Service Packs SP1 and SP2 ====
 
==== Service Packs SP1 and SP2 ====

Latest revision as of 15:32, 20 July 2018

Introduction

Lattice diamond is the software used to synthesize bitstream for Lattice FPGAs. It's required for the MachXO[1,2,3] FPGA.

Installation guide

Download

Download the rpm file on Lattice website [1].

Get a free license

On this page : [2]

Install on debian 64bits

  • First alien is needed to convert the rpm in debian package :
sudo apt-get install alien
  • Convert it to deb package then install it (take a long time ~13 min):
$ sudo alien diamond_3_10-base_x64-111-2-x86_64-linux.rpm
Warning: Skipping conversion of scripts in package diamond_3_10-base_x64: postinst postrm preinst prerm
Warning: Use the --scripts parameter to include the scripts.
diamond-3-10-base-x64_3.10-112_amd64.deb generate
  • Then install it
$ sudo dpkg -i diamond-3-10-base-x64_3.10-112_amd64.deb 
Selecting previously unselected package diamond-3-10-base-x64.
(Reading database ... 336262 files and directories currently installed.)
Preparing to unpack diamond-3-10-base-x64_3.10-112_amd64.deb ...
Unpacking diamond-3-10-base-x64 (3.10-112) ...
Setting up diamond-3-10-base-x64 (3.10-112) ...
  • The package is not correctly installed in directory /usr/local/diamond/. All tar.gz must be deflated :
cd /usr/local/diamond/3.10_x64/
cd bin/; sudo tar -zxvf bin.tar.gz;sudo rm bin.tar.gz; cd ..
cd synpbase/;sudo tar -zxvf synpbase.tar.gz;sudo rm synpbase.tar.gz; cd ..
cd examples/;sudo tar -zxvf examples.tar.gz;sudo rm examples.tar.gz; cd ..
cd data/;sudo tar -zxvf data.tar.gz; sudo rm data.tar.gz; cd ..
cd cae_library/;sudo tar -zxvf cae_library.tar.gz; sudo rm cae_library.tar.gz; cd ..
cd ispfpga/;sudo tar -zxvf ispfpga.tar.gz;sudo rm ispfpga.tar.gz; cd ..
cd tcltk/;sudo tar -zxvf tcltk.tar.gz; sudo rm tcltk.tar.gz; cd ..
cd embedded_source/;sudo tar -zxvf embedded_source.tar.gz; sudo rm embedded_source.tar.gz; cd ..
  • Install libpng correctly:
cd /usr/local/diamond/3.10_x64/bin/lin64
sudo mv libpng12.so.0 libpng12.so.0.old
sudo ln /usr/lib/x86_64-linux-gnu/libpng12.so.0 -s libpng12.so.0
  • save the license.dat received by mail in following directory:
/usr/local/diamond/3.10_x64/license/
  • Add this lines in your ~/.bashrc:
#Lattice Diamond
export PATH=$PATH:"/usr/local/diamond/3.10_x64/bin/lin64"
  • open a new terminal (or re-source your .bashrc) then launch diamond:
diamond

USB rights

Warning Warning: This is a hack to make usb-jtag working with diamond software. Be aware what you are doing, it can break some functionalities on your system

Launching diamond can raise this error :

$ libusb couldn't open USB device /dev/bus/usb/003/007: Permission denied.
libusb requires write access to USB device nodes.
Erreur de segmentation
  • To avoid it, just add udev rules in etc config :
$ sudo vim /etc/udev/rules.d/10-lattice.rules
  • And add this line :
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="0666", SYMLINK+="ftdi-%n", RUN+="/bin/sh -c 'basename $(dirname $(realpath /sys%p/device)) > /sys/bus/usb/drivers/ftdi_sio/unbind'",RUN+="/root/ftdi_fixer.py"
  • create a python script in /root/ftdi_fixer.py
$ sudo vim /root/ftdi_fixer.py
  • then give the rights :
sudo chmod +x /root/ftdi_fixer.py  
  • Then re-launch udev with :
sudo udevadm control --reload-rules

See the explanation here.

Service Packs SP1 and SP2

  • Download sp2
  • Convert rpm do deb (~5min):
$ sudo alien diamond_3_10-sp2_x64-115-1-x86_64-linux.rpm 
Warning: Skipping conversion of scripts in package diamond_3_10-sp2_x64: postinst postrm preinst prerm
Warning: Use the --scripts parameter to include the scripts.
diamond-3-10-sp2-x64_3.10-116_amd64.deb generated
  • Install package :
$ sudo dpkg -i diamond-3-10-sp2-x64_3.10-116_amd64.deb 
Selecting previously unselected package diamond-3-10-sp2-x64.
(Reading database ... 342843 files and directories currently installed.)
Preparing to unpack diamond-3-10-sp2-x64_3.10-116_amd64.deb ...
Unpacking diamond-3-10-sp2-x64 (3.10-116) ...
Setting up diamond-3-10-sp2-x64 (3.10-116) ...
Processing triggers for libc-bin (2.19-18+deb8u10) ...

Install on Gentoo 64bits

  • Install rpm
emerge -av rpm
  • Install diamon
export RPM_INSTALL_PREFIX=/usr/local/
rpm -Uvh --nodeps diamond_3_7-base_x64-96-1-x86_64-linux.rpm
  • save the license.dat received by mail in following directory:
/usr/local/diamond/3.7_x64/license/
  • Add this lines in your ~/.bashrc:
#Lattice Diamond
export PATH=$PATH:"/usr/local/diamond/3.7_x64/bin/lin64"
  • open a new terminal (or re-source your .bashrc) then launch diamond:
diamond

Ressources/links