VERDVANA'S BLOG Verdvana

Synopsys EDA Tools安装和使用过程中出现的问题及解决方法


1 前言

        想找到一种最方便的IC开发调试环境,于是多次在虚拟机或物理机的Ubuntu、WSL2、SLES、OpenSUSE上安装了Synopsys 2016和2018两个版本的Tools,就积(chāo)累(xí)了很多遇到的错误和解决方法。安装过程网上已经有比较完善的文章了,但安装过程中问题的解决却零零散散还不好找,所以就整理记录一下。

  • 操作系统:
    • Ubuntu 20.04.3 LTS
    • Windows Subsystem for Linux 2
    • SUSE Linux Enterprise Server 15 SP3
    • OpenSUSE Leap 15.3
  • 开发环境:
    • ic_compiler_vO-2018.06-SP1
    • ppower_vO-2018.06-SP3
    • pt_vO-2018.06-SP1
    • syn_vO-2018.06-SP5-5
    • vcs_vO-2018.09-SP2
    • verdi_vO-2018.09-SP2-11
    • spyglass_vO-2018.09-SP2-11

2 EDA Tools安装、破解过程中遇到的问题

2.1 缺少csh

        启动安装Tools的安装工具时,输入以下指令(2016版本):

./installer =gui

        启动时会报错:

Explain Error:No such file or directory

        这个问题一般出现在Ubuntu,SUSE目前没遇到。这是由于缺少了csh,所以安装它来解决:

sudo apt-get install csh

2.2 运行lmstat时找不到文件或路径

        运行lmstat时会遇到如下错误:

bash: /usr/synopsys/scl/linux/bin/lmgrd: No such file or directory

        这个问题可能由以下两个原因造成:

  • 没有lsb库;
  • lmgrd路径错误。

        第一个问题我只在Ubuntu里见过,安装lsb就可以了:

sudo apt-get install lsb-core

        第二个问题是因为等工具在不同的操作系统、或者相同操作系统32bit和64bit下的安装路径都不太一样。Ubuntu 32bit的安装路径通常为:

<setup_directory>/scl/linux/bin/

        而ubuntu 64bit下路径为:

<setup_directory>/scl/amd64/bin/

        在OpenSUSE或SLES的64bit下lmstat的路径为:

<setup_directory>/scl/linux64/bin/

        同样的,License中第二行snpslmd的路径也要改为和lmstat下相同的路径。


3 EDA Tools启动过程中遇到的问题

3.1 找不到.flexlm文件

        启动EDA时遇到如下错误:

Can't make directory /usr/tmp/.flexlm, errno: 2(No such file or directory)

        这个问题各个系统都会遇到,新建这个文件就行了:

sudo mkdir -p /usr/tmp
sudo touch /usr/tmp/.flexlm

3.2 缺少库文件(Ubuntu/WSL2)

        在Ubuntu、WSL2中可能缺失的库:

  • libjpeg.so.62:
    sudo apt-get install libjpeg62
    
  • libtiff.so.3:
    cd /usr/lib/x86_64-linux-gnu/
    sudo cp libtiff.so.5 /usr/lib/
    cd /usr/lib
    sudo ln -s libtiff.so.5 libtiff.so.3
    
  • libmng.so.1:
    sudo apt-get install libmng2
    cd /usr/lib/x86_64-linux-gnu
    sudo cp libmng.so.2 /usr/lib/
    cd /usr/lib
    sudo ln -s libmng.so.2 libmng.so.1
    
  • libpng12.so.0:
  • libstdc++.so.6:
    sudo apt-get install lib32stdc++6
    

3.3 缺少库文件(SLES/OpenSUSE)

        在SLES、OpenSUSE中可能确实的库:

  • libncurses.so.5:
    sudo zypper install libncurses5
    

3.4 库版本未找到(SLES/OpenSUSE)

        在SLES、OpenSUSE中打开PrimeTime的时候会出现以下错误:

