ruby-vpi 7.3.0 → 8.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (243) hide show
  1. data/HEADER +19 -4
  2. data/HISTORY +34 -1
  3. data/MEMO +2 -2
  4. data/README +14 -1
  5. data/Rakefile +39 -66
  6. data/bin/generate_test.rb +5 -23
  7. data/bin/generate_test_tpl/bench.rb +1 -1
  8. data/bin/generate_test_tpl/bench.v +2 -2
  9. data/bin/generate_test_tpl/proto.rb +8 -3
  10. data/bin/header_to_ruby.rb +3 -3
  11. data/doc/Rakefile +9 -26
  12. data/doc/{xhtml/background.html → background.html} +1 -1
  13. data/doc/{xhtml/background.methodology.html → background.methodology.html} +1 -1
  14. data/doc/{xhtml/background.organization.html → background.organization.html} +1 -1
  15. data/doc/{xhtml/background.running-tests.html → background.running-tests.html} +0 -0
  16. data/doc/{xhtml/background.terminology.html → background.terminology.html} +0 -0
  17. data/doc/{src/figures → figures}/organization.png +0 -0
  18. data/doc/{src/figures → figures}/organization_detailed.png +0 -0
  19. data/doc/{src/figures → figures}/ruby_init.png +0 -0
  20. data/doc/{src/figures → figures}/ruby_relay.png +0 -0
  21. data/doc/{xhtml/gfdl-0.html → gfdl-0.html} +0 -0
  22. data/doc/{xhtml/gfdl-1.html → gfdl-1.html} +0 -0
  23. data/doc/{xhtml/gfdl-10.html → gfdl-10.html} +0 -0
  24. data/doc/{xhtml/gfdl-2.html → gfdl-2.html} +0 -0
  25. data/doc/{xhtml/gfdl-3.html → gfdl-3.html} +0 -0
  26. data/doc/{xhtml/gfdl-4.html → gfdl-4.html} +0 -0
  27. data/doc/{xhtml/gfdl-5.html → gfdl-5.html} +0 -0
  28. data/doc/{xhtml/gfdl-6.html → gfdl-6.html} +0 -0
  29. data/doc/{xhtml/gfdl-7.html → gfdl-7.html} +0 -0
  30. data/doc/{xhtml/gfdl-8.html → gfdl-8.html} +0 -0
  31. data/doc/{xhtml/gfdl-9.html → gfdl-9.html} +0 -0
  32. data/doc/{xhtml/gfdl-addendum.html → gfdl-addendum.html} +0 -0
  33. data/doc/{xhtml/gfdl.html → gfdl.html} +0 -0
  34. data/doc/glossary.html +3 -0
  35. data/doc/{src/images → images}/COPYING +0 -0
  36. data/doc/{src/images → images}/ChangeLog +0 -0
  37. data/doc/{src/images → images}/blank.png +0 -0
  38. data/doc/{src/images → images}/callouts/1.png +0 -0
  39. data/doc/{src/images → images}/callouts/10.png +0 -0
  40. data/doc/{src/images → images}/callouts/11.png +0 -0
  41. data/doc/{src/images → images}/callouts/12.png +0 -0
  42. data/doc/{src/images → images}/callouts/13.png +0 -0
  43. data/doc/{src/images → images}/callouts/14.png +0 -0
  44. data/doc/{src/images → images}/callouts/15.png +0 -0
  45. data/doc/{src/images → images}/callouts/2.png +0 -0
  46. data/doc/{src/images → images}/callouts/3.png +0 -0
  47. data/doc/{src/images → images}/callouts/4.png +0 -0
  48. data/doc/{src/images → images}/callouts/5.png +0 -0
  49. data/doc/{src/images → images}/callouts/6.png +0 -0
  50. data/doc/{src/images → images}/callouts/7.png +0 -0
  51. data/doc/{src/images → images}/callouts/8.png +0 -0
  52. data/doc/{src/images → images}/callouts/9.png +0 -0
  53. data/doc/{src/images → images}/callouts/ChangeLog +0 -0
  54. data/doc/{src/images → images}/caution.png +0 -0
  55. data/doc/{src/images → images}/caution.svg +0 -0
  56. data/doc/{src/images → images}/copyright +0 -0
  57. data/doc/{src/images → images}/draft.png +0 -0
  58. data/doc/{src/images → images}/home.png +0 -0
  59. data/doc/{src/images → images}/home.svg +0 -0
  60. data/doc/{src/images → images}/important.png +0 -0
  61. data/doc/{src/images → images}/important.svg +0 -0
  62. data/doc/{src/images → images}/next.png +0 -0
  63. data/doc/{src/images → images}/next.svg +0 -0
  64. data/doc/{src/images → images}/note.png +0 -0
  65. data/doc/{src/images → images}/note.svg +0 -0
  66. data/doc/{src/images → images}/prev.png +0 -0
  67. data/doc/{src/images → images}/prev.svg +0 -0
  68. data/doc/{src/images → images}/tip.png +0 -0
  69. data/doc/{src/images → images}/tip.svg +0 -0
  70. data/doc/{src/images → images}/toc-blank.png +0 -0
  71. data/doc/{src/images → images}/toc-minus.png +0 -0
  72. data/doc/{src/images → images}/toc-plus.png +0 -0
  73. data/doc/{src/images → images}/up.png +0 -0
  74. data/doc/{src/images → images}/up.svg +0 -0
  75. data/doc/{src/images → images}/warning.png +0 -0
  76. data/doc/{src/images → images}/warning.svg +0 -0
  77. data/doc/{xhtml/index.html → index.html} +2 -2
  78. data/doc/{xhtml/introduction.html → introduction.html} +0 -0
  79. data/doc/{xhtml/introduction.license.html → introduction.license.html} +0 -0
  80. data/doc/{xhtml/introduction.manifest.html → introduction.manifest.html} +1 -1
  81. data/doc/{xhtml/introduction.related-works.html → introduction.related-works.html} +0 -0
  82. data/doc/{xhtml/introduction.resources.html → introduction.resources.html} +1 -1
  83. data/doc/{txt/manual.txt → manual.txt} +50 -49
  84. data/doc/{xhtml/problem.ivl.html → problem.ivl.html} +0 -0
  85. data/doc/{xhtml/problems.html → problems.html} +0 -0
  86. data/doc/{xhtml/problems.ruby.html → problems.ruby.html} +0 -0
  87. data/doc/{xhtml/problems.vsim.html → problems.vsim.html} +0 -0
  88. data/doc/src/manual.xml +53 -39
  89. data/doc/src/shared.dtd +1 -2
  90. data/doc/{xhtml/styles → styles}/manual.css +6 -10
  91. data/doc/{xhtml/usage.examples.html → usage.examples.html} +0 -0
  92. data/doc/{xhtml/usage.html → usage.html} +0 -0
  93. data/doc/{xhtml/usage.installation.html → usage.installation.html} +0 -0
  94. data/doc/{xhtml/usage.requirements.html → usage.requirements.html} +0 -0
  95. data/doc/{xhtml/usage.tools.html → usage.tools.html} +0 -0
  96. data/doc/{xhtml/usage.tutorial.html → usage.tutorial.html} +14 -18
  97. data/gem_extconf.rb +1 -1
  98. data/header.html +18 -4
  99. data/header.part.html +18 -4
  100. data/history.html +87 -5
  101. data/history.part.html +69 -1
  102. data/lib/ruby-vpi.rb +5 -5
  103. data/lib/ruby-vpi/rcov.rb +2 -2
  104. data/lib/ruby-vpi/runner.rb +4 -7
  105. data/lib/ruby-vpi/vpi_util.rb +2 -2
  106. data/memo.html +23 -9
  107. data/memo.part.html +5 -5
  108. data/readme.html +40 -5
  109. data/readme.part.html +22 -1
  110. data/ref/c/annotated.html +1 -1
  111. data/ref/c/common_8h.html +1 -1
  112. data/ref/c/files.html +1 -1
  113. data/ref/c/functions.html +1 -1
  114. data/ref/c/functions_vars.html +1 -1
  115. data/ref/c/globals.html +1 -1
  116. data/ref/c/globals_0x63.html +1 -1
  117. data/ref/c/globals_0x65.html +1 -1
  118. data/ref/c/globals_0x66.html +1 -1
  119. data/ref/c/globals_0x70.html +1 -1
  120. data/ref/c/globals_0x72.html +1 -1
  121. data/ref/c/globals_0x73.html +1 -1
  122. data/ref/c/globals_0x74.html +1 -1
  123. data/ref/c/globals_0x76.html +1 -1
  124. data/ref/c/globals_0x78.html +1 -1
  125. data/ref/c/globals_defs.html +1 -1
  126. data/ref/c/globals_defs_0x65.html +1 -1
  127. data/ref/c/globals_defs_0x70.html +1 -1
  128. data/ref/c/globals_defs_0x76.html +1 -1
  129. data/ref/c/globals_defs_0x78.html +1 -1
  130. data/ref/c/globals_enum.html +1 -1
  131. data/ref/c/globals_eval.html +1 -1
  132. data/ref/c/globals_func.html +1 -1
  133. data/ref/c/globals_type.html +1 -1
  134. data/ref/c/globals_vars.html +1 -1
  135. data/ref/c/hierarchy.html +1 -1
  136. data/ref/c/index.html +1 -1
  137. data/ref/c/relay_8cin.html +1 -1
  138. data/ref/c/relay_8hin.html +1 -1
  139. data/ref/c/ruby-vpi_8c.html +1 -1
  140. data/ref/c/structrelay____RubyOptions____def.html +1 -1
  141. data/ref/c/structt__cb__data.html +1 -1
  142. data/ref/c/structt__vpi__delay.html +1 -1
  143. data/ref/c/structt__vpi__error__info.html +1 -1
  144. data/ref/c/structt__vpi__strengthval.html +1 -1
  145. data/ref/c/structt__vpi__systf__data.html +1 -1
  146. data/ref/c/structt__vpi__time.html +1 -1
  147. data/ref/c/structt__vpi__value.html +1 -1
  148. data/ref/c/structt__vpi__vecval.html +1 -1
  149. data/ref/c/structt__vpi__vlog__info.html +1 -1
  150. data/ref/c/swig_8cin.html +1 -1
  151. data/ref/c/swig_8hin.html +1 -1
  152. data/ref/c/verilog_8h.html +1 -1
  153. data/ref/c/vlog_8cin.html +1 -1
  154. data/ref/c/vlog_8hin.html +1 -1
  155. data/ref/c/vpi__user_8h.html +1 -1
  156. data/ref/ruby/classes/OutputInfo.src/M000014.html +36 -36
  157. data/ref/ruby/classes/{RubyVPI.html → RubyVpi.html} +6 -6
  158. data/ref/ruby/classes/{RubyVPI.src → RubyVpi.src}/M000075.html +5 -5
  159. data/ref/ruby/classes/{RubyVPI.src → RubyVpi.src}/M000076.html +2 -2
  160. data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000070.html +2 -2
  161. data/ref/ruby/classes/Template.src/M000015.html +4 -4
  162. data/ref/ruby/classes/XX.html +4 -4
  163. data/ref/ruby/classes/XX/XHTML.html +5 -5
  164. data/ref/ruby/classes/XX/XHTML.src/{M000024.html → M000023.html} +0 -0
  165. data/ref/ruby/classes/XX/XHTML/Strict.html +5 -5
  166. data/ref/ruby/classes/XX/XHTML/Strict.src/{M000026.html → M000025.html} +0 -0
  167. data/ref/ruby/classes/XX/XHTML/Transitional.html +5 -5
  168. data/ref/ruby/classes/XX/XHTML/Transitional.src/{M000025.html → M000024.html} +0 -0
  169. data/ref/ruby/classes/XX/XMLish.html +5 -5
  170. data/ref/ruby/classes/XX/XMLish.src/{M000023.html → M000026.html} +0 -0
  171. data/ref/ruby/created.rid +1 -1
  172. data/ref/ruby/files/bin/generate_test_rb.html +7 -39
  173. data/ref/ruby/files/bin/generate_test_rb.src/M000001.html +15 -15
  174. data/ref/ruby/files/bin/header_to_ruby_rb.html +12 -4
  175. data/ref/ruby/files/lib/ruby-vpi/erb_rb.html +1 -1
  176. data/ref/ruby/files/lib/ruby-vpi/rake_rb.html +1 -1
  177. data/ref/ruby/files/lib/ruby-vpi/rcov_rb.html +1 -1
  178. data/ref/ruby/files/lib/ruby-vpi/rdoc_rb.html +1 -1
  179. data/ref/ruby/files/lib/ruby-vpi/rspec_rb.html +1 -1
  180. data/ref/ruby/files/lib/ruby-vpi/runner_proxy_rb.html +1 -1
  181. data/ref/ruby/files/lib/ruby-vpi/runner_rb.html +2 -7
  182. data/ref/ruby/files/lib/ruby-vpi/runner_rb.src/M000002.html +6 -6
  183. data/ref/ruby/files/lib/ruby-vpi/verilog_parser_rb.html +1 -1
  184. data/ref/ruby/files/lib/ruby-vpi/vpi_util_rb.html +1 -1
  185. data/ref/ruby/files/lib/ruby-vpi/xx_rb.html +1 -1
  186. data/ref/ruby/files/lib/ruby-vpi_rb.html +1 -1
  187. data/ref/ruby/fr_class_index.html +1 -1
  188. data/ref/ruby/fr_method_index.html +10 -10
  189. data/samp/counter/counter_rspecTest_bench.rb +1 -1
  190. data/samp/counter/counter_rspecTest_proto.rb +1 -1
  191. data/samp/counter/counter_unitTest_bench.rb +1 -1
  192. data/samp/counter/counter_unitTest_proto.rb +1 -1
  193. data/samp/pipelined_alu/hw5_unit_test_bench.rb +1 -1
  194. data/samp/pipelined_alu/hw5_unit_test_proto.rb +1 -1
  195. metadata +183 -237
  196. data/doc/src/styles/manual.css +0 -87
  197. data/doc/xhtml/figures/organization.png +0 -0
  198. data/doc/xhtml/figures/organization_detailed.png +0 -0
  199. data/doc/xhtml/figures/ruby_init.png +0 -0
  200. data/doc/xhtml/figures/ruby_relay.png +0 -0
  201. data/doc/xhtml/glossary.html +0 -3
  202. data/doc/xhtml/images/COPYING +0 -67
  203. data/doc/xhtml/images/ChangeLog +0 -27
  204. data/doc/xhtml/images/blank.png +0 -0
  205. data/doc/xhtml/images/callouts/1.png +0 -0
  206. data/doc/xhtml/images/callouts/10.png +0 -0
  207. data/doc/xhtml/images/callouts/11.png +0 -0
  208. data/doc/xhtml/images/callouts/12.png +0 -0
  209. data/doc/xhtml/images/callouts/13.png +0 -0
  210. data/doc/xhtml/images/callouts/14.png +0 -0
  211. data/doc/xhtml/images/callouts/15.png +0 -0
  212. data/doc/xhtml/images/callouts/2.png +0 -0
  213. data/doc/xhtml/images/callouts/3.png +0 -0
  214. data/doc/xhtml/images/callouts/4.png +0 -0
  215. data/doc/xhtml/images/callouts/5.png +0 -0
  216. data/doc/xhtml/images/callouts/6.png +0 -0
  217. data/doc/xhtml/images/callouts/7.png +0 -0
  218. data/doc/xhtml/images/callouts/8.png +0 -0
  219. data/doc/xhtml/images/callouts/9.png +0 -0
  220. data/doc/xhtml/images/callouts/ChangeLog +0 -15
  221. data/doc/xhtml/images/caution.png +0 -0
  222. data/doc/xhtml/images/caution.svg +0 -290
  223. data/doc/xhtml/images/copyright +0 -55
  224. data/doc/xhtml/images/draft.png +0 -0
  225. data/doc/xhtml/images/home.png +0 -0
  226. data/doc/xhtml/images/home.svg +0 -386
  227. data/doc/xhtml/images/important.png +0 -0
  228. data/doc/xhtml/images/important.svg +0 -163
  229. data/doc/xhtml/images/next.png +0 -0
  230. data/doc/xhtml/images/next.svg +0 -191
  231. data/doc/xhtml/images/note.png +0 -0
  232. data/doc/xhtml/images/note.svg +0 -483
  233. data/doc/xhtml/images/prev.png +0 -0
  234. data/doc/xhtml/images/prev.svg +0 -852
  235. data/doc/xhtml/images/tip.png +0 -0
  236. data/doc/xhtml/images/tip.svg +0 -1145
  237. data/doc/xhtml/images/toc-blank.png +0 -0
  238. data/doc/xhtml/images/toc-minus.png +0 -0
  239. data/doc/xhtml/images/toc-plus.png +0 -0
  240. data/doc/xhtml/images/up.png +0 -0
  241. data/doc/xhtml/images/up.svg +0 -195
  242. data/doc/xhtml/images/warning.png +0 -0
  243. data/doc/xhtml/images/warning.svg +0 -334
