上篇文件写完后,很多人留言说VCS启动有些问题在文中没有解决,这里总结汇总了下从VCS安装好以后,临时license授权到使用VCS成功运行并用verdi dump波形这个过程中可能会遇到的一些问题及解决方法。关于VCS安装可以参考我之前写的文章。
一、VCS安装license激活的问题
在VCS安装好后,使用scl工具对license进行激活时,可能会遇到如下错误:
bash: /usr/synopsys/scl/scl/linux64/bin/lmgrd: No such file or directory
该问题的原因是没有lsb库,在保证license文件路径正确的情况下,使用如下命令安装lsb库:
sudo apt-get install lsb-core
安装完成后reboot虚拟机即可解决上述问题,但可能还会出现flexlm文件不存在的问题:
Can't make directory /usr/tmp/.flexlm, errno: 2(No such file or directory)
这个问题比较好解决,直接创建一个flexlm文件就行了:
sudo mkdir /usr/tmp
sudo touch /usr/tmp/.flexlm
二、VCS启动过程中的问题
在临时license授权成功后,就可以对编写的RTL代码编译和运行,但由于系统一开始缺少一些设置,直接运行VCS可能会出现一些问题,一开始会遇到这样的问题:
/bin/sh: 0: Illegal option -h
Makefile:4: recipe for target 'simv' failed
make: *** [simv] Error 2
该问题是由于Ubuntu操作系统将sh链接到了dash,手动修改sh链接到bash即可解决该问题:
sudo mv /bin/sh /bin/sh_bak
sudo ln -s /bin/bash /bin/sh
解决上述问题后,可能会遇到product_timestamp error的问题:
Makefile:109: recipe for target 'product_timestamp' failed
make[1]: *** [product_timestamp] Error 1
make[1]: Leaving directory '/home/alanwu/Documents/RISCV-SIM/csrc'
Make exited with status 2
这是因为操作系统安装的gcc版本太高,VCS调用的版本较低,需要修改VCS启动的变量,将gcc指定为g++-4.8,同时在你的vcs命令中添加如下命令:
simv:filelist.f
vcs -full64 -cpp g++-4.8 -cc gcc-4.8 -LDFLAGS -Wl,--no-as-needed \
-f filelist.f \
-sverilog \
-debug_access+all \
-kdb \
-timescale=1ns/1ps \
-l com.log
#修改vcs -full64 \,添加-cpp g++-4.8 -cc gcc-4.8 -LDFLAGS -Wl,--no-as-needed \
如果操作系统没有安装gcc 4.8,会报错:
make[1]: Entering directory '/home/alanwu/Documents/RISCV-SIM/csrc'
make[1]: gcc-4.8: Command not found
安装gcc 4.8即可,这里安装直接从官方下载安装即可,不建议使用安装包的方式完成,如果虚拟机不能联网,再尝试安装包的方式解决问题。
sudo apt-get install gcc-4.8
sudo apt-get install g++-4.8
这里需要注意gcc4.8的源指定问题,有些源已经无法支持gcc4.8了,如果使用上述命令安装失败,尝试将源切换成下面log中的url,可以在sourcelist里面添加该源路径:
Get:1 http://cn.archive.ubuntu.com/ubuntu bionic/universe amd64 gcc-4.8-base amd64 4.8.5-4ubuntu8 [15.8 kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu bionic/universe amd64 cpp-4.8 amd64 4.8.5-4ubuntu8 [4,368 kB]
Get:3 http://cn.archive.ubuntu.com/ubuntu bionic/universe amd64 libasan0 amd64 4.8.5-4ubuntu8 [63.0 kB]
Get:4 http://cn.archive.ubuntu.com/ubuntu bionic/universe amd64 libgcc-4.8-dev amd64 4.8.5-4ubuntu8 [1,691 kB]
Get:5 http://cn.archive.ubuntu.com/ubuntu bionic/universe amd64 gcc-4.8 amd64 4.8.5-4ubuntu8 [4,510 kB]
如果gcc 4.8没有安装好,VCS还会报出rmapats.so的错误:
make[1]: Entering directory '/home/alanwu/Documents/RISCV-SIM/csrc'
make[1]: gcc-4.8: Command not found
Makefile.hsopt:47: recipe for target 'rmapats.so' failed
make[1]: *** [rmapats.so] Error 127
make[1]: Leaving directory '/home/alanwu/Documents/RISCV-SIM/csrc'
Error: Failed to make rmapats.so @ simv.daidir/rmapats.so
Makefile:4: recipe for target 'simv' failed
make: *** [simv] Error 1
三、g++-4.8 unrecognized command line option '-no-pie'错误
这里重点强调下g++的-no-pie错误,在安装好gcc 4.8和g++-4.8以后,可能还会报出g++-4.8: error: unrecognized command line option '-no-pie'的错误:
g++-4.8: error: unrecognized command line option '-no-pie'
Makefile:109: recipe for target 'product_timestamp' failed
出现该错误的原因是g++版本较低,VCS的预编译选项中会添加-no-pie标志,但g++不能够识别该命令,在VCS编译完成后的/csrc/Makefile文件中,会增加预编译选项:
csrc是个临时文件,真正产生该文件的位置是在安装的VCS路径下面:
因此,进入VCS安装路径对应的/bin/文件夹下,打开vcs文件,将其中的SNPS_VCS_INTERNAL_UBUNTU_PRE_LDFLAGS参数后面的-no-pie删除,即可成功解决该问题。
四、启动verdi和fsdb波形
在启动verdi时,可能会遇到libpng12.so文件不存在的问题:
error while loading shared libraries: libpng12.so.0:
cannot open shared object file: No such file or directory
可以从高版本的操作系统中copy一个,也可以在网上搜索下载一个: