ruby-vpi 12.0.2 → 12.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (197) hide show
  1. data/README +1 -0
  2. data/Rakefile +3 -1
  3. data/doc/history.html +246 -185
  4. data/doc/history.yml +27 -0
  5. data/doc/manual.doc +65 -3
  6. data/doc/manual.html +127 -11
  7. data/doc/readme.html +1 -1
  8. data/doc/rss.xml +7 -0
  9. data/index.html +1 -0
  10. data/lib/ruby-vpi.rb +36 -11
  11. data/lib/ruby-vpi/rcov.rb +2 -2
  12. data/lib/ruby-vpi/rdoc.rb +1 -1
  13. data/ref/c/annotated.html +1 -1
  14. data/ref/c/common_8h.html +1 -1
  15. data/ref/c/files.html +1 -1
  16. data/ref/c/functions.html +1 -1
  17. data/ref/c/functions_vars.html +1 -1
  18. data/ref/c/globals.html +1 -1
  19. data/ref/c/globals_0x62.html +1 -1
  20. data/ref/c/globals_0x63.html +1 -1
  21. data/ref/c/globals_0x65.html +1 -1
  22. data/ref/c/globals_0x66.html +1 -1
  23. data/ref/c/globals_0x67.html +1 -1
  24. data/ref/c/globals_0x69.html +1 -1
  25. data/ref/c/globals_0x6c.html +1 -1
  26. data/ref/c/globals_0x6d.html +1 -1
  27. data/ref/c/globals_0x6e.html +1 -1
  28. data/ref/c/globals_0x70.html +1 -1
  29. data/ref/c/globals_0x72.html +1 -1
  30. data/ref/c/globals_0x73.html +1 -1
  31. data/ref/c/globals_0x74.html +1 -1
  32. data/ref/c/globals_0x75.html +1 -1
  33. data/ref/c/globals_0x76.html +1 -1
  34. data/ref/c/globals_0x78.html +1 -1
  35. data/ref/c/globals_defs.html +1 -1
  36. data/ref/c/globals_defs_0x65.html +1 -1
  37. data/ref/c/globals_defs_0x6c.html +1 -1
  38. data/ref/c/globals_defs_0x6e.html +1 -1
  39. data/ref/c/globals_defs_0x70.html +1 -1
  40. data/ref/c/globals_defs_0x72.html +1 -1
  41. data/ref/c/globals_defs_0x73.html +1 -1
  42. data/ref/c/globals_defs_0x75.html +1 -1
  43. data/ref/c/globals_defs_0x76.html +1 -1
  44. data/ref/c/globals_defs_0x78.html +1 -1
  45. data/ref/c/globals_enum.html +1 -1
  46. data/ref/c/globals_eval.html +1 -1
  47. data/ref/c/globals_func.html +1 -1
  48. data/ref/c/globals_func_0x66.html +1 -1
  49. data/ref/c/globals_func_0x67.html +1 -1
  50. data/ref/c/globals_func_0x69.html +1 -1
  51. data/ref/c/globals_func_0x70.html +1 -1
  52. data/ref/c/globals_func_0x72.html +1 -1
  53. data/ref/c/globals_func_0x73.html +1 -1
  54. data/ref/c/globals_func_0x76.html +1 -1
  55. data/ref/c/globals_type.html +1 -1
  56. data/ref/c/globals_vars.html +1 -1
  57. data/ref/c/index.html +1 -1
  58. data/ref/c/relay_8c.html +1 -1
  59. data/ref/c/relay_8h.html +1 -1
  60. data/ref/c/structrelay____RubyOptions____def.html +1 -1
  61. data/ref/c/structswig__cast__info.html +1 -1
  62. data/ref/c/structswig__class.html +1 -1
  63. data/ref/c/structswig__module__info.html +1 -1
  64. data/ref/c/structswig__type__info.html +1 -1
  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/swig_8c.html +1 -1
  75. data/ref/c/swig_8h.html +1 -1
  76. data/ref/c/swig__vpi_8h.html +1 -1
  77. data/ref/c/swig__wrap_8cin.html +1 -1
  78. data/ref/c/unions__vpi__value__value.html +1 -1
  79. data/ref/c/verilog_8h.html +1 -1
  80. data/ref/c/vlog_8c.html +1 -1
  81. data/ref/c/vlog_8h.html +1 -1
  82. data/ref/c/vpi__user_8h.html +1 -1
  83. data/ref/ruby/classes/ERB.html +5 -5
  84. data/ref/ruby/classes/ERB.src/{M000036.html → M000032.html} +0 -0
  85. data/ref/ruby/classes/FileUtils.html +10 -10
  86. data/ref/ruby/classes/FileUtils.src/{M000083.html → M000034.html} +0 -0
  87. data/ref/ruby/classes/FileUtils.src/{M000084.html → M000035.html} +0 -0
  88. data/ref/ruby/classes/Float.html +5 -5
  89. data/ref/ruby/classes/Float.src/{M000031.html → M000027.html} +0 -0
  90. data/ref/ruby/classes/OutputInfo.html +5 -5
  91. data/ref/ruby/classes/OutputInfo.src/{M000030.html → M000026.html} +0 -0
  92. data/ref/ruby/classes/RDoc.html +5 -5
  93. data/ref/ruby/classes/RDoc.src/{M000099.html → M000050.html} +0 -0
  94. data/ref/ruby/classes/RubyVpi.html +10 -10
  95. data/ref/ruby/classes/RubyVpi.src/M000036.html +107 -0
  96. data/ref/ruby/classes/RubyVpi.src/{M000086.html → M000037.html} +0 -0
  97. data/ref/ruby/classes/String.html +15 -15
  98. data/ref/ruby/classes/String.src/{M000033.html → M000029.html} +0 -0
  99. data/ref/ruby/classes/String.src/{M000034.html → M000030.html} +0 -0
  100. data/ref/ruby/classes/String.src/{M000035.html → M000031.html} +0 -0
  101. data/ref/ruby/classes/Template.html +5 -5
  102. data/ref/ruby/classes/Template.src/{M000032.html → M000028.html} +0 -0
  103. data/ref/ruby/classes/Vpi/Handle.html +56 -56
  104. data/ref/ruby/classes/Vpi/Handle.src/{M000087.html → M000038.html} +0 -0
  105. data/ref/ruby/classes/Vpi/Handle.src/{M000088.html → M000039.html} +0 -0
  106. data/ref/ruby/classes/Vpi/Handle.src/{M000089.html → M000040.html} +0 -0
  107. data/ref/ruby/classes/Vpi/Handle.src/{M000090.html → M000041.html} +0 -0
  108. data/ref/ruby/classes/Vpi/Handle.src/{M000091.html → M000042.html} +0 -0
  109. data/ref/ruby/classes/Vpi/Handle.src/{M000092.html → M000043.html} +0 -0
  110. data/ref/ruby/classes/Vpi/Handle.src/{M000093.html → M000044.html} +0 -0
  111. data/ref/ruby/classes/Vpi/Handle.src/{M000094.html → M000045.html} +0 -0
  112. data/ref/ruby/classes/Vpi/Handle.src/{M000095.html → M000046.html} +0 -0
  113. data/ref/ruby/classes/Vpi/Handle.src/{M000097.html → M000048.html} +0 -0
  114. data/ref/ruby/classes/Vpi/Handle/Property.html +5 -5
  115. data/ref/ruby/classes/Vpi/Handle/Property.src/{M000098.html → M000049.html} +0 -0
  116. data/ref/ruby/classes/XX.html +1 -28
  117. data/ref/ruby/classes/XX/XMLish.html +6 -6
  118. data/ref/ruby/classes/XX/XMLish.src/{M000044.html → M000033.html} +0 -0
  119. data/ref/ruby/created.rid +1 -1
  120. data/ref/ruby/files/lib/ruby-vpi/rcov_rb.html +2 -2
  121. data/ref/ruby/files/lib/ruby-vpi/rdoc_rb.html +1 -1
  122. data/ref/ruby/files/lib/ruby-vpi/runner_proxy_rb.html +1 -1
  123. data/ref/ruby/files/lib/ruby-vpi/runner_rb.html +1 -1
  124. data/ref/ruby/files/lib/ruby-vpi/vpi_rb.html +1 -1
  125. data/ref/ruby/files/lib/ruby-vpi_rb.html +4 -3
  126. data/ref/ruby/fr_class_index.html +0 -13
  127. data/ref/ruby/fr_file_index.html +0 -2
  128. data/ref/ruby/fr_method_index.html +27 -76
  129. data/samp/pipelined_alu/hw5_unit_test_design.rb +0 -10
  130. metadata +50 -112
  131. data/lib/ruby-vpi/rspec.rb +0 -37
  132. data/lib/ruby-vpi/xx.rb +0 -761
  133. data/ref/ruby/classes/RubyVpi.src/M000085.html +0 -82
  134. data/ref/ruby/classes/Table.html +0 -191
  135. data/ref/ruby/classes/Table.src/M000026.html +0 -38
  136. data/ref/ruby/classes/Table.src/M000027.html +0 -18
  137. data/ref/ruby/classes/Table.src/M000028.html +0 -18
  138. data/ref/ruby/classes/Table.src/M000029.html +0 -18
  139. data/ref/ruby/classes/XX/Document.html +0 -295
  140. data/ref/ruby/classes/XX/Document.src/M000074.html +0 -22
  141. data/ref/ruby/classes/XX/Document.src/M000075.html +0 -20
  142. data/ref/ruby/classes/XX/Document.src/M000076.html +0 -20
  143. data/ref/ruby/classes/XX/Document.src/M000077.html +0 -20
  144. data/ref/ruby/classes/XX/Document.src/M000078.html +0 -22
  145. data/ref/ruby/classes/XX/Document.src/M000079.html +0 -21
  146. data/ref/ruby/classes/XX/Document.src/M000080.html +0 -21
  147. data/ref/ruby/classes/XX/Document.src/M000081.html +0 -34
  148. data/ref/ruby/classes/XX/Document.src/M000082.html +0 -98
  149. data/ref/ruby/classes/XX/HTML4.html +0 -145
  150. data/ref/ruby/classes/XX/HTML4.src/M000038.html +0 -20
  151. data/ref/ruby/classes/XX/HTML4/Strict.html +0 -138
  152. data/ref/ruby/classes/XX/HTML4/Strict.src/M000040.html +0 -20
  153. data/ref/ruby/classes/XX/HTML4/Transitional.html +0 -138
  154. data/ref/ruby/classes/XX/HTML4/Transitional.src/M000039.html +0 -20
  155. data/ref/ruby/classes/XX/Markup.html +0 -160
  156. data/ref/ruby/classes/XX/Markup.src/M000045.html +0 -28
  157. data/ref/ruby/classes/XX/Markup/ClassMethods.html +0 -236
  158. data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000046.html +0 -22
  159. data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000047.html +0 -20
  160. data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000048.html +0 -25
  161. data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000049.html +0 -20
  162. data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000050.html +0 -27
  163. data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000051.html +0 -20
  164. data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000052.html +0 -27
  165. data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000053.html +0 -22
  166. data/ref/ruby/classes/XX/Markup/Error.html +0 -111
  167. data/ref/ruby/classes/XX/Markup/InstanceMethods.html +0 -474
  168. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000054.html +0 -56
  169. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000055.html +0 -33
  170. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000056.html +0 -31
  171. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000057.html +0 -48
  172. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000058.html +0 -20
  173. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000059.html +0 -31
  174. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000060.html +0 -32
  175. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000061.html +0 -32
  176. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000062.html +0 -28
  177. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000063.html +0 -23
  178. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000064.html +0 -26
  179. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000065.html +0 -20
  180. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000066.html +0 -20
  181. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000067.html +0 -20
  182. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000068.html +0 -20
  183. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000069.html +0 -20
  184. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000070.html +0 -21
  185. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000071.html +0 -20
  186. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000072.html +0 -20
  187. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000073.html +0 -20
  188. data/ref/ruby/classes/XX/XHTML.html +0 -145
  189. data/ref/ruby/classes/XX/XHTML.src/M000041.html +0 -36
  190. data/ref/ruby/classes/XX/XHTML/Strict.html +0 -138
  191. data/ref/ruby/classes/XX/XHTML/Strict.src/M000043.html +0 -20
  192. data/ref/ruby/classes/XX/XHTML/Transitional.html +0 -138
  193. data/ref/ruby/classes/XX/XHTML/Transitional.src/M000042.html +0 -20
  194. data/ref/ruby/classes/XX/XML.html +0 -138
  195. data/ref/ruby/classes/XX/XML.src/M000037.html +0 -20
  196. data/ref/ruby/files/lib/ruby-vpi/rspec_rb.html +0 -115
  197. data/ref/ruby/files/lib/ruby-vpi/xx_rb.html +0 -148