/usr/software/synopsys/.../pt/shlib/libz.so.1: version `ZLIB_1.2.9' not found (required by /usr/lib64/...

        首先去zlib下载对应版本的zlib,我这里下载了1.2.9版本的zlib。然后把下载好的zlib-1.2.9.tar.gz放到某个路径下,在terminal里进入这个路径,执行以下命令:

tar -zxvf zlib-1.2.9.tar.gz
cd zlib-1.2.9
./configure
make #可能需要安装make:sudo zypper install make
make install

        安装好之后看下打印出来的信息,找到libz.so.1.2.9这个文件install到哪里,比如我的安装在/usr/local/lib/下。然后去error信息中的software安装路径下libz.so.1所在的路径,把安装好的libz.so.1.2.9文件link到这里:

ln -s /usr/local/lib/libz.so.1.2.9   /usr/software/synopsys/.../pt/shlib/libz.so.1

3.5 TCP端口被占用

        错误信息:

(lmgrd) Failed to open the TCP port number in the license.

        License文件中通常使用27000端口,如果这个端口被占用,使用如下命令查看占用进程的PID:

sudo lsof -i:27000

        然后用如下命令杀死进程:

sudo kill -9 <PID>

3.6 启动了多个snpslmd(OpenSUSE)

        在OpenSUSE中,启动lmgrd的时候会提示:

13:48:56 (lmgrd) Started snpslmd (internet tcp_port 59331 pid 2024)
13:48:56 (snpslmd) FlexNet Licensing version v11.14.1.3 build 212549 x64_lsb
13:48:56 (snpslmd) Cannot open daemon lock file
13:48:56 (snpslmd) EXITING DUE TO SIGNAL 41 Exit reason 9
13:48:56 (lmgrd) snpslmd exited with status 41 (Exited because another server was running)
13:48:56 (lmgrd) MULTIPLE "snpslmd" license server systems running.
13:48:56 (lmgrd) Please kill, and run lmreread
13:48:56 (lmgrd) 
13:48:56 (lmgrd) This error probably results from either:
13:48:56 (lmgrd)   1. Another copy of the license server manager (lmgrd) is running.
13:48:56 (lmgrd)   2. A prior license server manager (lmgrd) was killed with "kill -9"
13:48:56 (lmgrd)       (which would leave the vendor daemon running).
13:48:56 (lmgrd) To correct this, do a "ps -ax | grep snpslmd"
13:48:56 (lmgrd)   (or equivalent "ps" command)
13:48:56 (lmgrd) and kill the "snpslmd" process.

img1

        说启动了多个snpslmd,但是又kill不掉。

        首先去snpslmd所在目录scl/linux64/bin/下新建文件“gen-snpslmd-hack.c”,文件内容为:

#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <dlfcn.h>
#include <string.h>

static int is_root = 0;
static int d_ino = -1;

static DIR *(*orig_opendir)(const char *name);
static int (*orig_closedir)(DIR *dirp);
static struct dirent *(*orig_readdir)(DIR *dirp);

DIR *opendir(const char *name)
{
	if (strcmp(name, "/") == 0)
		is_root = 1;
	return orig_opendir(name);
}

int closedir(DIR *dirp)
{
	is_root = 0;
	return orig_closedir(dirp);
}

struct dirent *readdir(DIR *dirp)
{
	struct dirent *r = orig_readdir(dirp);
	if (is_root && r)
	{
		if (strcmp(r->d_name, ".") == 0)
			r->d_ino = d_ino;
		else if (strcmp(r->d_name, "..") == 0)
			r->d_ino = d_ino;
	}
	return r;
}

static __attribute__((constructor)) void init_methods()
{
	orig_opendir = dlsym(RTLD_NEXT, "opendir");
	orig_closedir = dlsym(RTLD_NEXT, "closedir");
	orig_readdir = dlsym(RTLD_NEXT, "readdir");
	DIR *d = orig_opendir("/");
	struct dirent *e = orig_readdir(d);
	while (e)
	{
		if (strcmp(e->d_name, ".") == 0)
		{
			d_ino = e->d_ino;
			break;
		}
		e = orig_readdir(d);
	}
	orig_closedir(d);
	if (d_ino == -1)
	{
		puts("Failed to determine root directory inode number");
		exit(EXIT_FAILURE);
	}
}

        然后使用如下命令编译:

gcc -ldl -shared -fPIC gen-snpslmd-hack.c -o snpslmd-hack.so

        这里可能要安装gcc:

sudo zypper install gcc

        接着关闭lmgrd:

lmdown

        在lmgrd所在路径下执行如下命令激活证书:

LD_PRELOAD=./snpslmd-hack.so ./lmgrd -c /usr/software/synopsys/license/Synopsys.dat

        如果激活成功,可以把环境变量里激活的指令换成:

alisa crack='LD_PRELOAD=/usr/software/synopsys/scl/scl/2018.06/linux64/bin/snpslmd-hack.so lmgrd -c /usr/software/synopsys/license/Synopsys.dat'

        但这样激活成功后,verdi会打不开,启动verdi时terminal返回:

Segmentation fault (core dumped)

img2

        后来我发现出现这种情况是因为之前设定的LD_PRELOAD环境变量影响了verdi的启动,所以在每次激活后再加一句如下指令即可:

unsetenv LD_PRELOAD

3.7 无法启动GUI(OpenSUSE)

        在OpenSUSE中可能会无法启动PrimeTime的GUI,terminal返回:

The connection to X-server '0.0' is broken or refused.

        这种情况需要设置DISPLAY这个环境变量的内容。在环境变量里添加:

setenv  DISPLAY :0    #tcsh\csh

        或

export DISPLAY=:0     #bash

3.8 SPYGLASS启动报错

        确保正确设置SPYGLASS环境变量:

export  SPYGLASS_HOME=.../SPYGLASSxxx.xx-SPx/SPYGLASS_HOME
export  PATH=$PATH:$SPYGLASS_HOME/bin
alias   sg='.../SPYGLASSxxxx.xx-SPx/SPYGLASS_HOME/bin/spyglass'

        但还会报如下错误:

spyglass: INTERNAL-ERROR, the VALUE OF `$SPYGLASS_HOME' (an internal variable) was not intuited correctly.
spyglass:                 The value guessed was: `SPYGLASS_HOME=.../SPYGLASSxxx.xx-SPx/SPYGLASS_HOME'
spyglass: INTERNAL-ERROR, the Perl 5 installation within `$SPYGLASS_HOME' could not be validated.
spyglass:                 A perl installation was expected at: `.../SPYGLASSxxx.xx-SPx/SPYGLASS_HOME/lib/multi-perl'
spyglass:                 either `$SPYGLASS_HOME' was guessed incorrectly or the installation is corrupted.
spyglass: NOTE, the caller's environment variable `$SPYGLASS_HOME' was ignored in this process.

        这是因为缺失了系统对应的分支。OpenSUSE Leap 15.3的内核版本是5.x,因此在如下文件中加入系统分支:

        在/SPYGLASS_HOME/lib/SpyGlass/standard-environment.sh中确认有以下行:

     Linux-3*)
            if [ X"$switch32bit" = "Xyes" ]; then
                echo "Linux2"
            elif  [ X"$switch64bit" = "Xyes" ]; then
                PROCNAME=`uname -p`
                if [ "X$PROCNAME" = "Xunknown" ]; then
                    PROCNAME=`uname -m`
                fi
                if [ X"$PROCNAME" = "Xx86_64" ]; then
                    echo "Linux4"
                else
                    echo "Linux2"
                fi
            else
                PROCNAME=`uname -p`
                if [ "X$PROCNAME" = "Xunknown" ]; then
                    PROCNAME=`uname -m`
                fi
                if [ X"$PROCNAME" = "Xx86_64" ]; then
                    if [ X"$defExeOn64Bit" = "X32" ]; then
                        echo "Linux2"
                    else
                        echo "Linux4"
                    fi
                else
                    echo "Linux2"
                fi
            fi
            ;;
