From joshg at xilinx.com Tue Oct 20 18:56:49 2009 From: joshg at xilinx.com (Josh Gold) Date: Tue, 20 Oct 2009 15:56:49 -0700 Subject: Ruby-VPI - VCS Core Dump iterating for DefParams Message-ID: Hi All, I've run into a problem using Ruby-VPI in VCS trying to iterate over the defparams. Every interface in the vpiModule can be accessed correctly without any issues. The only issue occurs when trying to read the vpiDepParam objects. The error is a core dump in VCS. This issue seems to be regardless to version as VCS fails on both 2006.06-sp1 and 2009.06. I am using ruby-vpi version 21.1.0 as well. The core dump occures on the following code section: defparamIterater = vpi_iterate(vpiDefParam, designHandle) while(defParamHandle = vpi_scan(defparamIterater)) p defParamHandle end The error that VCS reports before the stack traces are dumped is: Internal error in tool's source file "../vir/vir.cc" line 311. Please send these messages to vcs_support at synopsys.com. Again, this only occurs when trying to view design defparams. Has anyone seen this error before? I was hoping this was something someone has seen before because its hard to imagine that there is a global problem trying to view defparams. Thanks, -Josh This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately. From sunaku at gmail.com Wed Oct 21 00:36:37 2009 From: sunaku at gmail.com (Suraj Kurapati) Date: Tue, 20 Oct 2009 21:36:37 -0700 Subject: Ruby-VPI - VCS Core Dump iterating for DefParams In-Reply-To: References: Message-ID: On Tue, Oct 20, 2009 at 3:56 PM, Josh Gold wrote: > Every interface in the vpiModule can be accessed correctly > without any issues. Glad to hear this. > The only issue occurs when trying to read the > vpiDepParam objects. The error is a core dump in VCS. This issue seems to > be regardless to version as VCS fails on both 2006.06-sp1 and 2009.06. I am > using ruby-vpi version 21.1.0 as well. > > The core dump occures on the following code section: > > defparamIterater = vpi_iterate(vpiDefParam, designHandle) > while(defParamHandle = vpi_scan(defparamIterater)) > p defParamHandle > end > > The error that VCS reports before the stack traces are dumped is: > > Internal error in tool's source file "../vir/vir.cc" line 311. > Please send these messages to vcs_support at synopsys.com. Try setting the CFLAGS_EXTRA or the CFLAGS environment variable before installing Ruby-VPI and you should be able to inspect the core dump with GDB: $ export CFLAGS_EXTRA='-g -DDEBUG' $ gem install ruby-vpi # will reinstall it $ rake vcs ... # run your test (core dump) $ gdb core `which vcs` (gdb) bt full # print stack trace > Again, this only occurs when trying to view design defparams. Has anyone > seen this error before? I was hoping this was something someone has seen > before because its hard to imagine that there is a global problem trying to > view defparams. I haven't tried doing this before and the issue hasn't been raised on this mailing list so far. If you can provide a sample Verilog file that enables the Ruby code you posted, I can run it against other simulators for comparison. Otherwise, please wait for a few days while I regain my strength. I'm overloaded at work and don't have much energy for tinkering at the moment. Cheers. From sunaku at gmail.com Wed Oct 21 02:53:22 2009 From: sunaku at gmail.com (Suraj Kurapati) Date: Tue, 20 Oct 2009 23:53:22 -0700 Subject: Ruby-VPI - VCS Core Dump iterating for DefParams In-Reply-To: References: Message-ID: Suraj Kurapati wrote: > $ export CFLAGS_EXTRA='-g -DDEBUG' > $ gem install ruby-vpi # will reinstall it > $ rake vcs ... # run your test > (core dump) > $ gdb core `which vcs` > (gdb) bt full ?# print stack trace Whoops, I had the gdb arguments in the wrong order. The correct invocation is: $ gdb `which vcs` core Also, be sure to set `ulimit -c unlimited` before running VCS if it doesn't actually produce a core dump file. Cheers. From sunaku at gmail.com Mon Oct 26 15:40:52 2009 From: sunaku at gmail.com (Suraj Kurapati) Date: Mon, 26 Oct 2009 12:40:52 -0700 Subject: Ruby-VPI - VCS Core Dump iterating for DefParams In-Reply-To: <5c4e5f87-8e1c-4733-9181-a61443abb7bc@SG2EHSMHS007.ehs.local> References: <5c4e5f87-8e1c-4733-9181-a61443abb7bc@SG2EHSMHS007.ehs.local> Message-ID: Yeah, I didn't get the email via the mailing list either. Thanks for the test case, I'll look at it tonight. Cheers. On Mon, Oct 26, 2009 at 12:30 PM, Josh Gold wrote: > Hi Suraj, > > I'm not sure if this email got through since I didn't get a response on > the group. ?I'm resending it just in case. > > Thanks again! > > -Josh > > -----Original Message----- > From: Josh Gold > Sent: Friday, October 23, 2009 11:26 AM > To: 'ruby-vpi-discuss at rubyforge.org' > Subject: RE: Ruby-VPI - VCS Core Dump iterating for DefParams > > Hi Suraj, > > Thanks for taking a look at this when you have time. ?I appreciate it. > > Thanks again for making such as great tool as well. > > I've attached an example testcase in the email. > > Let me know if you need anything else. > > Thanks, > -Josh > > -----Original Message----- > From: ruby-vpi-discuss-bounces at rubyforge.org > [mailto:ruby-vpi-discuss-bounces at rubyforge.org] On Behalf Of Suraj > Kurapati > Sent: Tuesday, October 20, 2009 9:37 PM > To: ruby-vpi-discuss at rubyforge.org > Subject: Re: Ruby-VPI - VCS Core Dump iterating for DefParams > > On Tue, Oct 20, 2009 at 3:56 PM, Josh Gold wrote: >> Every interface in the vpiModule can be accessed correctly >> without any issues. > > Glad to hear this. > >> The only issue occurs when trying to read the >> vpiDepParam objects. ?The error is a core dump in VCS. ?This issue > seems to >> be regardless to version as VCS fails on both 2006.06-sp1 and 2009.06. > I am >> using ruby-vpi version 21.1.0 as well. >> >> The core dump occures on the following code section: >> >> defparamIterater = vpi_iterate(vpiDefParam, designHandle) >> while(defParamHandle = vpi_scan(defparamIterater)) >> ? p defParamHandle >> end >> >> The error that VCS reports before the stack traces are dumped is: >> >> Internal error in tool's source file "../vir/vir.cc" line 311. >> Please send these messages to vcs_support at synopsys.com. > > Try setting the CFLAGS_EXTRA or the CFLAGS environment variable before > installing Ruby-VPI and you should be able to inspect the core dump > with GDB: > > $ export CFLAGS_EXTRA='-g -DDEBUG' > $ gem install ruby-vpi # will reinstall it > $ rake vcs ... # run your test > (core dump) > $ gdb core `which vcs` > (gdb) bt full ?# print stack trace > >> Again, this only occurs when trying to view design defparams. ?Has > anyone >> seen this error before? ?I was hoping this was something someone has > seen >> before because its hard to imagine that there is a global problem > trying to >> view defparams. > > I haven't tried doing this before and the issue hasn't been raised on > this mailing list so far. > > If you can provide a sample Verilog file that enables the Ruby code > you posted, I can run it against other simulators for comparison. > > Otherwise, please wait for a few days while I regain my strength. ?I'm > overloaded at work and don't have much energy for tinkering at the > moment. > > Cheers. > > > > This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately. > > From sunaku at gmail.com Wed Oct 28 01:39:45 2009 From: sunaku at gmail.com (Suraj Kurapati) Date: Tue, 27 Oct 2009 22:39:45 -0700 Subject: Ruby-VPI - VCS Core Dump iterating for DefParams In-Reply-To: References: <5c4e5f87-8e1c-4733-9181-a61443abb7bc@SG2EHSMHS007.ehs.local> Message-ID: On Mon, Oct 26, 2009 at 12:40 PM, Suraj Kurapati wrote: > Thanks for the test case, I'll look at it tonight. I ran your test case against all simulators I have access to. Both Mentor Modelsim and CVC Verilog simulator (CVer) ran your test case just fine, VCS almost reached the finish line, and all others crashed (see below). Also, CVer wasn't running your test case as-is, so I appended your test.v file to the example counter.v shipped with Ruby-VPI and copied your iteration & printing logic from test_loader.rb into counter_loader.rb to get it working. Interestingly, Icarus Verilog seems to indicate that the problem is a NULL pointer being passed to vpi_iterate(). If I were you, I would try converting your sample test case into a very simple C/C++ Verilog VPI application see if VCS still crashes. By the way, I've been tinkering with an alternate approach to embedding Ruby side-by-side with C here[1]. I'll see if this new approach solves the problem with your test case. Let me know if you have any more questions. Cheers. [1]: http://redmine.ruby-lang.org/issues/show/2294 ############################################################### # rake vsim ############################################################### (in /tmp/ruby-vpi/examples/defparam) (in /tmp/ruby-vpi/examples/defparam) ["vlib work", {:verbose=>:default, :noop=>false}] ["vlog", "test.v", {:verbose=>:default, :noop=>false}] Model Technology ModelSim SE-64 vlog 6.4c Compiler 2008.12 Dec 8 2008 -- Compiling module test -- Compiling module FD Top level modules: test ["vsim", "-c", "-do", "run -all; exit", "-pli", "/tmp/ruby-vpi/obj/vsim.so", "test", {:verbose=>:default, :noop=>false}] Reading /mada/software/mentor/modeltech/tcl/vsim/pref.tcl # 6.4c # vsim -do {run -all; exit} -c -pli /tmp/ruby-vpi/obj/vsim.so test # ** Note: (vsim-3812) Design is being optimized... # ** Note: (vsim-3865) Due to PLI being present, full design access is being specified. # Loading /tmp/ruby-vpi/obj/vsim.so # // ModelSim SE-64 6.4c Dec 8 2008 Linux 2.6.18-8.1.6.el5 # // # // Copyright 1991-2008 Mentor Graphics Corporation # // All Rights Reserved. # // # // THIS WORK CONTAINS TRADE SECRET AND # // PROPRIETARY INFORMATION WHICH IS THE PROPERTY # // OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS # // AND IS SUBJECT TO LICENSE TERMS. # // # Loading work.test(fast) # Loading work.FD(fast) # run -all # Instance Name: fd_inst # Module Name : FD # # # # exit ############################################################### # rake cver ############################################################### (in /home/sun/tmp/ruby-vpi/examples/counter/xUnit) rake -f counter_runner.rake cver (in /home/sun/tmp/ruby-vpi/examples/counter/xUnit) ["cver", "+loadvpi=/home/sun/tmp/ruby-vpi/obj/cver.so:vlog_startup_routines_bootstrap", "+incdir+..", "../counter.v", {:noop=>false, :verbose=>:default}] cver +loadvpi=/home/sun/tmp/ruby-vpi/obj/cver.so:vlog_startup_routines_bootstrap +incdir+.. ../counter.v GPLCVER_2.12a of 05/16/07 (Linux-elf). Copyright (c) 1991-2007 Pragmatic C Software Corp. All Rights reserved. Licensed under the GNU General Public License (GPL). See the 'COPYING' file for details. NO WARRANTY provided. Today is Tue Oct 27 22:22:43 2009. Compiling source file "../counter.v" Highest level modules: counter test Instance Name: fd_inst Module Name : FD # # # Loaded suite ruby-vpi Started ... Finished in 0.104811 seconds. 3 tests, 35 assertions, 0 failures, 0 errors 202 simulation events and 3 declarative immediate assigns processed. 202 behavioral statements executed (68 procedural suspends). Times (in sec.): Translate 0.0, load/optimize 0.1, simulation 0.3. There were 23 error(s), 407 warning(s), and 14 inform(s). End of GPLCVER_2.12a at Tue Oct 27 22:22:44 2009 (elapsed 0.3 seconds). ############################################################### # rake vcs ############################################################### (in /tmp/ruby-vpi/examples/defparam) (in /tmp/ruby-vpi/examples/defparam) ["vcs", "-R", "+v2k", "+vpi", "+cli", "-P", "/tmp/ruby-vpi/lib/ruby-vpi/pli.tab", "-load", "/tmp/ruby-vpi/obj/vcs.so:vlog_startup_routines_bootstrap", "-full64", "test.v", {:verbose=>:default, :noop=>false}] Warning-[LNX_OS_VERUN] Unsupported Linux version Linux version 'CentOS release 5.4 (Final)' is not supported on 'x86_64' officially, assuming linux compatibility by default. Set VCS_ARCH_OVERRIDE to linux or suse32 to override. Please refer to release notes for information on supported platforms. Chronologic VCS (TM) Version C-2009.06_Full64 -- Tue Oct 27 22:00:33 2009 Copyright (c) 1991-2008 by Synopsys Inc. ALL RIGHTS RESERVED This program is proprietary and confidential information of Synopsys Inc. and may be used and disclosed only as authorized in a license agreement controlling such use and disclosure. Warning-[ACC_CLI_ON] ACC/CLI capabilities enabled ACC/CLI capabilities have been enabled for the entire design. For faster performance enable module specific capability in pli.tab file Parsing design file 'test.v' Top Level Modules: test No TimeScale specified Starting vcs inline pass... 1 module and 0 UDP read. recompiling module test gcc -pipe -O -I/mada/software/synopsys/vcs/include -c -o rmapats.o rmapats.c if [ -x ../simv ]; then chmod -x ../simv; fi g++ -o ../simv 5NrI_d.o 5NrIB_d.o gzYz_1_d.o rmapats_mop.o rmapats.o SIM_l.o /mada/software/synopsys/vcs/amd64/lib/libvirsim64.a /mada/software/synopsys/vcs/amd64/lib/liberrorinf.so /mada/software/synopsys/vcs/amd64/lib/libsnpsmalloc.so /mada/software/synopsys/vcs/amd64/lib/libvcsnew.so /mada/software/synopsys/vcs/amd64/lib/vcs_save_restore_new.o -ldl -lm -lc -lpthread -ldl ../simv up to date Chronologic VCS simulator copyright 1991-2008 Contains Synopsys proprietary information. Compiler version C-2009.06_Full64; Runtime version C-2009.06_Full64; Oct 27 22:00 2009 Instance Name: fd_inst Module Name : FD # # # Internal error in tool's source file "../vir/vir.cc" line 332. Please send these messages to vcs_support at synopsys.com.