ruby-vpi 11.1.0 → 11.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (292) hide show
  1. data/Rakefile +8 -37
  2. data/bin/generate_test_tpl/bench.v +1 -1
  3. data/doc/{src/LICENSE → LICENSE} +0 -0
  4. data/doc/Rakefile +39 -14
  5. data/doc/common.css +144 -0
  6. data/doc/common.tpl +49 -0
  7. data/doc/figures/figures.dia +1589 -0
  8. data/doc/history.erb +18 -0
  9. data/doc/history.html +1726 -0
  10. data/doc/history.rb +14 -0
  11. data/doc/history.yml +686 -0
  12. data/doc/images/{COPYING → LICENSE} +0 -0
  13. data/doc/intro.inc +48 -0
  14. data/doc/lib/doc_format.rb +62 -0
  15. data/doc/lib/doc_proxy.rb +160 -0
  16. data/doc/lib/erb_content.rb +67 -0
  17. data/doc/lib/erb_proxy.rb +48 -0
  18. data/doc/manual.erb +768 -0
  19. data/doc/manual.html +2107 -0
  20. data/doc/manual.rb +5 -0
  21. data/{MEMO → doc/memo.erb} +0 -0
  22. data/{memo.part.html → doc/memo.html} +38 -5
  23. data/doc/readme.erb +36 -0
  24. data/doc/readme.html +171 -0
  25. data/index.html +1 -0
  26. data/lib/ruby-vpi/float.rb +52 -0
  27. data/lib/ruby-vpi/rspec.rb +6 -1
  28. data/lib/ruby-vpi/verilog_parser.rb +4 -5
  29. data/ref/c/annotated.html +1 -6
  30. data/ref/c/common_8h.html +1 -1
  31. data/ref/c/files.html +1 -3
  32. data/ref/c/functions.html +24 -44
  33. data/ref/c/functions_vars.html +24 -44
  34. data/ref/c/globals.html +5 -211
  35. data/ref/c/globals_0x63.html +32 -49
  36. data/ref/c/globals_0x65.html +3 -10
  37. data/ref/c/globals_0x66.html +3 -20
  38. data/ref/c/globals_0x70.html +19 -26
  39. data/ref/c/globals_0x72.html +4 -15
  40. data/ref/c/globals_0x73.html +13 -199
  41. data/ref/c/globals_0x74.html +2 -9
  42. data/ref/c/globals_0x76.html +415 -426
  43. data/ref/c/globals_0x78.html +3 -10
  44. data/ref/c/globals_defs.html +30 -35
  45. data/ref/c/globals_defs_0x65.html +2 -7
  46. data/ref/c/globals_defs_0x70.html +3 -8
  47. data/ref/c/globals_defs_0x76.html +413 -420
  48. data/ref/c/globals_defs_0x78.html +2 -7
  49. data/ref/c/globals_enum.html +1 -1
  50. data/ref/c/globals_eval.html +1 -1
  51. data/ref/c/globals_func.html +14 -173
  52. data/ref/c/globals_type.html +26 -29
  53. data/ref/c/globals_vars.html +4 -88
  54. data/ref/c/index.html +1 -1
  55. data/ref/c/relay_8c.html +1 -1
  56. data/ref/c/relay_8h.html +1 -1
  57. data/ref/c/structrelay____RubyOptions____def.html +1 -1
  58. data/ref/c/structt__cb__data.html +6 -23
  59. data/ref/c/structt__vpi__delay.html +3 -20
  60. data/ref/c/structt__vpi__error__info.html +3 -71
  61. data/ref/c/structt__vpi__strengthval.html +3 -3
  62. data/ref/c/structt__vpi__systf__data.html +12 -46
  63. data/ref/c/structt__vpi__time.html +3 -3
  64. data/ref/c/structt__vpi__value.html +3 -113
  65. data/ref/c/structt__vpi__vecval.html +3 -3
  66. data/ref/c/structt__vpi__vlog__info.html +3 -54
  67. data/ref/c/swig_8c.html +2 -2
  68. data/ref/c/swig_8h.html +1 -1
  69. data/ref/c/verilog_8h.html +1 -1
  70. data/ref/c/vlog_8c.html +1 -1
  71. data/ref/c/vlog_8h.html +1 -1
  72. data/ref/c/vpi__user_8h.html +16 -16
  73. data/ref/ruby/classes/ERB.html +5 -5
  74. data/ref/ruby/classes/ERB.src/{M000034.html → M000036.html} +0 -0
  75. data/ref/ruby/classes/FileUtils.html +10 -10
  76. data/ref/ruby/classes/FileUtils.src/{M000081.html → M000083.html} +0 -0
  77. data/ref/ruby/classes/FileUtils.src/{M000082.html → M000084.html} +0 -0
  78. data/ref/ruby/classes/Float.html +140 -0
  79. data/ref/ruby/classes/Float.src/M000031.html +19 -0
  80. data/ref/ruby/classes/RDoc.html +5 -5
  81. data/ref/ruby/classes/RDoc.src/{M000095.html → M000097.html} +0 -0
  82. data/ref/ruby/classes/RubyVpi.html +10 -10
  83. data/ref/ruby/classes/RubyVpi.src/{M000083.html → M000085.html} +0 -0
  84. data/ref/ruby/classes/RubyVpi.src/{M000084.html → M000086.html} +0 -0
  85. data/ref/ruby/classes/String.html +33 -10
  86. data/ref/ruby/classes/String.src/M000033.html +28 -5
  87. data/ref/ruby/classes/String.src/M000034.html +18 -0
  88. data/ref/ruby/classes/String.src/M000035.html +36 -0
  89. data/ref/ruby/classes/Template.html +5 -5
  90. data/ref/ruby/classes/Template.src/{M000031.html → M000032.html} +0 -0
  91. data/ref/ruby/classes/VerilogParser/Module.src/M000006.html +9 -8
  92. data/ref/ruby/classes/VerilogParser/Module/Parameter.src/M000011.html +5 -7
  93. data/ref/ruby/classes/VerilogParser/Module/Port.src/M000007.html +7 -7
  94. data/ref/ruby/classes/VerilogParser/Module/Port.src/M000008.html +4 -4
  95. data/ref/ruby/classes/VerilogParser/Module/Port.src/M000009.html +4 -4
  96. data/ref/ruby/classes/VerilogParser/Module/Port.src/M000010.html +4 -4
  97. data/ref/ruby/classes/Vpi/Handle.html +46 -46
  98. data/ref/ruby/classes/Vpi/Handle.src/M000087.html +5 -9
  99. data/ref/ruby/classes/Vpi/Handle.src/M000088.html +5 -31
  100. data/ref/ruby/classes/Vpi/Handle.src/M000089.html +9 -74
  101. data/ref/ruby/classes/Vpi/Handle.src/M000090.html +31 -17
  102. data/ref/ruby/classes/Vpi/Handle.src/M000091.html +74 -11
  103. data/ref/ruby/classes/Vpi/Handle.src/M000092.html +30 -0
  104. data/ref/ruby/classes/Vpi/Handle.src/M000093.html +11 -55
  105. data/ref/ruby/classes/Vpi/Handle.src/M000095.html +68 -0
  106. data/ref/ruby/classes/Vpi/Handle/Property.html +5 -5
  107. data/ref/ruby/classes/Vpi/Handle/Property.src/{M000094.html → M000096.html} +0 -0
  108. data/ref/ruby/classes/XX/Document.html +45 -45
  109. data/ref/ruby/classes/XX/Document.src/M000074.html +9 -7
  110. data/ref/ruby/classes/XX/Document.src/M000075.html +7 -7
  111. data/ref/ruby/classes/XX/Document.src/M000076.html +7 -9
  112. data/ref/ruby/classes/XX/Document.src/M000077.html +7 -8
  113. data/ref/ruby/classes/XX/Document.src/M000078.html +9 -8
  114. data/ref/ruby/classes/XX/Document.src/M000079.html +8 -21
  115. data/ref/ruby/classes/XX/Document.src/M000080.html +8 -85
  116. data/ref/ruby/classes/XX/Document.src/M000081.html +34 -0
  117. data/ref/ruby/classes/XX/Document.src/M000082.html +98 -0
  118. data/ref/ruby/classes/XX/HTML4.html +5 -5
  119. data/ref/ruby/classes/XX/HTML4.src/{M000036.html → M000038.html} +0 -0
  120. data/ref/ruby/classes/XX/HTML4/Strict.html +5 -5
  121. data/ref/ruby/classes/XX/HTML4/Strict.src/{M000038.html → M000040.html} +0 -0
  122. data/ref/ruby/classes/XX/HTML4/Transitional.html +5 -5
  123. data/ref/ruby/classes/XX/HTML4/Transitional.src/{M000037.html → M000039.html} +0 -0
  124. data/ref/ruby/classes/XX/Markup.html +5 -5
  125. data/ref/ruby/classes/XX/Markup.src/{M000043.html → M000045.html} +0 -0
  126. data/ref/ruby/classes/XX/Markup/ClassMethods.html +40 -40
  127. data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000046.html +9 -12
  128. data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000047.html +7 -7
  129. data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000048.html +12 -14
  130. data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000049.html +7 -7
  131. data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000050.html +14 -14
  132. data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000051.html +7 -9
  133. data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000052.html +27 -0
  134. data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000053.html +22 -0
  135. data/ref/ruby/classes/XX/Markup/InstanceMethods.html +100 -100
  136. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000054.html +43 -18
  137. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000055.html +20 -35
  138. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000056.html +18 -7
  139. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000057.html +35 -18
  140. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000058.html +7 -19
  141. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000059.html +18 -19
  142. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000060.html +19 -15
  143. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000061.html +19 -10
  144. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000062.html +15 -13
  145. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000063.html +10 -7
  146. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000064.html +13 -7
  147. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000065.html +7 -7
  148. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000066.html +7 -7
  149. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000067.html +7 -7
  150. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000068.html +7 -8
  151. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000069.html +7 -7
  152. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000070.html +8 -7
  153. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000071.html +7 -7
  154. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000072.html +20 -0
  155. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000073.html +20 -0
  156. data/ref/ruby/classes/XX/XHTML.html +5 -5
  157. data/ref/ruby/classes/XX/XHTML.src/{M000039.html → M000041.html} +0 -0
  158. data/ref/ruby/classes/XX/XHTML/Strict.html +5 -5
  159. data/ref/ruby/classes/XX/XHTML/Strict.src/{M000041.html → M000043.html} +0 -0
  160. data/ref/ruby/classes/XX/XHTML/Transitional.html +5 -5
  161. data/ref/ruby/classes/XX/XHTML/Transitional.src/{M000040.html → M000042.html} +0 -0
  162. data/ref/ruby/classes/XX/XML.html +5 -5
  163. data/ref/ruby/classes/XX/XML.src/{M000035.html → M000037.html} +0 -0
  164. data/ref/ruby/classes/XX/XMLish.html +5 -5
  165. data/ref/ruby/classes/XX/XMLish.src/{M000042.html → M000044.html} +0 -0
  166. data/ref/ruby/created.rid +1 -1
  167. data/ref/ruby/files/lib/ruby-vpi/float_rb.html +101 -0
  168. data/ref/ruby/files/lib/ruby-vpi/rspec_rb.html +1 -1
  169. data/ref/ruby/files/lib/ruby-vpi/runner_rb.html +1 -1
  170. data/ref/ruby/files/lib/ruby-vpi/verilog_parser_rb.html +1 -1
  171. data/ref/ruby/fr_class_index.html +1 -0
  172. data/ref/ruby/fr_file_index.html +1 -0
  173. data/ref/ruby/fr_method_index.html +69 -67
  174. data/samp/counter/counter.v +4 -4
  175. data/samp/counter/counter_rspec_spec.rb +4 -8
  176. data/samp/counter/counter_xunit_spec.rb +4 -8
  177. metadata +112 -196
  178. data/HEADER +0 -97
  179. data/HISTORY +0 -687
  180. data/README +0 -23
  181. data/doc/background.html +0 -3
  182. data/doc/background.methodology.html +0 -3
  183. data/doc/background.organization.html +0 -10
  184. data/doc/background.running-tests.html +0 -3
  185. data/doc/background.terminology.html +0 -3
  186. data/doc/gfdl-0.html +0 -18
  187. data/doc/gfdl-1.html +0 -70
  188. data/doc/gfdl-10.html +0 -15
  189. data/doc/gfdl-2.html +0 -13
  190. data/doc/gfdl-3.html +0 -31
  191. data/doc/gfdl-4.html +0 -75
  192. data/doc/gfdl-5.html +0 -20
  193. data/doc/gfdl-6.html +0 -12
  194. data/doc/gfdl-7.html +0 -16
  195. data/doc/gfdl-8.html +0 -17
  196. data/doc/gfdl-9.html +0 -9
  197. data/doc/gfdl-addendum.html +0 -25
  198. data/doc/gfdl.html +0 -11
  199. data/doc/glossary.html +0 -3
  200. data/doc/hacking.html +0 -3
  201. data/doc/hacking.release-packages.html +0 -7
  202. data/doc/images/ChangeLog +0 -27
  203. data/doc/images/blank.png +0 -0
  204. data/doc/images/callouts/1.png +0 -0
  205. data/doc/images/callouts/10.png +0 -0
  206. data/doc/images/callouts/11.png +0 -0
  207. data/doc/images/callouts/12.png +0 -0
  208. data/doc/images/callouts/13.png +0 -0
  209. data/doc/images/callouts/14.png +0 -0
  210. data/doc/images/callouts/15.png +0 -0
  211. data/doc/images/callouts/2.png +0 -0
  212. data/doc/images/callouts/3.png +0 -0
  213. data/doc/images/callouts/4.png +0 -0
  214. data/doc/images/callouts/5.png +0 -0
  215. data/doc/images/callouts/6.png +0 -0
  216. data/doc/images/callouts/7.png +0 -0
  217. data/doc/images/callouts/8.png +0 -0
  218. data/doc/images/callouts/9.png +0 -0
  219. data/doc/images/callouts/ChangeLog +0 -15
  220. data/doc/images/copyright +0 -55
  221. data/doc/images/draft.png +0 -0
  222. data/doc/images/toc-blank.png +0 -0
  223. data/doc/images/toc-minus.png +0 -0
  224. data/doc/images/toc-plus.png +0 -0
  225. data/doc/index.html +0 -4
  226. data/doc/introduction.html +0 -3
  227. data/doc/introduction.license.html +0 -3
  228. data/doc/introduction.manifest.html +0 -3
  229. data/doc/introduction.related-works.html +0 -3
  230. data/doc/introduction.resources.html +0 -3
  231. data/doc/manual.txt +0 -1852
  232. data/doc/problem.ivl.html +0 -18
  233. data/doc/problems.html +0 -3
  234. data/doc/problems.ruby.html +0 -3
  235. data/doc/problems.vsim.html +0 -3
  236. data/doc/setup.html +0 -3
  237. data/doc/setup.installation.html +0 -9
  238. data/doc/setup.maintenance.html +0 -3
  239. data/doc/setup.reqs.html +0 -3
  240. data/doc/src/figures.dia +0 -0
  241. data/doc/src/license.xml +0 -446
  242. data/doc/src/manual.xml +0 -1824
  243. data/doc/src/manual.xsl +0 -23
  244. data/doc/src/shared.dtd +0 -62
  245. data/doc/styles/manual.css +0 -91
  246. data/doc/usage.examples.html +0 -3
  247. data/doc/usage.html +0 -3
  248. data/doc/usage.tools.html +0 -9
  249. data/doc/usage.tutorial.html +0 -189
  250. data/header.html +0 -95
  251. data/header.part.html +0 -95
  252. data/history.html +0 -1442
  253. data/history.part.html +0 -1346
  254. data/memo.html +0 -211
  255. data/readme.html +0 -138
  256. data/readme.part.html +0 -42
  257. data/ref/c/globals_0x62.html +0 -62
  258. data/ref/c/globals_0x67.html +0 -64
  259. data/ref/c/globals_0x69.html +0 -62
  260. data/ref/c/globals_0x6c.html +0 -64
  261. data/ref/c/globals_0x6d.html +0 -62
  262. data/ref/c/globals_0x6e.html +0 -63
  263. data/ref/c/globals_0x75.html +0 -63
  264. data/ref/c/globals_defs_0x6c.html +0 -57
  265. data/ref/c/globals_defs_0x6e.html +0 -56
  266. data/ref/c/globals_defs_0x72.html +0 -57
  267. data/ref/c/globals_defs_0x73.html +0 -164
  268. data/ref/c/globals_defs_0x75.html +0 -56
  269. data/ref/c/globals_func_0x66.html +0 -62
  270. data/ref/c/globals_func_0x67.html +0 -55
  271. data/ref/c/globals_func_0x69.html +0 -53
  272. data/ref/c/globals_func_0x70.html +0 -53
  273. data/ref/c/globals_func_0x72.html +0 -57
  274. data/ref/c/globals_func_0x73.html +0 -114
  275. data/ref/c/globals_func_0x76.html +0 -57
  276. data/ref/c/structswig__cast__info.html +0 -98
  277. data/ref/c/structswig__class.html +0 -115
  278. data/ref/c/structswig__module__info.html +0 -132
  279. data/ref/c/structswig__type__info.html +0 -132
  280. data/ref/c/swig__vpi_8h.html +0 -8739
  281. data/ref/c/swig__wrap_8cin.html +0 -11556
  282. data/ref/c/unions__vpi__value__value.html +0 -166
  283. data/ref/ruby/classes/String.src/M000032.html +0 -41
  284. data/ref/ruby/classes/Vpi/Handle.src/M000085.html +0 -18
  285. data/ref/ruby/classes/Vpi/Handle.src/M000086.html +0 -18
  286. data/ref/ruby/classes/XX/Document.src/M000072.html +0 -22
  287. data/ref/ruby/classes/XX/Document.src/M000073.html +0 -20
  288. data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000044.html +0 -22
  289. data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000045.html +0 -20
  290. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000052.html +0 -56
  291. data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000053.html +0 -33
  292. data/style.css +0 -47