@@ -1,3 +1,30 @@
1
+ -
2
+ Version: 12.1.0
3
+
4
+ Date: 2006-12-22
5
+
6
+ Summary: |
7
+ This release adds interactive debugging support, adds new sections to the user manual, and cleanses some internals.
8
+
9
+ Notice: |
10
+ * The <tt>lib/ruby-vpi/rspec.rb</tt> and <tt>lib/ruby-vpi/xx.rb</tt> files has been removed because they are no longer necessary.
11
+
12
+ * rSpec 0.7.0 or newer is now required because the sample tests utilize the @should ==@ syntax -- which was introduced in rSpec 0.7.0.
13
+
14
+ Detail: |
15
+ * Test runners now support the @DEBUG@ environment variable, which enables the interactive debugger (ruby-debug) in "post-mortem debugging mode":http://www.datanoise.com/articles/2006/12/20/post-mortem-debugging.
16
+ ** The @debugger@ can now be used when @DEBUG@ environment variable is not activated.
17
+ ** ruby-debug is now a gem dependency for Ruby-VPI.
18
+
19
+ * Status messages, which are shown during initialization of a Ruby bench, now appear in simulators' log files.
20
+
21
+ * Added documentation about "test runners":manual.html#usage.test-runner and the "interactive debugger":manual.html#usage.debugger in the user manual.
22
+
23
+ * Added a <tt>README</tt> file with hint about where to find the user manual.
24
+
25
+ * Removed code that wasn't being used, according to code coverage analysis, from the pipelined ALU sample.
26
+
27
+
1
28
  -
