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.
Files changed (123) hide show
  1. data/Rakefile +6 -1
  2. data/bin/generate_test_tpl/bench.rb +84 -1
  3. data/bin/generate_test_tpl/bench.v +8 -17
  4. data/bin/generate_test_tpl/proto.rb +1 -1
  5. data/doc/common.css +14 -41
  6. data/doc/common.tpl +1 -1
  7. data/doc/figures/figures.dia +274 -753
  8. data/doc/figures/organization_detailed.png +0 -0
  9. data/doc/figures/ruby_relay.png +0 -0
  10. data/doc/history.html +363 -276
  11. data/doc/history.yml +40 -0
  12. data/doc/intro.inc +37 -15
  13. data/doc/lib/doc_proxy.rb +24 -4
  14. data/doc/manual.doc +345 -196
  15. data/doc/manual.html +741 -497
  16. data/doc/memo.doc +15 -15
  17. data/doc/memo.html +28 -27
  18. data/doc/readme.doc +2 -2
  19. data/doc/readme.html +51 -15
  20. data/doc/rss.erb +1 -1
  21. data/doc/rss.xml +1624 -31
  22. data/ext/Rakefile +1 -6
  23. data/ext/main.c +8 -3
  24. data/ext/main.h +5 -0
  25. data/ext/relay.c +12 -12
  26. data/ext/relay.h +1 -6
  27. data/ext/swig_vpi.i +2 -2
  28. data/ext/swig_wrap.cin +37 -20
  29. data/ext/verilog.h +2 -2
  30. data/ext/vlog.c +10 -3
  31. data/ext/vlog.h +4 -4
  32. data/lib/ruby-vpi/vpi.rb +114 -0
  33. data/lib/ruby-vpi.rb +21 -59
  34. data/ref/c/annotated.html +1 -1
  35. data/ref/c/common_8h.html +1 -1
  36. data/ref/c/files.html +1 -1
  37. data/ref/c/functions.html +1 -1
  38. data/ref/c/functions_vars.html +1 -1
  39. data/ref/c/globals.html +1 -1
  40. data/ref/c/globals_0x63.html +1 -1
  41. data/ref/c/globals_0x65.html +1 -1
  42. data/ref/c/globals_0x66.html +1 -1
  43. data/ref/c/globals_0x6d.html +3 -2
  44. data/ref/c/globals_0x70.html +1 -1
  45. data/ref/c/globals_0x72.html +4 -5
  46. data/ref/c/globals_0x73.html +1 -1
  47. data/ref/c/globals_0x74.html +1 -1
  48. data/ref/c/globals_0x76.html +4 -2
  49. data/ref/c/globals_0x78.html +1 -1
  50. data/ref/c/globals_defs.html +1 -1
  51. data/ref/c/globals_defs_0x65.html +1 -1
  52. data/ref/c/globals_defs_0x70.html +1 -1
  53. data/ref/c/globals_defs_0x76.html +1 -1
  54. data/ref/c/globals_defs_0x78.html +1 -1
  55. data/ref/c/globals_enum.html +1 -1
  56. data/ref/c/globals_eval.html +1 -1
  57. data/ref/c/globals_func.html +8 -7
  58. data/ref/c/globals_type.html +1 -1
  59. data/ref/c/globals_vars.html +3 -2
  60. data/ref/c/index.html +1 -1
  61. data/ref/c/main_8c.html +26 -1
  62. data/ref/c/main_8h.html +26 -1
  63. data/ref/c/relay_8c.html +11 -35
  64. data/ref/c/relay_8h.html +3 -27
  65. data/ref/c/structt__cb__data.html +1 -1
  66. data/ref/c/structt__vpi__delay.html +1 -1
  67. data/ref/c/structt__vpi__error__info.html +1 -1
  68. data/ref/c/structt__vpi__strengthval.html +1 -1
  69. data/ref/c/structt__vpi__systf__data.html +1 -1
  70. data/ref/c/structt__vpi__time.html +1 -1
  71. data/ref/c/structt__vpi__value.html +1 -1
  72. data/ref/c/structt__vpi__vecval.html +1 -1
  73. data/ref/c/structt__vpi__vlog__info.html +1 -1
  74. data/ref/c/verilog_8h.html +5 -5
  75. data/ref/c/vlog_8c.html +44 -6
  76. data/ref/c/vlog_8h.html +7 -8
  77. data/ref/c/vpi__user_8h.html +1 -1
  78. data/ref/ruby/classes/RDoc.html +5 -5
  79. data/ref/ruby/classes/RDoc.src/{M000041.html → M000045.html} +0 -0
  80. data/ref/ruby/classes/RubyVpi.html +10 -28
  81. data/ref/ruby/classes/RubyVpi.src/M000029.html +101 -124
  82. data/ref/ruby/classes/Vpi/Handle.html +56 -56
  83. data/ref/ruby/classes/Vpi/Handle.src/M000034.html +5 -9
  84. data/ref/ruby/classes/Vpi/Handle.src/M000035.html +5 -31
  85. data/ref/ruby/classes/Vpi/Handle.src/M000036.html +5 -74
  86. data/ref/ruby/classes/Vpi/Handle.src/M000037.html +5 -17
  87. data/ref/ruby/classes/Vpi/Handle.src/M000038.html +9 -11
  88. data/ref/ruby/classes/Vpi/Handle.src/M000039.html +44 -0
  89. data/ref/ruby/classes/Vpi/Handle.src/M000040.html +74 -55
  90. data/ref/ruby/classes/Vpi/Handle.src/M000041.html +30 -0
  91. data/ref/ruby/classes/Vpi/Handle.src/M000042.html +24 -0
  92. data/ref/ruby/classes/Vpi/Handle.src/M000044.html +68 -0
  93. data/ref/ruby/classes/Vpi.html +149 -0
  94. data/ref/ruby/classes/Vpi.src/M000030.html +28 -0
  95. data/ref/ruby/classes/Vpi.src/M000031.html +18 -0
  96. data/ref/ruby/classes/Vpi.src/M000032.html +39 -0
  97. data/ref/ruby/classes/Vpi.src/M000033.html +22 -0
  98. data/ref/ruby/created.rid +1 -1
  99. data/ref/ruby/files/lib/ruby-vpi/vpi_rb.html +1 -1
  100. data/ref/ruby/files/lib/ruby-vpi_rb.html +2 -2
  101. data/ref/ruby/fr_method_index.html +18 -14
  102. data/samp/counter/counter_rspec_bench.rb +81 -1
  103. data/samp/counter/counter_rspec_bench.v +5 -12
  104. data/samp/counter/counter_rspec_design.rb +1 -2
  105. data/samp/counter/counter_rspec_proto.rb +1 -1
  106. data/samp/counter/counter_rspec_spec.rb +3 -3
  107. data/samp/counter/counter_xunit_bench.rb +81 -1
  108. data/samp/counter/counter_xunit_bench.v +5 -12
  109. data/samp/counter/counter_xunit_design.rb +1 -2
  110. data/samp/counter/counter_xunit_proto.rb +1 -1
  111. data/samp/counter/counter_xunit_spec.rb +3 -3
  112. data/samp/pipelined_alu/hw5_unit_test_bench.rb +81 -1
  113. data/samp/pipelined_alu/hw5_unit_test_bench.v +11 -18
  114. data/samp/pipelined_alu/hw5_unit_test_design.rb +1 -1
  115. data/samp/pipelined_alu/hw5_unit_test_proto.rb +1 -1
  116. data/samp/pipelined_alu/hw5_unit_test_spec.rb +1 -1
  117. metadata +12 -9
  118. data/doc/figures/ruby_init.png +0 -0
  119. data/ext/swig_vpi.h +0 -924
  120. data/ref/ruby/classes/Vpi/Handle.src/M000030.html +0 -18
  121. data/ref/ruby/classes/Vpi/Handle.src/M000031.html +0 -18
  122. data/ref/ruby/classes/Vpi/Handle.src/M000032.html +0 -18
  123. data/ref/ruby/classes/Vpi/Handle.src/M000033.html +0 -18