data/doc/src/manual.xml CHANGED
@@ -10,7 +10,7 @@
10
10
  the file named "LICENSE".
11
11
 
12
12
  Source code formatting rules:
13
- is a reserved keyword
13
+ <token> is a reserved keyword
14
14
  <type> is structure, class, variable type, etc.
15
15
  <varname> is a variable name
16
16
  <function> is function or method name
@@ -33,16 +33,17 @@
33
33
  <para>This problem was fixed in release 2.0.0 (2006-04-17). If it still occurs, then <link linkend='introduction.resources'>please report it</link>.</para>
34
34
  </note>">
35
35
 
36
- <!ENTITY test-bench.gloss "<glossterm linkend='term..test-bench'>test bench</glossterm>">
37
- <!ENTITY test.gloss "<glossterm linkend='term..test'>test</glossterm>">
38
- <!ENTITY design.gloss "<glossterm linkend='term..design'>design</glossterm>">
39
- <!ENTITY specification.gloss "<glossterm linkend='term..specification'>specification</glossterm>">
40
- <!ENTITY bench.gloss "<glossterm linkend='term..bench'>bench</glossterm>">
41
- <!ENTITY BDD.gloss "<glossterm linkend='term..BDD'>BDD</glossterm>">
42
- <!ENTITY TDD.gloss "<glossterm linkend='term..TDD'>TDD</glossterm>">
43
- <!ENTITY rspec.gloss "<glossterm linkend='term..rspec'>&rspec;</glossterm>">
44
- <!ENTITY rake.gloss "<glossterm linkend='term..rake'>&rake;</glossterm>">
45
- <!ENTITY handle.gloss "<glossterm linkend='term..handle'>handle</glossterm>">
36
+ <!ENTITY test-bench.gloss "<xref linkend='term..test-bench'/>">
37
+ <!ENTITY test.gloss "<xref linkend='term..test'/>">
38
+ <!ENTITY design.gloss "<xref linkend='term..design'/>">
39
+ <!ENTITY specification.gloss "<xref linkend='term..specification'/>">
40
+ <!ENTITY bench.gloss "<xref linkend='term..bench'/>">
41
+ <!ENTITY BDD.gloss "<xref linkend='term..BDD'/>">
42
+ <!ENTITY TDD.gloss "<xref linkend='term..TDD'/>">
43
+ <!ENTITY rspec.gloss "<xref linkend='term..rspec'/>">
44
+ <!ENTITY rake.gloss "<xref linkend='term..rake'/>">
45
+ <!ENTITY handle.gloss "<xref linkend='term..handle'/>">
46
+ <!ENTITY expectation.gloss "<xref linkend='term..expectation'/>">
46
47
 
