Module: RubyVPI
- Defined in:
- lib/ruby-vpi.rb,
lib/ruby-vpi/rcov.rb,
lib/ruby-vpi/core/edge.rb,
lib/ruby-vpi/core/callback.rb,
lib/ruby-vpi/core/scheduler.rb,
lib/ruby-vpi/core/edge-methods.rb
Overview
Defines methods for detecting all possible value changes. – Copyright 2007 Suraj N. Kurapati See the file named LICENSE for details.
Defined Under Namespace
Modules: Coverage Classes: CallbackClass, EdgeClass, SchedulerClass, Simulator
Constant Summary collapse
- Project =
{ :name => 'ruby-vpi', :version => '21.1.0', :release => '2008-08-02', :website => 'http://ruby-vpi.rubyforge.org', :home => File.(File.join(File.dirname(__FILE__), '..')) }
- SIMULATORS =
List of supported Verilog simulators.
[ Simulator.new(:cver, 'GPL Cver', '-DPRAGMATIC_CVER', ''), Simulator.new(:ivl, 'Icarus Verilog', '-DICARUS_VERILOG', ''), Simulator.new(:ncsim, 'Cadence NC-Sim', '-DCADENCE_NCSIM', ''), Simulator.new(:vcs, 'Synopsys VCS', '-DSYNOPSYS_VCS', ''), Simulator.new(:vsim, 'Mentor Modelsim', '-DMENTOR_MODELSIM', ''), ]
- Edge =
EdgeClass.instance
- Callback =
CallbackClass.instance
- Scheduler =
SchedulerClass.instance
Class Method Summary collapse
-
.load_test(aDesignHandleOrPath, *aTestFilePaths) ⇒ Object
Loads a test to exercise a design (the given VPI handle).
-
.say(fmt, *args) ⇒ Object
Speaks the given message using printf().
Class Method Details
.load_test(aDesignHandleOrPath, *aTestFilePaths) ⇒ Object
Loads a test to exercise a design (the given VPI handle).
-
Creates a sandbox (an anonymous module).
-
Defines a constant named “DUT” (which points to the given VPI handle) inside the sandbox.
-
Loads the given test files into the sandbox.
-
Returns the sandbox.
- aDesignHandleOrPath
-
either a VPI handle or a path to an object in the Verilog simulation
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/ruby-vpi.rb', line 51 def RubyVPI.load_test aDesignHandleOrPath, *aTestFilePaths # access the design under test design = if aDesignHandleOrPath.is_a? VPI::Handle aDesignHandleOrPath else VPI.vpi_handle_by_name(aDesignHandleOrPath.to_s, nil) end raise ArgumentError, "cannot access the design under test: #{aDesignHandleOrPath.inspect}" unless design # create a sandbox sandbox = Module.new sandbox.const_set :DUT, design sandboxBinding = sandbox.module_eval('binding') # load files into sandbox aTestFilePaths.flatten.compact.uniq.each do |path| if HAVE_RUBY_19X eval File.read(path), sandboxBinding, path else sandbox.module_eval File.read(path), path end end sandbox end |