微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微电子和IC设计 > IC验证交流 > 关于SystemVerilog和VCS编译器的问题

关于SystemVerilog和VCS编译器的问题

时间:10-02 整理:3721RD 点击:

版上各位大侠,我现在遇到一个关于VCS的问题。简单描述一下,使用VCS201209版编译了一段验证代码,没有发生编译错误,但是在运行时却发生了错误。经分析,发生错误的一段代码如下:
1868 //pcie_item.first_be = {{(length % `DW_BYTE_COUNT){1'b1}}, {(`FDW_BE_WIDTH - (length % `DW_BYTE_COUNT)){1'b0}}}; // change because of the run time error
1869 if ((`FDW_BE_WIDTH - (length % `DW_BYTE_COUNT)) == 0) begin
1870pcie_item.first_be = {(length % `DW_BYTE_COUNT){1'b1}};
1871 end
1872 else begin
1873pcie_item.first_be = {{(length % `DW_BYTE_COUNT){1'b1}}, {(`FDW_BE_WIDTH - (length % `DW_BYTE_COUNT)){1'b0}}};
1874 end
代码中各个宏的值为`DW_BYTE_COUNT=4; `FDW_BE_WIDTH=4,length为一变量。其中第1868行已经被我注释掉了,将其改成了1869-1874行的代码。改的原因是因为运行时发生了如下的运行错误:
../sv/04_ref_model/ref_model.sv, line 1868: ** OTENF: S QOP_CONCAT (S,S) /* {} */
Note: OTENF is an internal error meaning Op_Table Entry Not Found
Assertion failed " Note: Set environment variable VCS_REPORT_ALL_OTENF to get all the OPTENF errors." at line 711 in file fun.c
An unexpected termination has occurred in /EDA_Tools/synopsys/vcs1209/linux/bin/vcs1
at ../sv/04_ref_model/ref_model.sv, 1730
During Codegen
During Pass2 Module vcs_paramclassrepository Module vcs_paramclassrepository

--- Stack trace follows:
[Thread debugging using libthread_db enabled]
[New Thread 0xf7be9bb0 (LWP 24498)]
0xffffe405 in __kernel_vsyscall ()
Thread 2 (Thread 0xf7be9bb0 (LWP 24498)):
#00xffffe405 in __kernel_vsyscall ()
#10x00aebb26 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libpthread.so.0
#20x0aee7e64 in ? ()
#30x00ae9371 in start_thread () from /lib/tls/libpthread.so.0
#40x00a41ffe in clone () from /lib/tls/libc.so.6
Backtrace stopped: Not enough registers or memory available to unwind further
Thread 1 (Thread 0xf7fd2700 (LWP 24497)):
#00xffffe405 in __kernel_vsyscall ()
#10x00a0447b in waitpid () from /lib/tls/libc.so.6
#20x009ae349 in do_system () from /lib/tls/libc.so.6
#30x009ae6c1 in system () from /lib/tls/libc.so.6
#40x00aef78d in system () from /lib/tls/libpthread.so.0
#50x0b3bc389 in tracker::StackAnnotator::getGdbOutput(char const*, char const*, char const*) ()
#60x0b3bd677 in tracker::StackAnnotator::dumpProcessStack(unsigned int, char const*, char const*) ()
#70x0b3b29c6 in dumpStackTrace ()
#80x0b3b74e7 in vcsAssertNoReturn ()
#90x08fbbf0d in ? ()
#10 0x08fbc1c8 in BuildFUNsForRout ()
#11 0x0907ff8c in BuildMOPsForRout ()
#12 0x08f4e069 in ? ()
#13 0x08f4f12e in ? ()
#14 0x08f52423 in CodeGenC ()
#15 0x09187f31 in Phase234 ()
#16 0x08806fba in ? ()
#17 0x088214ab in ? ()
#18 0x088238ee in DoPass2 ()
#19 0x0876b5ab in doGAToPass2 ()
#20 0x0876be7a in c_main ()
#21 0x09293842 in main ()
Completed context dump phase location* 'Module' 'Module'
CPU time: 33.817 seconds to compile
make: *** [comp] Error 255
我分析了可能出错的原因,觉得有可能是`FDW_BE_WIDTH - (length % `DW_BYTE_COUNT)的值为0导致的。因此增加了判断`FDW_BE_WIDTH - (length % `DW_BYTE_COUNT)的值是否为0的条件,但是修改后还是报错。报错的行数则变为了1873行。既然已经增加了条件判断,为什么VCS还是会报这样一个错误呢。如果是`FDW_BE_WIDTH - (length % `DW_BYTE_COUNT)的值有可能为0,那么应该在编译阶段就报错啊,为什么到了运行时才报错呢。而添加条件判断之后,VCS为什么还是报错呢?
PS1: VCS错误报告中line 1730是出错代码所在task的入口;在验证代码中,由于需要依赖length的变量值来决定生成first_be的值,因此,我只能采取上述表达式去生成first_be。
PS2: 其实代码修改前的第1868行,根据之前的条件判断,`FDW_BE_WIDTH - (length % `DW_BYTE_COUNT)的值已经不可能为0了;为了确认一下,还是将该行代码修改成了1870-1874行的代码。PS3: 我如果将1873行的代码注释掉,则VCS不再报错。

解决了吗?我也遇到类似问题!

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top