47
48
  <!ENTITY rake "Rake">
48
49
  <!ENTITY rake.url "http://rake.rubyforge.org/">
@@ -121,7 +122,7 @@
121
122
  <varlistentry>
122
123
  <term><filename>lib</filename></term>
123
124
  <listitem>
124
- <para>This directory contains libraries, written in the Ruby language, for use by specifications.</para>
125
+ <para>This directory contains Ruby libraries provided by &rv;.</para>
125
126
  </listitem>
126
127
  </varlistentry>
127
128
 
@@ -153,7 +154,7 @@
153
154
  </varlistentry>
154
155
 
155
156
  <varlistentry>
156
- <term><ulink url="&rv.url-project;">Tracker</ulink></term>
157
+ <term><ulink url="&rv.url-tracker;">Tracker</ulink></term>
157
158
  <listitem>
158
159
  <para>Report problems, contribute patches, and more.</para>
159
160
  </listitem>
@@ -918,6 +919,7 @@
918
919
 
919
920
  <section id="usage.examples">
920
921
  <title>Examples</title>
922
+
921
923
  <para>The <filename>samp</filename> directory contains several example tests which illustrate how &rv; can be used. Each example has an associated <filename>Rakefile</filename> which simplifies the process of running it. Therefore, simply navigate into an example directory and run the command <command>rake</command> to get started.</para>
922
924
 
923
925
  <para>Also, some example specifications make use of BDD through the <application>RSpec</application> library. See the <xref linkend="background.methodology"/> for a discussion of <application>RSpec</application>.</para>
@@ -961,7 +963,7 @@
961
963
  <section id="usage.tutorial.declare-design">
962
964
  <title>Start with a design</title>
963
965
 
964
- <para>First, we need a design to verify. In this tutorial, <xref linkend="fig..counter.v_decl"/> will serve as our design. Its interface is composed of the following parts:
966
+ <para>First, we need a &design.gloss; to verify. In this tutorial, <xref linkend="fig..counter.v_decl"/> will serve as our design. Its interface is composed of the following parts:
965
967
  <variablelist>
966
968
  <varlistentry>
967
969
  <term><constant>Size</constant></term>
@@ -1003,10 +1005,10 @@
1003
1005
  <section id="usage.tutorial.generate-test">
1004
1006
  <title>Generate a test</title>
1005
1007
 
1006
- <para>Now that we have a design to verify, let us generate a test for it using the automated test generator tool. This tool allows us to implement our specification in either &rspec;, unit test, or our very own format. Each format represents a different software development methodology: &rspec; represents &BDD.gloss;, unit testing represents &TDD.gloss;, and our own format can represent another methodology.</para>
1008
+ <para>Now that we have a &design.gloss; to verify, let us generate a &test.gloss; for it using the automated test generator tool. This tool allows us to implement our &specification.gloss; in either &rspec;, unit test, or our very own format. Each format represents a different software development methodology: &rspec; represents &BDD.gloss;, unit testing represents &TDD.gloss;, and our own format can represent another methodology.</para>
1007
1009
 
1008
1010
  <note>
1009
- <para>In this tutorial, we will see how to implement our specification in both &rspec; and unit test formats.</para>
1011
+ <para>In this tutorial, you will see how specifications are implemented in <emphasis>both</emphasis> &rspec; and unit test formats.</para>
1010
1012
  </note>
1011
1013
 
1012
1014
  <para>Once we have decided how we want to implement our specification, we can proceed to generate a test for our design. <xref linkend="fig..generate-test.rspec"/> and <xref linkend="fig..generate-test.unit-test"/> illustrate this process. Here, the test generation tool produces a test composed of the following parts:
@@ -1044,7 +1046,7 @@
1044
1046
  </variablelist>
1045
1047
  </para>
1046
1048
 
1047
- <para>The reason for dividing a single test into these parts is mainly to decouple the design from the specification. This allows you to focus on writing the specification while the remainder is automatically generated by the tool. For example, when the interface of a &v; module changes, you would simply re-run this tool to incorporate those changes into the test without diverting your focus from the specification.</para>
1049
+ <para>The reason for dividing a single test into these parts is mainly to decouple the design from the specification. This allows you to focus on writing the specification while the remainder is automatically generated by the tool. For example, when the interface of a &v; module changes, you would simply re-run this tool and incorporate those changes (with the help of a smart merging tool, <ulink url="http://kdiff3.sourceforge.net/">such as <application>kdiff3</application></ulink>) into the test without diverting your focus from the specification.</para>
1048
1050
 
1049
1051
  <figure id="fig..generate-test.rspec">
1050
1052
  <title>Generating a test with specification in &rspec; format</title>
@@ -1084,7 +1086,7 @@ Parsed module: counter
1084
1086
  <section id="usage.tutorial.specification">
1085
1087
  <title>Specify your expectations</title>
1086
1088
 
1087
- <para>So far, the test generation tool has created a basic foundation for our test. Now we must build upon this foundation by identifying our expectations of the design. That is, how do we expect the design to <emphasis>behave</emphasis> under certain conditions?</para>
1089
+ <para>So far, the test generation tool has created a basic foundation for our &test.gloss;. Now we must build upon this foundation by identifying our &expectation.gloss;s of the &design.gloss;. That is, how do we expect the design to <emphasis>behave</emphasis> under certain conditions?</para>
1088
1090
 
1089
1091
  <para>The following is a reasonable set of expectations for our simple counter:
1090
1092
  <itemizedlist>
@@ -1133,7 +1135,7 @@ Parsed module: counter
1133
1135
  <constant>LIMIT</constant> = <literal>2</literal> ** <constant>Counter</constant>::<constant>Size</constant> <remark># lowest upper bound of counter's value</remark>
1134
1136
  <constant>MAX</constant> = <constant>LIMIT</constant> - <literal>1</literal> <remark># maximum allowed value for a counter</remark>
1135
1137
 
1136
- <function>include</function> <constant>Vpi</constant>
1138
+ <token>include</token> <constant>Vpi</constant>
1137
1139
 
1138
1140
  <function>context</function> <literal>"A resetted counter's value"</literal> <token>do</token>
1139
1141
  <function>setup</function> <token>do</token>
@@ -1178,7 +1180,7 @@ Parsed module: counter
1178
1180
  <constant>MAX</constant> = <constant>LIMIT</constant> - <literal>1</literal> <remark># maximum allowed value for a counter</remark>
1179
1181
 
1180
1182
  <token>class</token> <constant>ResettedCounterValue</constant> &lt; <constant>Test</constant>::<constant>Unit</constant>::<constant>TestCase</constant>
1181
- <function>include</function> <constant>Vpi</constant>
1183
+ <token>include</token> <constant>Vpi</constant>
1182
1184
 
1183
1185
  <token>def</token> <function>setup</function>
1184
1186
  <varname>@design</varname> = <constant>Counter</constant>.<function>new</function>
@@ -1198,7 +1200,7 @@ Parsed module: counter
1198
1200
  <token>end</token>
1199
1201
 
1200
1202
  <token>class</token> <constant>MaximumCounterValue</constant> &lt; <constant>Test</constant>::<constant>Unit</constant>::<constant>TestCase</constant>
1201
- <function>include</function> <constant>Vpi</constant>
1203
+ <token>include</token> <constant>Vpi</constant>
1202
1204
 
1203
1205
  <token>def</token> <function>setup</function>
1204
1206
  <varname>@design</varname> = <constant>Counter</constant>.<function>new</function>
@@ -1220,7 +1222,8 @@ Parsed module: counter
1220
1222
 
1221
1223
  <section id="usage.tutorial.implement-proto">
1222
1224
  <title>Implement the prototype</title>