data/doc/src/manual.xml DELETED
@@ -1,1824 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!--
3
- Copyright 2006 Suraj N. Kurapati.
4
-
5
- Permission is granted to copy, distribute and/or modify this
6
- document under the terms of the GNU Free Documentation License,
7
- Version 1.1 or any later version published by the Free Software
8
- Foundation; with no Invariant Sections, no Front-Cover Texts and
9
- no Back-Cover Texts. A copy of the license is included in the
10
- the file named "LICENSE".
11
-
12
- Source code formatting rules:
13
- <token> is a reserved keyword
14
- <type> is structure, class, variable type, etc.
15
- <varname> is a variable name
16
- <function> is function or method name
17
- <literal> is for strings, numbers, etc. anything literal
18
- <constant> is a constant variable name
19
- <remark> is a comment
20
- -->
21
-
22
- <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
23
- <!-- imports -->
24
- <!ENTITY % sharedDTD SYSTEM "shared.dtd"> %sharedDTD;
25
- <!ENTITY license SYSTEM "license.xml">
26
-
27
-
28
- <!-- content -->
29
- <!ENTITY background.step3 "<para>When the Ruby interpreter invokes the <code><constant>Vpi</constant>::<function>relay_verilog</function></code> method, it is paused and the &v; simulator is given control.</para>">
30
-
31
- <!ENTITY fixed-in-2.0.0 "<note>
32
- <title>Problem solved</title>
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
- </note>">
35
-
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'/>">
47
-
48
- <!ENTITY rake "Rake">
49
- <!ENTITY rake.url "http://rake.rubyforge.org/">
50
- <!ENTITY rake-doc.url "http://docs.rubyrake.org/">
51
-
52
- <!ENTITY rspec "rSpec">
53
- <!ENTITY rspec.url "http://rspec.rubyforge.org">
54
- <!ENTITY rspec..ulink "<ulink url='&rspec.url;'>&rspec;</ulink>">
55
- <!ENTITY rspec-tutorial.url "http://rspec.rubyforge.org/tutorials/index.html">
56
- <!ENTITY rspec-tutorial..ulink "<ulink url='&rspec-tutorial.url;'>&rspec; tutorial</ulink>">
57
-
58
- <!ENTITY kd "<application>kdiff3</application>">
59
-
60
- <!ENTITY test-gen.link "<link linkend='usage.tools.generate-test'>automated test generator</link>">
61
- ]>
62
- <book lang="en">
63
- <bookinfo>
64
- <title>&rv; user manual</title>
65
-
66
- &snk..copyright;
67
-
68
- <copyright>
69
- <year>2005</year>
70
- <year>2006</year>
71
- <holder><ulink url="http://tango.freedesktop.org">Tango Desktop Project</ulink> <remark>for admonition and navigation graphics released under <ulink url="images/COPYING">this license</ulink>.</remark></holder>
72
- </copyright>
73
-
74
- <copyright>
75
- <year>1999</year>
76
- <year>2000</year>
77
- <year>2001</year>
78
- <holder>Norman Walsh <remark>for DocBook graphics released under <ulink url="images/copyright">this license</ulink>.</remark></holder>
79
- </copyright>
80
-
81
- <abstract>
82
- <para>This manual explains how to use &rv;. A <ulink url="manual.txt">plain-text version of this manual</ulink> is also available. Finally, you can find the newest version of this manual at the <ulink url="&rv.url;">&rv; website</ulink>.</para>
83
- </abstract>
84
-
85
- <legalnotice>
86
- <para>Permission is granted to copy, distribute and/or modify this document under the terms of the &gnu; Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "&gnu; Free Documentation License".</para>
87
- </legalnotice>
88
- </bookinfo>
89
-
90
- <chapter id="introduction">
91
- <title>Introduction</title>
92
- <para>&rv; is a &r..ulink; interface to <ulink url="http://en.wikipedia.org/wiki/Verilog">&vpi;</ulink>. It lets you create complex &v; test benches easily and wholly in Ruby.</para>
93
-
94
- <section id="introduction.license">
95
- <title>License</title>
96
- <para>&rv; is <ulink url="http://en.wikipedia.org/wiki/Free_software">free software</ulink>; you can redistribute it and/or modify it under the terms of the <ulink url="http://www.gnu.org/copyleft/gpl.html">&gnu; General Public License</ulink> as published by the <ulink url="http://www.fsf.org">Free Software Foundation</ulink>; either version 2 of the License, or (at your option) any later version.</para>
97
- </section>
98
-
99
- <section id="introduction.manifest">
100
- <title>Manifest</title>
101
-
102
- <para>When you extract a &rv; release package, the following is what you would expect to find.</para>
103
-
104
- <variablelist>
105
- <varlistentry>
106
- <term><filename>doc</filename></term>
107
- <listitem>
108
- <para>This directory contains user documentation in various formats.</para>
109
- </listitem>
110
- </varlistentry>
111
-
112
- <varlistentry>
113
- <term><filename>ref</filename></term>
114
- <listitem>
115
- <para>This directory contains reference <acronym>API</acronym> documentation in &html; format.</para>
116
- </listitem>
117
- </varlistentry>
118
-
119
- <varlistentry>
120
- <term><filename>ext</filename></term>
121
- <listitem>
122
- <para>This directory contains source code, written in the C language, for the <link linkend="background.organization">core of &rv;</link>.</para>
123
- </listitem>
124
- </varlistentry>
125
-
126
- <varlistentry>
127
- <term><filename>lib</filename></term>
128
- <listitem>
129
- <para>This directory contains Ruby libraries provided by &rv;.</para>
130
- </listitem>
131
- </varlistentry>
132
-
133
- <varlistentry>
134
- <term><filename>bin</filename></term>
135
- <listitem>
136
- <para>This directory contains various tools. See <xref linkend="usage.tools"/> for more information.</para>
137
- </listitem>
138
- </varlistentry>
139
-
140
- <varlistentry>
141
- <term><filename>samp</filename></term>
142
- <listitem>
143
- <para>This directory contains example tests. See <xref linkend="usage.examples"/> for more information.</para>
144
- </listitem>
145
- </varlistentry>
146
- </variablelist>
147
- </section>
148
-
149
- <section id="introduction.resources">
150
- <title>Resources</title>
151
-
152
- <variablelist>
153
- <varlistentry>
154
- <term><ulink url="&rv.url-project;">Project</ulink></term>
155
- <listitem>
156
- <para>Access project facilities, hosted generously by <ulink url="http://rubyforge.org">RubyForge</ulink>.</para>
157
- </listitem>
158
- </varlistentry>
159
-
160
- <varlistentry>
161
- <term><ulink url="&rv.url-tracker;">Tracker</ulink></term>
162
- <listitem>
163
- <para>Report problems, contribute patches, and more.</para>
164
- </listitem>
165
- </varlistentry>
166
-
167
- <varlistentry>
168
- <term><ulink url="&rv.url-download;">Releases</ulink></term>
169
- <listitem>
170
- <para>Download the newest release of &rv;.</para>
171
- </listitem>
172
- </varlistentry>
173
-
174
- <varlistentry>
175
- <term><ulink url="&rv.url-source;">Sources</ulink></term>
176
- <listitem>
177
- <para>Browse or access the source code repository.</para>
178
- </listitem>
179
- </varlistentry>
180
-
181
- <varlistentry>
182
- <term><ulink url="&rv.url-forum;">Forums</ulink></term>
183
- <listitem>
184
- <para>Ask for help, give feedback, or discuss.</para>
185
- </listitem>
186
- </varlistentry>
187
- </variablelist>
188
- </section>
189
-
190
- <section id="introduction.related-works">
191
- <title>Related works</title>
192
-
193
- <para>You may wish to consider the following projects, which are similar to &rv;.</para>
194
-
195
- <variablelist>
196
- <varlistentry>
197
- <term><ulink url="http://rhdl.rubyforge.org">RHDL</ulink></term>
198
- <listitem>
199
- <para>Hardware description and verification language based on Ruby.</para>
200
- </listitem>
201
- </varlistentry>
202
- <varlistentry>
203
- <term><ulink url="http://myhdl.jandecaluwe.com">MyHDL</ulink></term>
204
- <listitem>
205
- <para>Hardware description and verification language based on Python, which features conversion to &v; and co-simulation.</para>
206
- </listitem>
207
- </varlistentry>
208
- <varlistentry>
209
- <term><ulink url="http://jove.sourceforge.net">JOVE</ulink></term>
210
- <listitem>
211
- <para>Java interface to &vpi;.</para>
212
- </listitem>
213
- </varlistentry>
214
- <varlistentry>
215
- <term><ulink url="http://embedded.eecs.berkeley.edu/Alumni/pinhong/scriptEDA/">ScriptEDA</ulink></term>
216
- <listitem>
217
- <para>Perl, Python, and Tcl interface to &vpi;.</para>
218
- </listitem>
219
- </varlistentry>
220
- </variablelist>
221
-
222
- <section id="introduction.related-works.pli">
223
- <title>Ye olde PLI</title>
224
- <para>The following projects utilize the archaic <acronym>tf</acronym> and <abbrev>acc</abbrev> PLI interfaces, which have been officially deprecated in IEEE Std 1364-2005.</para>
225
-
226
- <variablelist>
227
- <varlistentry>
228
- <term><ulink url="http://www.nelsim.com">ScriptSim</ulink></term>
229
- <listitem>
230
- <para>Perl, Python, and Tcl/Tk interface to PLI.</para>
231
- </listitem>
232
- </varlistentry>
233
- <varlistentry>
234
- <term><ulink url="http://www.veripool.com/verilog-pli.html">&v;::Pli</ulink></term>
235
- <listitem>
236
- <para>Perl interface to PLI.</para>
237
- </listitem>
238
- </varlistentry>
239
- <varlistentry>
240
- <term><ulink url="http://www.time-rover.com/jpli/">JPLI</ulink></term>
241
- <listitem>
242
- <para>Java interface to PLI.</para>
243
- </listitem>
244
- </varlistentry>
245
- </variablelist>
246
- </section>
247
- </section>
248
- </chapter>
249
-
250
- <chapter id="background">
251
- <title>Background</title>
252
-
253
- <para>&rv; is a &bench.gloss; which lets you &test.gloss; &v; modules using the Ruby language.</para>
254
-
255
- <section id="background.methodology">
256
- <title>Methodology</title>
257
-
258
- <para>&rv; presents an open-ended interface to &vpi;. Thus, you can use any methodology you wish when writing tests. However, &BDD.gloss; is emphasized in this project because it greatly simplifies thinking about <emphasis>how</emphasis> to verify a design.</para>
259
- </section>
260
-
261
- <section id="background.terminology">
262
- <title>Terminology</title>
263
-
264
- <tip>
265
- <para>Have a look at the <xref linkend="glossary"/> for definitions of terms used in this manual.</para>
266
- </tip>
267
-
268
- <para>As a newcomer into the world of &v;, I often heard the term <emphasis>test bench</emphasis>: <quote>I ran the test bench, but it didn't work!</quote> or <quote>Are you crazy?!! You <emphasis>still</emphasis> haven't written the test bench? o_O</quote>, for example. I flipped through my textbook and surfed the Internet for a definition of the term, but it was to no avail. Instead, both resources nonchalantly employed the term <emphasis>throughout</emphasis> their being, as if mocking my ignorance of what seems to be universal knowledge.</para>
269
-
270
- <para>Defeated, I turned to my inner faculties to determine the answer. <quote>Let's see, the term <emphasis>test bench</emphasis> has the word <emphasis>test</emphasis>&mdash;so it has something to do with testing&mdash;and it has the word <emphasis>bench</emphasis>&mdash;so maybe it's referring to a table where the testing should occur</quote>. This reasoning grew increasingly familiar as my mind rummaged through towering stores of obsolescence and ultimately revealed dreaded memories of sleepless anguish: debugging electronics in the robotics laboratory.</para>
271
-
272
- <para><quote>Aha!</quote>, I exclaimed hesitantly, trying to dismiss the past. The term has its roots in the testing of electronic devices, where an engineer would sit at a bench in an electronics laboratory and verify that an electronic component satisfies some criteria. The bench would be furnished with tools of measurement and manipulation&mdash;such as oscilloscopes, voltmeters, soldering irons, and so on&mdash;which help the engineer to verify the electronic component or locate the sources of defects in the component.</para>
273
-
274
- <para>Alright, now I remember what a laboratory bench is, but how does that compare with the term test bench? Surely they cannot have the same meaning, because it doesn't make sense to <emphasis>run</emphasis> a laboratory bench or to <emphasis>write</emphasis> one. Thus, to avoid propagating such confusion into this manual, I have attempted to clarify the terminology by <link linkend="glossary">simplifying and reintroducing it in a new light</link>.</para>
275
- </section>
276
-
277
- <section id="background.organization">
278
- <title>Organization</title>
279
-
280
- <figure id="fig..organization">
281
- <title>Overall organization of a test</title>
282
- <mediaobject>
283
- <imageobject>
284
- <imagedata fileref="figures/organization.png"/>
285
- </imageobject>
286
- </mediaobject>
287
- </figure>
288
-
289
- <para>As <xref linkend="fig..organization"/> shows, a test is composed of a bench, a design, and a specification. To extend the <link linkend="background.terminology">analogy of an electronics laboratory</link>, the first acts as the laboratory bench which provides measurement and manipulation tools. The second acts as the electronic component being verified by the engineer. And the third acts as the engineer who measures, manipulates, and verifies the electronic component.</para>
290
-
291
- <section id="organization.vpi">
292
- <title>Interface to &vpi;</title>
293
-
294
- <figure id="fig..organization.detail">
295
- <title>Detailed organization of a test</title>
296
- <mediaobject>
297
- <imageobject>
298
- <imagedata fileref="figures/organization_detailed.png"/>
299
- </imageobject>
300
- </mediaobject>
301
- </figure>
302
-
303
- <para>In <xref linkend="fig..organization.detail"/>, &rv; acts as the bench, a &v; simulator encapsulates the design, and a Ruby interpreter encapsulates the specification. Notice that &rv; encapsulates all communication between the Ruby interpreter and &vpi;. This allows the specification, or any Ruby program in general, to access &vpi; using nothing more than the Ruby language! Thus, &rv; removes the burden of having to write C programs in order to access &vpi;.</para>
304
-
305
- <para>Furthermore, &rv; presents the <emphasis>entire</emphasis> IEEE Std 1364-2005 &vpi; interface to the Ruby interpreter, but with the following minor changes.
306
-
307
- <itemizedlist>
308
- <listitem>
309
- <para>The first letter in the name of every function, type, structure, and constant becomes capitalized.</para>
310
-
311
- <para>For example, the <type>s_vpi_value</type> structure in C becomes the <type>S_vpi_value</type> class in Ruby. Likewise, the <constant>vpiIntVal</constant> constant in C becomes the <constant>VpiIntVal</constant> constant in Ruby.</para>
312
- </listitem>
313
-
314
- <listitem>
315
- <para>The &vpi; functions <function>vpi_vprintf</function> and <function>vpi_mcd_vprintf</function> are not made accessible to Ruby. However, this isn't a big problem because you can use Ruby's <function>printf</function> method instead.</para>
316
-
317
- <para>The reason for this limitation is that some C compilers have trouble with pointers to the <type>va_list</type> type. For these compilers, the second line in the code shown below causes a <quote>type mismatch</quote> error.</para>
318
-
319
- <programlisting>
320
- <type>void</type> <function>foo</function>(<parameter><type>va_list</type> <varname>ap</varname></parameter>) {
321
- <type>va_list</type> *<varname>p</varname> = &amp;<varname>ap</varname>;
322
- }
323
- </programlisting>
324
- </listitem>
325
- </itemizedlist>
326
- </para>
327
-
328
- <section id="organization.vpi.util">
329
- <title>&vpi; utility layer</title>
330
- <para>From a user's perspective, the &vpi; utility layer greatly enhances the ability to interact with handles. One simply invokes a handle's methods, which are carefully named in the following manner, to access either (1) its children or (2) its &vpi; properties.</para>
331
-
332
- <para>The children of a handle are simply the handles that are immediately contained within it in. For example, suppose that you had a &v; module that contains some registers. The children, of a handle to the module, would be handles to the registers.</para>
333
-
334
- <para>In the event that a child handle has the same name as a &vpi; property, the child is given priority. However, you can always access &vpi; properties explicitly via the <function>get_value</function> and <function>put_value</function> methods.</para>
335
-
336
- <table id="table..handle-property-accessor-naming-format" frame='all'>
337
- <title>Naming format for accessing a handle's &vpi; properties</title>
338
- <tgroup cols='6'>
339
- <colspec colname='c1'/>
340
- <colspec colname='c2'/>
341
- <colspec colname='c3'/>
342
- <colspec colname='c4'/>
343
- <colspec colname='c5'/>
344
- <colspec colname='c6'/>
345
- <thead>
346
- <row>
347
- <entry>Operation</entry>
348
- <entry>_</entry>
349
- <entry>Property</entry>
350
- <entry>_</entry>
351
- <entry>Accessor</entry>
352
- <entry>Addendum</entry>
353
- </row>
354
- </thead>
355
- <tbody>
356
- <row>
357
- <entry namest="c1" nameend="c2">optional</entry>
358
- <entry>required</entry>
359
- <entry namest="c4" nameend="c5">optional</entry>
360
- <entry>optional</entry>
361
- </row>
362
- </tbody>
363
- </tgroup>
364
- </table>
365
-
366
- <variablelist>
367
- <varlistentry>
368
- <term>Operation</term>
369
- <listitem>
370
- <para>This parameter suggests a method that should be invoked in the context of the Property parameter.</para>
371
- </listitem>
372
- </varlistentry>
373
- <varlistentry>
374
- <term>Property</term>
375
- <listitem>
376
- <para>This parameter suggests which &vpi; property should be accessed. The first letter of this parameter's value should be lower case, and the <emphasis>vpi</emphasis> prefix&mdash;common to all &vpi; properties&mdash;can be omitted.</para>
377
-
378
- <para>For example, the &vpi; property <emphasis>vpiFullName</emphasis> is considered equivalent to <emphasis>fullName</emphasis> but not equivalent to either <emphasis>FullName</emphasis> or <emphasis>full_name</emphasis>.</para>
379
- </listitem>
380
- </varlistentry>
381
- <varlistentry>
382
- <term>Accessor</term>
383
- <listitem>
384
- <para>This parameter suggests which &vpi; function should be used to access the &vpi; property. When this parameter is not specified, the &vpi; utility layer will attempt to <emphasis>guess</emphasis> the value of this parameter (<ulink url="../ref/ruby/classes/Vpi/Handle/Property.html">see the source code</ulink> of the <code><constant>Property</constant>.<function>resolve</function></code> method for details).</para>
385
-
386
- <table frame='all'>
387
- <title>Possible accessors and their implications</title>
388
- <tgroup cols='0'>
389
- <thead>
390
- <row>
391
- <entry>Accessor</entry>
392
- <entry>Kind of value accessed</entry>
393
- <entry>&vpi; functions used to access the value</entry>
394
- </row>
395
- </thead>
396
- <tbody>
397
- <row>
398
- <entry>d</entry>
399
- <entry>delay</entry>
400
- <entry><function>vpi_get_delays</function>, <function>vpi_put_delays</function></entry>
401
- </row>
402
- <row>
403
- <entry>l</entry>
404
- <entry>logic</entry>
405
- <entry><function>vpi_get_value</function>, <function>vpi_put_value</function></entry>
406
- </row>
407
- <row>
408
- <entry>i</entry>
409
- <entry>integer</entry>
410
- <entry><function>vpi_get</function></entry>
411
- </row>
412
- <row>
413
- <entry>b</entry>
414
- <entry>boolean</entry>
415
- <entry><function>vpi_get</function></entry>
416
- </row>
417
- <row>
418
- <entry>s</entry>
419
- <entry>string</entry>
420
- <entry><function>vpi_get_str</function></entry>
421
- </row>
422
- <row>
423
- <entry>h</entry>
424
- <entry>handle</entry>
425
- <entry><function>vpi_handle</function></entry>
426
- </row>
427
- </tbody>
428
- </tgroup>
429
- </table>
430
- </listitem>
431
- </varlistentry>
432
- <varlistentry>
433
- <term>Addendum</term>
434
- <listitem>
435
- <para>When this parameter is a question mark (<emphasis>?</emphasis>), it suggests that the specified &vpi; property should be queried as a boolean value. This produces the same effect as specifying <emphasis>b</emphasis> for the Accessor parameter.</para>
436
-
437
- <para>When this parameter is an equal sign (<emphasis>=</emphasis>), it suggests that the specified &vpi; property should be written to.</para>
438
- </listitem>
439
- </varlistentry>
440
- </variablelist>
441
-
442
- <example id="ex..handle-property-accessor-naming-format">
443
- <title>Accessing a handle's &vpi; properties</title>
444
-
445
- <informaltable frame='all'>
446
- <tgroup cols='6'>
447
- <colspec colname='c1'/>
448
- <colspec colname='c2'/>
449
- <colspec colname='c3'/>
450
- <colspec colname='c4'/>
451
- <colspec colname='c5'/>
452
- <colspec colname='c6'/>
453
- <colspec colname='c7'/>
454
- <colspec colname='c8'/>
455
- <thead>
456
- <row>
457
- <entry morerows="1">Ruby expression</entry>
458
- <entry namest="c2" nameend="c7">Naming format</entry>
459
- <entry morerows="1">Description</entry>
460
- </row>
461
- <row>
462
- <entry namest="c2">Operation</entry>
463
- <entry>_</entry>
464
- <entry>Property</entry>
465
- <entry>_</entry>
466
- <entry>Accessor</entry>
467
- <entry>Addendum</entry>
468
- </row>
469
- </thead>
470
- <tbody>
471
- <!-- each -->
472
- <row>
473
- <entry><code><varname>handle</varname>.<function>each_vpiNet</function> {|<varname>net</varname>| <function>puts</function> <varname>net</varname>.<function>fullName</function>}</code></entry>
474
- <entry>each</entry>
475
- <entry>_</entry>
476
- <entry>vpiNet</entry>
477
- <entry></entry>
478
- <entry></entry>
479
- <entry></entry>
480
- <entry morerows="1">These expressions print the full name of each <constant>vpiNet</constant> object associated with the handle.</entry>
481
- </row>
482
- <row>
483
- <entry><code><varname>handle</varname>.<function>each_net</function> {|<varname>net</varname>| <function>puts</function> <varname>net</varname>.<function>fullName</function>}</code></entry>
484
- <entry>each</entry>
485
- <entry>_</entry>
486
- <entry>net</entry>
487
- <entry></entry>
488
- <entry></entry>
489
- <entry></entry>
490
- </row>
491
-
492
- <!-- all? -->
493
- <row>
494
- <entry><code><varname>handle</varname>.<function>all_reg?</function> {|<varname>reg</varname>| <varname>reg</varname>.<function>size</function> == <literal>1</literal>}</code></entry>
495
- <entry>all?</entry>
496
- <entry>_</entry>
497
- <entry>vpiReg</entry>
498
- <entry></entry>
499
- <entry></entry>
500
- <entry></entry>
501
- <entry morerows="1">These expressions check if all registers associated with the handle are capable of storing only one bit.</entry>
502
- </row>
503
-
504
- <row>
505
- <entry><code><varname>handle</varname>.<function>all_reg?</function> {|<varname>reg</varname>| <varname>reg</varname>.<function>size</function> == <literal>1</literal>}</code></entry>
506
- <entry>all?</entry>
507
- <entry>_</entry>
508
- <entry>reg</entry>
509
- <entry></entry>
510
- <entry></entry>
511
- <entry></entry>
512
- </row>
513
-
514
- <!-- select -->
515
- <row>
516
- <entry><code><varname>handle</varname>.<function>select_vpiNet</function> {|<varname>net</varname>| <varname>net</varname>.<function>x?</function>}</code></entry>
517
- <entry>select</entry>
518
- <entry>_</entry>
519
- <entry>vpiReg</entry>
520
- <entry></entry>
521
- <entry></entry>
522
- <entry></entry>
523
- <entry morerows="4">These expressions return a list of nets whose logic value is <quote>don't care</quote>.</entry>
524
- </row>
525
-
526
- <row>
527
- <entry><code><varname>handle</varname>.<function>select_net</function> {|<varname>net</varname>| <varname>net</varname>.<function>x?</function>}</code></entry>
528
- <entry>select</entry>
529
- <entry>_</entry>
530
- <entry>net</entry>
531
- <entry></entry>
532
- <entry></entry>
533
- <entry></entry>
534
- </row>
535
-
536
- <row>
537
- <entry><code><varname>handle</varname>.<function>select</function>(<constant>VpiNet</constant>) {|<varname>net</varname>| <varname>net</varname>.<function>x?</function>}</code></entry>
538
- <entry>select</entry>
539
- <entry>_</entry>
540
- <entry></entry>
541
- <entry></entry>
542
- <entry></entry>
543
- <entry></entry>
544
- </row>
545
-
546
- <row>
547
- <entry><code><varname>handle</varname>.<function>select</function>(<literal>:VpiNet</literal>) {|<varname>net</varname>| <varname>net</varname>.<function>x?</function>}</code></entry>
548
- <entry>select</entry>
549
- <entry>_</entry>
550
- <entry></entry>
551
- <entry></entry>
552
- <entry></entry>
553
- <entry></entry>
554
- </row>
555
-
556
- <row>
557
- <entry><code><varname>handle</varname>.<function>select</function>(<literal>:net</literal>) {|<varname>net</varname>| <varname>net</varname>.<function>x?</function>}</code></entry>
558
- <entry>select</entry>
559
- <entry>_</entry>
560
- <entry></entry>
561
- <entry></entry>
562
- <entry></entry>
563
- <entry></entry>
564
- </row>
565
-
566
- <row>
567
- <entry><code><varname>handle</varname>.<function>vpiIntVal</function></code></entry>
568
- <entry></entry>
569
- <entry></entry>
570
- <entry>vpiIntVal</entry>
571
- <entry></entry>
572
- <entry></entry>
573
- <entry></entry>
574
- <entry morerows="3">These expressions access the logic value of the handle's <constant>vpiIntVal</constant> property.</entry>
575
- </row>
576
- <row>
577
- <entry><code><varname>handle</varname>.<function>vpiIntVal_l</function></code></entry>
578
- <entry></entry>
579
- <entry></entry>
580
- <entry>vpiIntVal</entry>
581
- <entry>_</entry>
582
- <entry>l</entry>
583
- <entry></entry>
584
- </row>
585
- <row>
586
- <entry><code><varname>handle</varname>.<function>intVal</function></code></entry>
587
- <entry></entry>
588
- <entry></entry>
589
- <entry>intVal</entry>
590
- <entry></entry>
591
- <entry></entry>
592
- <entry></entry>
593
- </row>
594
- <row>
595
- <entry><code><varname>handle</varname>.<function>intVal_l</function></code></entry>
596
- <entry></entry>
597
- <entry></entry>
598
- <entry>intVal</entry>
599
- <entry>_</entry>
600
- <entry>l</entry>
601
- <entry></entry>
602
- </row>
603
-
604
- <row>
605
- <entry><code><varname>handle</varname>.<function>vpiIntVal</function> = <literal>15</literal></code></entry>
606
- <entry></entry>
607
- <entry></entry>
608
- <entry>vpiIntVal</entry>
609
- <entry></entry>
610
- <entry></entry>
611
- <entry>=</entry>
612
- <entry morerows="3">These expressions assign the number 15 to the logic value of the handle's <constant>vpiIntVal</constant> property.</entry>
613
- </row>
614
- <row>
615
- <entry><code><varname>handle</varname>.<function>vpiIntVal_l</function> = <literal>15</literal></code></entry>
616
- <entry></entry>
617
- <entry></entry>
618
- <entry>vpiIntVal</entry>
619
- <entry>_</entry>
620
- <entry>l</entry>
621
- <entry>=</entry>
622
- </row>
623
- <row>
624
- <entry><code><varname>handle</varname>.<function>intVal</function> = <literal>15</literal></code></entry>
625
- <entry></entry>
626
- <entry></entry>
627
- <entry>intVal</entry>
628
- <entry></entry>
629
- <entry></entry>
630
- <entry>=</entry>
631
- </row>
632
- <row>
633
- <entry><code><varname>handle</varname>.<function>intVal</function>_l = <literal>15</literal></code></entry>
634
- <entry></entry>
635
- <entry></entry>
636
- <entry>intVal</entry>
637
- <entry>_</entry>
638
- <entry>l</entry>
639
- <entry>=</entry>
640
- </row>
641
-
642
- <row>
643
- <entry><code><varname>handle</varname>.<function>vpiType</function></code></entry>
644
- <entry></entry>
645
- <entry></entry>
646
- <entry>vpiType</entry>
647
- <entry></entry>
648
- <entry></entry>
649
- <entry></entry>
650
- <entry morerows="3">These expressions access the integer value of the handle's <constant>vpiType</constant> property.</entry>
651
- </row>
652
- <row>
653
- <entry><code><varname>handle</varname>.<function>vpiType_i</function></code></entry>
654
- <entry></entry>
655
- <entry></entry>
656
- <entry>vpiType</entry>
657
- <entry>_</entry>
658
- <entry>i</entry>
659
- <entry></entry>
660
- </row>
661
- <row>
662
- <entry><code><varname>handle</varname>.<function>type</function></code></entry>
663
- <entry></entry>
664
- <entry></entry>
665
- <entry>type</entry>
666
- <entry></entry>
667
- <entry></entry>
668
- <entry></entry>
669
- </row>
670
- <row>
671
- <entry><code><varname>handle</varname>.<function>type_i</function></code></entry>
672
- <entry></entry>
673
- <entry></entry>
674
- <entry>type</entry>
675
- <entry>_</entry>
676
- <entry>i</entry>
677
- <entry></entry>
678
- </row>
679
-
680
- <row>
681
- <entry><code><varname>handle</varname>.<function>vpiProtected</function></code></entry>
682
- <entry></entry>
683
- <entry></entry>
684
- <entry>vpiProtected</entry>
685
- <entry></entry>
686
- <entry></entry>
687
- <entry></entry>
688
- <entry morerows="5">These expressions access the boolean value of the handle's <constant>vpiProtected</constant> property.</entry>
689
- </row>
690
- <row>
691
- <entry><code><varname>handle</varname>.<function>vpiProtected_b</function></code></entry>
692
- <entry></entry>
693
- <entry></entry>
694
- <entry>vpiProtected</entry>
695
- <entry>_</entry>
696
- <entry>b</entry>
697
- <entry></entry>
698
- </row>
699
- <row>
700
- <entry><code><varname>handle</varname>.<function>vpiProtected?</function></code></entry>
701
- <entry></entry>
702
- <entry></entry>
703
- <entry>vpiProtected</entry>
704
- <entry></entry>
705
- <entry></entry>
706
- <entry>?</entry>
707
- </row>
708
- <row>
709
- <entry><code><varname>handle</varname>.<function>protected</function></code></entry>
710
- <entry></entry>
711
- <entry></entry>
712
- <entry>protected</entry>
713
- <entry></entry>
714
- <entry></entry>
715
- <entry></entry>
716
- </row>
717
- <row>
718
- <entry><code><varname>handle</varname>.<function>protected_b</function></code></entry>
719
- <entry></entry>
720
- <entry></entry>
721
- <entry>protected</entry>
722
- <entry>_</entry>
723
- <entry>b</entry>
724
- <entry></entry>
725
- </row>
726
- <row>
727
- <entry><code><varname>handle</varname>.<function>protected?</function></code></entry>
728
- <entry></entry>
729
- <entry></entry>
730
- <entry>protected</entry>
731
- <entry></entry>
732
- <entry></entry>
733
- <entry>?</entry>
734
- </row>
735
-
736
- <row>
737
- <entry><code><varname>handle</varname>.<function>vpiFullName</function></code></entry>
738
- <entry></entry>
739
- <entry></entry>
740
- <entry>vpiFullName</entry>
741
- <entry></entry>
742
- <entry></entry>
743
- <entry></entry>
744
- <entry morerows="3">These expressions access the string value of the handle's <constant>vpiFullName</constant> property.</entry>
745
- </row>
746
- <row>
747
- <entry><code><varname>handle</varname>.<function>vpiFullName_s</function></code></entry>
748
- <entry></entry>
749
- <entry></entry>
750
- <entry>vpiFullName</entry>
751
- <entry>_</entry>
752
- <entry>s</entry>
753
- <entry></entry>
754
- </row>
755
- <row>
756
- <entry><code><varname>handle</varname>.<function>fullName</function></code></entry>
757
- <entry></entry>
758
- <entry></entry>
759
- <entry>fullName</entry>
760
- <entry></entry>
761
- <entry></entry>
762
- <entry></entry>
763
- </row>
764
- <row>
765
- <entry><code><varname>handle</varname>.<function>fullName_s</function></code></entry>
766
- <entry></entry>
767
- <entry></entry>
768
- <entry>fullName</entry>
769
- <entry>_</entry>
770
- <entry>s</entry>
771
- <entry></entry>
772
- </row>
773
-
774
- <row>
775
- <entry><code><varname>handle</varname>.<function>vpiParent</function></code></entry>
776
- <entry></entry>
777
- <entry></entry>
778
- <entry>vpiParent</entry>
779
- <entry></entry>
780
- <entry></entry>
781
- <entry></entry>
782
- <entry morerows="3">These expressions access the handle value of the handle's <constant>vpiParent</constant> property.</entry>
783
- </row>
784
- <row>
785
- <entry><code><varname>handle</varname>.<function>vpiParent_h</function></code></entry>
786
- <entry></entry>
787
- <entry></entry>
788
- <entry>vpiParent</entry>
789
- <entry>_</entry>
790
- <entry>h</entry>
791
- <entry></entry>
792
- </row>
793
- <row>
794
- <entry><code><varname>handle</varname>.<function>parent</function></code></entry>
795
- <entry></entry>
796
- <entry></entry>
797
- <entry>parent</entry>
798
- <entry></entry>
799
- <entry></entry>
800
- <entry></entry>
801
- </row>
802
- <row>
803
- <entry><code><varname>handle</varname>.<function>parent_h</function></code></entry>
804
- <entry></entry>
805
- <entry></entry>
806
- <entry>parent</entry>
807
- <entry>_</entry>
808
- <entry>h</entry>
809
- <entry></entry>
810
- </row>
811
-
812
- </tbody>
813
- </tgroup>
814
- </informaltable>
815
- </example>
816
- </section>
817
- </section>
818
- </section>
819
-
820
- <section id="background.running-tests">
821
- <title>Running a test</title>
822
-
823
- <para>Unlike an engineer who can verify an electronic component in real-time, the &v; simulator and the Ruby interpreter (see <xref linkend="fig..organization.detail"/>) take turns working with objects in a simulation when a test is run. In particular, they take turns manipulating the design and transfer control to each other when appropriate.</para>
824
-
825
- <para>The situation is similar to a pair of friends playing catch. One friend throws a ball to the other, and the other throws it back. Either is able to inspect and modify the ball, but only when it is in hand.</para>
826
-
827
- <section id="background.running-tests.init">
828
- <title>Initialization</title>
829
-
830
- <para>A test is first initialized before it is <link linkend="background.running-tests.exec">executed</link>. <xref linkend="fig..ruby_init"/> illustrates the initialization process <link linkend="proc..ruby_init">described below</link>.</para>
831
-
832
- <figure id="fig..ruby_init">
833
- <title>Initialization of a test</title>
834
- <mediaobject>
835
- <imageobject>
836
- <imagedata fileref="figures/ruby_init.png"/>
837
- </imageobject>
838
- </mediaobject>
839
- </figure>
840
-
841
- <procedure id="proc..ruby_init">
842
- <title>Initialization of a test</title>
843
-
844
- <step>
845
- <para>The &v; simulator initializes the Ruby interpreter by invoking the <code><function>$ruby_init</function>;</code> system task/function, whose parameters represent the command-line invocation of the Ruby interpreter. For example, one would specify <code><function>$ruby_init</function>(<parameter><literal>"ruby"</literal></parameter>, <parameter><literal>"-w"</literal></parameter>);</code> in &v; to achieve the same effect as specifying <command>ruby <option>-w</option></command> at a command-prompt.</para>
846
- </step>
847
-
848
- <step>
849
- <para>The &v; simulator is paused and the Ruby interpreter is initialized with the arguments of the <code><function>$ruby_init</function>;</code> system task/function.</para>
850
- </step>
851
-
852
- <step>&background.step3;</step>
853
- </procedure>
854
- </section>
855
-
856
- <section id="background.running-tests.exec">
857
- <title>Execution</title>
858
-
859
- <para>After a test is <link linkend="background.running-tests.init">initialized</link>, it is executed such that the design is verified against the specification. <xref linkend="fig..ruby_relay"/> illustrates the execution process <link linkend="proc..ruby_relay">described below</link>.</para>
860
-
861
- <figure id="fig..ruby_relay">
862
- <title>Execution of a test</title>
863
- <mediaobject>
864
- <imageobject>
865
- <imagedata fileref="figures/ruby_relay.png"/>
866
- </imageobject>
867
- </mediaobject>
868
- </figure>
869
-
870
- <procedure id="proc..ruby_relay">
871
- <title>Execution of a test</title>
872
-
873
- <step>
874
- <para>The &v; simulator transfers control to the Ruby interpreter by invoking the <code><function>$ruby_relay</function>;</code> system task/function.</para>
875
- </step>
876
-
877
- <step>
878
- <para>The &v; simulator is paused and the Ruby interpreter is given control.</para>
879
- </step>
880
-
881
- <step>&background.step3;</step>
882
- </procedure>
883
- </section>
884
- </section>
885
- </chapter>
886
-
887
- <chapter id="setup">
888
- <title>Setup</title>
889
-
890
- <section id="setup.reqs">
891
- <title>Requirements</title>
892
- <para>The following software is necessary in order to use &rv;.</para>
893
-
894
- <variablelist>
895
- <varlistentry>
896
- <term>&v; simulator</term>
897
- <listitem>
898
- <para>&rv; is known to work with the following simulators. Nevertheless, you should be able to use it with any &v; simulator that supports &vpi;.</para>
899
-
900
- <variablelist>
901
- <varlistentry>
902
- <term><ulink url="http://www.icarus.com/eda/&v;/">Icarus &v;</ulink></term>
903
- <listitem>
904
- <para>Version 0.8 or newer is acceptable.</para>
905
- </listitem>
906
- </varlistentry>
907
-
908
- <varlistentry>
909
- <term><ulink url="http://www.pragmatic-c.com/gpl-cver/">GPL Cver</ulink></term>
910
- <listitem>
911
- <para>Version 2.11a or newer is acceptable.</para>
912
- </listitem>
913
- </varlistentry>
914
-
915
- <varlistentry>
916
- <term><ulink url="http://www.synopsys.com/products/simulation/simulation.html">Synopsys VCS</ulink></term>
917
- <listitem>
918
- <para>Any version that supports the <option>-load</option> option is acceptable.</para>
919
- </listitem>
920
- </varlistentry>
921
-
922
- <varlistentry>
923
- <term><ulink url="http://www.model.com">Mentor Modelsim</ulink></term>
924
- <listitem>
925
- <para>Any version that supports the <option>-pli</option> option is acceptable.</para>
926
- </listitem>
927
- </varlistentry>
928
- </variablelist>
929
- </listitem>
930
- </varlistentry>
931
-
932
- <varlistentry>
933
- <term><application>make</application></term>
934
- <listitem>
935
- <para><ulink url="http://www.gnu.org/software/make/">&gnu; make</ulink> is preferred but any distribution of <command>make</command> should be acceptable.</para>
936
- </listitem>
937
- </varlistentry>
938
-
939
- <varlistentry>
940
- <term>C compiler</term>
941
- <listitem>
942
- <para><ulink url="http://www.gnu.org/software/gcc/">&gnu; Compiler Collection (<acronym>GCC</acronym>)</ulink> is preferred but any C compiler should be acceptable.</para>
943
- </listitem>
944
- </varlistentry>
945
-
946
- <varlistentry>
947
- <term><ulink url="http://en.wikipedia.org/wiki/Pthreads"><acronym>POSIX</acronym> threads (pthreads)</ulink></term>
948
- <listitem>
949
- <para>Header and linkable object files, and operating system support for this library are necessary.</para>
950
- </listitem>
951
- </varlistentry>
952
-
953
- <varlistentry>
954
- <term><ulink url="http://www.ruby-lang.org">Ruby</ulink></term>
955
- <listitem>
956
- <para>Version 1.8 or newer, including header and linkable object files for building extensions, is necessary. You can install Ruby by following <ulink url="http://www.rubygarden.org/faq/section/show/3">these instructions</ulink>.</para>
957
- </listitem>
958
- </varlistentry>
959
-
960
- <varlistentry>
961
- <term><ulink url="http://rubyforge.org/frs/?group_id=126">RubyGems</ulink></term>
962
- <listitem>
963
- <para>Any recent version should be acceptable. You can install RubyGems by following <ulink url="http://www.rubygems.org/read/chapter/3">these instructions</ulink>.</para>
964
- </listitem>
965
- </varlistentry>
966
- </variablelist>
967
-
968
- <section id="setup.reqs.optional">
969
- <title>Recommendations</title>
970
- <para>The following software may make your interactions with &rv; more pleasant.</para>
971
-
972
- <variablelist>
973
- <varlistentry>
974
- <term>Text merging tool</term>
975
- <listitem>
976
- <para>An <emphasis>interactive</emphasis> text merging tool can greatly simplify the process of transferring wanted changes from one file to another. In particular, such tools are especially beneficial when using the &test-gen.link;. A handful of the currently available open-source text merging tools are listed below.</para>
977
-
978
- <variablelist>
979
-
980
- <varlistentry>
981
- <term><ulink url="http://kdiff3.sourceforge.net/">&kd;</ulink></term>
982
- <listitem>
983
- <para>A graphical, three-way merging tool for KDE.</para>
984
- </listitem>
985
- </varlistentry>
986
-
987
- <varlistentry>
988
- <term><ulink url="http://meld.sourceforge.net/"><application>meld</application></ulink></term>
989
- <listitem>
990
- <para>A graphical, three-way merging tool for GNOME.</para>
991
- </listitem>
992
- </varlistentry>
993
-
994
- <varlistentry>
995
- <term><ulink url="http://tkdiff.sourceforge.net/"><application>tkdiff</application></ulink></term>
996
- <listitem>
997
- <para>A graphical, two-way merging tool that uses the cross-platform Tk windowing toolkit.</para>
998
- </listitem>
999
- </varlistentry>
1000
-
1001
- <varlistentry>
1002
- <term><ulink url="http://furius.ca/xxdiff/"><application>xxdiff</application></ulink></term>
1003
- <listitem>
1004
- <para>A graphical, three-way merging tool.</para>
1005
- </listitem>
1006
- </varlistentry>
1007
-
1008
- <varlistentry>
1009
- <term><ulink url="http://elonen.iki.fi/code/imediff/"><application>imediff2</application></ulink></term>
1010
- <listitem>
1011
- <para>A textual, fullscreen two-way merging tool. This tool is useful when you are working remotely via SSH.</para>
1012
- </listitem>
1013
- </varlistentry>
1014
-
1015
- </variablelist>
1016
- </listitem>
1017
- </varlistentry>
1018
- </variablelist>
1019
- </section>
1020
- </section>
1021
-
1022
- <section id="setup.installation">
1023
- <title>Installation</title>
1024
-
1025
- <para>Once you have satisfied the <link linkend="setup.reqs">necessary requirements</link>, you can install &rv; by running the command <command>gem <action>install</action> <replaceable>ruby-vpi</replaceable></command>. RubyGems will install &rv; into the system gem directory, whose path can be determined by running the command <command>gem <action>env</action> <replaceable>gemdir</replaceable></command>. Within this directory, there is a "gems" subdirectory which contains the &rv; installation, as illustrated below.</para>
1026
-
1027
- <screen>
1028
- <prompt>$</prompt> <userinput><command>gem <action>env</action> <replaceable>gemdir</replaceable></command></userinput>
1029
- <computeroutput>/usr/lib/ruby/gems/1.8</computeroutput>
1030
-
1031
- <prompt>$</prompt> <userinput><command>ls <option>-d</option> <replaceable>/usr/lib/ruby/gems/1.8</replaceable>/gems/ruby-vpi-*</command></userinput>
1032
- <computeroutput>/usr/lib/ruby/gems/1.8/gems/ruby-vpi-7.0.0/</computeroutput>
1033
- </screen>
1034
-
1035
- <section id="setup.installation.windows">
1036
- <title>Installing on Windows</title>
1037
-
1038
- <procedure>
1039
- <step>
1040
- <para>Install <ulink url="http://www.cygwin.com">Cygwin</ulink>, the Linux-like environment for Windows.</para>
1041
- </step>
1042
- <step>
1043
- <para>Search for object files whose names end with <filename>.so</filename>, <filename>.o</filename>, or <filename>.dll</filename> in your &v; simulator's installation directory.</para>
1044
- </step>
1045
- <step>
1046
- <para>Determine which object files, among those found in the previous step, contain symbols whose names begin with <symbol>_vpi</symbol><footnote><para>Because &rv; makes use of the &vpi; C-language interface, it links to symbols whose names begin with <symbol>_vpi</symbol>. It is possible for these symbols to be undefined when &rv; is compiled under GNU/Linux and similar operating systems. In contrast, one <ulink url="http://sourceware.org/ml/cygwin/2001-12/msg01293.html">cannot compile a shared object file with references to undefined symbols under Windows</ulink>. Thus, we must find a Verilog simulator's shared object file, which contains definitions of all &vpi; symbols, and give this file to the linker when compiling &rv;.</para></footnote> by running the command <command>for x in *.{o,so,dll}; do nm $x | grep -q '[Tt] _vpi' > /dev/null &amp;&amp; echo $x; done</command> in Cygwin.</para>
1047
-
1048
- <tip>
1049
- <para>If you are using Mentor Modelsim, the desired object file can be found at a path similar to <filename>C:\Modeltech\win32\libvsim.dll</filename>.</para>
1050
- </tip>
1051
-
1052
- <tip>
1053
- <para>If you are using GPL Cver, the desired object file can be found at a path similar to <filename>C:\gplcver\objs\v_vpi.o</filename>.</para>
1054
- </tip>
1055
- </step>
1056
- <step>
1057
- <para>Assign the path of the object file (determined in the previous step) to the <varname>LDFLAGS</varname> environment variable. For example, if the object file's path is <replaceable>/foo/bar/vpi.so</replaceable>, then you would run the command <command>export <varname>LDFLAGS</varname>=<replaceable>/foo/bar/vpi.so</replaceable></command> in Cygwin.</para>
1058
- </step>
1059
- <step>
1060
- <para>You may now install &rv; by running the command <command>gem <action>install</action> <replaceable>ruby-vpi</replaceable></command> in Cygwin.</para>
1061
- </step>
1062
- </procedure>
1063
- </section>
1064
- </section>
1065
-
1066
- <section id="setup.maintenance">
1067
- <title>Maintenance</title>
1068
-
1069
- <para>You can uninstall &rv; by running the command <command>gem <action>uninstall</action> <replaceable>ruby-vpi</replaceable></command>. Furthermore, you can upgrade to the latest release of &rv; by running the command <command>gem <action>update</action> <replaceable>ruby-vpi</replaceable></command>. Finally, you can learn more about using and manipulating RubyGems in <ulink url="http://www.rubygems.org">the RubyGems user manual</ulink>.</para>
1070
- </section>
1071
- </chapter>
1072
-
1073
- <chapter id="usage">
1074
- <title>Usage</title>
1075
-
1076
- <section id="usage.tools">
1077
- <title>Tools</title>
1078
- <para>The <filename>bin</filename> directory contains various utilities which ease the process of writing tests. Each tool provides help and usage information invoked with the <option>--help</option> option.</para>
1079
-
1080
- <section id="usage.tools.generate-test">
1081
- <title>Automated test generation</title>
1082
-
1083
- <para>The automated test generator (<command>generate_test.rb</command>) generates tests from &v; 2001 module declarations, as demonstrated in <xref linkend="usage.tutorial.generate-test"/>. A generated test is composed of the following parts:
1084
- <variablelist>
1085
- <varlistentry>
1086
- <term>Runner</term>
1087
- <listitem>
1088
- <para>Written in Rake, this file builds and runs the test.</para>
1089
- </listitem>
1090
- </varlistentry>
1091
- <varlistentry>
1092
- <term>Bench</term>
1093
- <listitem>
1094
- <para>Written in Verilog and Ruby, these files define the testing environment.</para>
1095
- </listitem>
1096
- </varlistentry>
1097
- <varlistentry>
1098
- <term>Design</term>
1099
- <listitem>
1100
- <para>Written in Ruby, this file provides an interface to the design being verified.</para>
1101
- </listitem>
1102
- </varlistentry>
1103
- <varlistentry>
1104
- <term>Prototype</term>
1105
- <listitem>
1106
- <para>Written in Ruby, this file defines a prototype of the design being verified.</para>
1107
- </listitem>
1108
- </varlistentry>
1109
- <varlistentry>
1110
- <term>Specification</term>
1111
- <listitem>
1112
- <para>Written in Ruby, this file verifies the design.</para>
1113
- </listitem>
1114
- </varlistentry>
1115
- </variablelist>
1116
- </para>
1117
-
1118
- <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 (using a <link linkend="setup.reqs.optional">text merging tool</link>) into the test without diverting your focus from the specification.</para>
1119
-
1120
- <tip>
1121
- <title>Using &kd; with the automated test generator</title>
1122
- <para>Create a file named <filename>merge2</filename> with the content below, make it executable, and put it somewhere accessible by your <varname>PATH</varname> environment variable. Next, update the <varname>MERGER</varname> environment variable by executing <command>export <varname>MERGER</varname>=<replaceable>merge2</replaceable></command>.</para>
1123
-
1124
- <programlisting>
1125
- #!/bin/sh
1126
- # args: old file, new file
1127
- kdiff3 --auto --merge --output "$2" "$@" 2>/dev/null
1128
- </programlisting>
1129
-
1130
- <para>From now on, &kd; will be invoked to help you transfer your changes between generated files. When you are finished transferring changes, simply issue the "save the file" command and terminate &kd;. Or, if you do not want to transfer any changes, simply terminate &kd;.</para>
1131
- </tip>
1132
- </section>
1133
-
1134
- <section id="usage.tools.verilog-ruby-conv">
1135
- <title>&v; to &r; conversion</title>
1136
-
1137
- <para>The <command>header_to_ruby.rb</command> tool can be used to convert &v; header files into &r;. You can try it by running the command <command>header_to_ruby.rb <option>--help</option></command>.</para>
1138
- </section>
1139
- </section>
1140
-
1141
- <section id="usage.tutorial">
1142
- <title>Tutorial</title>
1143
-
1144
- <procedure>
1145
- <title>Typical way of using &rv;</title>
1146
-
1147
- <step>
1148
- <para><link linkend="usage.tutorial.declare-design">Declare the design</link>, which is a &v; module, using &v; 2001 syntax.</para>
1149
- </step>
1150
-
1151
- <step>
1152
- <para><link linkend="usage.tutorial.generate-test">Generate a test</link> for the design using the &test-gen.link; tool.</para>
1153
- </step>
1154
-
1155
- <step>
1156
- <para><link linkend="usage.tutorial.specification">Identify your expectations</link> for the design and implement them in the specification.</para>
1157
- </step>
1158
-
1159
- <step>
1160
- <para>(Optional) <link linkend="usage.tutorial.implement-proto">Implement the prototype</link> of the design in &r;.</para>
1161
- </step>
1162
-
1163
- <step>
1164
- <para>(Optional) <link linkend="usage.tutorial.test-proto">Verify the prototype</link> against the specification.</para>
1165
- </step>
1166
-
1167
- <step>
1168
- <para><link linkend="usage.tutorial.implement-design">Implement the design</link> in &v; once the prototype has been verified.</para>
1169
- </step>
1170
-
1171
- <step>
1172
- <para><link linkend="usage.tutorial.test-design">Verify the design</link> against the specification.</para>
1173
- </step>
1174
- </procedure>
1175
-
1176
- <section id="usage.tutorial.declare-design">
1177
- <title>Start with a design</title>
1178
-
1179
- <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:
1180
- <variablelist>
1181
- <varlistentry>
1182
- <term><constant>Size</constant></term>
1183
- <listitem><para>This parameter defines the number of bits used to represent the counter's value.</para></listitem>
1184
- </varlistentry>
1185
- <varlistentry>
1186
- <term><varname>clock</varname></term>
1187
- <listitem><para>Each positive edge of this signal causes the <varname>count</varname> register to increment.</para></listitem>
1188
- </varlistentry>
1189
- <varlistentry>
1190
- <term><varname>reset</varname></term>
1191
- <listitem><para>Assertion of this signal causes the <varname>count</varname> register to become zero.</para></listitem>
1192
- </varlistentry>
1193
- <varlistentry>
1194
- <term><varname>count</varname></term>
1195
- <listitem><para>This register contains the counter's value.</para></listitem>
1196
- </varlistentry>
1197
- </variablelist>
1198
- </para>
1199
-
1200
- <figure id="fig..counter.v_decl">
1201
- <title>Declaration of a simple up-counter with synchronous reset</title>
1202
- <programlisting>
1203
- <token>module</token> counter #(<token>parameter</token> <constant>Size</constant> = <literal>5</literal>) (
1204
- <token>input</token> <varname>clock</varname>,
1205
- <token>input</token> <varname>reset</varname>,
1206
- <token>output</token> <type>reg</type> [<constant>Size</constant> - <literal>1</literal> : <literal>0</literal>] <varname>count</varname>
1207
- );
1208
- <token>endmodule</token>
1209
- </programlisting>
1210
- </figure>
1211
-
1212
- <important>
1213
- <title>Before we continue&hellip;</title>
1214
- <para>Save the source code shown in <xref linkend="fig..counter.v_decl"/> into a file named <filename>counter.v</filename>.</para>
1215
- </important>
1216
- </section>
1217
-
1218
- <section id="usage.tutorial.generate-test">
1219
- <title>Generate a test</title>
1220
-
1221
- <para>Now that we have a &design.gloss; to verify, let us generate a &test.gloss; for it using the &test-gen.link;. This tool allows us to implement our &specification.gloss; in either &rspec;, xUnit, or our very own format. Each format represents a different software development methodology: &rspec; represents &BDD.gloss;, xUnit represents &TDD.gloss;, and our own format can represent another methodology. Both &rspec; and xUnit are presented in this tutorial.</para>
1222
-
1223
- <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.</para>
1224
-
1225
- <figure id="fig..generate-test.rspec">
1226
- <title>Generating a test with specification in &rspec; format</title>
1227
- <screen>
1228
- <prompt>$</prompt> <userinput><command>generate_test.rb <replaceable>counter.v</replaceable> <option>--rspec</option> <option>--name</option> <replaceable>rspec</replaceable></command></userinput>
1229
- <computeroutput>
1230
- name rspec
1231
- format rSpec
1232
-
1233
- module counter
1234
- create counter_rspec_runner.rake
1235
- create counter_rspec_bench.v
1236
- create counter_rspec_bench.rb
1237
- create counter_rspec_design.rb
1238
- create counter_rspec_proto.rb
1239
- create counter_rspec_spec.rb
1240
- </computeroutput>
1241
- </screen>
1242
- </figure>
1243
-
1244
- <figure id="fig..generate-test.unit-test">
1245
- <title>Generating a test with specification in xUnit format</title>
1246
- <screen>
1247
- <prompt>$</prompt> <userinput><command>generate_test.rb <replaceable>counter.v</replaceable> <option>--xunit</option> <option>--name</option> <replaceable>xunit</replaceable></command></userinput>
1248
- <computeroutput>
1249
- name xunit
1250
- format xUnit
1251
-
1252
- module counter
1253
- create counter_xunit_runner.rake
1254
- create counter_xunit_bench.v
1255
- create counter_xunit_bench.rb
1256
- create counter_xunit_design.rb
1257
- create counter_xunit_proto.rb
1258
- create counter_xunit_spec.rb
1259
- </computeroutput>
1260
- </screen>
1261
- </figure>
1262
- </section>
1263
-
1264
- <section id="usage.tutorial.specification">
1265
- <title>Specify your expectations</title>
1266
-
1267
- <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>
1268
-
1269
- <para>The following is a reasonable set of expectations for our simple counter:
1270
- <itemizedlist>
1271
- <listitem>
1272
- <para>A resetted counter's value should be zero.</para>
1273
- </listitem>
1274
- <listitem>
1275
- <para>A resetted counter's value should increment by one count upon each rising clock edge.</para>
1276
- </listitem>
1277
- <listitem>
1278
- <para>A counter with the maximum value should overflow upon increment.</para>
1279
- </listitem>
1280
- </itemizedlist>
1281
- </para>
1282
-
1283
- <para>Now that we have identified a set of expectations for our design, we are ready to implement them in our specification. <xref linkend="fig..counter_rspec_spec.rb"/> and <xref linkend="fig..counter_xunit_spec.rb"/> illustrate this process. Note the striking similarities between our expectations and their implementation.</para>
1284
-
1285
- <figure id="fig..counter_rspec_spec.rb">
1286
- <title>Specification implemented in &rspec; format</title>
1287
- <programlisting>
1288
- <remark># lowest upper bound of counter's value</remark>
1289
- <constant>LIMIT</constant> = <literal>2</literal> ** <constant>Counter</constant>.<function>Size</function>.<function>intVal</function>
1290
-
1291
- <remark># maximum allowed value for a counter</remark>
1292
- <constant>MAX</constant> = <constant>LIMIT</constant> - <literal>1</literal>
1293
-
1294
- <function>context</function> <literal>"A resetted counter's value"</literal> <token>do</token>
1295
- <function>setup</function> <token>do</token>
1296
- <constant>Counter</constant>.<function>reset!</function>
1297
- <token>end</token>
1298
-
1299
- <function>specify</function> <literal>"should be zero"</literal> <token>do</token>
1300
- <constant>Counter</constant>.<function>count</function>.<function>intVal</function>.<function>should_equal</function> <literal>0</literal>
1301
- <token>end</token>
1302
-
1303
- <function>specify</function> <literal>"should increment by one count upon each rising clock edge"</literal> <token>do</token>
1304
- <constant>LIMIT</constant>.<function>times</function> <token>do</token> |<varname>i</varname>|
1305
- <constant>Counter</constant>.<function>count</function>.<function>intVal</function>.<function>should_equal</function> <varname>i</varname>
1306
- <function>relay_verilog</function> <remark># advance the clock</remark>
1307
- <token>end</token>
1308
- <token>end</token>
1309
- <token>end</token>
1310
-
1311
- <function>context</function> <literal>"A counter with the maximum value"</literal> <token>do</token>
1312
- <function>setup</function> <token>do</token>
1313
- <constant>Counter</constant>.<function>reset!</function>
1314
-
1315
- <remark># increment the counter to maximum value</remark>
1316
- <constant>MAX</constant>.<function>times</function> <token>do</token> <function>relay_verilog</function> <token>end</token>
1317
- <constant>Counter</constant>.<function>count</function>.<function>intVal</function>.<function>should_equal</function> <constant>MAX</constant>
1318
- <token>end</token>
1319
-
1320
- <function>specify</function> <literal>"should overflow upon increment"</literal> <token>do</token>
1321
- <function>relay_verilog</function> <remark># increment the counter</remark>
1322
- <constant>Counter</constant>.<function>count</function>.<function>intVal</function>.<function>should_equal</function> <literal>0</literal>
1323
- <token>end</token>
1324
- <token>end</token>
1325
- </programlisting>
1326
- </figure>
1327
-
1328
- <figure id="fig..counter_xunit_spec.rb">
1329
- <title>Specification implemented in xUnit format</title>
1330
- <programlisting>
1331
- <remark># lowest upper bound of counter's value</remark>
1332
- <constant>LIMIT</constant> = <literal>2</literal> ** <constant>Counter</constant>.<function>Size</function>.<function>intVal</function>
1333
-
1334
- <remark># maximum allowed value for a counter</remark>
1335
- <constant>MAX</constant> = <constant>LIMIT</constant> - <literal>1</literal>
1336
-
1337
- <token>class</token> <constant>ResettedCounterValue</constant> &lt; <constant>Test</constant>::<constant>Unit</constant>::<constant>TestCase</constant>
1338
- <token>def</token> <function>setup</function>
1339
- <constant>Counter</constant>.<function>reset!</function>
1340
- <token>end</token>
1341
-
1342
- <token>def</token> <function>test_zero</function>
1343
- <function>assert_equal</function> <literal>0</literal>, <constant>Counter</constant>.<function>count</function>.<function>intVal</function>
1344
- <token>end</token>
1345
-
1346
- <token>def</token> <function>test_increment</function>
1347
- <constant>LIMIT</constant>.<function>times</function> <token>do</token> |<varname>i</varname>|
1348
- <function>assert_equal</function> <varname>i</varname>, <constant>Counter</constant>.<function>count</function>.<function>intVal</function>
1349
- <function>relay_verilog</function> <remark># advance the clock</remark>
1350
- <token>end</token>
1351
- <token>end</token>
1352
- <token>end</token>
1353
-
1354
- <token>class</token> <constant>MaximumCounterValue</constant> &lt; <constant>Test</constant>::<constant>Unit</constant>::<constant>TestCase</constant>
1355
- <token>def</token> <function>setup</function>
1356
- <constant>Counter</constant>.<function>reset!</function>
1357
-
1358
- <remark># increment the counter to maximum value</remark>
1359
- <constant>MAX</constant>.<function>times</function> <token>do</token> <function>relay_verilog</function> <token>end</token>
1360
- <function>assert_equal</function> <constant>MAX</constant>, <constant>Counter</constant>.<function>count</function>.<function>intVal</function>
1361
- <token>end</token>
1362
-
1363
- <token>def</token> <function>test_overflow</function>
1364
- <function>relay_verilog</function> <remark># increment the counter</remark>
1365
- <function>assert_equal</function> <literal>0</literal>, <constant>Counter</constant>.<function>count</function>.<function>intVal</function>
1366
- <token>end</token>
1367
- <token>end</token>
1368
- </programlisting>
1369
- </figure>
1370
-
1371
- <important>
1372
- <title>Before we continue&hellip;</title>
1373
- <itemizedlist>
1374
- <listitem>
1375
- <para>Replace the contents of the file named <filename>counter_rspec_spec.rb</filename> with the source code shown in <xref linkend="fig..counter_rspec_spec.rb"/>.</para>
1376
- </listitem>
1377
- <listitem>
1378
- <para>Replace the contents of the file named <filename>counter_xunit_spec.rb</filename> with the source code shown in <xref linkend="fig..counter_xunit_spec.rb"/>.</para>
1379
- </listitem>
1380
- <listitem>
1381
- <para>Replace the contents of the files named <filename>counter_rspec_design.rb</filename> and <filename>counter_xunit_design.rb</filename> with the following code. This code defines the <function>reset!</function> method which resets our &v; design.</para>
1382
-
1383
- <programlisting>
1384
- <token>def</token> <constant>Counter</constant>.<function>reset!</function>
1385
- <function>reset</function>.<function>intVal</function> = <literal>1</literal>
1386
- <function>relay_verilog</function> <remark># advance the clock</remark>
1387
- <function>reset</function>.<function>intVal</function> = <literal>0</literal>
1388
- <token>end</token>
1389
- </programlisting>
1390
- </listitem>
1391
- </itemizedlist>
1392
- </important>
1393
- </section>
1394
-
1395
- <section id="usage.tutorial.implement-proto">
1396
- <title>Implement the prototype</title>
1397
-
1398
- <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>
1399
-
1400
- <figure id="fig..counter_proto.rb">
1401
- <title>Ruby prototype of our &v; design</title>
1402
- <programlisting>
1403
- <token>def</token> <constant>Counter</constant>.<function>simulate!</function>
1404
- <token>if</token> <function>reset</function>.<function>intVal</function> == <literal>1</literal>
1405
- <function>count</function>.<function>intVal</function> = <literal>0</literal>
1406
- <token>else</token>
1407
- <function>count</function>.<function>intVal</function> += <literal>1</literal>
1408
- <token>end</token>
1409
- <token>end</token>
1410
- </programlisting>
1411
- </figure>
1412
-
1413
- <important>
1414
- <title>Before we continue&hellip;</title>
1415
- <para>Replace the contents of the files named <filename>counter_rspec_proto.rb</filename> and <filename>counter_xunit_proto.rb</filename> with the source code shown in <xref linkend="fig..counter_proto.rb"/>.</para>
1416
- </important>
1417
- </section>
1418
-
1419
- <section id="usage.tutorial.test-proto">
1420
- <title>Verify the prototype</title>
1421
- <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>
1422
-
1423
- <tip>
1424
- <title>Reuse your past efforts!</title>
1425
- <para>The <emphasis>same</emphasis> specification can be used to verify both prototype and design.</para>
1426
- </tip>
1427
-
1428
- <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>cver</replaceable>, is used to run the simulation.</para>
1429
-
1430
- <tip>
1431
- <title>What can the test runner do?</title>
1432
- <para>If you invoke the test runner (1) without any arguments or (2) with the <option>-T</option> option, it will show you a list of tasks that it can perform for you.</para>
1433
- </tip>
1434
-
1435
- <figure id="fig..test-proto.rspec">
1436
- <title>Running a test with specification in &rspec; format</title>
1437
- <screen>
1438
- <prompt>$</prompt> <userinput><command>rake <option>-f</option> <replaceable>counter_rspec_runner.rake</replaceable> <replaceable>cver</replaceable> <varname>PROTOTYPE</varname>=<replaceable>1</replaceable></command></userinput>
1439
- <computeroutput>counter_rspec: verifying prototype instead of design
1440
-
1441
- A resetted counter's value
1442
- - should be zero
1443
- - should increment by one count upon each rising clock edge
1444
-
1445
- A counter with the maximum value
1446
- - should overflow upon increment
1447
-
1448
- Finished in 0.018199 seconds
1449
-
1450
- 3 specifications, 0 failures</computeroutput>
1451
- </screen>
1452
- </figure>
1453
-
1454
- <figure id="fig..test-proto.unit-test">
1455
- <title>Running a test with specification in xUnit format</title>
1456
- <screen>
1457
- <prompt>$</prompt> <userinput><command>rake <option>-f</option> <replaceable>counter_xunit_runner.rake</replaceable> <replaceable>cver</replaceable> <varname>PROTOTYPE</varname>=<replaceable>1</replaceable></command></userinput>
1458
- <computeroutput>counter_xunit: verifying prototype instead of design
1459
-
1460
- Loaded suite counter_xunit_bench
1461
- Started
1462
- ...
1463
- Finished in 0.040668 seconds.
1464
-
1465
- 3 tests, 35 assertions, 0 failures, 0 errors</computeroutput>
1466
- </screen>
1467
- </figure>
1468
- </section>
1469
-
1470
- <section id="usage.tutorial.implement-design">
1471
- <title>Implement the design</title>
1472
-
1473
- <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>
1474
-
1475
- <figure id="fig..counter.v_impl">
1476
- <title>Implementation of a simple up-counter with synchronous reset</title>
1477
- <programlisting>
1478
- <token>module</token> counter #(<token>parameter</token> <constant>Size</constant> = <literal>5</literal>) (
1479
- <token>input</token> <varname>clock</varname>,
1480
- <token>input</token> <varname>reset</varname>,
1481
- <token>output</token> <type>reg</type> [<constant>Size</constant> - <literal>1</literal> : <literal>0</literal>] <varname>count</varname>
1482
- );
1483
- <token>always</token> @(<token>posedge</token> <varname>clock</varname>) <token>begin</token>
1484
- <token>if</token> (<varname>reset</varname>)
1485
- <varname>count</varname> &lt;= <literal>0</literal>;
1486
- <token>else</token>
1487
- <varname>count</varname> &lt;= <varname>count</varname> + <literal>1</literal>;
1488
- <token>end</token>
1489
- <token>endmodule</token>
1490
- </programlisting>
1491
- </figure>
1492
-
1493
- <important>
1494
- <title>Before we continue&hellip;</title>
1495
- <para>Replace the contents of the file named <filename>counter.v</filename> with the source code shown in <xref linkend="fig..counter.v_impl"/>.</para>
1496
- </important>
1497
- </section>
1498
-
1499
- <section id="usage.tutorial.test-design">
1500
- <title>Verify the design</title>
1501
- <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>
1502
-
1503
- <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 GPL Cver &v; simulator, denoted by <replaceable>cver</replaceable>, is used to run the simulation.</para>
1504
-
1505
- <tip>
1506
- <title>Running multiple tests</title>
1507
- <para>Create a file named <filename>Rakefile</filename> containing the following line.</para>
1508
-
1509
- <programlisting>require 'ruby-vpi/runner_proxy'</programlisting>
1510
-
1511
- <para>Now you can invoke all test runners in the current directory simply by executing <command>rake <replaceable>cver</replaceable></command> (where <replaceable>cver</replaceable> denotes the GPL Cver simulator).</para>
1512
- </tip>
1513
-
1514
- <figure id="fig..test-design.rspec">
1515
- <title>Running a test with specification in &rspec; format</title>
1516
- <screen>
1517
- <prompt>$</prompt> <userinput><command>rake <option>-f</option> <replaceable>counter_rspec_runner.rake</replaceable> <replaceable>cver</replaceable></command></userinput>
1518
- <computeroutput>A resetted counter's value
1519
- - should be zero
1520
- - should increment by one count upon each rising clock edge
1521
-
1522
- A counter with the maximum value
1523
- - should overflow upon increment
1524
-
1525
- Finished in 0.005628 seconds
1526
-
1527
- 3 specifications, 0 failures</computeroutput>
1528
- </screen>
1529
- </figure>
1530
-
1531
- <figure id="fig..test-design.unit-test">
1532
- <title>Running a test with specification in xUnit format</title>
1533
- <screen>
1534
- <prompt>$</prompt> <userinput><command>rake <option>-f</option> <replaceable>counter_xunit_runner.rake</replaceable> <replaceable>cver</replaceable></command></userinput>
1535
- <computeroutput>Loaded suite counter_xunit_bench
1536
- Started
1537
- ...
1538
- Finished in 0.006766 seconds.
1539
-
1540
- 3 tests, 35 assertions, 0 failures, 0 errors</computeroutput>
1541
- </screen>
1542
- </figure>
1543
- </section>
1544
- </section>
1545
-
1546
- <section id="usage.examples">
1547
- <title>Examples</title>
1548
-
1549
- <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>
1550
-
1551
- <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>
1552
- </section>
1553
- </chapter>
1554
-
1555
- <chapter id="hacking">
1556
- <title>Hacking</title>
1557
-
1558
- <section id="hacking.release-packages">
1559
- <title>Building release packages</title>
1560
- <para>In addition to the "normal requirements":./doc/usage.requirements.html, you need the following software to build release packages:
1561
-
1562
- <variablelist>
1563
- <varlistentry>
1564
- <term><ulink url="http://www.docbook.org/">DocBook-XML</ulink></term>
1565
- <listitem><para/></listitem>
1566
- </varlistentry>
1567
- <varlistentry>
1568
- <term>xsltproc</term>
1569
- <listitem><para/></listitem>
1570
- </varlistentry>
1571
- <varlistentry>
1572
- <term>xmlto</term>
1573
- <listitem><para/></listitem>
1574
- </varlistentry>
1575
- <varlistentry>
1576
- <term><ulink url="http://rubyforge.org/projects/redcloth/">RedCloth</ulink></term>
1577
- <listitem><para/></listitem>
1578
- </varlistentry>
1579
- <varlistentry>
1580
- <term><ulink url="http://www.swig.org/">SWIG</ulink></term>
1581
- <listitem><para/></listitem>
1582
- </varlistentry>
1583
- </variablelist>
1584
-
1585
- Once you have satisfied these requirements, you can run <command>rake <action>release</action></command> to build the release packages. Also, see the output of <command>rake <option>-T</option></command> for more build options.</para>
1586
- </section>
1587
-
1588
- </chapter>
1589
-
1590
- <chapter id="problems">
1591
- <title>Known problems</title>
1592
-
1593
- <para>This chapter presents known problems and possible solutions. In addition, previously solved problems have been retained for historical reference.</para>
1594
-
1595
- <section id="problems.ruby">
1596
- <title>Ruby</title>
1597
-
1598
- <section id="problems.ruby.SystemStackError">
1599
- <title>SystemStackError</title>
1600
-
1601
- &fixed-in-2.0.0;
1602
-
1603
- <para>If a <quote>stack level too deep (SystemStackError)</quote> error occurs during the simulation, then increase the system-resource limit for stack-size by running the command <command>ulimit <option>-s</option> <replaceable>unlimited</replaceable></command> before starting the simulation.</para>
1604
- </section>
1605
-
1606
- <section id="problems.ruby.xUnit">
1607
- <title>test/unit</title>
1608
-
1609
- &fixed-in-2.0.0;
1610
-
1611
- <para>If your specification employs Ruby's unit testing framework, then you will encounter the error: <quote>[BUG] cross-thread violation on rb_gc()</quote>.</para>
1612
- </section>
1613
- </section>
1614
-
1615
- <section id="problem.ivl">
1616
- <title>Icarus &v;</title>
1617
-
1618
- <section id="problems.ivl.vpi_handle_by_name">
1619
- <title>vpi_handle_by_name</title>
1620
-
1621
- <section id="problems.ivl.vpi_handle_by_name.absolute-paths">
1622
- <title>Give full paths to &v; objects</title>
1623
-
1624
- <para>In version 0.8 and snapshot 20061009 of Icarus &v;, the <function>vpi_handle_by_name</function> function requires an <emphasis>absolute</emphasis> path (including the name of the bench which instantiates the design) to a &v; object. In addition, <function>vpi_handle_by_name</function> is unable to retrieve the handle for a module parameter.</para>
1625
-
1626
- <para>For example, consider <xref linkend="ex..TestFoo"/>. Here, one needs to specify <code>TestFoo.my_foo.clk</code> instead of <code>my_foo.clk</code> in order to access the <varname>clk</varname> input of the <varname>my_foo</varname> module instance.</para>
1627
-
1628
- <example id="ex..TestFoo">
1629
- <title>Part of a bench which instantiates a &v; design</title>
1630
- <programlisting>
1631
- <token>module</token> TestFoo;
1632
- <type>reg</type> <varname>clk_reg</varname>;
1633
- Foo <varname>my_foo</varname>(<parameter>.clk</parameter>(<varname>clk_reg</varname>));
1634
- <token>endmodule</token>
1635
- </programlisting>
1636
- </example>
1637
- </section>
1638
-
1639
- <section id="problems.ivl.vpi_handle_by_name.connect-registers">
1640
- <title>Registers must be connected</title>
1641
-
1642
- <para>In version 0.8 of Icarus &v;, if you want to access a register in a design, then it must be connected to something (either assigned to a wire or passed as a parameter to a module instantiation). Otherwise, you will get a <literal>nil</literal> value as the result of <function>vpi_handle_by_name</function> method.</para>
1643
-
1644
- <para>For example, suppose you wanted to access the <varname>clk_reg</varname> register, from the bench shown in <xref linkend="ex..TestFoo_bad"/>. If you execute the statement <code><varname>clk_reg</varname> = <function>vpi_handle_by_name</function>(<parameter><literal>"TestFoo.clk_reg"</literal></parameter>, <parameter><literal>nil</literal></parameter>)</code> in a specification, then you will discover that the <function>vpi_handle_by_name</function> method returns <literal>nil</literal> instead of a handle to the <varname>clk_reg</varname> register.</para>
1645
-
1646
- <para>The solution is to change the design such that it appears like the one shown in <xref linkend="ex..TestFoo_fix"/> where the register is connected to a wire, or <xref linkend="ex..TestFoo"/> where the register is connected to a module instantiation.</para>
1647
-
1648
- <example id="ex..TestFoo_bad">
1649
- <title>Bad design with unconnected registers</title>
1650
-
1651
- <para>Here the <varname>clk_reg</varname> register is not connected to anything.</para>
1652
-
1653
- <programlisting>
1654
- <token>module</token> TestFoo;
1655
- <type>reg</type> <varname>clk_reg</varname>;
1656
- <token>endmodule</token>
1657
- </programlisting>
1658
- </example>
1659
-
1660
- <example id="ex..TestFoo_fix">
1661
- <title>Fixed design with wired registers</title>
1662
-
1663
- <para>Here the <varname>clk_reg</varname> register is connected to the <varname>clk_wire</varname> wire.</para>
1664
-
1665
- <programlisting>
1666
- <token>module</token> TestFoo;
1667
- <type>reg</type> <varname>clk_reg</varname>;
1668
- <type>wire</type> <varname>clk_wire</varname>;
1669
- <token>assign</token> <varname>clk_wire</varname> = <varname>clk_reg</varname>;
1670
- <token>endmodule</token>
1671
- </programlisting>
1672
- </example>
1673
- </section>
1674
- </section>
1675
-
1676
- <section id="problems.ivl.vpi_reset">
1677
- <title>Vpi::reset</title>
1678
-
1679
- <caution>
1680
- <title>Deprecated method</title>
1681
- <para>The <function>vpi_control</function> method was removed in release 3.0.0 (2006-04-23) of &rv;, and is deprecated. Please use <code><constant>Vpi</constant>::<function>vpi_control</function>(<parameter><constant>VpiReset</constant></parameter>)</code> instead.</para>
1682
- </caution>
1683
-
1684
- <para>In version 0.8 of Icarus &v;, the <code><function>vpi_control</function>(<parameter><constant>vpiReset</constant></parameter>)</code> &vpi; function causes an assertion to fail inside the simulator. As a result, the simulation terminates and a core dump is produced.</para>
1685
- </section>
1686
- </section>
1687
-
1688
- <section id="problems.vsim">
1689
- <title>Mentor Modelsim</title>
1690
-
1691
- <section id="problems.vsim.ruby_run">
1692
- <title>ruby_run()</title>
1693
-
1694
- &fixed-in-2.0.0;
1695
-
1696
- <para>Version 6.1b of Mentor Modelsim doesn't play nicely with either an embedded Ruby interpreter or POSIX threads in a PLI application. When &rv; invokes the <function>ruby_run</function> function (which starts the Ruby interpreter), the simulator terminates immediately with an exit status of 0.</para>
1697
- </section>
1698
- </section>
1699
- </chapter>
1700
-
1701
- <glossary id="glossary">
1702
- <glossdiv>
1703
- <title>B</title>
1704
-
1705
- <glossentry id="term..bench">
1706
- <glossterm>Bench</glossterm>
1707
- <glossdef>
1708
- <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>
1709
- </glossdef>
1710
- </glossentry>
1711
-
1712
- <glossentry id="term..BDD">
1713
- <glossterm><acronym>BDD</acronym></glossterm>
1714
-
1715
- <glossdef>
1716
- <para>Behavior driven development.</para>
1717
- <para>A software development methodology which emphasizes thinking in terms of behavior when designing, implementing, and verifying software. See the <ulink url="http://behaviour-driven.org/">official wiki</ulink> for more information.</para>
1718
-
1719
- <glossseealso otherterm="term..TDD"/>
1720
- <glossseealso otherterm="term..rspec"/>
1721
- </glossdef>
1722
- </glossentry>
1723
- </glossdiv>
1724
-
1725
- <glossdiv>
1726
- <title>D</title>
1727
-
1728
- <glossentry id="term..design">
1729
- <glossterm>Design</glossterm>
1730
- <glossdef>
1731
- <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>
1732
- </glossdef>
1733
- </glossentry>
1734
- </glossdiv>
1735
-
1736
- <glossdiv>
1737
- <title>E</title>
1738
-
1739
- <glossentry id="term..expectation">
1740
- <glossterm>Expectation</glossterm>
1741
- <glossdef>
1742
- <para>The desired response to some stimulus.</para>
1743
- </glossdef>
1744
- </glossentry>
1745
- </glossdiv>
1746
-
1747
- <glossdiv>
1748
- <title>H</title>
1749
-
1750
- <glossentry id="term..handle">
1751
- <glossterm>Handle</glossterm>
1752
- <glossdef>
1753
- <para>An object in a &v; simulation. For example, a handle can represent a wire, register, module, if-statement, expression, and so on.</para>
1754
- </glossdef>
1755
- </glossentry>
1756
- </glossdiv>
1757
-
1758
- <glossdiv>
1759
- <title>R</title>
1760
-
1761
- <glossentry id="term..rake">
1762
- <glossterm>&rake;</glossterm>
1763
- <glossdef>
1764
- <blockquote>
1765
- <attribution><ulink url="&rake-doc.url;">&rake; documentation</ulink></attribution>
1766
- <para>Rake is a build tool, written in Ruby, using Ruby as a build language. Rake is similar to make in scope and purpose.</para>
1767
- </blockquote>
1768
-
1769
- <para>See the <ulink url="&rake.url;">&rake; website</ulink> for more information.</para>
1770
- </glossdef>
1771
- </glossentry>
1772
-
1773
- <glossentry id="term..rspec">
1774
- <glossterm>&rspec;</glossterm>
1775
- <glossdef>
1776
- <para>Ruby framework for BDD. See the <ulink url="&rspec.url;">&rspec; website</ulink> and &rspec-tutorial..ulink; for more information.</para>
1777
-
1778
- <glossseealso otherterm="term..BDD"/>
1779
- </glossdef>
1780
- </glossentry>
1781
- </glossdiv>
1782
-
1783
- <glossdiv>
1784
- <title>S</title>
1785
-
1786
- <glossentry id="term..specification">
1787
- <glossterm>Specification</glossterm>
1788
- <glossdef>
1789
- <para>A set of &expectation.gloss;s which define the desired behavior of a &design.gloss; when it is subjected to certain conditions.</para>
1790
- </glossdef>
1791
- </glossentry>
1792
- </glossdiv>
1793
-
1794
- <glossdiv>
1795
- <title>T</title>
1796
-
1797
- <glossentry id="term..TDD">
1798
- <glossterm>TDD</glossterm>
1799
- <glossdef>
1800
- <para>Test Driven Development.</para>
1801
- <glossseealso otherterm="term..BDD"/>
1802
- </glossdef>
1803
- </glossentry>
1804
-
1805
- <glossentry id="term..test">
1806
- <glossterm>Test</glossterm>
1807
- <glossdef>
1808
- <para>Something that checks if a &design.gloss; satisfies a &specification.gloss;.</para>
1809
- <glossseealso otherterm="term..test-bench"/>
1810
- </glossdef>
1811
- </glossentry>
1812
-
1813
- <glossentry id="term..test-bench">
1814
- <glossterm>Test bench</glossterm>
1815
- <glossdef>
1816
- <para>An allusion to <link linkend="background.terminology">a bench in an electronics laboratory</link>, or so it seems.</para>
1817
- <glossseealso otherterm="term..test"/>
1818
- </glossdef>
1819
- </glossentry>
1820
- </glossdiv>
1821
- </glossary>
1822
-
1823
- &license;
1824
- </book>