@@ -76,6 +76,16 @@
76
76
 
77
77
  </div>
78
78
 
79
+ <div id="method-list">
80
+ <h3 class="section-bar">Methods</h3>
81
+
82
+ <div class="name-list">
83
+ <a href="#M000032">advance_time</a>&nbsp;&nbsp;
84
+ <a href="#M000031">simulate</a>&nbsp;&nbsp;
85
+ <a href="#M000033">simulation_time</a>&nbsp;&nbsp;
86
+ <a href="#M000030">vpi_register_cb</a>&nbsp;&nbsp;
87
+ </div>
88
+ </div>
79
89
 
80
90
  </div>
81
91
 
@@ -96,21 +106,160 @@
96
106
 
97
107
  <div class="name-list">
98
108
  <table summary="Constants">
109
+ <tr class="top-aligned-row context-row">
110
+ <td class="context-item-name">INTEGER_BITS</td>
111
+ <td>=</td>
112
+ <td class="context-item-value">32</td>
113
+ <td width="3em">&nbsp;</td>
114
+ <td class="context-item-desc">
115
+ Number of bits in PLI_INT32.
116
+
117
+ </td>
118
+ </tr>
119
+ <tr class="top-aligned-row context-row">
120
+ <td class="context-item-name">INTEGER_LIMIT</td>
121
+ <td>=</td>
122
+ <td class="context-item-value">2 ** INTEGER_BITS</td>
123
+ <td width="3em">&nbsp;</td>
124
+ <td class="context-item-desc">
125
+ Lowest upper bound of PLI_INT32.
126
+
127
+ </td>
128
+ </tr>
129
+ <tr class="top-aligned-row context-row">
130
+ <td class="context-item-name">INTEGER_MASK</td>
131
+ <td>=</td>
132
+ <td class="context-item-value">INTEGER_LIMIT - 1</td>
133
+ <td width="3em">&nbsp;</td>
134
+ <td class="context-item-desc">
135
+ Bit-mask capable of capturing PLI_INT32.
136
+
137
+ </td>
138
+ </tr>
99
139
  <tr class="top-aligned-row context-row">
