|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
本帖最后由 mrforever 于 2013-4-7 12:36 编辑
版上各位大侠,我现在遇到一个关于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
1870 pcie_item.first_be = {(length % `DW_BYTE_COUNT){1'b1}};
1871 end
1872 else begin
1873 pcie_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)):
#0 0xffffe405 in __kernel_vsyscall ()
#1 0x00aebb26 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libpthread.so.0
#2 0x0aee7e64 in ?? ()
#3 0x00ae9371 in start_thread () from /lib/tls/libpthread.so.0
#4 0x00a41ffe 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)):
#0 0xffffe405 in __kernel_vsyscall ()
#1 0x00a0447b in waitpid () from /lib/tls/libc.so.6
#2 0x009ae349 in do_system () from /lib/tls/libc.so.6
#3 0x009ae6c1 in system () from /lib/tls/libc.so.6
#4 0x00aef78d in system () from /lib/tls/libpthread.so.0
#5 0x0b3bc389 in tracker::StackAnnotator::getGdbOutput(char const*, char const*, char const*) ()
#6 0x0b3bd677 in tracker::StackAnnotator::dumpProcessStack(unsigned int, char const*, char const*) ()
#7 0x0b3b29c6 in dumpStackTrace ()
#8 0x0b3b74e7 in vcsAssertNoReturn ()
#9 0x08fbbf0d 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不再报错。 |
|