文章目录
前言
记录做项目的时候编译问题,好记性不如烂笔头,下次碰到相同的问题也可以方便查阅
2023.2.10
问题1:编写makefile脚本后,执行make all,遇到如下问题
解决方法:
(1)按照下面这个办法,打开vcs文件,1200行没有这句话
(2)在编译选项添加-full64
即可,问题解决
问题2:遇到过好几次
collect2: error: ld returned 1 exit status
Makefile:104: recipe for target 'product_timestamp' failed
make: *** [product_timestamp] Error 1
解决方法:确保gcc版本为4.8,然后添加选项
vcs -full64 -cpp g++-4.8 -cc gcc-4.8 -LDFLAGS -Wl,--no-as-needed -sverilog -debug_all -timescale=1ns/1ps -f file.list -l com.log
问题3:
make[1]: g++4.8: Command not found
Makefile:104: recipe for target 'product_timestamp' failed
make[1]: *** [product_timestamp] Error 127
make[1]: Leaving directory '/home/xxx/test/csrc'
Make exited with status 2
CPU time: .107 seconds to compile + .016 seconds to elab + .077 seconds to link
makefile:4: recipe for target 'com' failed
make: *** [com] Error 2
又报错了!哭!破案了!!!!
–no-as-needed复制到makefile里面变成了-no-as-needed,总算解决了
(ps:好多时候都是这种低级错误,然后整好久)
问题4:前面都没问题,dve执行又报错了
ERROR - /home/xxx/synopsys/vcs-2016.06/gui/dve/linux/bin is not valid directory.
Check if DVE variable is valid. If you want to run 64bit, please use -mode64 or -full64 option.
解决方法:暂时没找到解决方法,但是仔细发现,我最开始用的设计里面是没有添加波形的,可能就出错了。然后换了一个设计就跑成功了!!!看到最后面那句话也就是运行成功了。
2023.2.26
问题1:想用vcs去编译整个仿真环境,把文件添加到了ahb2apb/dv/etc/tb.f tc.f
文件夹下,但是找不到这些文件
Error-[SFCOR] Source file cannot be opened
Source file "$DV_ROOT/vip/ahbl_mst/ahbl_mst_pkg.sv" cannot be opened for
reading due to 'No such file or directory'.
Please fix above issue and compile again.
问题原因:
本来是想设置绝对路径去做,在最上面声明项目的绝对路径,这样下次移植时只要修改变量名即可。
在f文件里面使用了makefile文件里面定义的变量,这个变量好像并没有传递到我要去编译的f文件,没有替换到变量名,于是系统无法识别该变量,所以找不到文件。
解决方法:
为什么变量没有传进去,可能是该变量只在makefile文件里面有效?
法一:要用export
!我只写了变量等于什么,并没有export进去!
法二:没有用绝对路径了,改用相对路径,把各个f文件里面的路径修改成相对于makefile文件的路径。在filelist文件中用相对路径的话,都是相对于makefile文件的相对路径。
问题2:语法错误
解决方法:
-f选项只对rtl.f文件产生效果,后面的tb.f tc.f被当成设计文件去编译了
应该加三个-f选项
问题3:
Error-[UST] Undefined System Task Call
/home/xxxx/ahb2apb/dv/tb/ahb2apb_tb.sv, 150
Undefined System Task call to '$fsdbDumpfile'.
解决方法:
配置verdi的库文件
编译选项加上-P
问题4:报错说run test函数没有例化对象
发现是+UVM_TESTNAME=${TC}
写成了+UVM_TESTNAME = ${TC}
。中间等号间隔开了就不行。
2023.3.16
问题1: 我想把每次随机后的种子记录下来写到log文件名称里面。但是生成的文件名称没有log文件后缀,不知道为啥()
解决方法:
在开头声明这个变量,然后后面再去使用,这样就没有报错了,但是原因未知
com_log_name = ${testname}_${SEED}
-l ./log/${com_log_name}.log \
2023.3.22
问题1:每次跑回归测试的时候,总是会出现错误,总共只有5个test,单独跑这个case的时候是没有问题的
An unexpected termination has occurred in ./SIMV/ahbl_mst_burst_apb_slv_slverr_051555011_simv due to a signal: Segmentation fault
问题分析: 发生了段错误,没有物理内存对应该地址,好像是访问了一些不存在的物理内存空间,在出现这个错误之前,还出现下面的warning信息。但是我在仿真脚本的编译选项里面是添加了这个+ntb_solver_array_size_warn=10000
,可能是没起作用,导致数组长度太大。
Warning-[CNST-LASW] Constraint large array size warning
/home/xxx/ahb2apb/dv/seqlib/ahbl_mst_seqlib.sv, 30
Variable haddr_q.size() has value > 100000, which may cause severe performance degradation.
Please try to reduce the array size.
You can use +ntb_solver_array_size_warn=<num> to adjust the array size warning limit.
Warning-[UNK_COMP_ARG] Unknown compile time plus argument used
Unknown compile time plus argument 'ntb_solver_array_size_warn=100000' is ignored.
解决方法:
把它设置成了200000,还是有warning信息
Warning - [CNST-LASW] Constraint large array size warning/home/xxxx/ahb2apb/dv / seqlib/ahbl_mst_seqlib.sv,30
Variable haddr q.size( ) has value > 1410065408,which may cause severe performance degradation.Please try to reduce the array size.
You can use +ntb_solver_array_size_warn=<num> to adjust the array sizewarning limit.
问题2 :为了避免对case语句中default语句收集覆盖率,所以添加了编译选项-cm_nocasedef
,出现如下warning
Warning-[VCM-OPTINWP] Option used in wrong phase.
-cm_nocasedef is not a compile-time coverage option. It will have no effect at compile-time.
This option should be used at report-time.Please contact VCS support forfurther information.
解决方法:区分compile-time
、run-time
、report-time
这三个不同的时间,看上去像是选项加错了位置,而且总感觉出现这些问题都是我要一步执行-R引起的,但是又说一步执行的vcs选项的顺序又没有太大的要求,这点暂时还没理解清楚
改成了-cm_cond nocasedef,又出现了下面这个错误,-cm_cond没有nocasedef这个选项,有的选项在另外一篇博客有介绍
Error-[CM-ARGPL] Incorrect argument 'nocasedef' is not a valid argument to -cm_cond. The -cm_cond option requires a '+' separated list of flags. The legal flags are: basic std allops full event anywidth tf caseeq for path sop ports allvectors scalarbitwise flat obs noxfalse objects
最后在urg的时候加上去除收集default语句的行覆盖率:-line nocasedef
urg -full64 -line nocasedef -dir *.vdb -dbname merge -report urgReport
输出的urg log信息中有如下:
Note-[URG-NCDN] No case default
Since the -line nocasedef option was given, URG will exclude all the
"default" case items from the line coverage reports.
2023.4.30
问题1:写了一个agent,里面包含各个组件,想编译一下看这部分有没有什么问题,make com的时候出现如下问题,好像主要是这句话undefined reference
to `sramc/dv/agent/ahbl_master/simv"’
objs/amcQw_d.o: In function `NSIM':
(.text+0x177): undefined reference to `sramc/dv/agent/ahbl_master/simv"'
collect2: error: ld returned 1 exit status
Makefile:104: recipe for target 'product_timestamp' failed
make[1]: *** [product_timestamp] Error 1
make[1]: Leaving directory '/home/xxxx/ahb sramc/dv/agent/ahbl_master/csrc'
Make exited with status 2
CPU time: 4.082 seconds to compile + .201 seconds to elab + .345 seconds to link
makefile:4: recipe for target 'com' failed
make: *** [com] Error 2
解决方法:未解决 不知道哪里有问题
问题2:整体编译时,出现如下错误
VCS Error-[NYI-NS] Not Yet Implemented The following feature is not yet supported: Replacing interface cell in logical library not yet supported.
解决方法:在interface文件开头添加了`ifndef声明,就没有报错了,但是之前跑ahb2apb的时候也没有声明。
2023.5.18
问题1: 编译文件报错,driver组件中如果抓到是空包,就发送一拍idle
之前只要reset的时候没有报错,新添加这部分就报错
Error-[XMRE] Cross-module reference resolution error
/home/xxxxx/ahb_sramc/dv/agent/ahbl_master/ahbl_mst_drv.sv, 71
Error found while trying to resolve cross-module reference.
token 'vif'. Originating package 'ahbl_mst_pkg'.
Source info: vif.drv_cb.hburst <= 3'b0;
解决: 因为我把函数声明为了extern,但是新添加的这个函数没有写ahbl_mst_drv::drive_1clc_idle
,所以查找不到vif
2023.6.2
问题1: 语法错误,检查了好几遍12行的代码,没有拼写错误,也没有写中文标点符号(最近好几次都是这种莫名其妙的语法错误,没有拼写错误,就是不知道哪里错了)
Error-[SE] Syntax error
Following verilog source has syntax error :
token ‘vsequencer’ should be a valid type. Please declare it virtual
if it is an Interface.
“./…/dv/env/apbuart_environment.sv”, 12: token is ‘;’
vsequencer v_sqr;
解决: 原来是我在写文件路径的时候,把env的文件先编译了,而vsequencer的文件在env后面,所以就找不到vsequencer,发生语法错误了
2023.6.4
问题1: 在执行makefile中的脚本的时候报错,第一次出现这种,检查了每个命令之后都有分号,而且makefile指令如果换行写的话也添加了反斜杠。
run_all:
@for i in $(TEST_NAMES); do
@echo “SEED:${SEED}”;
@echo “testname:$i”;
${compile} -cm_name $$i_name_${SEED} -R \
-o ./SIM/$$i_${SEED}simv
-l ./log/$$i${SEED}.log
+UVM_TIMEOUT=900000000
+UVM_TESTNAME=$$i;
done
错误如下:
/bin/sh: -c: line 4: syntax error: unexpected end of file
Makefile:23: recipe for target ‘run_all’ failed
make: *** [run_all] Error 1
解决: 在网上看到说unexpected end of file错误可能是反斜杠后门有空格,编辑器认为该行是一条完整的命令,但是没有分号,所以就报错,果然在-R \
的后面发现了一个空格。