Repository

Looks good to me!

User Tools

Site Tools


projects:electronics:fpga:lattice

Lattice Diamond

Installation

Packages for Diamond is provided by Lattice in their download page, packaged for Red Hat Enterprise. Tried to follow this tutorial to get it to work on Ubuntu 22.04 LTS, but failed at the .deb package installation step. This blogpost details an alternative method by simply unpacking and then running a post-install script.

Software installation

First install the required libraries: rpm for identifying the post-install scriptlet, and rpm2cpio to use the cpio tool to copy files from the RPM archive.

sudo apt-get install rpm rpm2cpio

Extract the file contents of the RPM package with:

rpm2cpio *.rpm | cpio -idmv

Identify the post-install scriptlet, which for posterity is copied below in postinstall.sh:

rpm -qp --scripts *.rpm
postin.sh
echo "Extracting compressed data files..."
cd $RPM_INSTALL_PREFIX/diamond/3.12/bin; tar xzf bin.tar.gz; rm -f bin.tar.gz
cd $RPM_INSTALL_PREFIX/diamond/3.12/cae_library; tar xzf cae_library.tar.gz; rm -f cae_library.tar.gz
cd $RPM_INSTALL_PREFIX/diamond/3.12/data; tar xzf data.tar.gz; rm -f data.tar.gz
cd $RPM_INSTALL_PREFIX/diamond/3.12/embedded_source; tar xzf embedded_source.tar.gz; rm -f embedded_source.tar.gz
cd $RPM_INSTALL_PREFIX/diamond/3.12/examples; tar xzf examples.tar.gz; rm -f examples.tar.gz
cd $RPM_INSTALL_PREFIX/diamond/3.12/ispfpga; tar xzf ispfpga.tar.gz; rm -f ispfpga.tar.gz
cd $RPM_INSTALL_PREFIX/diamond/3.12/modeltech; tar xzf modeltech.tar.gz; rm -f modeltech.tar.gz
cd $RPM_INSTALL_PREFIX/diamond/3.12/synpbase; tar xzf synpbase.tar.gz; rm -f synpbase.tar.gz
cd $RPM_INSTALL_PREFIX/diamond/3.12/tcltk; tar xzf tcltk.tar.gz; rm -f tcltk.tar.gz

Run the post-install scriptlet:

chmod +x postin.sh
RPM_INSTALL_PREFIX=$PWD/usr/local bash postin.sh  

Copy the files into the correct location:

sudo cp -Rva --no-preserve=ownership ./usr/local/diamond /usr/local/  

License activation

Obtain the (free floating) license from Lattice if not already done so. Copy the license to the specified directory nested within the program directory (this location is auto-searched so there is no need to add the LM_LICENSE_FILE environment variable).

sudo mv license.dat /usr/local/diamond/3.12/license/license.dat

Modify the following configuration variables in the license file (these steps are documented in the Lattice installation guide as well) - the other unspecified values in the table are already pre-configured:

SERVER [HOSTNAME] [MAC_ADDRESS] [PORT]
DAEMON lattice [DAEMON_PATH]
...
DAEMON mgcld [MGCLD_PATH]
...
Line Configuration variable Value
1 HOSTNAME Copy value of hostname
2 DAEMON_PATH /usr/local/diamond/3.12/ispfpga/bin/lin64
18 MGCLD_PATH /usr/local/diamond/3.12/modeltech/linuxloem

Create a log file for the license manager:

sudo touch /usr/local/diamond/3.12/license/license.log

Running the license manager would likely yield a bash: /usr/local/diamond/3.12/ispfpga/bin/lin64/lmgrd: No such file or directory error, which indicates that a dependency is missing, narrowed down to those specified in ldd /usr/local/diamond/3.12/ispfpga/bin/lin64/lmgrd. Most likely it is the Linux Standard Base (LSB), so install that first:

sudo apt install lsb

Finally, run the license manager:

/usr/local/diamond/3.12/ispfpga/bin/lin64/lmgrd -l /usr/local/diamond/3.12/license/license.log -c /usr/local/diamond/3.12/license/license.dat

Running the software

For convenience, create a symbolic link in /usr/local/bin pointing to /usr/local/diamond/3.12/bin/lin64/diamond, so that the program can be started from the command line from anywhere:

sudo ln -s /usr/local/diamond/3.12/bin/lin64/diamond /usr/local/bin/diamond

To run via the run tool, add to /usr/bin instead.

Instructions in email on installing as floating server license

On the server machine:

  Edit the license.dat file to specify the server name and the paths to the Lattice daemon.
  Save the license file on your server hard drive. Lattice recommends saving to a common license location such as C:\licenses\FlexLM (Windows) or /usr/local/licenses/flexlm (Linux).
  Set the LM_LICENSE_FILE environment variable to the path of your license file.
  Open LMTOOLS.exe located at <sw_install>\ispfpga\bin\nt64. Complete the Config Services tab. Start server in Start/Stop/Reread tab.
  On the client machine:
  Set the LM_LICENSE_FILE environment variable to port@server_name where the port is specified on the server line in your license file.
  Open the Design Software tool. If your license checks out successfully, the tool will open.
projects/electronics/fpga/lattice.txt · Last modified: 19 months ago ( 2 May 2023) by 127.0.0.1