1223
- <para>Now that we have a specification against which to verify our design, let us build a prototype of our design. By doing so, we exercise our specification, experience potential problems that may arise when we later implement our design in &v;, and gain confidence in our work. <!--Furthermore, we will use the <emphasis>same</emphasis> specification later when verifying our design!--> <xref linkend="fig..counter_proto.rb"/> shows the completed prototype for our design.</para>
1225
+
1226
+ <para>Now that we have a &specification.gloss; against which to verify our &design.gloss;, let us build a prototype of our design. By doing so, we exercise our specification, experience potential problems that may arise when we later implement our design in &v;, and gain confidence in our work. <xref linkend="fig..counter_proto.rb"/> shows the completed prototype for our design.</para>
1224
1227
 
1225
1228
  <important>
1226
1229
  <title>Before we continue&hellip;</title>
@@ -1230,7 +1233,7 @@ Parsed module: counter
1230
1233
  <figure id="fig..counter_proto.rb">
1231
1234
  <title>Ruby prototype of our &v; design</title>
1232
1235
  <programlisting>
1233
- <token>class</token> <constant>CounterProto</constant> &lt; <constant>Counter</constant>
1236
+ <token>class</token> <constant>CounterPrototype</constant> &lt; <constant>Counter</constant>
1234
1237
  <token>def</token> <function>simulate!</function>
1235
1238
  <token>if</token> <varname>@reset</varname>.<function>intVal</function> == <literal>1</literal>
1236
1239
  <varname>@count</varname>.<function>intVal</function> = <literal>0</literal>
@@ -1246,15 +1249,18 @@ Parsed module: counter
1246
1249
 
1247
1250
  <section id="usage.tutorial.test-proto">
1248
1251
  <title>Verify the prototype</title>
1249
- <para>Now that we have implemented our prototype, we are ready to verify it against our specification by running the test. <xref linkend="fig..test-proto.rspec"/> and <xref linkend="fig..test-proto.unit-test"/> illustrate this process.</para>
1252
+ <para>Now that we have implemented our prototype, we are ready to verify it against our &specification.gloss; by running the &test.gloss;. <xref linkend="fig..test-proto.rspec"/> and <xref linkend="fig..test-proto.unit-test"/> illustrate this process.</para>
1253
+
1254
+ <tip>
1255
+ <para>The <emphasis>same</emphasis> specification can be used to verify both prototype and design.</para>
1256
+ </tip>
1250
1257
 
1251
- <para>Here, the <varname>PROTO</varname> environment variable is set&mdash;any value is fine&mdash;before running the test in order to replace the design with the prototype in the simulation. Otherwise, instead of our prototype, our design will be verified against our specification. Furthermore, the manner in which the <varname>PROTO</varname> environment variable is set in these figures follows the syntax of the &bash; shell. If you use a different shell, you may have to use different syntax, or a different command altogether, in order to set this variable. Finally, the Icarus &v; simulator, denoted by <replaceable>ivl</replaceable>, is used to simulate our design.</para>
1258
+ <para>Here, the <varname>PROTOTYPE</varname> environment variable is assigned a non-empty value while running the test, so that, instead of our design, our prototype is verified against our specification. You can also assign a value to <varname>PROTOTYPE</varname> before running the test, by using your shell's <command>export</command> or <command>setenv</command> command. Finally, the Icarus &v; simulator, denoted by <replaceable>ivl</replaceable>, is used to run the simulation.</para>
1252
1259
 
1253
1260
  <figure id="fig..test-proto.rspec">
1254
1261
  <title>Running a test with specification in &rspec; format</title>
1255
1262
  <screen>
1256
- <prompt>$</prompt> <userinput><command>export <replaceable>PROTO=1</replaceable></command></userinput>
1257
- <prompt>$</prompt> <userinput><command>rake <option>-f</option> <replaceable>counter_rspecTest_runner.rake</replaceable> <replaceable>ivl</replaceable></command></userinput>
1263
+ <prompt>$</prompt> <userinput><command>rake <option>-f</option> <replaceable>counter_rspecTest_runner.rake</replaceable> <replaceable>ivl</replaceable> <varname>PROTOTYPE</varname>=<replaceable>1</replaceable></command></userinput>
1258
1264
  <computeroutput>counter_rspecTest: verifying prototype instead of design
1259
1265
 
1260
1266
  A resetted counter's value
@@ -1273,8 +1279,7 @@ Finished in 0.018199 seconds
1273
1279
  <figure id="fig..test-proto.unit-test">
1274
1280
  <title>Running a test with specification in unit test format</title>
1275
1281
  <screen>
1276
- <prompt>$</prompt> <userinput><command>export <replaceable>PROTO=1</replaceable></command></userinput>
1277
- <prompt>$</prompt> <userinput><command>rake <option>-f</option> <replaceable>counter_unitTest_runner.rake</replaceable> <replaceable>ivl</replaceable></command></userinput>
1282
+ <prompt>$</prompt> <userinput><command>rake <option>-f</option> <replaceable>counter_unitTest_runner.rake</replaceable> <replaceable>ivl</replaceable> <varname>PROTOTYPE</varname>=<replaceable>1</replaceable></command></userinput>
1278
1283
  <computeroutput>counter_unitTest: verifying prototype instead of design
1279
1284
 
1280
1285
  Loaded suite counter_unitTest_bench
@@ -1290,7 +1295,7 @@ Finished in 0.040668 seconds.
1290
1295
  <section id="usage.tutorial.implement-design">
1291
1296
  <title>Implement the design</title>
1292
1297
 
1293
- <para>Now that we have implemented and verified our prototype, we are ready to implement our design. This is often quite simple because we translate <emphasis>existing</emphasis> code from &r; (our prototype) into &v; (our design). <xref linkend="fig..counter.v_impl"/> illustrates the result of this process. Once again, note the striking similarities between the implementations of our prototype and our design.</para>
1298
+ <para>Now that we have implemented and verified our prototype, we are ready to implement our &design.gloss;. This is often quite simple because we translate <emphasis>existing</emphasis> code from &r; (our prototype) into &v; (our design). <xref linkend="fig..counter.v_impl"/> illustrates the result of this process. Once again, note the striking similarities between the implementation of our prototype and design.</para>
1294
1299
 
1295
1300
  <important>
1296
1301
  <title>Before we continue&hellip;</title>
@@ -1318,14 +1323,13 @@ Finished in 0.040668 seconds.
1318
1323
 
1319
1324
  <section id="usage.tutorial.test-design">
1320
1325
  <title>Verify the design</title>
1321
- <para>Now that we have implemented our design, we are ready to verify it against our specification by running the test. <xref linkend="fig..test-design.rspec"/> and <xref linkend="fig..test-design.unit-test"/> illustrate this process.</para>
1326
+ <para>Now that we have implemented our &design.gloss;, we are ready to verify it against our &specification.gloss; by running the &test.gloss;. <xref linkend="fig..test-design.rspec"/> and <xref linkend="fig..test-design.unit-test"/> illustrate this process.</para>
1322
1327
 
1323
- <para>Here, the <varname>PROTO</varname> environment variable is unset before the test is run in order to prevent the design from being replaced by the prototype. Otherwise, our prototype will be verified&mdash;instead of our design&mdash;against our specification. Furthermore, the manner in which the <varname>PROTO</varname> environment variable is unset in these figures follows the syntax of the &bash; shell. If you use a different shell, you may have to use different syntax, or a different command altogether, in order to set this variable. Finally, the Icarus &v; simulator, denoted by <replaceable>ivl</replaceable>, is used to simulate our design.</para>
1328
+ <para>Here, the <varname>PROTOTYPE</varname> environment variable is <emphasis>not</emphasis> 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 <varname>PROTOTYPE</varname>, or by using your shell's <command>unset</command> command. Finally, the Icarus &v; simulator, denoted by <replaceable>ivl</replaceable>, is used to run the simulation.</para>
1324
1329
 
1325
1330
  <figure id="fig..test-design.rspec">
1326
1331
  <title>Running a test with specification in &rspec; format</title>
1327
1332
  <screen>
1328
- <prompt>$</prompt> <userinput><command>unset <replaceable>PROTO</replaceable></command></userinput>
1329
1333
  <prompt>$</prompt> <userinput><command>rake <option>-f</option> <replaceable>counter_rspecTest_runner.rake</replaceable> <replaceable>ivl</replaceable></command></userinput>
1330
1334
  <computeroutput>A resetted counter's value
1331
1335
  - should be zero
@@ -1343,7 +1347,6 @@ Finished in 0.005628 seconds
1343
1347
  <figure id="fig..test-design.unit-test">
1344
1348
  <title>Running a test with specification in unit test format</title>
1345
1349
  <screen>
1346
- <prompt>$</prompt> <userinput><command>unset <replaceable>PROTO</replaceable></command></userinput>
1347
1350
  <prompt>$</prompt> <userinput><command>rake <option>-f</option> <replaceable>counter_unitTest_runner.rake</replaceable> <replaceable>ivl</replaceable></command></userinput>
1348
1351
  <computeroutput>Loaded suite counter_unitTest_bench
1349
1352
  Started
@@ -1476,7 +1479,7 @@ Finished in 0.006766 seconds.
1476
1479
  <glossentry id="term..bench">
1477
1480
  <glossterm>Bench</glossterm>
1478
1481
  <glossdef>
1479
- <para>An environment in which a design is verified against a specification. Often, it is used to emulate conditions in which the design will be eventually deployed.</para>
1482
+ <para>An environment in which a &design.gloss; is verified against a &specification.gloss;. Often, it is used to emulate conditions in which the design will be eventually deployed.</para>
1480
1483
  </glossdef>
