ruby-vpi 13.0.0 → 14.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +6 -1
- data/bin/generate_test_tpl/bench.rb +84 -1
- data/bin/generate_test_tpl/bench.v +8 -17
- data/bin/generate_test_tpl/proto.rb +1 -1
- data/doc/common.css +14 -41
- data/doc/common.tpl +1 -1
- data/doc/figures/figures.dia +274 -753
- data/doc/figures/organization_detailed.png +0 -0
- data/doc/figures/ruby_relay.png +0 -0
- data/doc/history.html +363 -276
- data/doc/history.yml +40 -0
- data/doc/intro.inc +37 -15
- data/doc/lib/doc_proxy.rb +24 -4
- data/doc/manual.doc +345 -196
- data/doc/manual.html +741 -497
- data/doc/memo.doc +15 -15
- data/doc/memo.html +28 -27
- data/doc/readme.doc +2 -2
- data/doc/readme.html +51 -15
- data/doc/rss.erb +1 -1
- data/doc/rss.xml +1624 -31
- data/ext/Rakefile +1 -6
- data/ext/main.c +8 -3
- data/ext/main.h +5 -0
- data/ext/relay.c +12 -12
- data/ext/relay.h +1 -6
- data/ext/swig_vpi.i +2 -2
- data/ext/swig_wrap.cin +37 -20
- data/ext/verilog.h +2 -2
- data/ext/vlog.c +10 -3
- data/ext/vlog.h +4 -4
- data/lib/ruby-vpi/vpi.rb +114 -0
- data/lib/ruby-vpi.rb +21 -59
- data/ref/c/annotated.html +1 -1
- data/ref/c/common_8h.html +1 -1
- data/ref/c/files.html +1 -1
- data/ref/c/functions.html +1 -1
- data/ref/c/functions_vars.html +1 -1
- data/ref/c/globals.html +1 -1
- data/ref/c/globals_0x63.html +1 -1
- data/ref/c/globals_0x65.html +1 -1
- data/ref/c/globals_0x66.html +1 -1
- data/ref/c/globals_0x6d.html +3 -2
- data/ref/c/globals_0x70.html +1 -1
- data/ref/c/globals_0x72.html +4 -5
- data/ref/c/globals_0x73.html +1 -1
- data/ref/c/globals_0x74.html +1 -1
- data/ref/c/globals_0x76.html +4 -2
- data/ref/c/globals_0x78.html +1 -1
- data/ref/c/globals_defs.html +1 -1
- data/ref/c/globals_defs_0x65.html +1 -1
- data/ref/c/globals_defs_0x70.html +1 -1
- data/ref/c/globals_defs_0x76.html +1 -1
- data/ref/c/globals_defs_0x78.html +1 -1
- data/ref/c/globals_enum.html +1 -1
- data/ref/c/globals_eval.html +1 -1
- data/ref/c/globals_func.html +8 -7
- data/ref/c/globals_type.html +1 -1
- data/ref/c/globals_vars.html +3 -2
- data/ref/c/index.html +1 -1
- data/ref/c/main_8c.html +26 -1
- data/ref/c/main_8h.html +26 -1
- data/ref/c/relay_8c.html +11 -35
- data/ref/c/relay_8h.html +3 -27
- data/ref/c/structt__cb__data.html +1 -1
- data/ref/c/structt__vpi__delay.html +1 -1
- data/ref/c/structt__vpi__error__info.html +1 -1
- data/ref/c/structt__vpi__strengthval.html +1 -1
- data/ref/c/structt__vpi__systf__data.html +1 -1
- data/ref/c/structt__vpi__time.html +1 -1
- data/ref/c/structt__vpi__value.html +1 -1
- data/ref/c/structt__vpi__vecval.html +1 -1
- data/ref/c/structt__vpi__vlog__info.html +1 -1
- data/ref/c/verilog_8h.html +5 -5
- data/ref/c/vlog_8c.html +44 -6
- data/ref/c/vlog_8h.html +7 -8
- data/ref/c/vpi__user_8h.html +1 -1
- data/ref/ruby/classes/RDoc.html +5 -5
- data/ref/ruby/classes/RDoc.src/{M000041.html → M000045.html} +0 -0
- data/ref/ruby/classes/RubyVpi.html +10 -28
- data/ref/ruby/classes/RubyVpi.src/M000029.html +101 -124
- data/ref/ruby/classes/Vpi/Handle.html +56 -56
- data/ref/ruby/classes/Vpi/Handle.src/M000034.html +5 -9
- data/ref/ruby/classes/Vpi/Handle.src/M000035.html +5 -31
- data/ref/ruby/classes/Vpi/Handle.src/M000036.html +5 -74
- data/ref/ruby/classes/Vpi/Handle.src/M000037.html +5 -17
- data/ref/ruby/classes/Vpi/Handle.src/M000038.html +9 -11
- data/ref/ruby/classes/Vpi/Handle.src/M000039.html +44 -0
- data/ref/ruby/classes/Vpi/Handle.src/M000040.html +74 -55
- data/ref/ruby/classes/Vpi/Handle.src/M000041.html +30 -0
- data/ref/ruby/classes/Vpi/Handle.src/M000042.html +24 -0
- data/ref/ruby/classes/Vpi/Handle.src/M000044.html +68 -0
- data/ref/ruby/classes/Vpi.html +149 -0
- data/ref/ruby/classes/Vpi.src/M000030.html +28 -0
- data/ref/ruby/classes/Vpi.src/M000031.html +18 -0
- data/ref/ruby/classes/Vpi.src/M000032.html +39 -0
- data/ref/ruby/classes/Vpi.src/M000033.html +22 -0
- data/ref/ruby/created.rid +1 -1
- data/ref/ruby/files/lib/ruby-vpi/vpi_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi_rb.html +2 -2
- data/ref/ruby/fr_method_index.html +18 -14
- data/samp/counter/counter_rspec_bench.rb +81 -1
- data/samp/counter/counter_rspec_bench.v +5 -12
- data/samp/counter/counter_rspec_design.rb +1 -2
- data/samp/counter/counter_rspec_proto.rb +1 -1
- data/samp/counter/counter_rspec_spec.rb +3 -3
- data/samp/counter/counter_xunit_bench.rb +81 -1
- data/samp/counter/counter_xunit_bench.v +5 -12
- data/samp/counter/counter_xunit_design.rb +1 -2
- data/samp/counter/counter_xunit_proto.rb +1 -1
- data/samp/counter/counter_xunit_spec.rb +3 -3
- data/samp/pipelined_alu/hw5_unit_test_bench.rb +81 -1
- data/samp/pipelined_alu/hw5_unit_test_bench.v +11 -18
- data/samp/pipelined_alu/hw5_unit_test_design.rb +1 -1
- data/samp/pipelined_alu/hw5_unit_test_proto.rb +1 -1
- data/samp/pipelined_alu/hw5_unit_test_spec.rb +1 -1
- metadata +12 -9
- data/doc/figures/ruby_init.png +0 -0
- data/ext/swig_vpi.h +0 -924
- data/ref/ruby/classes/Vpi/Handle.src/M000030.html +0 -18
- data/ref/ruby/classes/Vpi/Handle.src/M000031.html +0 -18
- data/ref/ruby/classes/Vpi/Handle.src/M000032.html +0 -18
- data/ref/ruby/classes/Vpi/Handle.src/M000033.html +0 -18
data/doc/manual.doc
CHANGED
@@ -1,19 +1,21 @@
|
|
1
|
-
<div class="cover-page">
|
2
|
-
|
3
1
|
h1. Ruby-VPI user manual
|
4
2
|
|
5
|
-
|
3
|
+
This manual was last updated on <%= Time.now %>.
|
4
|
+
|
5
|
+
It is meant to be read in conjunction with the "reference documentation for Ruby-VPI":../ref/ruby/index.html. In addition, if you are new to "the Ruby language":http://www.ruby-lang.org, you are encouraged to "explore its documentation":http://www.ruby-lang.org/en/documentation/ alongside this manual.
|
6
6
|
|
7
|
-
|
7
|
+
You can give feedback about this manual and, in general, any aspect of the Ruby-VPI project on the "project forums":http://rubyforge.org/forum/?group_id=1339.
|
8
8
|
|
9
|
-
|
9
|
+
_Happy reading!_
|
10
10
|
|
11
11
|
|
12
12
|
h2(#terms). Terms
|
13
13
|
|
14
|
+
Copyright (c) 2006 Suraj N. Kurapati.
|
15
|
+
|
14
16
|
Permission is granted to copy, distribute and/or modify this document under the terms of the "GNU Free Documentation License":http://www.gnu.org/copyleft/fdl.html, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. A copy of the license is included in the the file named "LICENSE":./LICENSE.
|
15
17
|
|
16
|
-
|
18
|
+
The admonition and navigation graphics used in this manual are Copyright (c) 2005, 2006 "Tango Desktop Project":http://tango.freedesktop.org and are licensed under "these terms":./images/LICENSE.
|
17
19
|
|
18
20
|
|
19
21
|
h1(#intro). Introduction
|
@@ -46,8 +48,6 @@ The following projects utilize the archaic *tf* and *acc* PLI interfaces, which
|
|
46
48
|
|
47
49
|
h1(#background). Background
|
48
50
|
|
49
|
-
Ruby-VPI is a "bench":#glossary.bench which lets you "test":#glossary.test Verilog modules using the Ruby language.
|
50
|
-
|
51
51
|
|
52
52
|
h2(#background.methodology). Methodology
|
53
53
|
|
@@ -79,132 +79,33 @@ As <xref #fig..organization> shows, a "test":#glossary.test is composed of a "be
|
|
79
79
|
|
80
80
|
To extend the "analogy of an electronics laboratory":#background.vocab, the _bench_ acts as the laboratory bench which provides measurement and manipulation tools. The _design_ acts as the electronic component being verified by the engineer. And the _specification_ acts as the engineer who measures, manipulates, and verifies the electronic component.
|
81
81
|
|
82
|
-
|
83
|
-
h3(#background.org.vpi). Interface to VPI
|
84
|
-
|
85
82
|
<% figure "Detailed organization of a test", "#fig..organization.detail" do %>
|
86
83
|
!figures/organization_detailed.png!
|
87
84
|
<% end %>
|
88
85
|
|
89
|
-
|
90
|
-
|
91
|
-
Notice that Ruby-VPI encapsulates all communication between the Ruby interpreter and VPI. This allows the specification, or any Ruby program in general, to access VPI using nothing more than the Ruby language! Thus, Ruby-VPI removes the burden of having to write C programs in order to access VPI.
|
92
|
-
|
93
|
-
Furthermore, Ruby-VPI presents the _entire_ IEEE Std 1364-2005 VPI interface to the Ruby interpreter, but with the following minor changes.
|
94
|
-
|
95
|
-
* The first letter in the name of every function, type, structure, and constant becomes capitalized. For example, the @s_vpi_value@ structure in C becomes the @S_vpi_value@ class in Ruby. Likewise, the @vpiIntVal@ constant in C becomes the @VpiIntVal@ constant in Ruby.
|
96
|
-
|
97
|
-
* The VPI functions @vpi_vprintf@ and @vpi_mcd_vprintf@ are not made accessible to Ruby. However, this isn't a big problem because you can use Ruby's printf method instead.
|
98
|
-
|
99
|
-
bq. The reason for this limitation is that some C compilers have trouble with pointers to the va_list type. For these compilers, the second line in the code shown below causes a "type mismatch" error.
|
86
|
+
Now, let us take a more detailed look at this organization, as illustrated in <xref #fig..organization.detail>.
|
100
87
|
|
101
|
-
|
102
|
-
void foo(va_list ap) {
|
103
|
-
va_list *p = ≈
|
104
|
-
}
|
105
|
-
</code>
|
106
|
-
|
107
|
-
|
108
|
-
h4(#background.org.vpi.util). VPI utility layer
|
109
|
-
|
110
|
-
From a user's perspective, the VPI utility layer (see <xref #fig..organization.detail>) greatly enhances the ability to interact with "handles":#glossary.handle. One simply invokes a handle's methods, which are carefully named in the following manner, to access either (1) its children or (2) its VPI properties.
|
111
|
-
|
112
|
-
The children of a handle are simply the handles that are _immediately_ contained within it in. For example, suppose that you had a Verilog module that contains some registers. The children of a handle to that module would be handles to that module's registers.
|
113
|
-
|
114
|
-
In the event that a child handle has the same name as a VPI property, the child is given priority. However, you can always access VPI properties explicitly via the @Vpi::Handle.get_value@ and @Vpi::Handle.put_value@ methods.
|
88
|
+
Notice that Ruby-VPI encapsulates all communication between the Ruby interpreter and VPI. This allows the specification, or any Ruby program in general, to access VPI using nothing more than the Ruby language! Thus, Ruby-VPI removes the burden of having to write C programs in order to use VPI.
|
115
89
|
|
116
90
|
|
117
|
-
|
118
|
-
|_. Operation |_. _ |_. Property |_. _ |_. Accessor |_. Addendum |
|
119
|
-
|\2. optional | required |\3. optional |
|
120
|
-
|
121
|
-
* *Operation* suggests a method that should be invoked in the context of the Property parameter. All "methods in the Enumerable module":http://www.ruby-doc.org/core/classes/Enumerable.html are available as operations.
|
122
|
-
|
123
|
-
* *Property* suggests a VPI property that should be accessed. The "vpi" prefix, which is common to all VPI properties, can be omitted if you wish. For example, the VPI property "vpiFullName" is considered equivalent to "fullName" and "FullName", but not equivalent "full_name".
|
91
|
+
h2(#background.relay). Ruby/Verilog interaction
|
124
92
|
|
125
|
-
|
93
|
+
In a typical VPI application written in C, the _Verilog simulator_ is in charge. Verilog code temporarily transfers control to C by invoking C functions, which return control to Verilog when they finish.
|
126
94
|
|
127
|
-
|
128
|
-
<% end %>
|
95
|
+
In contrast, Ruby-VPI puts the _specification_ in charge. The specification temporarily transfers control to the Verilog simulator by invoking the @Vpi::advance_time@ method, which returns control to the specification when it finishes. This process is illustrated in <xref#fig..ruby_relay>.
|
129
96
|
|
130
|
-
|
131
|
-
|_. Accessor |_. Kind of value accessed |_. VPI functions used to access the value |
|
132
|
-
| d | delay | @vpi_get_delays@, @vpi_put_delays@ |
|
133
|
-
| l | logic | @vpi_get_value@, @vpi_put_value@ |
|
134
|
-
| i | integer | @vpi_get@ |
|
135
|
-
| b | boolean | @vpi_get@ |
|
136
|
-
| s | string | @vpi_get_str@ |
|
137
|
-
| h | handle | @vpi_handle@ |
|
138
|
-
<% end %>
|
97
|
+
Ruby-VPI's approach is the same as any software testing framework, where the _specification_ drives the design under test. Whereas, the typical VPI & C approach is literally _backwards_ because the design under test drives the specification.
|
139
98
|
|
140
|
-
<%
|
141
|
-
|_/2. Ruby expression |_\6. Parts of speech |_/2. Description |
|
142
|
-
||_. Operation |_. _ |_. Property |_. _ |_. Accessor |_. Addendum ||
|
143
|
-
| @handle.vpiIntVal@ | | | vpiIntVal | | | |/4. These expressions access the logic value of the handle's vpiIntVal property. |
|
144
|
-
| @handle.vpiIntVal_l@ | | | vpiIntVal | _ | l | |
|
145
|
-
| @handle.intVal@ | | | intVal | | | |
|
146
|
-
| @handle.intVal_l@ | | | intVal | _ | l | |
|
147
|
-
| @handle.vpiIntVal = 15@ | | | vpiIntVal | | | = |/4. These expressions assign the number 15 to the logic value of the handle's vpiIntVal property. |
|
148
|
-
| @handle.vpiIntVal_l = 15@ | | | vpiIntVal | _ | l | = |
|
149
|
-
| @handle.intVal = 15@ | | | intVal | | | = |
|
150
|
-
| @handle.intVal_l = 15@ | | | intVal | _ | l | = |
|
151
|
-
| @handle.vpiType@ | | | vpiType | | | |/4. These expressions access the integer value of the handle's vpiType property. |
|
152
|
-
| @handle.vpiType_i@ | | | vpiType | _ | i | |
|
153
|
-
| @handle.type@ | | | type | | | |
|
154
|
-
| @handle.type_i@ | | | type | _ | i | |
|
155
|
-
| @handle.vpiProtected@ | | | vpiProtected | | | |/6. These expressions access the boolean value of the handle's vpiProtected property. |
|
156
|
-
| @handle.vpiProtected_b@ | | | vpiProtected | _ | b | |
|
157
|
-
| @handle.vpiProtected?@ | | | vpiProtected | | | ? |
|
158
|
-
| @handle.protected@ | | | protected | | | |
|
159
|
-
| @handle.protected_b@ | | | protected | _ | b | |
|
160
|
-
| @handle.protected?@ | | | protected | | | ? |
|
161
|
-
| @handle.vpiFullName@ | | | vpiFullName | | | |/4. These expressions access the string value of the handle's vpiFullName property. |
|
162
|
-
| @handle.vpiFullName_s@ | | | vpiFullName | _ | s | |
|
163
|
-
| @handle.fullName@ | | | fullName | | | |
|
164
|
-
| @handle.fullName_s@ | | | fullName | _ | s | |
|
165
|
-
| @handle.vpiParent@ | | | vpiParent | | | |/4. These expressions access the handle value of the handle's vpiParent property. |
|
166
|
-
| @handle.vpiParent_h@ | | | vpiParent | _ | h | |
|
167
|
-
| @handle.parent@ | | | parent | | | |
|
168
|
-
| @handle.parent_h@ | | | parent | _ | h | |
|
169
|
-
| <code>handle.each_vpiNet {|net| puts net.fullName}</code> | each | _ | vpiNet | | | |/2. These expressions print the full name of each vpiNet object associated with the handle. |
|
170
|
-
| <code>handle.each_net {|net| puts net.fullName}</code> | each | _ | net | | | |
|
171
|
-
| <code>handle.all_vpiReg? {|reg| reg.size == 1}</code> | all? | _ | vpiReg | | | |/2. These expressions check if all registers associated with the handle are capable of storing only one bit. |
|
172
|
-
| <code>handle.all_reg? {|reg| reg.size == 1}</code> | all? | _ | reg | | | |
|
173
|
-
| <code>handle.select_vpiNet {|net| net.x?}</code> | select | _ | VpiNet | | | |/2. These expressions return a list of nets whose logic value is unknown or "don't care" (x).|
|
174
|
-
| <code>handle.select_net {|net| net.x?}</code> | select | _ | net | | | |
|
175
|
-
<% end %>
|
176
|
-
|
177
|
-
|
178
|
-
h2(#background.running-tests). Running a test
|
179
|
-
|
180
|
-
Unlike an engineer who can verify an electronic component in real-time, the Verilog simulator and the Ruby interpreter (see <xref #fig..organization.detail>) take turns working with "handles":#glossary.handle when a "test":#glossary.test is run. In particular, they take turns manipulating the Verilog "design":#glossary.design and transfer control to each other when appropriate.
|
181
|
-
|
182
|
-
The situation is similar to a pair of friends playing catch. One friend throws a ball to the other, and the other throws it back. Either is able to inspect and modify the ball, but only when it is in hand.
|
183
|
-
|
184
|
-
|
185
|
-
h3(#background.running-tests.init). Initialization
|
186
|
-
|
187
|
-
A "test":#glossary.test is first initialized before it is "executed":#background.running-tests.exec. This process is illustrated by <xref #fig..ruby_init>.
|
188
|
-
|
189
|
-
<% figure "Initialization of a test", "#fig..ruby_init" do %>
|
190
|
-
!figures/ruby_init.png!
|
191
|
-
|
192
|
-
# The Verilog simulator initializes the Ruby interpreter by invoking the @$ruby_init;@ system task/function, whose parameters represent the command-line invocation of the Ruby interpreter. For example, one would specify @$ruby_init("ruby", "-w");@ in Verilog to achieve the same effect as running <pre>ruby -w</pre> at a command-prompt.
|
193
|
-
# The Verilog simulator is paused and the Ruby interpreter is initialized with the arguments of the @$ruby_init;@ system task/function.
|
194
|
-
# When the Ruby interpreter invokes the @Vpi::relay_verilog@ method, it is paused and the Verilog simulator is given control.
|
195
|
-
<% end %>
|
196
|
-
|
197
|
-
|
198
|
-
h3(#background.running-tests.exec). Execution
|
199
|
-
|
200
|
-
After a "test":#glossary.test is "initialized":#background.running-tests.init, it is executed such that the design is verified against the "specification":#glossary.specification. This process is illustrated by <xref #fig..ruby_relay>.
|
201
|
-
|
202
|
-
<% figure "Execution of a test", "#fig..ruby_relay" do %>
|
99
|
+
<% figure "Interaction between Ruby and Verilog", "#fig..ruby_relay" do %>
|
203
100
|
!figures/ruby_relay.png!
|
204
101
|
|
205
|
-
# The
|
206
|
-
# The
|
207
|
-
#
|
102
|
+
# The current simulation time is _X_.
|
103
|
+
# The specification invokes the @Vpi::advance_time@ method with parameter _Y_, which specifies the number of simulation time steps to be simulated.
|
104
|
+
# The Verilog simulator is now in control (temporarily).
|
105
|
+
# The current simulation time has _not_ changed; it is still _X_.
|
106
|
+
# The Verilog simulator simulates _Y_ simulation time steps.
|
107
|
+
# The current simulation time is now _X + Y_.
|
108
|
+
# The Verilog simulator returns control back to the specification.
|
208
109
|
<% end %>
|
209
110
|
|
210
111
|
|
@@ -242,7 +143,6 @@ The following software is necessary in order to use Ruby-VPI.
|
|
242
143
|
Write a "support request":http://rubyforge.org/tracker/?group_id=1339 for your simulator, while providing a sample transcript of the commands you use to run a test with your simulator, and we will add support for your simulator in the next release!
|
243
144
|
<% end %>
|
244
145
|
|
245
|
-
|
246
146
|
* *make*
|
247
147
|
- any distribution should be acceptable.
|
248
148
|
|
@@ -320,6 +220,329 @@ Learn more about using and manipulating RubyGems in "the RubyGems user manual":h
|
|
320
220
|
|
321
221
|
h1(#usage). Usage
|
322
222
|
|
223
|
+
|
224
|
+
h2(#usage.vpi). VPI in Ruby
|
225
|
+
|
226
|
+
The _entire_ IEEE Std 1364-2005 VPI interface is available in Ruby, but with one minor difference: the names of all VPI types, structures, and constants become _capitalized_ because Ruby requires that the names of constants begin with a capital letter.
|
227
|
+
|
228
|
+
For example, the @s_vpi_value@ structure becomes the @S_vpi_value@ class in Ruby. Likewise, the @vpiIntVal@ constant becomes the @VpiIntVal@ constant in Ruby.
|
229
|
+
|
230
|
+
Note that this capitalization rule does *not* apply to VPI functions; their names remain _unchanged_ in Ruby.
|
231
|
+
|
232
|
+
|
233
|
+
h3(#usage.vpi.handles). Handles
|
234
|
+
|
235
|
+
A _handle_ is a reference to an object, such as a module, register, wire, and so on, inside the Verilog simulation. In short, handles allow you to inspect and manipulate the design under test and its components.
|
236
|
+
|
237
|
+
<% note do %>
|
238
|
+
Handles are instances of the @Vpi::Handle@ class (see "reference documentation":../ref/ruby/classes/Vpi/Handle.html for details) in Ruby-VPI.
|
239
|
+
<% end %>
|
240
|
+
|
241
|
+
Handles have various _properties_, which provide different kinds of information (see the "Kind of value accessed" column in <xref #tbl..accessors>) about the underlying Verilog object represented by a handle. These properties are accessed through various functions, which are listed in the "VPI functions used to access the value" column in <xref #tbl..accessors>.
|
242
|
+
|
243
|
+
Handles are typically obtained through the @vpi_handle_by_name@ and @vpi_handle@ functions. These functions are hierarchical in nature, because they allow you to obtain new handles that are related to existing handles. For example, to obtain a handle to a register inside a module, you would typically write: @some_reg = vpi_handle(VpiReg, some_handle)@.
|
244
|
+
|
245
|
+
|
246
|
+
p(title). Shortcuts for productivity
|
247
|
+
|
248
|
+
Given a handle, Ruby-VPI allows you to access (1) its relatives and (2) its properties by simply invoking its methods.
|
249
|
+
|
250
|
+
If a handle's relative happens to have the same name as one of the handle's properties, then the relative is given preference. However, if you _really_ need to access a handle's property in such a situation, then you can use the @Vpi::Handle.get_value@ and @Vpi::Handle.put_value@ methods.
|
251
|
+
|
252
|
+
|
253
|
+
h4. Accessing a handle's relatives
|
254
|
+
|
255
|
+
To access a handle's relative (a handle related to it), simply invoke the relative's name as a method on the handle.
|
256
|
+
|
257
|
+
For example, to access the @reset@ signal of the @counter@ module shown in <xref #fig..counter.v_decl>, you would write the following:
|
258
|
+
|
259
|
+
<code>
|
260
|
+
counter_module = vpi_handle_by_name("counter", nil)
|
261
|
+
|
262
|
+
reset_signal = counter_module.reset # <== shortcut!
|
263
|
+
</code>
|
264
|
+
|
265
|
+
In this code, the shortcut is that you simply wrote @counter_module.reset@ instead of having to write @vpi_handle_by_name("reset", counter_module)@.
|
266
|
+
|
267
|
+
|
268
|
+
h4. Accessing a handle's properties
|
269
|
+
|
270
|
+
To access a handle's properties, invoke the proprty name, using the following format, as a method on the handle. <xref ex..properties> shows how this naming format is used.
|
271
|
+
|
272
|
+
<% figure "Method naming format for accessing a handle's properties" do %>
|
273
|
+
|_. Operation |_. _ |_. Property |_. _ |_. Accessor |_. Addendum |
|
274
|
+
|\2. optional | required |\3. optional |
|
275
|
+
|
276
|
+
* *Operation* suggests a method that should be invoked in the context of the Property parameter. All "methods in the Enumerable module":http://www.ruby-doc.org/core/classes/Enumerable.html are valid _operations_.
|
277
|
+
|
278
|
+
* *Property* suggests a VPI property that should be accessed. The "vpi" prefix, which is common to all VPI properties, can be omitted if you wish. For example, the VPI property "vpiFullName" is considered equivalent to "fullName" and "FullName", but not equivalent "full_name".
|
279
|
+
|
280
|
+
* *Accessor* suggests a VPI function that should be used in order to access the VPI property. When this parameter is not specified, Ruby-VPI will attempt to _guess_ the value of this parameter.
|
281
|
+
|
282
|
+
<xref #tbl..accessors> shows a list of valid accessors and how they affect the access to a property.
|
283
|
+
|
284
|
+
* *Addendum* suggests that the specified VPI property should be queried as a boolean value when it is a question mark @?@. This suggestion is the same as specifying @b@ for the Accessor parameter.
|
285
|
+
|
286
|
+
Also, when this parameter is an equal sign @=@, it suggests that the specified VPI property should be written to.
|
287
|
+
<% end %>
|
288
|
+
|
289
|
+
<% table "Possible accessors and their implications", "tbl..accessors" do %>
|
290
|
+
|_. Accessor |_. Kind of value accessed |_. VPI functions used to access the value |
|
291
|
+
| d | delay | @vpi_get_delays@, @vpi_put_delays@ |
|
292
|
+
| l | logic | @vpi_get_value@, @vpi_put_value@ |
|
293
|
+
| i | integer | @vpi_get@ |
|
294
|
+
| b | boolean | @vpi_get@ |
|
295
|
+
| s | string | @vpi_get_str@ |
|
296
|
+
| h | handle | @vpi_handle@ |
|
297
|
+
<% end %>
|
298
|
+
|
299
|
+
<% example "Examples of accessing a handle's properties", "ex..properties" do %>
|
300
|
+
|_/2. Ruby expression |_\6. Parts of speech |_/2. Description |
|
301
|
+
||_. Operation |_. _ |_. Property |_. _ |_. Accessor |_. Addendum ||
|
302
|
+
| @handle.vpiIntVal@ | | | vpiIntVal | | | |/4. These expressions access the logic value of the handle's vpiIntVal property. |
|
303
|
+
| @handle.vpiIntVal_l@ | | | vpiIntVal | _ | l | |
|
304
|
+
| @handle.intVal@ | | | intVal | | | |
|
305
|
+
| @handle.intVal_l@ | | | intVal | _ | l | |
|
306
|
+
| @handle.vpiIntVal = 15@ | | | vpiIntVal | | | = |/4. These expressions assign the number 15 to the logic value of the handle's vpiIntVal property. |
|
307
|
+
| @handle.vpiIntVal_l = 15@ | | | vpiIntVal | _ | l | = |
|
308
|
+
| @handle.intVal = 15@ | | | intVal | | | = |
|
309
|
+
| @handle.intVal_l = 15@ | | | intVal | _ | l | = |
|
310
|
+
| @handle.vpiType@ | | | vpiType | | | |/4. These expressions access the integer value of the handle's vpiType property. |
|
311
|
+
| @handle.vpiType_i@ | | | vpiType | _ | i | |
|
312
|
+
| @handle.type@ | | | type | | | |
|
313
|
+
| @handle.type_i@ | | | type | _ | i | |
|
314
|
+
| @handle.vpiProtected@ | | | vpiProtected | | | |/6. These expressions access the boolean value of the handle's vpiProtected property. |
|
315
|
+
| @handle.vpiProtected_b@ | | | vpiProtected | _ | b | |
|
316
|
+
| @handle.vpiProtected?@ | | | vpiProtected | | | ? |
|
317
|
+
| @handle.protected@ | | | protected | | | |
|
318
|
+
| @handle.protected_b@ | | | protected | _ | b | |
|
319
|
+
| @handle.protected?@ | | | protected | | | ? |
|
320
|
+
| @handle.vpiFullName@ | | | vpiFullName | | | |/4. These expressions access the string value of the handle's vpiFullName property. |
|
321
|
+
| @handle.vpiFullName_s@ | | | vpiFullName | _ | s | |
|
322
|
+
| @handle.fullName@ | | | fullName | | | |
|
323
|
+
| @handle.fullName_s@ | | | fullName | _ | s | |
|
324
|
+
| @handle.vpiParent@ | | | vpiParent | | | |/4. These expressions access the handle value of the handle's vpiParent property. |
|
325
|
+
| @handle.vpiParent_h@ | | | vpiParent | _ | h | |
|
326
|
+
| @handle.parent@ | | | parent | | | |
|
327
|
+
| @handle.parent_h@ | | | parent | _ | h | |
|
328
|
+
| <code>handle.each_vpiNet {|net| puts net.fullName}</code> | each | _ | vpiNet | | | |/2. These expressions print the full name of each vpiNet object associated with the handle. |
|
329
|
+
| <code>handle.each_net {|net| puts net.fullName}</code> | each | _ | net | | | |
|
330
|
+
| <code>handle.all_vpiReg? {|reg| reg.size == 1}</code> | all? | _ | vpiReg | | | |/2. These expressions check if all registers associated with the handle are capable of storing only one bit. |
|
331
|
+
| <code>handle.all_reg? {|reg| reg.size == 1}</code> | all? | _ | reg | | | |
|
332
|
+
| <code>handle.select_vpiNet {|net| net.x?}</code> | select | _ | VpiNet | | | |/2. These expressions return a list of nets whose logic value is unknown or "don't care" (x).|
|
333
|
+
| <code>handle.select_net {|net| net.x?}</code> | select | _ | net | | | |
|
334
|
+
<% end %>
|
335
|
+
|
336
|
+
|
337
|
+
h3(#usage.vpi.callbacks). Callbacks
|
338
|
+
|
339
|
+
A _callback_ is a mechanism that makes the Verilog simuluator execute a block of code, which is known as a "callback handler", when some prescribed event occurs in the simulation. They are set up using the @vpi_register_cb@ function and torn down using the @vpi_remove_cb@ function.
|
340
|
+
|
341
|
+
<% example "Using a callback for value change notification", "ex..callback" do %>
|
342
|
+
This example shows how to use a callback for notification of changes in a handle's @VpiIntVal@ property. When you no longer need this callback, you can tear it down using @vpi_remove_cb(cb_handle)@.
|
343
|
+
|
344
|
+
In this example, the handle being monitored is the @Counter.count@ signal from <xref#fig..counter.v_decl>.
|
345
|
+
|
346
|
+
<code>
|
347
|
+
cb_time = S_vpi_time.new
|
348
|
+
cb_time.type = VpiSimTime
|
349
|
+
cb_time.low = 0
|
350
|
+
cb_time.high = 0
|
351
|
+
|
352
|
+
cb_value = S_vpi_value.new
|
353
|
+
cb_value.format = VpiIntVal
|
354
|
+
|
355
|
+
cb_data = S_cb_data.new
|
356
|
+
cb_data.reason = CbValueChange
|
357
|
+
cb_data.obj = Counter.count
|
358
|
+
cb_data.time = cb_time
|
359
|
+
cb_data.value = cb_value
|
360
|
+
cb_data.index = 0
|
361
|
+
|
362
|
+
cb_handle = vpi_register_cb(cb_data) do |data|
|
363
|
+
|
364
|
+
time = (data.time.high << 32) | data.time.low
|
365
|
+
count = data.value.value.integer
|
366
|
+
|
367
|
+
puts "hello from callback! time=#{time} count=#{count}"
|
368
|
+
|
369
|
+
end
|
370
|
+
</code>
|
371
|
+
|
372
|
+
To see this code in action, append it to the <tt>counter_rspec_spec.rb</tt> and <tt>counter_xunit_spec.rb</tt> files, which are provided in <xref#usage.examples> and discussed in <xref#usage.tutorial.specification>.
|
373
|
+
<% end %>
|
374
|
+
|
375
|
+
<% figure "Output from <xref#ex..callback>" do %>
|
376
|
+
Shown below is the output from running the "counter_rspec test":#usage.tutorial after appending the code shown in <xref#ex..callback> to the <tt>counter_rspec_spec.rb</tt> file.
|
377
|
+
|
378
|
+
<pre>
|
379
|
+
$ rake -f counter_rspec_runner.rake cver
|
380
|
+
|
381
|
+
(in /home/sun/src/ruby-vpi/samp/counter)
|
382
|
+
cver +loadvpi=/home/sun/src/ruby-vpi/lib/ruby-vpi/../../obj/ruby-vpi.cver.so:vlog_startup_routines_bootstrap counter.v counter_rspec_bench.v
|
383
|
+
GPLCVER_2.11a of 07/05/05 (Linux-elf).
|
384
|
+
Copyright (c) 1991-2005 Pragmatic C Software Corp.
|
385
|
+
All Rights reserved. Licensed under the GNU General Public License (GPL).
|
386
|
+
See the 'COPYING' file for details. NO WARRANTY provided.
|
387
|
+
Today is Sat Dec 30 09:24:09 2006.
|
388
|
+
Compiling source file "counter.v"
|
389
|
+
Compiling source file "counter_rspec_bench.v"
|
390
|
+
Highest level modules:
|
391
|
+
counter_rspec_bench
|
392
|
+
|
393
|
+
|
394
|
+
A resetted counter's value
|
395
|
+
hello from callback! time=1 count=0
|
396
|
+
- should be zero
|
397
|
+
hello from callback! time=5 count=1
|
398
|
+
hello from callback! time=7 count=2
|
399
|
+
hello from callback! time=9 count=3
|
400
|
+
hello from callback! time=11 count=4
|
401
|
+
hello from callback! time=13 count=5
|
402
|
+
hello from callback! time=15 count=6
|
403
|
+
hello from callback! time=17 count=7
|
404
|
+
hello from callback! time=19 count=8
|
405
|
+
hello from callback! time=21 count=9
|
406
|
+
hello from callback! time=23 count=10
|
407
|
+
hello from callback! time=25 count=11
|
408
|
+
hello from callback! time=27 count=12
|
409
|
+
hello from callback! time=29 count=13
|
410
|
+
hello from callback! time=31 count=14
|
411
|
+
hello from callback! time=33 count=15
|
412
|
+
hello from callback! time=35 count=16
|
413
|
+
hello from callback! time=37 count=17
|
414
|
+
hello from callback! time=39 count=18
|
415
|
+
hello from callback! time=41 count=19
|
416
|
+
hello from callback! time=43 count=20
|
417
|
+
hello from callback! time=45 count=21
|
418
|
+
hello from callback! time=47 count=22
|
419
|
+
hello from callback! time=49 count=23
|
420
|
+
hello from callback! time=51 count=24
|
421
|
+
hello from callback! time=53 count=25
|
422
|
+
hello from callback! time=55 count=26
|
423
|
+
hello from callback! time=57 count=27
|
424
|
+
hello from callback! time=59 count=28
|
425
|
+
hello from callback! time=61 count=29
|
426
|
+
hello from callback! time=63 count=30
|
427
|
+
hello from callback! time=65 count=31
|
428
|
+
hello from callback! time=67 count=0
|
429
|
+
- should increment by one count upon each rising clock edge
|
430
|
+
|
431
|
+
A counter with the maximum value
|
432
|
+
hello from callback! time=71 count=1
|
433
|
+
hello from callback! time=73 count=2
|
434
|
+
hello from callback! time=75 count=3
|
435
|
+
hello from callback! time=77 count=4
|
436
|
+
hello from callback! time=79 count=5
|
437
|
+
hello from callback! time=81 count=6
|
438
|
+
hello from callback! time=83 count=7
|
439
|
+
hello from callback! time=85 count=8
|
440
|
+
hello from callback! time=87 count=9
|
441
|
+
hello from callback! time=89 count=10
|
442
|
+
hello from callback! time=91 count=11
|
443
|
+
hello from callback! time=93 count=12
|
444
|
+
hello from callback! time=95 count=13
|
445
|
+
hello from callback! time=97 count=14
|
446
|
+
hello from callback! time=99 count=15
|
447
|
+
hello from callback! time=101 count=16
|
448
|
+
hello from callback! time=103 count=17
|
449
|
+
hello from callback! time=105 count=18
|
450
|
+
hello from callback! time=107 count=19
|
451
|
+
hello from callback! time=109 count=20
|
452
|
+
hello from callback! time=111 count=21
|
453
|
+
hello from callback! time=113 count=22
|
454
|
+
hello from callback! time=115 count=23
|
455
|
+
hello from callback! time=117 count=24
|
456
|
+
hello from callback! time=119 count=25
|
457
|
+
hello from callback! time=121 count=26
|
458
|
+
hello from callback! time=123 count=27
|
459
|
+
hello from callback! time=125 count=28
|
460
|
+
hello from callback! time=127 count=29
|
461
|
+
hello from callback! time=129 count=30
|
462
|
+
hello from callback! time=131 count=31
|
463
|
+
hello from callback! time=133 count=0
|
464
|
+
- should overflow upon increment
|
465
|
+
|
466
|
+
Finished in 0.042328 seconds
|
467
|
+
|
468
|
+
3 specifications, 0 failures
|
469
|
+
</pre>
|
470
|
+
<% end %>
|
471
|
+
|
472
|
+
|
473
|
+
h2(#usage.debugger). Debugging
|
474
|
+
|
475
|
+
The "ruby-debug project":http://www.datanoise.com/articles/category/ruby-debug serves as the interactive debugger for Ruby-VPI.
|
476
|
+
|
477
|
+
# Enable the debugger by activating the @DEBUG@ environment variable (see <xref #usage.test-runner> for details).
|
478
|
+
# Put the @debugger@ command in your code -- anywhere you wish to activate an interactive debugging session. These commands are automatically ignored when the debugger is disabled; so you can safely leave them in your code, if you wish.
|
479
|
+
|
480
|
+
|
481
|
+
h3(#usage.debugger.init). Advanced initialization
|
482
|
+
|
483
|
+
By default, Ruby-VPI enables the debugger by invoking the @Debugger.start@ method. If you wish to perform more advanced initialization, such as having the debugger accept remote network connections for interfacing with a remote debugging session or perhaps with an IDE (see "the ruby-debug documentation":http://www.datanoise.com/articles/category/ruby-debug for details), then:
|
484
|
+
|
485
|
+
# Deactivate the @DEBUG@ environment variable.
|
486
|
+
# Put your own code, which initializes the debugger, above the @RubyVpi.init_bench@ line in your generated <tt>spec.rb</tt> file.
|
487
|
+
|
488
|
+
|
489
|
+
h2(#usage.test-runner). Test runner
|
490
|
+
|
491
|
+
A test runner is a file, generated by the "automated test generator":#usage.tools.generate-test, whose name ends with <tt>.rake</tt>. It helps you run generated tests -- you can think of it as a _makefile_ if you are familiar with C programming in a UNIX environment.
|
492
|
+
|
493
|
+
<% example "Seeing what a test runner can do" do %>
|
494
|
+
When you invoke a test runner without any arguments, it will show you a list of available tasks:
|
495
|
+
<pre>$ rake -f some_test_runner.rake
|
496
|
+
|
497
|
+
<%= `rake -f ../samp/counter/counter_rspec_runner.rake` %></pre>
|
498
|
+
<% end %>
|
499
|
+
|
500
|
+
<% tip "Running multiple tests at once." do %>
|
501
|
+
Create a file named <tt>Rakefile</tt> containing the following line.
|
502
|
+
|
503
|
+
bq. @require 'ruby-vpi/runner_proxy'@
|
504
|
+
|
505
|
+
Now you can invoke all test runners in the current directory simply by executing <pre>rake cver</pre> (where _cver_ denotes the "GPL Cver simulator":#setup.reqs).
|
506
|
+
<% end %>
|
507
|
+
|
508
|
+
|
509
|
+
h3(#usage.test-runner.env-vars). Environment variables
|
510
|
+
|
511
|
+
Test runners support the following _environment_ variables, which allow you to easily change the behavior of the test runner.
|
512
|
+
|
513
|
+
* @COVERAGE@ enables code coverage analysis and generation of code coverage reports.
|
514
|
+
* @DEBUG@ enables the "interactive debugger":#usage.debugger in its "post-mortem debugging mode":http://www.datanoise.com/articles/2006/12/20/post-mortem-debugging.
|
515
|
+
* @PROTOTYPE@ enables the Ruby prototype for the design under test.
|
516
|
+
|
517
|
+
To activate these variables, simply assign a non-empty value to them. For example, @DEBUG=1@ and @DEBUG=yes@ and @DEBUG=foo_bar_baz@ all activate the @DEBUG@ variable.
|
518
|
+
|
519
|
+
To deactivate these variables, simply assign an _empty_ value to them, *unset* them in your shell, or do not specify them as command-line arguments to rake. For example, both @DEBUG=@ dectivates the @DEBUG@ variable.
|
520
|
+
|
521
|
+
In addition, you can specify variable assignments as arguments to the *rake* command. For example, <pre>rake DEBUG=1</pre> is equivalent to <pre>
|
522
|
+
$ DEBUG=1
|
523
|
+
$ export DEBUG
|
524
|
+
$ rake
|
525
|
+
</pre> in Bourne shell or <pre>
|
526
|
+
% setenv DEBUG 1
|
527
|
+
% rake
|
528
|
+
</pre> in C shell.
|
529
|
+
|
530
|
+
<% example "Running a test with environment variables" do %>
|
531
|
+
|
532
|
+
Here we enable the prototype and code coverage analysis:
|
533
|
+
<pre>rake -f some_test_runner.rake PROTOTYPE=1 COVERAGE=1</pre>
|
534
|
+
|
535
|
+
Here we _disable_ the prototype and enable the code coverage analysis. Note that both of these invocations are equivalent:
|
536
|
+
<pre>rake -f some_test_runner.rake PROTOTYPE= COVERAGE=1</pre>
|
537
|
+
<pre>rake -f some_test_runner.rake COVERAGE=1</pre>
|
538
|
+
<% end %>
|
539
|
+
|
540
|
+
|
541
|
+
h2(#usage.examples). Sample tests
|
542
|
+
|
543
|
+
The <tt>samp</tt> directory contains several sample tests which illustrate how Ruby-VPI can be used. Each sample has an associated <tt>Rakefile</tt> which simplifies the process of running it. Therefore, simply navigate into an example directory and run the <pre>rake</pre> command to get started.
|
544
|
+
|
545
|
+
|
323
546
|
h2(#usage.tools). Tools
|
324
547
|
|
325
548
|
The <tt>bin</tt> directory contains various utilities which ease the process of writing tests. Each tool provides help and usage information invoked with the <tt>--help</tt> option.
|
@@ -586,80 +809,6 @@ Finished in 0.006766 seconds.
|
|
586
809
|
In these examples, the @PROTOTYPE@ environment variable is _not_ specified while running the test, so that our design, instead of our prototype, is verified against our specification. You can also achieve this effect by assigning an empty value to @PROTOTYPE@, or by using your shell's *unset* command. Finally, the "GPL Cver simulator":#setup.reqs, denoted by _cver_, is used to run the simulation.
|
587
810
|
|
588
811
|
|
589
|
-
h2(#usage.test-runner). Test runner
|
590
|
-
|
591
|
-
A test runner is a file, generated by the "automated test generator":#usage.tools.generate-test, whose name ends with <tt>.rake</tt>. It helps you run generated tests -- you can think of it as a _makefile_ if you are familiar with C programming in a UNIX environment.
|
592
|
-
|
593
|
-
<% example "Seeing what a test runner can do" do %>
|
594
|
-
When you invoke a test runner without any arguments, it will show you a list of available tasks:
|
595
|
-
<pre>$ rake -f some_test_runner.rake
|
596
|
-
|
597
|
-
<%= `rake -f ../samp/counter/counter_rspec_runner.rake` %></pre>
|
598
|
-
<% end %>
|
599
|
-
|
600
|
-
<% tip "Running multiple tests at once." do %>
|
601
|
-
Create a file named <tt>Rakefile</tt> containing the following line.
|
602
|
-
|
603
|
-
bq. @require 'ruby-vpi/runner_proxy'@
|
604
|
-
|
605
|
-
Now you can invoke all test runners in the current directory simply by executing <pre>rake cver</pre> (where _cver_ denotes the "GPL Cver simulator":#setup.reqs).
|
606
|
-
<% end %>
|
607
|
-
|
608
|
-
|
609
|
-
h3(#usage.test-runner.env-vars). Environment variables
|
610
|
-
|
611
|
-
Test runners support the following _environment_ variables, which allow you to easily change the behavior of the test runner.
|
612
|
-
|
613
|
-
* @COVERAGE@ enables code coverage analysis and generation of code coverage reports.
|
614
|
-
* @DEBUG@ enables the "interactive debugger":#usage.debugger in its "post-mortem debugging mode":http://www.datanoise.com/articles/2006/12/20/post-mortem-debugging.
|
615
|
-
* @PROTOTYPE@ enables the Ruby prototype for the design under test.
|
616
|
-
|
617
|
-
To activate these variables, simply assign a non-empty value to them. For example, @DEBUG=1@ and @DEBUG=yes@ and @DEBUG=foo_bar_baz@ all activate the @DEBUG@ variable.
|
618
|
-
|
619
|
-
To deactivate these variables, simply assign an _empty_ value to them, *unset* them in your shell, or do not specify them as command-line arguments to rake. For example, both @DEBUG=@ dectivates the @DEBUG@ variable.
|
620
|
-
|
621
|
-
In addition, you can specify variable assignments as arguments to the *rake* command. For example, <pre>rake DEBUG=1</pre> is equivalent to <pre>
|
622
|
-
$ DEBUG=1
|
623
|
-
$ export DEBUG
|
624
|
-
$ rake
|
625
|
-
</pre> in Bourne shell or <pre>
|
626
|
-
% setenv DEBUG 1
|
627
|
-
% rake
|
628
|
-
</pre> in C shell.
|
629
|
-
|
630
|
-
<% example "Running a test with environment variables" do %>
|
631
|
-
|
632
|
-
Here we enable the prototype and code coverage analysis:
|
633
|
-
<pre>rake -f some_test_runner.rake PROTOTYPE=1 COVERAGE=1</pre>
|
634
|
-
|
635
|
-
Here we _disable_ the prototype and enable the code coverage analysis. Note that both of these invocations are equivalent:
|
636
|
-
<pre>rake -f some_test_runner.rake PROTOTYPE= COVERAGE=1</pre>
|
637
|
-
<pre>rake -f some_test_runner.rake COVERAGE=1</pre>
|
638
|
-
<% end %>
|
639
|
-
|
640
|
-
|
641
|
-
h2(#usage.debugger). Interactive debugger
|
642
|
-
|
643
|
-
The "ruby-debug project":http://www.datanoise.com/articles/category/ruby-debug serves as the interactive debugger for Ruby-VPI.
|
644
|
-
|
645
|
-
# Enable the debugger by activating the @DEBUG@ environment variable (see <xref #usage.test-runner> for details).
|
646
|
-
# Put the @debugger@ command in your code -- anywhere you wish to activate an interactive debugging session. These commands are automatically ignored when the debugger is disabled; so you can safely leave them in your code, if you wish.
|
647
|
-
|
648
|
-
|
649
|
-
h3(#usage.debugger.init). Advanced initialization
|
650
|
-
|
651
|
-
By default, Ruby-VPI enables the debugger by invoking the @Debugger.start@ method. If you wish to perform more advanced initialization, such as having the debugger accept remote network connections for interfacing with a remote debugging session or perhaps with an IDE (see "the ruby-debug documentation":http://www.datanoise.com/articles/category/ruby-debug for details), then:
|
652
|
-
|
653
|
-
# Deactivate the @DEBUG@ environment variable.
|
654
|
-
# Put your own code, which initializes the debugger, above the @RubyVpi.init_bench@ line in your generated <tt>spec.rb</tt> file.
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
h2(#usage.examples). Sample tests
|
659
|
-
|
660
|
-
The <tt>samp</tt> directory contains several sample tests which illustrate how Ruby-VPI can be used. Each sample has an associated <tt>Rakefile</tt> which simplifies the process of running it. Therefore, simply navigate into an example directory and run the <pre>rake</pre> command to get started.
|
661
|
-
|
662
|
-
|
663
812
|
h1(#hacking). Hacking
|
664
813
|
|
665
814
|
h2(#hacking.release-packages). Building release packages
|