Kazunori Kimura | 20 Jun 09:41
Picon
Picon

RSpec error

Hi,

I tried to use ruby-vpi-21.1.0 follows environment:

OS : Debian Linux x86-64
Linux Version : 2.6.37.2
Ruby Version : 1.8.7
ruby-vpi version : 21.1.0

When I run 'rake vsim PROTOTYPE=1' in example/counter/RSpec directory,
RSpec module not found.

# LoadError: no such file to load -- spec

I checked RSpec version by 'gem list'. RSpec's version was 2.6.0.
then, I tried to follows

ruby -e "require 'rubygems'; require'rspec'"

this command works. so, I modified counter_spec.rb . replace 'spec' to
'rspec'.

then, I tried 'rake vsim PROTOTYPE=1' one more. but follows error ocurred.

NoMethodError: undefined method `setup' for #<Class:0x7f5230a464e0>

I check RSpec 2.6.0 document. there are no 'setup' mothod.
document uses 'before(:each)' instead of 'setup'

I replaced 'setup' to 'before(:each)'. and then 'rake vsim PROTOTYPE=1'.
(Continue reading)

Suraj N. Kurapati | 20 Jun 20:03
Picon

Re: RSpec error

On Mon 20 Jun 2011 04:41:41 PM PDT, Kazunori Kimura wrote:
> NoMethodError: undefined method `setup' for #<Class:0x7f5230a464e0>
>
> I check RSpec 2.6.0 document. there are no 'setup' mothod.
> document uses 'before(:each)' instead of 'setup'

Please try with rspec version 1.1.4 (released May 26, 2008).

> I replaced 'setup' to 'before(:each)'. and then 'rake vsim
> PROTOTYPE=1'. error messages were not appeared. but, there were no
> test result mesasge.
>
> How do I get correct result with 'rake vsim PROTOTYPE=1'.

Good question.  It should work regardless of the unit testing
framework being used.  I'll try to dig into this issue this week.

By the way, I noticed that your e-mail address comes from Kyoto
University! the birthplace of the original ruby-vpi! :)  Welcome!

Are you interested in maintaining or developing Ruby-VPI?  I have
done more experiments, such as using ucontext instead of pthread[1],
and have more ideas, such as replacing `rake vsim` with a
ruby-vpi.so that can be loaded into any simulator and invoked
on-demand from a C program, and other ideas written in my notebook.

[1]: https://github.com/sunaku/ruby-coroutine-example

--

-- 
To give happiness is to deserve happiness.
(Continue reading)

Kazunori Kimura | 21 Jun 06:10
Picon
Picon

RSpec 1.1.4 works correct

>>>>> In <20110620110339.63b2d299@...> 
>>>>>	"Suraj N. Kurapati" <sunaku@...> wrote:
Hi Suraj.

Thank you for you response.

> Please try with rspec version 1.1.4 (released May 26, 2008).

I tried rspec version 1.1.4 . It seemed that test result was correct.
then, I tried with no PROTOTYPE, 'rake vsim'. but, segmentation error
occured. follows are message.

** Fatal: (SIGSEGV) Bad pointer access. Closing vsimk.
** Fatal: vsimk is exiting with code 211.
(Exit codes are defined in the ModelSim messages appendix
of the ModelSim User's Manual.)
# SystemExit: exit
#       from
** /home/kazunori/.gem/ruby/1.8/gems/ruby-vpi-21.1.0/lib/ruby-vpi/core/callback.rb:73:in
** `user_data'
#       from
** /home/kazunori/.gem/ruby/1.8/gems/ruby-vpi-21.1.0/lib/ruby-vpi/core/callback.rb:73:in
** `relay_verilog'
#       from
** /home/kazunori/.gem/ruby/1.8/gems/ruby-vpi-21.1.0/lib/ruby-vpi/core/scheduler.rb:103:in
** `advance_to_read_only_slot'
#       from
** /home/kazunori/.gem/ruby/1.8/gems/ruby-vpi-21.1.0/lib/ruby-vpi/core/scheduler.rb:29:in `initialize'

when I tried gplcver, no errors appeared. so I think vsim.so has problem.
(Continue reading)


Gmane