1481
1484
  </glossentry>
1482
1485
 
@@ -1499,7 +1502,18 @@ Finished in 0.006766 seconds.
1499
1502
  <glossentry id="term..design">
1500
1503
  <glossterm>Design</glossterm>
1501
1504
  <glossdef>
1502
- <para>An idea or entity that is verified against a specification in order to ensure correctness or soundness of its being.</para>
1505
+ <para>An idea or entity that is verified against a &specification.gloss; in order to ensure correctness or soundness of its being. In other words, it is the thing being checked: does it work or not?</para>
1506
+ </glossdef>
1507
+ </glossentry>
1508
+ </glossdiv>
1509
+
1510
+ <glossdiv>
1511
+ <title>E</title>
1512
+
1513
+ <glossentry id="term..expectation">
1514
+ <glossterm>Expectation</glossterm>
1515
+ <glossdef>
1516
+ <para>The desired response to some stimulus.</para>
1503
1517
  </glossdef>
1504
1518
  </glossentry>
1505
1519
  </glossdiv>
@@ -1510,7 +1524,7 @@ Finished in 0.006766 seconds.
1510
1524
  <glossentry id="term..handle">
1511
1525
  <glossterm>Handle</glossterm>
1512
1526
  <glossdef>
1513
- <para>An object in a &v; simulation.</para>
1527
+ <para>An object in a &v; simulation. For example, a handle can represent a wire, register, module, if-statement, expression, and so on.</para>
1514
1528
  </glossdef>
1515
1529
  </glossentry>
1516
1530
  </glossdiv>
@@ -1546,7 +1560,7 @@ Finished in 0.006766 seconds.
1546
1560
  <glossentry id="term..specification">
1547
1561
  <glossterm>Specification</glossterm>
1548
1562
  <glossdef>
1549
- <para>A collection of expectations that must be satisfied by a design when subjected to certain conditions.</para>
1563
+ <para>A set of &expectation.gloss;s which define the desired behavior of a &design.gloss; when it is subjected to certain conditions.</para>
1550
1564
  </glossdef>
1551
1565
  </glossentry>
1552
1566
  </glossdiv>
@@ -1565,7 +1579,7 @@ Finished in 0.006766 seconds.
1565
1579
  <glossentry id="term..test">
1566
1580
  <glossterm>Test</glossterm>
1567
1581
  <glossdef>
1568
- <para>The act of verifying a design against a specification in a bench.</para>
1582
+ <para>Something that checks if a &design.gloss; satisfies a &specification.gloss;.</para>
1569
1583
  <glossseealso otherterm="term..test-bench"/>
1570
1584
  </glossdef>
1571
1585
  </glossentry>
data/doc/src/shared.dtd CHANGED
@@ -16,8 +16,7 @@
16
16
  <!ENTITY rv.url-download "http://rubyforge.org/frs/?group_id=1339">
17
17
  <!ENTITY rv.url-tracker "http://rubyforge.org/tracker/?group_id=1339">
18
18
  <!ENTITY rv.url-forum "http://rubyforge.org/forum/?group_id=1339">
19
- <!ENTITY rv.url-source-repo "svn://rubyforge.org//var/svn/ruby-vpi">
20
- <!ENTITY rv.url-source "http://rubyforge.org/scm/?group_id=1339">
19
+ <!ENTITY rv.url-source "&rv.url;/src/ruby-vpi">
21
20
  <!ENTITY rv..ulink "<ulink url='&rv.url;'>&rv;</ulink>">
22
21
 
23
22
 