Linux-4*)
            if [ X"$switch32bit" = "Xyes" ]; then
                echo "Linux2"
            elif  [ X"$switch64bit" = "Xyes" ]; then
                PROCNAME=`uname -p`
                if [ "X$PROCNAME" = "Xunknown" ]; then
                    PROCNAME=`uname -m`
                fi
                if [ X"$PROCNAME" = "Xx86_64" ]; then
                    echo "Linux4"
                else
                    echo "Linux2"
                fi
            else
                PROCNAME=`uname -p`
                if [ "X$PROCNAME" = "Xunknown" ]; then
                    PROCNAME=`uname -m`
                fi
                if [ X"$PROCNAME" = "Xx86_64" ]; then
                    if [ X"$defExeOn64Bit" = "X32" ]; then
                        echo "Linux2"
                    else
                        echo "Linux4"
                    fi
                else
                    echo "Linux2"
                fi
            fi
            ;;
Linux-5*)
            if [ X"$switch32bit" = "Xyes" ]; then
                echo "Linux2"
            elif  [ X"$switch64bit" = "Xyes" ]; then
                PROCNAME=`uname -p`
                if [ "X$PROCNAME" = "Xunknown" ]; then
                    PROCNAME=`uname -m`
                fi
                if [ X"$PROCNAME" = "Xx86_64" ]; then
                    echo "Linux4"
                else
                    echo "Linux2"
                fi
            else
                PROCNAME=`uname -p`
                if [ "X$PROCNAME" = "Xunknown" ]; then
                    PROCNAME=`uname -m`
                fi
                if [ X"$PROCNAME" = "Xx86_64" ]; then
                    if [ X"$defExeOn64Bit" = "X32" ]; then
                        echo "Linux2"
                    else
                        echo "Linux4"
                    fi
                else
                    echo "Linux2"
                fi
            fi
            ;;
    *)             echo UNKNOWN ;;
    esac
}

        在SpyGlass-Lxxxx.xx/perl/bin/perl中确认有以下行:

     Linux-3*)      ##now we have Linux-64 bit also
            PROCNAME=`uname -p`
            if [ "X$PROCNAME" = "Xunknown" ]; then
               PROCNAME=`uname -m`
            fi
            if [ X"$PROCNAME" = "Xx86_64" ]; then
                       species=Linux4
                    else
                       species=Linux2
                    fi
              ;;
     Linux-4*)      ##now we have Linux-64 bit also
            PROCNAME=`uname -p`
            if [ "X$PROCNAME" = "Xunknown" ]; then
               PROCNAME=`uname -m`
            fi
            if [ X"$PROCNAME" = "Xx86_64" ]; then
                       species=Linux4
                    else
                       species=Linux2
                    fi
              ;;
     Linux-5*)      ##now we have Linux-64 bit also
            PROCNAME=`uname -p`
            if [ "X$PROCNAME" = "Xunknown" ]; then
               PROCNAME=`uname -m`
            fi
            if [ X"$PROCNAME" = "Xx86_64" ]; then
                       species=Linux4
                    else
                       species=Linux2
                    fi
              ;;

    *)             echo "ERROR(perl): Unknown platform: $PLAT" 1>&2; exit 1;;