2
29
  Version: 12.0.2
3
30
 
@@ -242,6 +242,7 @@ The following software is necessary in order to use Ruby-VPI.
242
242
  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
243
  <% end %>
244
244
 
245
+
245
246
  * *make*
246
247
  - any distribution should be acceptable.
247
248
 
@@ -275,7 +276,7 @@ An _interactive_ text merging tool can greatly simplify the process of transferr
275
276
 
276
277
  h2(#setup.installation). Installation
277
278
 
278
- Once you have satisfied the "necessary requirements":#setup.reqs, you can install Ruby-VPI by running the <pre>gem install ruby-vpi</pre> command. RubyGems will install Ruby-VPI into the system gem directory, whose path can be determined by running the <pre>gem env gemdir</pre> command. Within this directory, there is a "gems" subdirectory which contains the Ruby-VPI installation, as illustrated below.
279
+ Once you have satisfied the "necessary requirements":#setup.reqs, you can install Ruby-VPI by running the <pre>gem install -y ruby-vpi</pre> command. RubyGems will install Ruby-VPI into the system gem directory, whose path can be determined by running the <pre>gem env gemdir</pre> command. Within this directory, there is a <tt>gems/</tt> subdirectory which contains the Ruby-VPI installation, as illustrated below.
279
280
 
280
281
  <pre>
281
282
  $ gem env gemdir
@@ -584,6 +585,18 @@ Finished in 0.006766 seconds.
584
585
 
585
586
  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.
586
587
 
588
+
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
+
587
600
  <% tip "Running multiple tests at once." do %>
588
601
  Create a file named <tt>Rakefile</tt> containing the following line.
589
602
 
@@ -593,9 +606,58 @@ Now you can invoke all test runners in the current directory simply by executing
593
606
  <% end %>
594
607
 
595
608
 
596
- h2(#usage.examples). Examples
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
597
659
 
598
- The <tt>samp</tt> directory contains several example tests which illustrate how Ruby-VPI can be used. Each example 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.
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.
599
661
 
600
662
 
601
663
  h1(#hacking). Hacking
@@ -90,7 +90,17 @@
90
90
  <li><a href="#usage.tutorial.test-design">Verify the design</a></li>
91
91
  </ul>
92
92
  </li>
93
- <li><a href="#usage.examples">Examples</a></li>
93
+ <li><a href="#usage.test-runner">Test runner</a>
94
+ <ul>
95
+ <li><a href="#usage.test-runner.env-vars">Environment variables</a></li>
96
+ </ul>
97
+ </li>
98
+ <li><a href="#usage.debugger">Interactive debugger</a>
99
+ <ul>
100
+ <li><a href="#usage.debugger.init">Advanced initialization</a></li>
101
+ </ul>
102
+ </li>
103
+ <li><a href="#usage.examples">Sample tests</a></li>
94
104
  </ul>
95
105
  </li>
96
106
  <li><a href="#hacking">Hacking</a>
@@ -194,6 +204,8 @@
194
204
  <li><a href="#fig..counter.v_impl">Implementation of a simple up-counter with synchronous reset</a></li>
195
205
  <li><a href="#fig..test-design.rspec">Running a test with specification in rSpec format</a></li>
196
206
  <li><a href="#fig..test-design.unit-test">Running a test with specification in xUnit format</a></li>
207
+ <li><a href="#example13">Seeing what a test runner can do</a></li>
208
+ <li><a href="#example14">Running a test with environment variables</a></li>
197
209
  <li><a href="#ex..TestFoo">Part of a bench which instantiates a Verilog design</a></li>
198
210
  <li><a href="#ex..TestFoo_bad">Bad design with unconnected registers</a></li>
199
211
  <li><a href="#ex..TestFoo_fix">Fixed design with wired registers</a></li>
@@ -207,7 +219,7 @@
207
219
  <p>Suraj N. Kurapati</p>
208
220
 
209
221
 
210
- <p>Mon Dec 18 15:23:49 <span class="caps">PST 2006</span></p>
222
+ <p>Fri Dec 22 21:43:06 <span class="caps">PST 2006</span></p>
211
223
 
212
224
 
213
225
  </div>
@@ -1000,7 +1012,7 @@ In <a href="#fig..organization.detail">the figure named &ldquo;Detailed organiza
1000
1012
  <li><tt>ext</tt> contains source code, written in the C language, for the <a href="#background.org">core of Ruby-VPI</a>.</li>
1001
1013
  <li><tt>lib</tt> contains Ruby libraries provided by Ruby-VPI.</li>
1002
1014
  <li><tt>bin</tt> contains various tools. See <a href="#usage.tools">the section named &ldquo;Tools&rdquo;</a> for more information.</li>
1003
- <li><tt>samp</tt> contains example tests. See <a href="#usage.examples">the section named &ldquo;Examples&rdquo;</a> for more information.</li>
1015
+ <li><tt>samp</tt> contains example tests. See <a href="#usage.examples">the section named &ldquo;Sample tests&rdquo;</a> for more information.</li>
1004
1016
  </ul>
1005
1017
 
1006
1018
 
@@ -1042,8 +1054,12 @@ In <a href="#fig..organization.detail">the figure named &ldquo;Detailed organiza
1042
1054
  </div>
1043
1055
 
1044
1056
  </div>
1045
- * <strong>make</strong>
1046
- &#8211; any distribution should be acceptable.
1057
+
1058
+ <ul>
1059
+ <li><strong>make</strong>
1060
+ &#8211; any distribution should be acceptable.</li>
1061
+ </ul>
1062
+
1047
1063
 
1048
1064
  <ul>
1049
1065
  <li>C compiler
@@ -1091,7 +1107,7 @@ An <em>interactive</em> text merging tool can greatly simplify the process of tr
1091
1107
  <h2 id="setup.installation">Installation</h2>
1092
1108
 
1093
1109
 
1094
- <p>Once you have satisfied the <a href="#setup.reqs">necessary requirements</a>, you can install Ruby-VPI by running the <pre>gem install ruby-vpi</pre> command. RubyGems will install Ruby-VPI into the system gem directory, whose path can be determined by running the <pre>gem env gemdir</pre> command. Within this directory, there is a &#8220;gems&#8221; subdirectory which contains the Ruby-VPI installation, as illustrated below.</p>
1110
+ <p>Once you have satisfied the <a href="#setup.reqs">necessary requirements</a>, you can install Ruby-VPI by running the <pre>gem install -y ruby-vpi</pre> command. RubyGems will install Ruby-VPI into the system gem directory, whose path can be determined by running the <pre>gem env gemdir</pre> command. Within this directory, there is a <tt>gems/</tt> subdirectory which contains the Ruby-VPI installation, as illustrated below.</p>
1095
1111
 
1096
1112
 
1097
1113
  <pre>
@@ -1763,6 +1779,35 @@ Finished in 0.006766 seconds.
1763
1779
  </div>
1764
1780
  In these examples, the <code class="code"><span style="color:#036; font-weight:bold">PROTOTYPE</span></code> environment variable is <em>not</em> 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 <code class="code"><span style="color:#036; font-weight:bold">PROTOTYPE</span></code>, or by using your shell&#8217;s <strong>unset</strong> command. Finally, the <a href="#setup.reqs"><span class="caps">GPL</span> Cver simulator</a>, denoted by <em>cver</em>, is used to run the simulation.
1765
1781
 
1782
+ <h2 id="usage.test-runner">Test runner</h2>
1783
+
1784
+
1785
+ <p>A test runner is a file, generated by the <a href="#usage.tools.generate-test">automated test generator</a>, whose name ends with <tt>.rake</tt>. It helps you run generated tests&#8212;you can think of it as a <em>makefile</em> if you are familiar with C programming in a <span class="caps">UNIX</span> environment.</p>
1786
+
1787
+
1788
+ <div class="formal">
1789
+
1790
+ <div class="example" id="example13">
1791
+
1792
+ <p class="title">Example 13. Seeing what a test runner can do</p>
1793
+
1794
+
1795
+ When you invoke a test runner without any arguments, it will show you a list of available tasks:
1796
+ <pre>$ rake -f some_test_runner.rake
1797
+
1798
+ (in /home/sun/src/ruby-vpi/doc)
1799
+ rake clean # Remove any temporary products.
1800
+ rake clobber # Remove any generated file.
1801
+ rake cver # Simulate with GPL Cver.
1802
+ rake default # Show a list of available tasks.
1803
+ rake ivl # Simulate with Icarus Verilog.
1804
+ rake vcs # Simulate with Synopsys VCS.
1805
+ rake vsim # Simulate with Mentor Modelsim.
1806
+ </pre>
1807
+
1808
+ </div>
1809
+
1810
+ </div>
1766
1811
  <div class="admonition">
1767
1812
 
1768
1813
  <div class="tip" id="tip4">
@@ -1788,10 +1833,81 @@ In these examples, the <code class="code"><span style="color:#036; font-weight:b
1788
1833
 
1789
1834
  </div>
1790
1835
 
1791
- <h2 id="usage.examples">Examples</h2>
1836
+ <h3 id="usage.test-runner.env-vars">Environment variables</h3>
1837
+
1838
+
1839
+ <p>Test runners support the following <em>environment</em> variables, which allow you to easily change the behavior of the test runner.</p>
1840
+
1841
+
1842
+ <ul>
1843
+ <li><code class="code"><span style="color:#036; font-weight:bold">COVERAGE</span></code> enables code coverage analysis and generation of code coverage reports.</li>
1844
+ <li><code class="code"><span style="color:#036; font-weight:bold">DEBUG</span></code> enables the <a href="#usage.debugger">interactive debugger</a> in its <a href="http://www.datanoise.com/articles/2006/12/20/post-mortem-debugging">post-mortem debugging mode</a>.</li>
1845
+ <li><code class="code"><span style="color:#036; font-weight:bold">PROTOTYPE</span></code> enables the Ruby prototype for the design under test.</li>
1846
+ </ul>
1847
+
1848
+
1849
+ <p>To activate these variables, simply assign a non-empty value to them. For example, <code class="code"><span style="color:#036; font-weight:bold">DEBUG</span>=<span style="color:#00D; font-weight:bold">1</span></code> and <code class="code"><span style="color:#036; font-weight:bold">DEBUG</span>=yes</code> and <code class="code"><span style="color:#036; font-weight:bold">DEBUG</span>=foo_bar_baz</code> all activate the <code class="code"><span style="color:#036; font-weight:bold">DEBUG</span></code> variable.</p>
1850
+
1851
+
1852
+ <p>To deactivate these variables, simply assign an <em>empty</em> value to them, <strong>unset</strong> them in your shell, or do not specify them as command-line arguments to rake. For example, both <code class="code"><span style="color:#036; font-weight:bold">DEBUG</span>=</code> dectivates the <code class="code"><span style="color:#036; font-weight:bold">DEBUG</span></code> variable.</p>
1853
+
1854
+
1855
+ <p>In addition, you can specify variable assignments as arguments to the <strong>rake</strong> command. For example, <pre>rake DEBUG=1</pre> is equivalent to <pre>
1856
+ $ DEBUG=1
1857
+ $ export DEBUG
1858
+ $ rake
1859
+ </pre> in Bourne shell or <pre>
1860
+ % setenv DEBUG 1
1861
+ % rake
1862
+ </pre> in C shell.</p>
1863
+
1864
+
1865
+ <div class="formal">
1866
+
1867
+ <div class="example" id="example14">
1868
+
1869
+ <p class="title">Example 14. Running a test with environment variables</p>
1870
+
1871
+
1872
+ Here we enable the prototype and code coverage analysis:
1873
+ <pre>rake -f some_test_runner.rake PROTOTYPE=1 COVERAGE=1</pre>
1874
+
1875
+ Here we <em>disable</em> the prototype and enable the code coverage analysis. Note that both of these invocations are equivalent:
1876
+ <pre>rake -f some_test_runner.rake PROTOTYPE= COVERAGE=1</pre>
1877
+ <pre>rake -f some_test_runner.rake COVERAGE=1</pre>
1878
+
1879
+ </div>
1880
+
1881
+ </div>
1882
+
1883
+ <h2 id="usage.debugger">Interactive debugger</h2>
1884
+
1885
+
1886
+ <p>The <a href="http://www.datanoise.com/articles/category/ruby-debug">ruby-debug project</a> serves as the interactive debugger for Ruby-VPI.</p>
1887
+
1888
+
1889
+ <ol>
1890
+ <li>Enable the debugger by activating the <code class="code"><span style="color:#036; font-weight:bold">DEBUG</span></code> environment variable (see <a href="#usage.test-runner">the section named &ldquo;Test runner&rdquo;</a> for details).</li>
1891
+ <li>Put the <code class="code">debugger</code> command in your code&#8212;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.</li>
1892
+ </ol>
1893
+
1894
+
1895
+ <h3 id="usage.debugger.init">Advanced initialization</h3>
1896
+
1897
+
1898
+ <p>By default, Ruby-VPI enables the debugger by invoking the <code class="code"><span style="color:#036; font-weight:bold">Debugger</span>.start</code> 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 <span class="caps">IDE</span> (see <a href="http://www.datanoise.com/articles/category/ruby-debug">the ruby-debug documentation</a> for details), then:</p>
1899
+
1900
+
1901
+ <ol>
1902
+ <li>Deactivate the <code class="code"><span style="color:#036; font-weight:bold">DEBUG</span></code> environment variable.</li>
1903
+ <li>Put your own code, which initializes the debugger, above the <code class="code"><span style="color:#036; font-weight:bold">RubyVpi</span>.init_bench</code> line in your generated <tt>spec.rb</tt> file.</li>
1904
+ </ol>
1905
+
1906
+
1907
+ <h2 id="usage.examples">Sample tests</h2>
1792
1908
 
1793
1909
 
1794
- <p>The <tt>samp</tt> directory contains several example tests which illustrate how Ruby-VPI can be used. Each example 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.</p>
1910
+ <p>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.</p>
1795
1911
 
1796
1912
 
1797
1913
  <h1 id="hacking">Hacking</h1>
@@ -1883,7 +1999,7 @@ If your specification employs Ruby&#8217;s unit testing framework, then you will
1883
1999
 
1884
2000
  <div class="example" id="ex..TestFoo">
1885
2001
 
1886
- <p class="title">Example 13. Part of a bench which instantiates a Verilog design</p>
2002
+ <p class="title">Example 15. Part of a bench which instantiates a Verilog design</p>
1887
2003
 
1888
2004
 
1889
2005
  <pre class="code" lang="verilog">
@@ -1913,7 +2029,7 @@ endmodule
1913
2029
 
1914
2030
  <div class="example" id="ex..TestFoo_bad">
1915
2031
 
1916
- <p class="title">Example 14. Bad design with unconnected registers</p>
2032
+ <p class="title">Example 16. Bad design with unconnected registers</p>
1917
2033
 
1918
2034
 
1919
2035
  <pre class="code" lang="verilog">
@@ -1932,7 +2048,7 @@ endmodule
1932
2048
 
1933
2049
  <div class="example" id="ex..TestFoo_fix">
1934
2050
 
1935
- <p class="title">Example 15. Fixed design with wired registers</p>
2051
+ <p class="title">Example 17. Fixed design with wired registers</p>
1936
2052
 
1937
2053
 
1938
2054
  <pre class="code" lang="verilog">
@@ -65,7 +65,7 @@
65
65
 
66
66
  </div>
67
67
 
68
- <h1 id="anchor105">Welcome to Ruby-VPI
68
+ <h1 id="anchor108">Welcome to Ruby-VPI
69
69
  <a type="application/rss+xml" href="http://ruby-vpi.rubyforge.org/doc/rss.xml"><img src="images/feed-icon.png" title="RSS feed for this project." alt="RSS feed for this project." /></a></h1>
70
70
 
71
71
 
@@ -4,6 +4,13 @@
4
4
  <title>Ruby-VPI</title>
5
5
  <link>http://ruby-vpi.rubyforge.org</link>
6
6
  <description>Ruby-VPI is a Ruby interface to IEEE 1364-2005 Verilog VPI. It lets you create complex Verilog test benches easily and wholly in Ruby.</description>
7
+ <item>
8
+ <title>Version 12.1.0 released</title>
9
+ <link>http://ruby-vpi.rubyforge.org/doc/history.html#12.1.0</link>
10
+ <guid>http://ruby-vpi.rubyforge.org/doc/history.html#12.1.0</guid>
11
+ <description>&lt;p&gt;This release adds interactive debugging support, adds new sections to the user manual, and cleanses some internals.&lt;/p&gt;</description>
12
+ <pubDate>Fri, 22 Dec 2006 00:00:00 PST</pubDate>
13
+ </item>
7
14
  <item>
8
15
  <title>Version 12.0.2 released</title>
9
16
  <link>http://ruby-vpi.rubyforge.org/doc/history.html#12.0.2</link>
data/index.html CHANGED
@@ -1 +1,2 @@
1
1
  <META HTTP-EQUIV=REFRESH CONTENT="0; URL=./doc/readme.html">
2
+ This page will redirect you to: <tt>./doc/readme.html</tt>.
@@ -33,18 +33,15 @@ module RubyVpi
33
33
  raise 'Unable to determine name of test.'
34
34
  end
35
35
 
36
- # set up the VPI utility layer
37
- require 'ruby-vpi/vpi'
38
-
39
- Object.class_eval do
40
- include Vpi
41
- end
36
+ useDebugger = !(ENV['DEBUG'] || '').empty?
37
+ useCoverage = !(ENV['COVERAGE'] || '').empty?
38
+ usePrototype = !(ENV['PROTOTYPE'] || '').empty?
42
39
 
43
40
  # service the $ruby_init() task
44
- relay_verilog
41
+ Vpi::relay_verilog
45
42
 
46
43
  # set up code coverage analysis
47
- unless (ENV['COVERAGE'] || '').empty?
44
+ if useCoverage
48
45
  require 'ruby-vpi/rcov'
49
46
 
50
47
  RubyVpi.with_coverage_analysis do |a|
@@ -53,6 +50,8 @@ module RubyVpi
53
50
  Rcov::HTMLCoverage.new(:destdir => "#{testName}_coverage")
54
51
  ]
55
52
  end
53
+
54
+ Vpi::vpi_printf "#{Config::PROJECT_NAME}: coverage analysis is enabled for test #{testName.inspect}\n"
56
55
  end
57
56
 
58
57
  # set up the specification library
@@ -62,13 +61,39 @@ module RubyVpi
62
61
 
63
62
  when :rSpec
64
63
  ARGV.concat %w[-f s]
65
- require 'ruby-vpi/rspec'
64
+ require 'spec'
66
65
 
67
66
  when :tSpec
68
67
  ARGV << '-rs'
69
68
  require 'test/spec'
70
69
  end
71
70
 
71
+ # set up the interactive debugger
72
+ if useDebugger
73
+ require 'ruby-debug'
74
+
75
+ Debugger.start
76
+ Debugger.post_mortem
77
+
78
+ Vpi::vpi_printf "#{Config::PROJECT_NAME}: debugger is enabled for test #{testName.inspect}\n"
79
+ end
80
+
81
+ # suppress undefined method errors when debugger is not enabled
82
+ unless Kernel.respond_to? :debugger
83
+ Kernel.class_eval do
84
+ define_method :debugger do
85
+ # this is a dummy method!
86
+ end
87
+ end
88
+ end
89
+
90
+ # set up the VPI utility layer
91
+ require 'ruby-vpi/vpi'
92
+
93
+ Object.class_eval do
94
+ include Vpi
95
+ end
96
+
72
97
  # load the design under test
73
98
  unless design = vpi_handle_by_name("#{testName}_bench", nil)
74
99
  raise "Verilog bench for test #{testName.inspect} is inaccessible."
@@ -78,7 +103,7 @@ module RubyVpi
78
103
  require "#{testName}_design.rb"
79
104
 
80
105
  # load the design's prototype
81
- unless (ENV['PROTOTYPE'] || '').empty?
106
+ if usePrototype
82
107
  require "#{testName}_proto.rb"
83
108
 
84
109
  Vpi.class_eval do
@@ -87,7 +112,7 @@ module RubyVpi
87
112
  end
88
113
  end
89
114
 
90
- puts "#{Config::PROJECT_NAME}: prototype has been enabled for test #{testName.inspect}"
115
+ Vpi::vpi_printf "#{Config::PROJECT_NAME}: prototype is enabled for test #{testName.inspect}\n"
91
116
  end
92
117
 
93
118
  # load the design's specification