@@ -5,8 +5,6 @@ body {
5
5
 
6
6
  /* admonitions */
7
7
  .tip, .note, .important, .caution, .warning {
8
- /* border: thin solid lightgreen;
9
- background-color: honeydew; */
10
8
  border: thin solid steelblue;
11
9
  background-color: aliceblue;
12
10
  padding: 1em;
@@ -36,34 +34,32 @@ body {
36
34
  }
37
35
 
38
36
  .function {
39
- color: orangered;
40
37
  }
41
38
 
42
39
  .constant {
43
- color: brown;
40
+ color: green;
44
41
  font-weight: bold;
45
42
  }
46
43
 
47
44
  .literal {
48
- color: darkgreen;
49
- background-color: honeydew;
45
+ color: blue;
50
46
  }
51
47
 
52
48
  .varname {
53
49
  color: magenta;
54
- /*background-color: ghostwhite;*/
55
50
  }
56
51
 
57
52
  .token {
58
- color: midnightblue;
53
+ font-weight: bold;
54
+ color: indigo;
59
55
  }
60
56
 
61
57
  .type {
62
- color: royalblue;
58
+ color: red;
63
59
  }
64
60
 
65
61
  .remark {
66
- color: gray;
62
+ color: orangered;
67
63
  }
68
64
 
69
65
  .command {
File without changes
File without changes
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
2
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Tutorial</title><link rel="stylesheet" href="styles/manual.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.68.1" /><link rel="start" href="index.html" title="Ruby-VPI user manual" /><link rel="up" href="usage.html" title="Chapter 3. Usage" /><link rel="prev" href="usage.examples.html" title="Examples" /><link rel="next" href="problems.html" title="Chapter 4. Known problems" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Tutorial</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="usage.examples.html"><img src="images/prev.png" alt="Prev" /></a> </td><th width="60%" align="center">Chapter 3. Usage</th><td width="20%" align="right"> <a accesskey="n" href="problems.html"><img src="images/next.png" alt="Next" /></a></td></tr></table><hr /></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="usage.tutorial"></a>Tutorial</h2></div></div></div><div class="procedure"><a id="id2523047"></a><p class="title"><b>Procedure 3.1. Typical way of using <span class="application">Ruby-VPI</span></b></p><ol type="1"><li><p><a href="usage.tutorial.html#usage.tutorial.declare-design" title="Start with a design">Declare the design</a>, which is a Verilog module, using Verilog 2001 syntax.</p></li><li><p><a href="usage.tutorial.html#usage.tutorial.generate-test" title="Generate a test">Generate a test</a> for the design using the <a href="usage.tools.html#usage.tools.generate-test" title="Automated test generation">automated test generator</a> tool.</p></li><li><p><a href="usage.tutorial.html#usage.tutorial.specification" title="Specify your expectations">Identify your expectations</a> for the design and implement them in the specification.</p></li><li><p><a href="usage.tutorial.html#usage.tutorial.implement-proto" title="Implement the prototype">Implement the prototype</a> of the design in Ruby.</p></li><li><p><a href="usage.tutorial.html#usage.tutorial.test-proto" title="Verify the prototype">Verify the prototype</a> against the specification.</p></li><li><p><a href="usage.tutorial.html#usage.tutorial.implement-design" title="Implement the design">Implement the design</a> in Verilog once the prototype has been verified.</p></li><li><p><a href="usage.tutorial.html#usage.tutorial.test-design" title="Verify the design">Verify the design</a> against the specification.</p></li></ol></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tutorial.declare-design"></a>Start with a design</h3></div></div></div><p>First, we need a design to verify. In this tutorial, <a href="usage.tutorial.html#fig..counter.v_decl" title="Figure 3.1. Declaration of a simple up-counter with synchronous reset">Figure 3.1, “Declaration of a simple up-counter with synchronous reset”</a> will serve as our design. Its interface is composed of the following parts:
3
+ <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Tutorial</title><link rel="stylesheet" href="styles/manual.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.68.1" /><link rel="start" href="index.html" title="Ruby-VPI user manual" /><link rel="up" href="usage.html" title="Chapter 3. Usage" /><link rel="prev" href="usage.examples.html" title="Examples" /><link rel="next" href="problems.html" title="Chapter 4. Known problems" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Tutorial</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="usage.examples.html"><img src="images/prev.png" alt="Prev" /></a> </td><th width="60%" align="center">Chapter 3. Usage</th><td width="20%" align="right"> <a accesskey="n" href="problems.html"><img src="images/next.png" alt="Next" /></a></td></tr></table><hr /></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="usage.tutorial"></a>Tutorial</h2></div></div></div><div class="procedure"><a id="id2523048"></a><p class="title"><b>Procedure 3.1. Typical way of using <span class="application">Ruby-VPI</span></b></p><ol type="1"><li><p><a href="usage.tutorial.html#usage.tutorial.declare-design" title="Start with a design">Declare the design</a>, which is a Verilog module, using Verilog 2001 syntax.</p></li><li><p><a href="usage.tutorial.html#usage.tutorial.generate-test" title="Generate a test">Generate a test</a> for the design using the <a href="usage.tools.html#usage.tools.generate-test" title="Automated test generation">automated test generator</a> tool.</p></li><li><p><a href="usage.tutorial.html#usage.tutorial.specification" title="Specify your expectations">Identify your expectations</a> for the design and implement them in the specification.</p></li><li><p><a href="usage.tutorial.html#usage.tutorial.implement-proto" title="Implement the prototype">Implement the prototype</a> of the design in Ruby.</p></li><li><p><a href="usage.tutorial.html#usage.tutorial.test-proto" title="Verify the prototype">Verify the prototype</a> against the specification.</p></li><li><p><a href="usage.tutorial.html#usage.tutorial.implement-design" title="Implement the design">Implement the design</a> in Verilog once the prototype has been verified.</p></li><li><p><a href="usage.tutorial.html#usage.tutorial.test-design" title="Verify the design">Verify the design</a> against the specification.</p></li></ol></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tutorial.declare-design"></a>Start with a design</h3></div></div></div><p>First, we need a <a href="glossary.html#term..design">Design</a> to verify. In this tutorial, <a href="usage.tutorial.html#fig..counter.v_decl" title="Figure 3.1. Declaration of a simple up-counter with synchronous reset">Figure 3.1, “Declaration of a simple up-counter with synchronous reset”</a> will serve as our design. Its interface is composed of the following parts:
4
4
  </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">Size</code></span></dt><dd><p>This parameter defines the number of bits used to represent the counter's value.</p></dd><dt><span class="term"><code class="varname">clock</code></span></dt><dd><p>Each positive edge of this signal causes the <code class="varname">count</code> register to increment.</p></dd><dt><span class="term"><code class="varname">reset</code></span></dt><dd><p>Assertion of this signal causes the <code class="varname">count</code> register to become zero.</p></dd><dt><span class="term"><code class="varname">count</code></span></dt><dd><p>This register contains the counter's value.</p></dd></dl></div><p>
5
5
  </p><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Important: Before we continue…"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="images/important.png" /></td><th align="left">Before we continue…</th></tr><tr><td align="left" valign="top"><p>Save the source code shown in <a href="usage.tutorial.html#fig..counter.v_decl" title="Figure 3.1. Declaration of a simple up-counter with synchronous reset">Figure 3.1, “Declaration of a simple up-counter with synchronous reset”</a> into a file named <code class="filename">counter.v</code>.</p></td></tr></table></div><div class="figure"><a id="fig..counter.v_decl"></a><p class="title"><b>Figure 3.1. Declaration of a simple up-counter with synchronous reset</b></p><pre class="programlisting">
6
6
  <span class="token">module</span> counter #(<span class="token">parameter</span> <code class="constant">Size</code> = <code class="literal">5</code>) (
@@ -9,9 +9,9 @@
9
9
  <span class="token">output</span> <span class="type">reg</span> [<code class="constant">Size</code> - <code class="literal">1</code> : <code class="literal">0</code>] <code class="varname">count</code>
10
10
  );
11
11
  <span class="token">endmodule</span>
12
- </pre></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tutorial.generate-test"></a>Generate a test</h3></div></div></div><p>Now that we have a design to verify, let us generate a test for it using the automated test generator tool. This tool allows us to implement our specification in either RSpec, unit test, or our very own format. Each format represents a different software development methodology: RSpec represents <a href="glossary.html#term..BDD"><em class="glossterm">BDD</em></a>, unit testing represents <a href="glossary.html#term..TDD"><em class="glossterm">TDD</em></a>, and our own format can represent another methodology.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png" /></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>In this tutorial, we will see how to implement our specification in both RSpec and unit test formats.</p></td></tr></table></div><p>Once we have decided how we want to implement our specification, we can proceed to generate a test for our design. <a href="usage.tutorial.html#fig..generate-test.rspec" title="Figure 3.2. Generating a test with specification in RSpec format">Figure 3.2, “Generating a test with specification in RSpec format”</a> and <a href="usage.tutorial.html#fig..generate-test.unit-test" title="Figure 3.3. Generating a test with specification in unit test format">Figure 3.3, “Generating a test with specification in unit test format”</a> illustrate this process. Here, the test generation tool produces a test composed of the following parts:
12
+ </pre></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tutorial.generate-test"></a>Generate a test</h3></div></div></div><p>Now that we have a <a href="glossary.html#term..design">Design</a> to verify, let us generate a <a href="glossary.html#term..test">Test</a> for it using the automated test generator tool. This tool allows us to implement our <a href="glossary.html#term..specification">Specification</a> in either RSpec, unit test, or our very own format. Each format represents a different software development methodology: RSpec represents <a href="glossary.html#term..BDD"><span class="acronym">BDD</span></a>, unit testing represents <a href="glossary.html#term..TDD">TDD</a>, and our own format can represent another methodology.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png" /></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>In this tutorial, you will see how specifications are implemented in <span class="emphasis"><em>both</em></span> RSpec and unit test formats.</p></td></tr></table></div><p>Once we have decided how we want to implement our specification, we can proceed to generate a test for our design. <a href="usage.tutorial.html#fig..generate-test.rspec" title="Figure 3.2. Generating a test with specification in RSpec format">Figure 3.2, “Generating a test with specification in RSpec format”</a> and <a href="usage.tutorial.html#fig..generate-test.unit-test" title="Figure 3.3. Generating a test with specification in unit test format">Figure 3.3, “Generating a test with specification in unit test format”</a> illustrate this process. Here, the test generation tool produces a test composed of the following parts:
13
13
  </p><div class="variablelist"><dl><dt><span class="term">Runner</span></dt><dd><p>Written in Rake, this file builds and runs the test.</p></dd><dt><span class="term">Bench</span></dt><dd><p>Written in Verilog and Ruby, these files define the testing environment.</p></dd><dt><span class="term">Design</span></dt><dd><p>Written in Ruby, this file provides an interface to the design being verified.</p></dd><dt><span class="term">Prototype</span></dt><dd><p>Written in Ruby, this file defines a prototype of the design being verified.</p></dd><dt><span class="term">Specification</span></dt><dd><p>Written in Ruby, this file verifies the design.</p></dd></dl></div><p>
14
- </p><p>The reason for dividing a single test into these parts is mainly to decouple the design from the specification. This allows you to focus on writing the specification while the remainder is automatically generated by the tool. For example, when the interface of a Verilog module changes, you would simply re-run this tool to incorporate those changes into the test without diverting your focus from the specification.</p><div class="figure"><a id="fig..generate-test.rspec"></a><p class="title"><b>Figure 3.2. Generating a test with specification in RSpec format</b></p><pre class="screen">
14
+ </p><p>The reason for dividing a single test into these parts is mainly to decouple the design from the specification. This allows you to focus on writing the specification while the remainder is automatically generated by the tool. For example, when the interface of a Verilog module changes, you would simply re-run this tool and incorporate those changes (with the help of a smart merging tool, <a href="http://kdiff3.sourceforge.net/" target="_top">such as <span class="application">kdiff3</span></a>) into the test without diverting your focus from the specification.</p><div class="figure"><a id="fig..generate-test.rspec"></a><p class="title"><b>Figure 3.2. Generating a test with specification in RSpec format</b></p><pre class="screen">
15
15
  <code class="prompt">$</code> <strong class="userinput"><code><span><strong class="command">generate_test.rb <em class="replaceable"><code>counter.v</code></em> <code class="option">--rspec</code> <code class="option">--name</code> <em class="replaceable"><code>rspecTest</code></em></strong></span></code></strong>
16
16
  <code class="computeroutput">Using name `rspecTest' for generated test.
17
17
  Using RSpec specification format.
@@ -35,7 +35,7 @@ Parsed module: counter
35
35
  - Generated design: counter_unitTest_design.rb
36
36
  - Generated prototype: counter_unitTest_proto.rb
37
37
  - Generated specification: counter_unitTest_spec.rb</code>
38
- </pre></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tutorial.specification"></a>Specify your expectations</h3></div></div></div><p>So far, the test generation tool has created a basic foundation for our test. Now we must build upon this foundation by identifying our expectations of the design. That is, how do we expect the design to <span class="emphasis"><em>behave</em></span> under certain conditions?</p><p>The following is a reasonable set of expectations for our simple counter:
38
+ </pre></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tutorial.specification"></a>Specify your expectations</h3></div></div></div><p>So far, the test generation tool has created a basic foundation for our <a href="glossary.html#term..test">Test</a>. Now we must build upon this foundation by identifying our <a href="glossary.html#term..expectation">Expectation</a>s of the <a href="glossary.html#term..design">Design</a>. That is, how do we expect the design to <span class="emphasis"><em>behave</em></span> under certain conditions?</p><p>The following is a reasonable set of expectations for our simple counter:
39
39
  </p><div class="itemizedlist"><ul type="disc"><li><p>A resetted counter's value should be zero.</p></li><li><p>A resetted counter's value should increment by one count upon each rising clock edge.</p></li><li><p>A counter with the maximum value should overflow upon increment.</p></li></ul></div><p>
40
40
  </p><p>Now that we have identified a set of expectations for our design, we are ready to implement them in our specification. <a href="usage.tutorial.html#fig..counter_rspecTest_spec.rb" title="Figure 3.4. Specification implemented in RSpec format">Figure 3.4, “Specification implemented in RSpec format”</a> and <a href="usage.tutorial.html#fig..counter_unitTest_spec.rb" title="Figure 3.5. Specification implemented in unit test format">Figure 3.5, “Specification implemented in unit test format”</a> illustrate this process. Note the striking similarities between our expectations and their implementation.</p><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Important: Before we continue…"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="images/important.png" /></td><th align="left">Before we continue…</th></tr><tr><td align="left" valign="top"><div class="itemizedlist"><ul type="disc"><li><p>Append the following code to the files named <code class="filename">counter_rspecTest_design.rb</code> and <code class="filename">counter_unitTest_design.rb</code>.</p><pre class="programlisting">
41
41
  <span class="token">class</span> <code class="constant">Counter</code>
@@ -49,7 +49,7 @@ Parsed module: counter
49
49
  <code class="constant">LIMIT</code> = <code class="literal">2</code> ** <code class="constant">Counter</code>::<code class="constant">Size</code> <em><span class="remark"># lowest upper bound of counter's value</span></em>
50
50
  <code class="constant">MAX</code> = <code class="constant">LIMIT</code> - <code class="literal">1</code> <em><span class="remark"># maximum allowed value for a counter</span></em>
51
51
 
52
- <code class="function">include</code> <code class="constant">Vpi</code>
52
+ <span class="token">include</span> <code class="constant">Vpi</code>
53
53
 
54
54
  <code class="function">context</code> <code class="literal">"A resetted counter's value"</code> <span class="token">do</span>
55
55
  <code class="function">setup</code> <span class="token">do</span>
@@ -89,7 +89,7 @@ Parsed module: counter
89
89
  <code class="constant">MAX</code> = <code class="constant">LIMIT</code> - <code class="literal">1</code> <em><span class="remark"># maximum allowed value for a counter</span></em>
90
90
 
91
91
  <span class="token">class</span> <code class="constant">ResettedCounterValue</code> &lt; <code class="constant">Test</code>::<code class="constant">Unit</code>::<code class="constant">TestCase</code>
92
- <code class="function">include</code> <code class="constant">Vpi</code>
92
+ <span class="token">include</span> <code class="constant">Vpi</code>
93
93
 
94
94
  <span class="token">def</span> <code class="function">setup</code>
95
95
  <code class="varname">@design</code> = <code class="constant">Counter</code>.<code class="function">new</code>
@@ -109,7 +109,7 @@ Parsed module: counter
109
109
  <span class="token">end</span>
110
110
 
111
111
  <span class="token">class</span> <code class="constant">MaximumCounterValue</code> &lt; <code class="constant">Test</code>::<code class="constant">Unit</code>::<code class="constant">TestCase</code>
112
- <code class="function">include</code> <code class="constant">Vpi</code>
112
+ <span class="token">include</span> <code class="constant">Vpi</code>
113
113
 
114
114
  <span class="token">def</span> <code class="function">setup</code>
115
115
  <code class="varname">@design</code> = <code class="constant">Counter</code>.<code class="function">new</code>
@@ -125,8 +125,8 @@ Parsed module: counter
125
125
  <code class="function">assert_equal</code> <code class="literal">0</code>, <code class="varname">@design</code>.<code class="function">count</code>.<code class="function">intVal</code>
126
126
  <span class="token">end</span>
127
127
  <span class="token">end</span>
128
- </pre></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tutorial.implement-proto"></a>Implement the prototype</h3></div></div></div><p>Now that we have a specification against which to verify our design, let us build a prototype of our design. By doing so, we exercise our specification, experience potential problems that may arise when we later implement our design in Verilog, and gain confidence in our work. <a href="usage.tutorial.html#fig..counter_proto.rb" title="Figure 3.6. Ruby prototype of our Verilog design">Figure 3.6, “Ruby prototype of our Verilog design”</a> shows the completed prototype for our design.</p><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Important: Before we continue…"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="images/important.png" /></td><th align="left">Before we continue…</th></tr><tr><td align="left" valign="top"><p>Replace the contents of the files named <code class="filename">counter_rspecTest_proto.rb</code> and <code class="filename">counter_unitTest_proto.rb</code> with the source code shown in <a href="usage.tutorial.html#fig..counter_proto.rb" title="Figure 3.6. Ruby prototype of our Verilog design">Figure 3.6, “Ruby prototype of our Verilog design”</a>.</p></td></tr></table></div><div class="figure"><a id="fig..counter_proto.rb"></a><p class="title"><b>Figure 3.6. Ruby prototype of our Verilog design</b></p><pre class="programlisting">
129
- <span class="token">class</span> <code class="constant">CounterProto</code> &lt; <code class="constant">Counter</code>
128
+ </pre></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tutorial.implement-proto"></a>Implement the prototype</h3></div></div></div><p>Now that we have a <a href="glossary.html#term..specification">Specification</a> against which to verify our <a href="glossary.html#term..design">Design</a>, let us build a prototype of our design. By doing so, we exercise our specification, experience potential problems that may arise when we later implement our design in Verilog, and gain confidence in our work. <a href="usage.tutorial.html#fig..counter_proto.rb" title="Figure 3.6. Ruby prototype of our Verilog design">Figure 3.6, “Ruby prototype of our Verilog design”</a> shows the completed prototype for our design.</p><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Important: Before we continue…"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="images/important.png" /></td><th align="left">Before we continue…</th></tr><tr><td align="left" valign="top"><p>Replace the contents of the files named <code class="filename">counter_rspecTest_proto.rb</code> and <code class="filename">counter_unitTest_proto.rb</code> with the source code shown in <a href="usage.tutorial.html#fig..counter_proto.rb" title="Figure 3.6. Ruby prototype of our Verilog design">Figure 3.6, “Ruby prototype of our Verilog design”</a>.</p></td></tr></table></div><div class="figure"><a id="fig..counter_proto.rb"></a><p class="title"><b>Figure 3.6. Ruby prototype of our Verilog design</b></p><pre class="programlisting">
129
+ <span class="token">class</span> <code class="constant">CounterPrototype</code> &lt; <code class="constant">Counter</code>
130
130
  <span class="token">def</span> <code class="function">simulate!</code>
131
131
  <span class="token">if</span> <code class="varname">@reset</code>.<code class="function">intVal</code> == <code class="literal">1</code>
132
132
  <code class="varname">@count</code>.<code class="function">intVal</code> = <code class="literal">0</code>
@@ -135,9 +135,8 @@ Parsed module: counter
135
135
  <span class="token">end</span>
136
136
  <span class="token">end</span>
137
137
  <span class="token">end</span>
138
- </pre></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tutorial.test-proto"></a>Verify the prototype</h3></div></div></div><p>Now that we have implemented our prototype, we are ready to verify it against our specification by running the test. <a href="usage.tutorial.html#fig..test-proto.rspec" title="Figure 3.7. Running a test with specification in RSpec format">Figure 3.7, “Running a test with specification in RSpec format”</a> and <a href="usage.tutorial.html#fig..test-proto.unit-test" title="Figure 3.8. Running a test with specification in unit test format">Figure 3.8, “Running a test with specification in unit test format”</a> illustrate this process.</p><p>Here, the <code class="varname">PROTO</code> environment variable is set—any value is fine—before running the test in order to replace the design with the prototype in the simulation. Otherwise, instead of our prototype, our design will be verified against our specification. Furthermore, the manner in which the <code class="varname">PROTO</code> environment variable is set in these figures follows the syntax of the <span class="application"><span class="acronym">GNU</span> <span class="acronym">BASH</span></span> shell. If you use a different shell, you may have to use different syntax, or a different command altogether, in order to set this variable. Finally, the Icarus Verilog simulator, denoted by <em class="replaceable"><code>ivl</code></em>, is used to simulate our design.</p><div class="figure"><a id="fig..test-proto.rspec"></a><p class="title"><b>Figure 3.7. Running a test with specification in RSpec format</b></p><pre class="screen">
139
- <code class="prompt">$</code> <strong class="userinput"><code><span><strong class="command">export <em class="replaceable"><code>PROTO=1</code></em></strong></span></code></strong>
140
- <code class="prompt">$</code> <strong class="userinput"><code><span><strong class="command">rake <code class="option">-f</code> <em class="replaceable"><code>counter_rspecTest_runner.rake</code></em> <em class="replaceable"><code>ivl</code></em></strong></span></code></strong>
138
+ </pre></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tutorial.test-proto"></a>Verify the prototype</h3></div></div></div><p>Now that we have implemented our prototype, we are ready to verify it against our <a href="glossary.html#term..specification">Specification</a> by running the <a href="glossary.html#term..test">Test</a>. <a href="usage.tutorial.html#fig..test-proto.rspec" title="Figure 3.7. Running a test with specification in RSpec format">Figure 3.7, “Running a test with specification in RSpec format”</a> and <a href="usage.tutorial.html#fig..test-proto.unit-test" title="Figure 3.8. Running a test with specification in unit test format">Figure 3.8, “Running a test with specification in unit test format”</a> illustrate this process.</p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="images/tip.png" /></td><th align="left">Tip</th></tr><tr><td align="left" valign="top"><p>The <span class="emphasis"><em>same</em></span> specification can be used to verify both prototype and design.</p></td></tr></table></div><p>Here, the <code class="varname">PROTOTYPE</code> environment variable is assigned a non-empty value while running the test, so that, instead of our design, our prototype is verified against our specification. You can also assign a value to <code class="varname">PROTOTYPE</code> before running the test, by using your shell's <span><strong class="command">export</strong></span> or <span><strong class="command">setenv</strong></span> command. Finally, the Icarus Verilog simulator, denoted by <em class="replaceable"><code>ivl</code></em>, is used to run the simulation.</p><div class="figure"><a id="fig..test-proto.rspec"></a><p class="title"><b>Figure 3.7. Running a test with specification in RSpec format</b></p><pre class="screen">
139
+ <code class="prompt">$</code> <strong class="userinput"><code><span><strong class="command">rake <code class="option">-f</code> <em class="replaceable"><code>counter_rspecTest_runner.rake</code></em> <em class="replaceable"><code>ivl</code></em> <code class="varname">PROTOTYPE</code>=<em class="replaceable"><code>1</code></em></strong></span></code></strong>
141
140
  <code class="computeroutput">counter_rspecTest: verifying prototype instead of design
142
141
 
143
142
  A resetted counter's value
@@ -151,8 +150,7 @@ Finished in 0.018199 seconds
151
150
 
152
151
  3 specifications, 0 failures</code>
153
152
  </pre></div><div class="figure"><a id="fig..test-proto.unit-test"></a><p class="title"><b>Figure 3.8. Running a test with specification in unit test format</b></p><pre class="screen">
154
- <code class="prompt">$</code> <strong class="userinput"><code><span><strong class="command">export <em class="replaceable"><code>PROTO=1</code></em></strong></span></code></strong>
155
- <code class="prompt">$</code> <strong class="userinput"><code><span><strong class="command">rake <code class="option">-f</code> <em class="replaceable"><code>counter_unitTest_runner.rake</code></em> <em class="replaceable"><code>ivl</code></em></strong></span></code></strong>
153
+ <code class="prompt">$</code> <strong class="userinput"><code><span><strong class="command">rake <code class="option">-f</code> <em class="replaceable"><code>counter_unitTest_runner.rake</code></em> <em class="replaceable"><code>ivl</code></em> <code class="varname">PROTOTYPE</code>=<em class="replaceable"><code>1</code></em></strong></span></code></strong>
156
154
  <code class="computeroutput">counter_unitTest: verifying prototype instead of design
157
155
 
158
156
  Loaded suite counter_unitTest_bench
@@ -161,7 +159,7 @@ Started
161
159
  Finished in 0.040668 seconds.
162
160
 
163
161
  3 tests, 35 assertions, 0 failures, 0 errors</code>
164
- </pre></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tutorial.implement-design"></a>Implement the design</h3></div></div></div><p>Now that we have implemented and verified our prototype, we are ready to implement our design. This is often quite simple because we translate <span class="emphasis"><em>existing</em></span> code from Ruby (our prototype) into Verilog (our design). <a href="usage.tutorial.html#fig..counter.v_impl" title="Figure 3.9. Implementation of a simple up-counter with synchronous reset">Figure 3.9, “Implementation of a simple up-counter with synchronous reset”</a> illustrates the result of this process. Once again, note the striking similarities between the implementations of our prototype and our design.</p><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Important: Before we continue…"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="images/important.png" /></td><th align="left">Before we continue…</th></tr><tr><td align="left" valign="top"><p>Replace the contents of the file named <code class="filename">counter.v</code> with the source code shown in <a href="usage.tutorial.html#fig..counter.v_impl" title="Figure 3.9. Implementation of a simple up-counter with synchronous reset">Figure 3.9, “Implementation of a simple up-counter with synchronous reset”</a>.</p></td></tr></table></div><div class="figure"><a id="fig..counter.v_impl"></a><p class="title"><b>Figure 3.9. Implementation of a simple up-counter with synchronous reset</b></p><pre class="programlisting">
162
+ </pre></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tutorial.implement-design"></a>Implement the design</h3></div></div></div><p>Now that we have implemented and verified our prototype, we are ready to implement our <a href="glossary.html#term..design">Design</a>. This is often quite simple because we translate <span class="emphasis"><em>existing</em></span> code from Ruby (our prototype) into Verilog (our design). <a href="usage.tutorial.html#fig..counter.v_impl" title="Figure 3.9. Implementation of a simple up-counter with synchronous reset">Figure 3.9, “Implementation of a simple up-counter with synchronous reset”</a> illustrates the result of this process. Once again, note the striking similarities between the implementation of our prototype and design.</p><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Important: Before we continue…"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="images/important.png" /></td><th align="left">Before we continue…</th></tr><tr><td align="left" valign="top"><p>Replace the contents of the file named <code class="filename">counter.v</code> with the source code shown in <a href="usage.tutorial.html#fig..counter.v_impl" title="Figure 3.9. Implementation of a simple up-counter with synchronous reset">Figure 3.9, “Implementation of a simple up-counter with synchronous reset”</a>.</p></td></tr></table></div><div class="figure"><a id="fig..counter.v_impl"></a><p class="title"><b>Figure 3.9. Implementation of a simple up-counter with synchronous reset</b></p><pre class="programlisting">
165
163
  <span class="token">module</span> counter #(<span class="token">parameter</span> <code class="constant">Size</code> = <code class="literal">5</code>) (
166
164
  <span class="token">input</span> <code class="varname">clock</code>,
167
165
  <span class="token">input</span> <code class="varname">reset</code>,
@@ -174,8 +172,7 @@ Finished in 0.040668 seconds.
174
172
  <code class="varname">count</code> &lt;= <code class="varname">count</code> + <code class="literal">1</code>;
175
173
  <span class="token">end</span>
176
174
  <span class="token">endmodule</span>
177
- </pre></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tutorial.test-design"></a>Verify the design</h3></div></div></div><p>Now that we have implemented our design, we are ready to verify it against our specification by running the test. <a href="usage.tutorial.html#fig..test-design.rspec" title="Figure 3.10. Running a test with specification in RSpec format">Figure 3.10, “Running a test with specification in RSpec format”</a> and <a href="usage.tutorial.html#fig..test-design.unit-test" title="Figure 3.11. Running a test with specification in unit test format">Figure 3.11, “Running a test with specification in unit test format”</a> illustrate this process.</p><p>Here, the <code class="varname">PROTO</code> environment variable is unset before the test is run in order to prevent the design from being replaced by the prototype. Otherwise, our prototype will be verified—instead of our design—against our specification. Furthermore, the manner in which the <code class="varname">PROTO</code> environment variable is unset in these figures follows the syntax of the <span class="application"><span class="acronym">GNU</span> <span class="acronym">BASH</span></span> shell. If you use a different shell, you may have to use different syntax, or a different command altogether, in order to set this variable. Finally, the Icarus Verilog simulator, denoted by <em class="replaceable"><code>ivl</code></em>, is used to simulate our design.</p><div class="figure"><a id="fig..test-design.rspec"></a><p class="title"><b>Figure 3.10. Running a test with specification in RSpec format</b></p><pre class="screen">
178
- <code class="prompt">$</code> <strong class="userinput"><code><span><strong class="command">unset <em class="replaceable"><code>PROTO</code></em></strong></span></code></strong>
175
+ </pre></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tutorial.test-design"></a>Verify the design</h3></div></div></div><p>Now that we have implemented our <a href="glossary.html#term..design">Design</a>, we are ready to verify it against our <a href="glossary.html#term..specification">Specification</a> by running the <a href="glossary.html#term..test">Test</a>. <a href="usage.tutorial.html#fig..test-design.rspec" title="Figure 3.10. Running a test with specification in RSpec format">Figure 3.10, “Running a test with specification in RSpec format”</a> and <a href="usage.tutorial.html#fig..test-design.unit-test" title="Figure 3.11. Running a test with specification in unit test format">Figure 3.11, “Running a test with specification in unit test format”</a> illustrate this process.</p><p>Here, the <code class="varname">PROTOTYPE</code> environment variable is <span class="emphasis"><em>not</em></span> 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="varname">PROTOTYPE</code>, or by using your shell's <span><strong class="command">unset</strong></span> command. Finally, the Icarus Verilog simulator, denoted by <em class="replaceable"><code>ivl</code></em>, is used to run the simulation.</p><div class="figure"><a id="fig..test-design.rspec"></a><p class="title"><b>Figure 3.10. Running a test with specification in RSpec format</b></p><pre class="screen">
179
176
  <code class="prompt">$</code> <strong class="userinput"><code><span><strong class="command">rake <code class="option">-f</code> <em class="replaceable"><code>counter_rspecTest_runner.rake</code></em> <em class="replaceable"><code>ivl</code></em></strong></span></code></strong>
180
177
  <code class="computeroutput">A resetted counter's value
181
178
  - should be zero
@@ -188,7 +185,6 @@ Finished in 0.005628 seconds
188
185
 
189
186
  3 specifications, 0 failures</code>
190
187
  </pre></div><div class="figure"><a id="fig..test-design.unit-test"></a><p class="title"><b>Figure 3.11. Running a test with specification in unit test format</b></p><pre class="screen">
191
- <code class="prompt">$</code> <strong class="userinput"><code><span><strong class="command">unset <em class="replaceable"><code>PROTO</code></em></strong></span></code></strong>
192
188
  <code class="prompt">$</code> <strong class="userinput"><code><span><strong class="command">rake <code class="option">-f</code> <em class="replaceable"><code>counter_unitTest_runner.rake</code></em> <em class="replaceable"><code>ivl</code></em></strong></span></code></strong>
193
189
  <code class="computeroutput">Loaded suite counter_unitTest_bench
194
190
  Started
data/gem_extconf.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'fileutils'
4
4
 
5
- system('rake build config_gem_install') &&
5
+ system('rake build gem_config_inst') &&
6
6
  FileUtils.touch('Makefile')
7
7
 
8
8
  exit $?.exitstatus