esac

4 EDA Tools使用过程中遇到的问题

4.1 python的安装和版本

        VCS仿真阶段会遇到如下错误:

/usr/bin/env: 'python': No such file or directory

        这是由于没有安装python,它需要的时python2.3版本,如果安装的是比如3.8版本,则会报错:

profrpt requires 2.3.0 <= Python version < 3.0.0 to run

        所以要安装python2.x版本:

sudo apt install python     #Ubuntu/WSL

        或

sudo zypper install python  #SLES/OpenSUSE

4.2 gcc++-4.8命令找不到(Ubuntu/WSL)

        在2016版本的VCS仿真阶段会遇到如下错误:

make[1]: g++-4.8: Command not found

        安装gcc4.8和g++4.8,并提高4.8版本的优先级:

sudo apt-get install gcc-4.8 g++-4.8										# 安装
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 100	# 提升优先级

        之后可以用如下命令查看gcc默认版本:

sudo update-alternatives --config gcc

4.3 gcc++-4.8命令找不到(OpenSUSE)

        在2018版本的VCS仿真阶段会遇到如下错误:

make[1]: g++: Command not found

        安装g++:

sudo zypper install gcc-c++

4.4 dc_shell或pt_shell中方向键或制表键无法使用

        启动dc_shell或pt_shell后,提示警告:

Warning: Cannot use command line editor for terminal type 'xterm-256color'. (CLE-100)

        并且方向键变成如图所示:

img3

        解决这个问题只需要在环境变量中添加:

setenv  TERM xterm    #tcsh/csh

        或

export  TERM=xterm    #bash

5 其它问题

5.1 WSL2中遇到的问题

        WSL2比较特殊,在之前的文章WSL2环境下安装使用Synopsys工具时出现的问题及解决办法中总结过。


        告辞。