100
140
  <td class="context-item-name">Handle</td>
101
141
  <td>=</td>
102
142
  <td class="context-item-value">SWIG::TYPE_p_unsigned_int</td>
143
+ <td width="3em">&nbsp;</td>
144
+ <td class="context-item-desc">
145
+ handles
146
+
147
+ </td>
103
148
  </tr>
104
149
  </table>
105
150
  </div>
106
151
  </div>
107
152
 
153
+ <div id="aliases-list">
154
+ <h3 class="section-bar">External Aliases</h3>
155
+
156
+ <div class="name-list">
157
+ <table summary="aliases">
158
+ <tr class="top-aligned-row context-row">
159
+ <td class="context-item-name">vpi_register_cb</td>
160
+ <td>-></td>
161
+ <td class="context-item-value">vpi_register_cb_old</td>
162
+ </tr>
163
+ <tr class="top-aligned-row context-row">
164
+ <td class="context-item-name">vpi_remove_cb</td>
165
+ <td>-></td>
166
+ <td class="context-item-value">vpi_remove_cb_old</td>
167
+ </tr>
168
+ </table>
169
+ </div>
170
+ </div>
108
171
 
109
172
 
110
173
 
111
174
 
112
175
 
113
176
  <!-- if method_list -->
177
+ <div id="methods">
178
+ <h3 class="section-bar">Public Instance methods</h3>
179
+
180
+ <div id="method-M000032" class="method-detail">
181
+ <a name="M000032"></a>
182
+
183
+ <div class="method-heading">
184
+ <a href="Vpi.src/M000032.html" target="Code" class="method-signature"
185
+ onclick="popupCode('Vpi.src/M000032.html');return false;">
186
+ <span class="method-name">advance_time</span><span class="method-args">(aNumSteps = 1)</span>
187
+ </a>
188
+ </div>
189
+
190
+ <div class="method-description">
191
+ <p>
192
+ Advances the simulation by the given number of steps.
193
+ </p>
194
+ </div>
195
+ </div>
196
+
197
+ <div id="method-M000031" class="method-detail">
198
+ <a name="M000031"></a>
199
+
200
+ <div class="method-heading">
201
+ <a href="Vpi.src/M000031.html" target="Code" class="method-signature"
202
+ onclick="popupCode('Vpi.src/M000031.html');return false;">
203
+ <span class="method-name">simulate</span><span class="method-args">()</span>
204
+ </a>
205
+ </div>
206
+
207
+ <div class="method-description">
208
+ <p>
209
+ Simulates the design under test according to <a
210
+ href="RubyVpi.html#M000029">RubyVpi.init_bench</a>.
211
+ </p>
212
+ </div>
213
+ </div>
214
+
215
+ <div id="method-M000033" class="method-detail">
216
+ <a name="M000033"></a>
217
+
218
+ <div class="method-heading">
219
+ <a href="Vpi.src/M000033.html" target="Code" class="method-signature"
220
+ onclick="popupCode('Vpi.src/M000033.html');return false;">
221
+ <span class="method-name">simulation_time</span><span class="method-args">()</span>
222
+ </a>
223
+ </div>
224
+
225
+ <div class="method-description">
226
+ <p>
227
+ Returns the current simulation time as a 64-bit integer.
228
+ </p>
229
+ </div>
230
+ </div>
231
+
232
+ <div id="method-M000030" class="method-detail">
233
+ <a name="M000030"></a>
234
+
235
+ <div class="method-heading">
236
+ <a href="Vpi.src/M000030.html" target="Code" class="method-signature"
237
+ onclick="popupCode('Vpi.src/M000030.html');return false;">
238
+ <span class="method-name">vpi_register_cb</span><span class="method-args">(aData {|Vpi::S_cb_data| ...}</span>
239
+ </a>
240
+ </div>
241
+
242
+ <div class="method-description">
243
+ <p>
244
+ This is a Ruby version of the <a
245
+ href="Vpi.html#M000030">vpi_register_cb</a> C function. It is identical to
246
+ the C function, except for the following differences:
247
+ </p>
248
+ <ul>
249
+ <li>This method accepts a block (callback handler) which is executed whenever
250
+ the callback occurs.
251
+
252
+ </li>
253
+ <li>This method overwrites the <tt>cb_rtn</tt> and <tt>user_data</tt> fields of
254
+ the given <tt>S_cb_data</tt> object.
255
+
256
+ </li>
257
+ </ul>
258
+ </div>
259
+ </div>
260
+
261
+
262
+ </div>
114
263
 
115
264
 
116
265
  </div>
@@ -0,0 +1,28 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>vpi_register_cb (Vpi)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 383</span>
14
+ 383: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">vpi_register_cb</span> <span class="ruby-identifier">aData</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">aHandler</span> <span class="ruby-comment cmt"># :yields: Vpi::S_cb_data</span>
15
+ 384: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;block must be given&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block_given?</span>
16
+ 385:
17
+ 386: <span class="ruby-identifier">key</span> = <span class="ruby-identifier">aHandler</span>.<span class="ruby-identifier">object_id</span>.<span class="ruby-identifier">to_s</span>
18
+ 387:
19
+ 388: <span class="ruby-comment cmt"># register the callback with Verilog</span>
20
+ 389: <span class="ruby-identifier">aData</span>.<span class="ruby-identifier">user_data</span> = <span class="ruby-identifier">key</span>
21
+ 390: <span class="ruby-identifier">aData</span>.<span class="ruby-identifier">cb_rtn</span> = <span class="ruby-constant">Vlog_relay_ruby</span>
22
+ 391: <span class="ruby-identifier">token</span> = <span class="ruby-identifier">vpi_register_cb_old</span>(<span class="ruby-identifier">aData</span>)
23
+ 392:
24
+ 393: <span class="ruby-ivar">@@callbacks</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-constant">Callback</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">aHandler</span>, <span class="ruby-identifier">token</span>)
25
+ 394: <span class="ruby-identifier">token</span>
26
+ 395: <span class="ruby-keyword kw">end</span></pre>
27
+ </body>
28
+ </html>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>simulate (Vpi)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 430</span>
14
+ 430: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">simulate</span>
15
+ 431: <span class="ruby-comment cmt"># this is a dummy method!</span>
16
+ 432: <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,39 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>advance_time (Vpi)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 435</span>
14
+ 435: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">advance_time</span> <span class="ruby-identifier">aNumSteps</span> = <span class="ruby-value">1</span>
15
+ 436: <span class="ruby-comment cmt"># schedule wake-up callback from verilog</span>
16
+ 437: <span class="ruby-identifier">time</span> = <span class="ruby-constant">S_vpi_time</span>.<span class="ruby-identifier">new</span>
17
+ 438: <span class="ruby-identifier">time</span>.<span class="ruby-identifier">low</span> = <span class="ruby-identifier">aNumSteps</span> <span class="ruby-operator">&amp;</span> <span class="ruby-constant">INTEGER_MASK</span>
18
+ 439: <span class="ruby-identifier">time</span>.<span class="ruby-identifier">high</span> = (<span class="ruby-identifier">aNumSteps</span> <span class="ruby-operator">&gt;&gt;</span> <span class="ruby-constant">INTEGER_BITS</span>) <span class="ruby-operator">&amp;</span> <span class="ruby-constant">INTEGER_MASK</span>
19
+ 440: <span class="ruby-identifier">time</span>.<span class="ruby-identifier">type</span> = <span class="ruby-constant">VpiSimTime</span>
20
+ 441:
21
+ 442: <span class="ruby-identifier">value</span> = <span class="ruby-constant">S_vpi_value</span>.<span class="ruby-identifier">new</span>
22
+ 443: <span class="ruby-identifier">value</span>.<span class="ruby-identifier">format</span> = <span class="ruby-constant">VpiSuppressVal</span>
23
+ 444:
24
+ 445: <span class="ruby-identifier">alarm</span> = <span class="ruby-constant">S_cb_data</span>.<span class="ruby-identifier">new</span>
25
+ 446: <span class="ruby-identifier">alarm</span>.<span class="ruby-identifier">reason</span> = <span class="ruby-constant">CbAfterDelay</span>
26
+ 447: <span class="ruby-identifier">alarm</span>.<span class="ruby-identifier">cb_rtn</span> = <span class="ruby-constant">Vlog_relay_ruby</span>
27
+ 448: <span class="ruby-identifier">alarm</span>.<span class="ruby-identifier">obj</span> = <span class="ruby-keyword kw">nil</span>
28
+ 449: <span class="ruby-identifier">alarm</span>.<span class="ruby-identifier">time</span> = <span class="ruby-identifier">time</span>
29
+ 450: <span class="ruby-identifier">alarm</span>.<span class="ruby-identifier">value</span> = <span class="ruby-identifier">value</span>
30
+ 451: <span class="ruby-identifier">alarm</span>.<span class="ruby-identifier">index</span> = <span class="ruby-value">0</span>
31
+ 452: <span class="ruby-identifier">alarm</span>.<span class="ruby-identifier">user_data</span> = <span class="ruby-keyword kw">nil</span>
32
+ 453:
33
+ 454: <span class="ruby-identifier">vpi_free_object</span>(<span class="ruby-identifier">vpi_register_cb_old</span>(<span class="ruby-identifier">alarm</span>))
34
+ 455:
35
+ 456: <span class="ruby-comment cmt"># relay to verilog</span>
36
+ 457: <span class="ruby-identifier">relay_verilog_proxy</span>
37
+ 458: <span class="ruby-keyword kw">end</span></pre>
38
+ </body>
39
+ </html>
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html>
7
+ <head>
8
+ <title>simulation_time (Vpi)</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
+ </head>
12
+ <body class="standalone-code">
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 464</span>
14
+ 464: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">simulation_time</span>
15
+ 465: <span class="ruby-identifier">t</span> = <span class="ruby-constant">S_vpi_time</span>.<span class="ruby-identifier">new</span>
16
+ 466: <span class="ruby-identifier">t</span>.<span class="ruby-identifier">type</span> = <span class="ruby-constant">VpiSimTime</span>
17
+ 467:
18
+ 468: <span class="ruby-identifier">vpi_get_time</span> <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">t</span>
19
+ 469: (<span class="ruby-identifier">t</span>.<span class="ruby-identifier">high</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">INTEGER_BITS</span>) <span class="ruby-operator">|</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">low</span>
20
+ 470: <span class="ruby-keyword kw">end</span></pre>
21
+ </body>
22
+ </html>
data/ref/ruby/created.rid CHANGED
@@ -1 +1 @@
1
- Wed Dec 27 22:29:46 PST 2006
1
+ Sat Dec 30 19:26:26 PST 2006
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Wed Dec 27 19:14:41 PST 2006</td>
59
+ <td>Fri Dec 29 15:08:37 PST 2006</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Wed Dec 27 22:02:52 PST 2006</td>
59
+ <td>Fri Dec 29 15:04:26 PST 2006</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -73,12 +73,12 @@
73
73
  <h3 class="section-bar">Required files</h3>
74
74
 
75
75
  <div class="name-list">
76
+ ruby-vpi/vpi&nbsp;&nbsp;
76
77
  ruby-vpi/rcov&nbsp;&nbsp;
77
78
  test/unit&nbsp;&nbsp;
78
79
  spec&nbsp;&nbsp;
79
80
  test/spec&nbsp;&nbsp;
80
81
  ruby-debug&nbsp;&nbsp;
81
- ruby-vpi/vpi&nbsp;&nbsp;
82
82
  </div>
83
83
  </div>
84
84
 
@@ -20,47 +20,51 @@
20
20
  <div id="index">
21
21
  <h1 class="section-bar">Methods</h1>
22
22
  <div id="index-entries">
23
- <a href="classes/Vpi/Handle.html#M000037">[] (Vpi::Handle)</a><br />
23
+ <a href="classes/Vpi/Handle.html#M000041">[] (Vpi::Handle)</a><br />
24
+ <a href="classes/Vpi.html#M000032">advance_time (Vpi)</a><br />
24
25
  <a href="classes/FileUtils.html#M000028">collect_args (FileUtils)</a><br />
25
26
  <a href="classes/Integer.html#M000017">ensure_max (Integer)</a><br />
26
27
  <a href="classes/Integer.html#M000016">ensure_min (Integer)</a><br />
27
28
  <a href="classes/Integer.html#M000020">extend_sign (Integer)</a><br />
28
- <a href="classes/Vpi/Handle.html#M000035">get_value (Vpi::Handle)</a><br />
29
- <a href="classes/Vpi/Handle.html#M000034">get_value_wrapper (Vpi::Handle)</a><br />
29
+ <a href="classes/Vpi/Handle.html#M000039">get_value (Vpi::Handle)</a><br />
30
+ <a href="classes/Vpi/Handle.html#M000038">get_value_wrapper (Vpi::Handle)</a><br />
30
31
  <a href="classes/RubyVpi.html#M000029">init_bench (RubyVpi)</a><br />
31
32
  <a href="classes/VerilogParser/Module/Port.html#M000004">input? (VerilogParser::Module::Port)</a><br />
32
- <a href="classes/Vpi/Handle.html#M000038">inspect (Vpi::Handle)</a><br />
33
+ <a href="classes/Vpi/Handle.html#M000042">inspect (Vpi::Handle)</a><br />
33
34
  <a href="classes/Integer.html#M000009">length (Integer)</a><br />
34
35
  <a href="classes/Integer.html#M000010">limit (Integer)</a><br />
35
36
  <a href="classes/Integer.html#M000008">log2 (Integer)</a><br />
36
37
  <a href="classes/Float.html#M000022">mantissa (Float)</a><br />
37
38
  <a href="classes/Integer.html#M000012">mask (Integer)</a><br />
38
39
  <a href="classes/Integer.html#M000014">max (Integer)</a><br />
39
- <a href="classes/Vpi/Handle.html#M000040">method_missing (Vpi::Handle)</a><br />
40
+ <a href="classes/Vpi/Handle.html#M000044">method_missing (Vpi::Handle)</a><br />
40
41
  <a href="classes/VerilogParser.html#M000001">new (VerilogParser)</a><br />
41
- <a href="classes/VerilogParser/Module/Port.html#M000003">new (VerilogParser::Module::Port)</a><br />
42
+ <a href="classes/ERB.html#M000026">new (ERB)</a><br />
42
43
  <a href="classes/VerilogParser/Module.html#M000002">new (VerilogParser::Module)</a><br />
43
44
  <a href="classes/VerilogParser/Module/Parameter.html#M000007">new (VerilogParser::Module::Parameter)</a><br />
44
- <a href="classes/ERB.html#M000026">new (ERB)</a><br />
45
+ <a href="classes/VerilogParser/Module/Port.html#M000003">new (VerilogParser::Module::Port)</a><br />
45
46
  <a href="classes/VerilogParser/Module/Port.html#M000005">output? (VerilogParser::Module::Port)</a><br />
46
47
  <a href="classes/Integer.html#M000018">pack (Integer)</a><br />
47
- <a href="classes/Vpi/Handle.html#M000036">put_value (Vpi::Handle)</a><br />
48
+ <a href="classes/Vpi/Handle.html#M000040">put_value (Vpi::Handle)</a><br />
48
49
  <a href="classes/VerilogParser/Module/Port.html#M000006">reg? (VerilogParser::Module::Port)</a><br />
49
50
  <a href="classes/FileUtils.html#M000027">sh (FileUtils)</a><br />
51
+ <a href="classes/Vpi.html#M000031">simulate (Vpi)</a><br />
52
+ <a href="classes/Vpi.html#M000033">simulation_time (Vpi)</a><br />
50
53
  <a href="classes/Integer.html#M000021">split (Integer)</a><br />
51
54
  <a href="classes/String.html#M000023">to_f (String)</a><br />
52
55
  <a href="classes/Integer.html#M000011">to_limit (Integer)</a><br />
53
56
  <a href="classes/Integer.html#M000013">to_mask (Integer)</a><br />
54
57
  <a href="classes/Integer.html#M000015">to_max (Integer)</a><br />
55
58
  <a href="classes/String.html#M000025">to_ruby_const_name (String)</a><br />
56
- <a href="classes/Vpi/Handle.html#M000039">to_s (Vpi::Handle)</a><br />
59
+ <a href="classes/Vpi/Handle.html#M000043">to_s (Vpi::Handle)</a><br />
57
60
  <a href="classes/Integer.html#M000019">unpack (Integer)</a><br />
58
- <a href="classes/RDoc.html#M000041">usage_from_file (RDoc)</a><br />
61
+ <a href="classes/RDoc.html#M000045">usage_from_file (RDoc)</a><br />
59
62
  <a href="classes/String.html#M000024">verilog_to_ruby (String)</a><br />
60
- <a href="classes/Vpi/Handle.html#M000031">x! (Vpi::Handle)</a><br />
61
- <a href="classes/Vpi/Handle.html#M000030">x? (Vpi::Handle)</a><br />
62
- <a href="classes/Vpi/Handle.html#M000033">z! (Vpi::Handle)</a><br />
63
- <a href="classes/Vpi/Handle.html#M000032">z? (Vpi::Handle)</a><br />
63
+ <a href="classes/Vpi.html#M000030">vpi_register_cb (Vpi)</a><br />
64
+ <a href="classes/Vpi/Handle.html#M000035">x! (Vpi::Handle)</a><br />
65
+ <a href="classes/Vpi/Handle.html#M000034">x? (Vpi::Handle)</a><br />
66
+ <a href="classes/Vpi/Handle.html#M000037">z! (Vpi::Handle)</a><br />
67
+ <a href="classes/Vpi/Handle.html#M000036">z? (Vpi::Handle)</a><br />
64
68
  </div>
65
69
  </div>
66
70
  </body>
@@ -3,4 +3,84 @@
3
3
  require 'rubygems'
4
4
  require 'ruby-vpi'
5
5
 
6
- RubyVpi.init_bench :Counter, :rSpec
6
+ RubyVpi.init_bench :Counter, :rSpec do
7
+ ##
8
+ # This block is executed whenever Vpi::simulate is invoked.
9
+ #
10
+ # It simulates the design under test. This is typically done
11
+ # by toggling the clock signal, as demonstrated below.
12
+ ##
13
+
14
+ ##
15
+ # We are currently here (marked by the ! signs):
16
+ #
17
+ # !
18
+ # !
19
+ # ! ____ ____ ____ ____
20
+ # ___!/ \____/ \____/ \____/ \
21
+ # !
22
+ # !
23
+ #
24
+ ##
25
+
26
+ Counter.clock.intVal = 1
27
+
28
+ ##
29
+ # After setting the clock signal to high, we are here:
30
+ #
31
+ # !
32
+ # !
33
+ # !____ ____ ____ ____
34
+ # ____/! \____/ \____/ \____/ \
35
+ # !
36
+ # !
37
+ #
38
+ ##
39
+
40
+ advance_time
41
+
42
+ ##
43
+ # After advancing the time, we are here:
44
+ #
45
+ # !
46
+ # !
47
+ # ____! ____ ____ ____
48
+ # ____/ !\____/ \____/ \____/ \
49
+ # !
50
+ # !
51
+ #
52
+ ##
53
+
54
+ Counter.clock.intVal = 0
55
+
56
+ ##
57
+ # After setting the clock signal to low, we are here:
58
+ #
59
+ # !
60
+ # !
61
+ # ____ ! ____ ____ ____
62
+ # ____/ \!____/ \____/ \____/ \
63
+ # !
64
+ # !
65
+ #
66
+ ##
67
+
68
+ advance_time
69
+
70
+ ##
71
+ # After advancing the time, we are here:
72
+ #
73
+ #
74
+ # !
75
+ # !
76
+ # ____ ! ____ ____ ____
77
+ # ____/ \____!/ \____/ \____/ \
78
+ # !
79
+ # !
80
+ #
81
+ ##
82
+
83
+ ##
84
+ # This process repeats when Vpi::simulate is invoked again.
85
+ ##
86
+ end
@@ -1,16 +1,9 @@
1
1
  // This file is the Verilog side of the bench.
2
2
  module counter_rspec_bench;
3
+ parameter Size = 5;
4
+ reg clock;
5
+ reg reset;
6
+ wire [Size - 1 : 0] count;
3
7
 
4
- // instantiate the design under test
5
- parameter Size = 5;
6
- reg clock;
7
- reg reset;
8
- wire [Size - 1 : 0] count;
9
-
10
- counter #(.Size(Size)) counter_rspec_bench_design(.clock(clock), .reset(reset), .count(count));
11
-
12
- // generate clock for the design under test
13
- initial clock = 0;
14
- always #5 clock = !clock;
15
-
8
+ counter #(.Size(Size)) counter_rspec_bench_design(.clock(clock), .reset(reset), .count(count));
16
9
  endmodule
@@ -2,8 +2,7 @@
2
2
 
3
3
  # This method resets the design under test.
4
4
  def Counter.reset!
5
- # assert the reset signal for two clock cycles
6
5
  reset.intVal = 1
7
- 2.times {relay_verilog}
6
+ simulate
8
7
  reset.intVal = 0
9
8
  end
@@ -1,6 +1,6 @@
1
1
  # This is a prototype of the design under test.
2
2
 
3
- # When prototyping is enabled, relay_verilog invokes this method
3
+ # When prototyping is enabled, Vpi::simulate invokes this method
4
4
  # instead of transferring control to the Verilog simulator.
5
5
  def Counter.simulate!
6
6
  if reset.intVal == 1
@@ -18,7 +18,7 @@ context "A resetted counter's value" do
18
18
  specify "should increment by one count upon each rising clock edge" do
19
19
  LIMIT.times do |i|
20
20
  Counter.count.intVal.should == i
21
- relay_verilog # increment the counter
21
+ simulate # increment the counter
22
22
  end
23
23
  end
24
24
  end
@@ -28,12 +28,12 @@ context "A counter with the maximum value" do
28
28
  Counter.reset!
29
29
 
30
30
  # increment the counter to maximum value
31
- MAX.times {relay_verilog}
31
+ MAX.times {simulate}
32
32
  Counter.count.intVal.should == MAX
33
33
  end
34
34
 
35
35
  specify "should overflow upon increment" do
36
- relay_verilog # increment the counter
36
+ simulate # increment the counter
37
37
  Counter.count.intVal.should == 0
38
38
  end
39
39
  end
@@ -3,4 +3,84 @@
3
3
  require 'rubygems'
4
4
  require 'ruby-vpi'
5
5
 
6
- RubyVpi.init_bench :Counter, :xUnit
6
+ RubyVpi.init_bench :Counter, :xUnit do
7
+ ##
8
+ # This block is executed whenever Vpi::simulate is invoked.
9
+ #
10
+ # It simulates the design under test. This is typically done
11
+ # by toggling the clock signal, as demonstrated below.
12
+ ##
13
+
14
+ ##
15
+ # We are currently here (marked by the ! signs):
16
+ #
17
+ # !
18
+ # !
19
+ # ! ____ ____ ____ ____
20
+ # ___!/ \____/ \____/ \____/ \
21
+ # !
22
+ # !
23
+ #
24
+ ##
25
+
26
+ Counter.clock.intVal = 1
27
+
28
+ ##
29
+ # After setting the clock signal to high, we are here:
30
+ #
31
+ # !
32
+ # !
33
+ # !____ ____ ____ ____
34
+ # ____/! \____/ \____/ \____/ \
35
+ # !
36
+ # !
37
+ #
38
+ ##
39
+
40
+ advance_time
41
+
42
+ ##
43
+ # After advancing the time, we are here:
44
+ #
45
+ # !
46
+ # !
47
+ # ____! ____ ____ ____
48
+ # ____/ !\____/ \____/ \____/ \
49
+ # !
50
+ # !
51
+ #
52
+ ##
53
+
54
+ Counter.clock.intVal = 0
55
+
56
+ ##
57
+ # After setting the clock signal to low, we are here:
58
+ #
59
+ # !
60
+ # !
61
+ # ____ ! ____ ____ ____
62
+ # ____/ \!____/ \____/ \____/ \
63
+ # !
64
+ # !
65
+ #
66
+ ##
67
+
68
+ advance_time
69
+
70
+ ##
71
+ # After advancing the time, we are here:
72
+ #
73
+ #
74
+ # !
75
+ # !
76
+ # ____ ! ____ ____ ____
77
+ # ____/ \____!/ \____/ \____/ \
78
+ # !
79
+ # !
80
+ #
81
+ ##
82
+
83
+ ##
84
+ # This process repeats when Vpi::simulate is invoked again.
85
+ ##
86
+ end