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.xsl DELETED
@@ -1,23 +0,0 @@
1
- <?xml version='1.0'?>
2
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
3
- <!-- chunking -->
4
- <xsl:param name="use.id.as.filename" select="'1'"/>
5
- <xsl:param name="chunk.first.sections" select="1"></xsl:param>
6
- <!--<xsl:param name="chunk.tocs.and.lots" select="'1'"/>-->
7
-
8
- <!-- graphics -->
9
- <xsl:param name="admon.graphics" select="'1'"/>
10
- <xsl:param name="admon.graphics.extension" select="'.png'"/>
11
-
12
- <xsl:param name="callout.graphics" select="'1'"/>
13
-
14
- <xsl:param name="navig.graphics" select="1"/>
15
- <xsl:param name="navig.graphics.extension" select="'.png'"/>
16
-
17
- <!-- line numbering -->
18
- <!--<xsl:param name="use.extensions" select="1"/>-->
19
- <!--<xsl:param name="linenumbering.extension" select="1"/>-->
20
-
21
- <!-- styles -->
22
- <xsl:param name="html.stylesheet" select="'styles/manual.css'"/>
23
- </xsl:stylesheet>
data/doc/src/shared.dtd DELETED
@@ -1,62 +0,0 @@
1
- <!--
2
- Copyright 2006 Suraj N. Kurapati.
3
-
4
- Permission is granted to copy, distribute and/or modify this
5
- document under the terms of the GNU Free Documentation License,
6
- Version 1.1 or any later version published by the Free Software
7
- Foundation; with no Invariant Sections, no Front-Cover Texts and
8
- no Back-Cover Texts. A copy of the license is included in the
9
- the file named "LICENSE".
10
- -->
11
-
12
- <!-- project -->
13
- <!ENTITY rv "<application>Ruby-VPI</application>">
14
- <!ENTITY rv.url "http://ruby-vpi.rubyforge.org">
15
- <!ENTITY rv.url-project "http://rubyforge.org/projects/ruby-vpi">
16
- <!ENTITY rv.url-download "http://rubyforge.org/frs/?group_id=1339">
17
- <!ENTITY rv.url-tracker "http://rubyforge.org/tracker/?group_id=1339">
18
- <!ENTITY rv.url-forum "http://rubyforge.org/forum/?group_id=1339">
19
- <!ENTITY rv.url-source "&rv.url;/src/ruby-vpi">
20
- <!ENTITY rv..ulink "<ulink url='&rv.url;'>&rv;</ulink>">
21
-
22
-
23
- <!-- authors -->
24
- <!ENTITY snk "Suraj N. Kurapati">
25
- <!ENTITY snk..initials "snk">
26
- <!ENTITY snk..author "<author> <firstname>Suraj</firstname> <othername>N.</othername> <surname>Kurapati</surname> </author>">
27
- <!ENTITY snk..year "<year>2006</year>">
28
- <!ENTITY snk..holder "<holder>&snk;</holder>">
29
- <!ENTITY snk..copyright "<copyright>&snk..year; &snk..holder;</copyright>">
30
-
31
-
32
- <!-- acronyms & abbreviations -->
33
- <!ENTITY r "Ruby">
34
- <!ENTITY r.url "http://www.ruby-lang.org/en/20020101.html">
35
- <!ENTITY r..ulink "<ulink url='&r.url;'>&r;</ulink>">
36
- <!ENTITY v "Verilog">
37
- <!ENTITY vpi "<acronym>VPI</acronym>">
38
-
39
- <!ENTITY unix "<acronym>UNIX</acronym>">
40
- <!ENTITY url "<acronym>URL</acronym>">
41
- <!ENTITY l10n "<acronym>L10N</acronym>">
42
- <!ENTITY ansi "<acronym>ANSI</acronym>">
43
- <!ENTITY xml "<acronym>XML</acronym>">
44
- <!ENTITY xhtml "<acronym>XHTML</acronym>">
45
- <!ENTITY html "<acronym>HTML</acronym>">
46
-
47
- <!ENTITY gnu "<acronym>GNU</acronym>">
48
- <!ENTITY gpl "&gnu; <acronym>GPL</acronym>">
49
- <!ENTITY bash "<application>&gnu; <acronym>BASH</acronym></application>">
50
- <!ENTITY coreutils "&gnu; coreutils">
51
- <!ENTITY find "<application>&gnu; find</application>">
52
- <!ENTITY gna "<acronym>Gna!</acronym>">
53
- <!ENTITY gpg "<acronym>&gnu; Privacy Guard</acronym>">
54
-
55
- <!ENTITY iso639 "<acronym>ISO</acronym> 639">
56
- <!ENTITY iso639..ulink "<ulink url='http://www.oasis-open.org/cover/iso639a.html'>&iso639;</ulink>">
57
-
58
-
59
- <!-- fixed content -->
60
- <!ENTITY period "period or full stop &quot;<literal>.</literal>&quot;">
61
- <!ENTITY hyphen "hyphen or dash &quot;<literal>-</literal>&quot;">
62
- <!ENTITY pipe "pipe or vertical bar &quot;<literal>|</literal>&quot;">
@@ -1,91 +0,0 @@
1
- body {
2
- font-family: sans-serif;
3
- line-height: 2em;
4
- }
5
-
6
- /* admonitions */
7
- .tip, .note, .important, .caution, .warning {
8
- border: thin solid steelblue;
9
- background-color: aliceblue;
10
- padding: 1em;
11
- }
12
-
13
- /* headings */
14
- .title, th {
15
- font-family: serif;
16
- }
17
-
18
- h3, h4, h5, h6 {
19
- margin-top: 10em;
20
- text-align: center;
21
-
22
- background-color: mistyrose;
23
- padding: 1em;
24
- }
25
-
26
- /* source code */
27
- .screen, .filename {
28
- background-color: whitesmoke;
29
- }
30
-
31
- .code, .programlisting, .function, .constant, .literal, .varname, .token, .type, .remark {
32
- font-family: monospace;
33
- background-color: ivory;
34
- }
35
-
36
- .screen, .programlisting {
37
- border: thin solid silver;
38
- padding: 1em;
39
- line-height: normal;
40
- display: block;
41
- overflow: auto;
42
- }
43
-
44
- .function {
45
- }
46
-
47
- .constant {
48
- color: green;
49
- font-weight: bold;
50
- }
51
-
52
- .literal {
53
- color: blue;
54
- }
55
-
56
- .varname {
57
- color: magenta;
58
- }
59
-
60
- .token {
61
- font-weight: bold;
62
- color: indigo;
63
- }
64
-
65
- .type {
66
- color: red;
67
- }
68
-
69
- .remark {
70
- color: orangered;
71
- }
72
-
73
- .command {
74
- background-color: bisque;
75
- }
76
-
77
- /* tables */
78
- table[border="1"] {
79
- border: none;
80
- }
81
-
82
- table[border="1"] th {
83
- border: none;
84
- background-color: whitesmoke;
85
- }
86
-
87
- table[border="1"] th,
88
- table[border="1"] td {
89
- border: thin solid silver;
90
- padding: 1em;
91
- }
@@ -1,3 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Examples</title><link rel="stylesheet" href="styles/manual.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.68.1" /><link rel="start" href="index.html" title="Ruby-VPI user manual" /><link rel="up" href="usage.html" title="Chapter 4. Usage" /><link rel="prev" href="usage.tutorial.html" title="Tutorial" /><link rel="next" href="hacking.html" title="Chapter 5. Hacking" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Examples</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="usage.tutorial.html"><img src="images/prev.png" alt="Prev" /></a> </td><th width="60%" align="center">Chapter 4. Usage</th><td width="20%" align="right"> <a accesskey="n" href="hacking.html"><img src="images/next.png" alt="Next" /></a></td></tr></table><hr /></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="usage.examples"></a>Examples</h2></div></div></div><p>The <code class="filename">samp</code> directory contains several example tests which illustrate how <span class="application">Ruby-VPI</span> can be used. Each example has an associated <code class="filename">Rakefile</code> which simplifies the process of running it. Therefore, simply navigate into an example directory and run the command <span><strong class="command">rake</strong></span> to get started.</p><p>Also, some example specifications make use of BDD through the <span class="application">rSpec</span> library. See the <a href="background.methodology.html" title="Methodology">the section called “Methodology”</a> for a discussion of <span class="application">rSpec</span>.</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="usage.tutorial.html"><img src="images/prev.png" alt="Prev" /></a> </td><td width="20%" align="center"><a accesskey="u" href="usage.html"><img src="images/up.png" alt="Up" /></a></td><td width="40%" align="right"> <a accesskey="n" href="hacking.html"><img src="images/next.png" alt="Next" /></a></td></tr><tr><td width="40%" align="left" valign="top">Tutorial </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home" /></a></td><td width="40%" align="right" valign="top"> Chapter 5. Hacking</td></tr></table></div></body></html>
data/doc/usage.html DELETED
@@ -1,3 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 4. Usage</title><link rel="stylesheet" href="styles/manual.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.68.1" /><link rel="start" href="index.html" title="Ruby-VPI user manual" /><link rel="up" href="index.html" title="Ruby-VPI user manual" /><link rel="prev" href="setup.maintenance.html" title="Maintenance" /><link rel="next" href="usage.tools.html" title="Tools" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 4. Usage</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="setup.maintenance.html"><img src="images/prev.png" alt="Prev" /></a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="usage.tools.html"><img src="images/next.png" alt="Next" /></a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="usage"></a>Chapter 4. Usage</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="usage.tools.html">Tools</a></span></dt><dd><dl><dt><span class="section"><a href="usage.tools.html#usage.tools.generate-test">Automated test generation</a></span></dt><dt><span class="section"><a href="usage.tools.html#usage.tools.verilog-ruby-conv">Verilog to Ruby conversion</a></span></dt></dl></dd><dt><span class="section"><a href="usage.tutorial.html">Tutorial</a></span></dt><dd><dl><dt><span class="section"><a href="usage.tutorial.html#usage.tutorial.declare-design">Start with a design</a></span></dt><dt><span class="section"><a href="usage.tutorial.html#usage.tutorial.generate-test">Generate a test</a></span></dt><dt><span class="section"><a href="usage.tutorial.html#usage.tutorial.specification">Specify your expectations</a></span></dt><dt><span class="section"><a href="usage.tutorial.html#usage.tutorial.implement-proto">Implement the prototype</a></span></dt><dt><span class="section"><a href="usage.tutorial.html#usage.tutorial.test-proto">Verify the prototype</a></span></dt><dt><span class="section"><a href="usage.tutorial.html#usage.tutorial.implement-design">Implement the design</a></span></dt><dt><span class="section"><a href="usage.tutorial.html#usage.tutorial.test-design">Verify the design</a></span></dt></dl></dd><dt><span class="section"><a href="usage.examples.html">Examples</a></span></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="setup.maintenance.html"><img src="images/prev.png" alt="Prev" /></a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="usage.tools.html"><img src="images/next.png" alt="Next" /></a></td></tr><tr><td width="40%" align="left" valign="top">Maintenance </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home" /></a></td><td width="40%" align="right" valign="top"> Tools</td></tr></table></div></body></html>
data/doc/usage.tools.html DELETED
@@ -1,9 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Tools</title><link rel="stylesheet" href="styles/manual.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.68.1" /><link rel="start" href="index.html" title="Ruby-VPI user manual" /><link rel="up" href="usage.html" title="Chapter 4. Usage" /><link rel="prev" href="usage.html" title="Chapter 4. Usage" /><link rel="next" href="usage.tutorial.html" title="Tutorial" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Tools</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="usage.html"><img src="images/prev.png" alt="Prev" /></a> </td><th width="60%" align="center">Chapter 4. Usage</th><td width="20%" align="right"> <a accesskey="n" href="usage.tutorial.html"><img src="images/next.png" alt="Next" /></a></td></tr></table><hr /></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="usage.tools"></a>Tools</h2></div></div></div><p>The <code class="filename">bin</code> directory contains various utilities which ease the process of writing tests. Each tool provides help and usage information invoked with the <code class="option">--help</code> option.</p><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tools.generate-test"></a>Automated test generation</h3></div></div></div><p>The automated test generator (<span><strong class="command">generate_test.rb</strong></span>) generates tests from Verilog 2001 module declarations, as demonstrated in <a href="usage.tutorial.html#usage.tutorial.generate-test" title="Generate a test">the section called “Generate a test”</a>. A generated test is composed of the following parts:
4
- </p><div class="variablelist"><dl><dt><span class="term">Runner</span></dt><dd><p>Written in Rake, this file builds and runs the test.</p></dd><dt><span class="term">Bench</span></dt><dd><p>Written in Verilog and Ruby, these files define the testing environment.</p></dd><dt><span class="term">Design</span></dt><dd><p>Written in Ruby, this file provides an interface to the design being verified.</p></dd><dt><span class="term">Prototype</span></dt><dd><p>Written in Ruby, this file defines a prototype of the design being verified.</p></dd><dt><span class="term">Specification</span></dt><dd><p>Written in Ruby, this file verifies the design.</p></dd></dl></div><p>
5
- </p><p>The reason for dividing a single test into these parts is mainly to decouple the design from the specification. This allows you to focus on writing the specification while the remainder is automatically generated by the tool. For example, when the interface of a Verilog module changes, you would simply re-run this tool and incorporate those changes (using a <a href="setup.reqs.html#setup.reqs.optional" title="Recommendations">text merging tool</a>) into the test without diverting your focus from the specification.</p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip: Using kdiff3 with the automated test generator"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="images/tip.png" /></td><th align="left">Using <span class="application">kdiff3</span> with the automated test generator</th></tr><tr><td align="left" valign="top"><p>Create a file named <code class="filename">merge2</code> with the content below, make it executable, and put it somewhere accessible by your <code class="varname">PATH</code> environment variable. Next, update the <code class="varname">MERGER</code> environment variable by executing <span><strong class="command">export <code class="varname">MERGER</code>=<em class="replaceable"><code>merge2</code></em></strong></span>.</p><pre class="programlisting">
6
- #!/bin/sh
7
- # args: old file, new file
8
- kdiff3 --auto --merge --output "$2" "$@" 2&gt;/dev/null
9
- </pre><p>From now on, <span class="application">kdiff3</span> 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 <span class="application">kdiff3</span>. Or, if you do not want to transfer any changes, simply terminate <span class="application">kdiff3</span>.</p></td></tr></table></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tools.verilog-ruby-conv"></a>Verilog to Ruby conversion</h3></div></div></div><p>The <span><strong class="command">header_to_ruby.rb</strong></span> tool can be used to convert Verilog header files into Ruby. You can try it by running the command <span><strong class="command">header_to_ruby.rb <code class="option">--help</code></strong></span>.</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="usage.html"><img src="images/prev.png" alt="Prev" /></a> </td><td width="20%" align="center"><a accesskey="u" href="usage.html"><img src="images/up.png" alt="Up" /></a></td><td width="40%" align="right"> <a accesskey="n" href="usage.tutorial.html"><img src="images/next.png" alt="Next" /></a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 4. Usage </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home" /></a></td><td width="40%" align="right" valign="top"> Tutorial</td></tr></table></div></body></html>
@@ -1,189 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Tutorial</title><link rel="stylesheet" href="styles/manual.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.68.1" /><link rel="start" href="index.html" title="Ruby-VPI user manual" /><link rel="up" href="usage.html" title="Chapter 4. Usage" /><link rel="prev" href="usage.tools.html" title="Tools" /><link rel="next" href="usage.examples.html" title="Examples" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Tutorial</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="usage.tools.html"><img src="images/prev.png" alt="Prev" /></a> </td><th width="60%" align="center">Chapter 4. Usage</th><td width="20%" align="right"> <a accesskey="n" href="usage.examples.html"><img src="images/next.png" alt="Next" /></a></td></tr></table><hr /></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="usage.tutorial"></a>Tutorial</h2></div></div></div><div class="procedure"><a id="id2529000"></a><p class="title"><b>Procedure 4.1. Typical way of using <span class="application">Ruby-VPI</span></b></p><ol type="1"><li><p><a href="usage.tutorial.html#usage.tutorial.declare-design" title="Start with a design">Declare the design</a>, which is a Verilog module, using Verilog 2001 syntax.</p></li><li><p><a href="usage.tutorial.html#usage.tutorial.generate-test" title="Generate a test">Generate a test</a> for the design using the <a href="usage.tools.html#usage.tools.generate-test" title="Automated test generation">automated test generator</a> tool.</p></li><li><p><a href="usage.tutorial.html#usage.tutorial.specification" title="Specify your expectations">Identify your expectations</a> for the design and implement them in the specification.</p></li><li><p>(Optional) <a href="usage.tutorial.html#usage.tutorial.implement-proto" title="Implement the prototype">Implement the prototype</a> of the design in Ruby.</p></li><li><p>(Optional) <a href="usage.tutorial.html#usage.tutorial.test-proto" title="Verify the prototype">Verify the prototype</a> against the specification.</p></li><li><p><a href="usage.tutorial.html#usage.tutorial.implement-design" title="Implement the design">Implement the design</a> in Verilog once the prototype has been verified.</p></li><li><p><a href="usage.tutorial.html#usage.tutorial.test-design" title="Verify the design">Verify the design</a> against the specification.</p></li></ol></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tutorial.declare-design"></a>Start with a design</h3></div></div></div><p>First, we need a <a href="glossary.html#term..design">Design</a> to verify. In this tutorial, <a href="usage.tutorial.html#fig..counter.v_decl" title="Figure 4.1. Declaration of a simple up-counter with synchronous reset">Figure 4.1, “Declaration of a simple up-counter with synchronous reset”</a> will serve as our design. Its interface is composed of the following parts:
4
- </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">Size</code></span></dt><dd><p>This parameter defines the number of bits used to represent the counter's value.</p></dd><dt><span class="term"><code class="varname">clock</code></span></dt><dd><p>Each positive edge of this signal causes the <code class="varname">count</code> register to increment.</p></dd><dt><span class="term"><code class="varname">reset</code></span></dt><dd><p>Assertion of this signal causes the <code class="varname">count</code> register to become zero.</p></dd><dt><span class="term"><code class="varname">count</code></span></dt><dd><p>This register contains the counter's value.</p></dd></dl></div><p>
5
- </p><div class="figure"><a id="fig..counter.v_decl"></a><p class="title"><b>Figure 4.1. Declaration of a simple up-counter with synchronous reset</b></p><pre class="programlisting">
6
- <span class="token">module</span> counter #(<span class="token">parameter</span> <code class="constant">Size</code> = <code class="literal">5</code>) (
7
- <span class="token">input</span> <code class="varname">clock</code>,
8
- <span class="token">input</span> <code class="varname">reset</code>,
9
- <span class="token">output</span> <span class="type">reg</span> [<code class="constant">Size</code> - <code class="literal">1</code> : <code class="literal">0</code>] <code class="varname">count</code>
10
- );
11
- <span class="token">endmodule</span>
12
- </pre></div><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Important: Before we continue…"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="images/important.png" /></td><th align="left">Before we continue…</th></tr><tr><td align="left" valign="top"><p>Save the source code shown in <a href="usage.tutorial.html#fig..counter.v_decl" title="Figure 4.1. Declaration of a simple up-counter with synchronous reset">Figure 4.1, “Declaration of a simple up-counter with synchronous reset”</a> into a file named <code class="filename">counter.v</code>.</p></td></tr></table></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tutorial.generate-test"></a>Generate a test</h3></div></div></div><p>Now that we have a <a href="glossary.html#term..design">Design</a> to verify, let us generate a <a href="glossary.html#term..test">Test</a> for it using the <a href="usage.tools.html#usage.tools.generate-test" title="Automated test generation">automated test generator</a>. This tool allows us to implement our <a href="glossary.html#term..specification">Specification</a> in either rSpec, xUnit, or our very own format. Each format represents a different software development methodology: rSpec represents <a href="glossary.html#term..BDD"><span class="acronym">BDD</span></a>, xUnit represents <a href="glossary.html#term..TDD">TDD</a>, and our own format can represent another methodology. Both rSpec and xUnit are presented in this tutorial.</p><p>Once we have decided how we want to implement our specification, we can proceed to generate a test for our design. <a href="usage.tutorial.html#fig..generate-test.rspec" title="Figure 4.2. Generating a test with specification in rSpec format">Figure 4.2, “Generating a test with specification in rSpec format”</a> and <a href="usage.tutorial.html#fig..generate-test.unit-test" title="Figure 4.3. Generating a test with specification in xUnit format">Figure 4.3, “Generating a test with specification in xUnit format”</a> illustrate this process.</p><div class="figure"><a id="fig..generate-test.rspec"></a><p class="title"><b>Figure 4.2. Generating a test with specification in rSpec format</b></p><pre class="screen">
13
- <code class="prompt">$</code> <strong class="userinput"><code><span><strong class="command">generate_test.rb <em class="replaceable"><code>counter.v</code></em> <code class="option">--rspec</code> <code class="option">--name</code> <em class="replaceable"><code>rspec</code></em></strong></span></code></strong>
14
- <code class="computeroutput">
15
- name rspec
16
- format rSpec
17
-
18
- module counter
19
- create counter_rspec_runner.rake
20
- create counter_rspec_bench.v
21
- create counter_rspec_bench.rb
22
- create counter_rspec_design.rb
23
- create counter_rspec_proto.rb
24
- create counter_rspec_spec.rb
25
- </code>
26
- </pre></div><div class="figure"><a id="fig..generate-test.unit-test"></a><p class="title"><b>Figure 4.3. Generating a test with specification in xUnit format</b></p><pre class="screen">
27
- <code class="prompt">$</code> <strong class="userinput"><code><span><strong class="command">generate_test.rb <em class="replaceable"><code>counter.v</code></em> <code class="option">--xunit</code> <code class="option">--name</code> <em class="replaceable"><code>xunit</code></em></strong></span></code></strong>
28
- <code class="computeroutput">
29
- name xunit
30
- format xUnit
31
-
32
- module counter
33
- create counter_xunit_runner.rake
34
- create counter_xunit_bench.v
35
- create counter_xunit_bench.rb
36
- create counter_xunit_design.rb
37
- create counter_xunit_proto.rb
38
- create counter_xunit_spec.rb
39
- </code>
40
- </pre></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tutorial.specification"></a>Specify your expectations</h3></div></div></div><p>So far, the test generation tool has created a basic foundation for our <a href="glossary.html#term..test">Test</a>. Now we must build upon this foundation by identifying our <a href="glossary.html#term..expectation">Expectation</a>s of the <a href="glossary.html#term..design">Design</a>. That is, how do we expect the design to <span class="emphasis"><em>behave</em></span> under certain conditions?</p><p>The following is a reasonable set of expectations for our simple counter:
41
- </p><div class="itemizedlist"><ul type="disc"><li><p>A resetted counter's value should be zero.</p></li><li><p>A resetted counter's value should increment by one count upon each rising clock edge.</p></li><li><p>A counter with the maximum value should overflow upon increment.</p></li></ul></div><p>
42
- </p><p>Now that we have identified a set of expectations for our design, we are ready to implement them in our specification. <a href="usage.tutorial.html#fig..counter_rspec_spec.rb" title="Figure 4.4. Specification implemented in rSpec format">Figure 4.4, “Specification implemented in rSpec format”</a> and <a href="usage.tutorial.html#fig..counter_xunit_spec.rb" title="Figure 4.5. Specification implemented in xUnit format">Figure 4.5, “Specification implemented in xUnit format”</a> illustrate this process. Note the striking similarities between our expectations and their implementation.</p><div class="figure"><a id="fig..counter_rspec_spec.rb"></a><p class="title"><b>Figure 4.4. Specification implemented in rSpec format</b></p><pre class="programlisting">
43
- <em><span class="remark"># lowest upper bound of counter's value</span></em>
44
- <code class="constant">LIMIT</code> = <code class="literal">2</code> ** <code class="constant">Counter</code>.<code class="function">Size</code>.<code class="function">intVal</code>
45
-
46
- <em><span class="remark"># maximum allowed value for a counter</span></em>
47
- <code class="constant">MAX</code> = <code class="constant">LIMIT</code> - <code class="literal">1</code>
48
-
49
- <code class="function">context</code> <code class="literal">"A resetted counter's value"</code> <span class="token">do</span>
50
- <code class="function">setup</code> <span class="token">do</span>
51
- <code class="constant">Counter</code>.<code class="function">reset!</code>
52
- <span class="token">end</span>
53
-
54
- <code class="function">specify</code> <code class="literal">"should be zero"</code> <span class="token">do</span>
55
- <code class="constant">Counter</code>.<code class="function">count</code>.<code class="function">intVal</code>.<code class="function">should_equal</code> <code class="literal">0</code>
56
- <span class="token">end</span>
57
-
58
- <code class="function">specify</code> <code class="literal">"should increment by one count upon each rising clock edge"</code> <span class="token">do</span>
59
- <code class="constant">LIMIT</code>.<code class="function">times</code> <span class="token">do</span> |<code class="varname">i</code>|
60
- <code class="constant">Counter</code>.<code class="function">count</code>.<code class="function">intVal</code>.<code class="function">should_equal</code> <code class="varname">i</code>
61
- <code class="function">relay_verilog</code> <em><span class="remark"># advance the clock</span></em>
62
- <span class="token">end</span>
63
- <span class="token">end</span>
64
- <span class="token">end</span>
65
-
66
- <code class="function">context</code> <code class="literal">"A counter with the maximum value"</code> <span class="token">do</span>
67
- <code class="function">setup</code> <span class="token">do</span>
68
- <code class="constant">Counter</code>.<code class="function">reset!</code>
69
-
70
- <em><span class="remark"># increment the counter to maximum value</span></em>
71
- <code class="constant">MAX</code>.<code class="function">times</code> <span class="token">do</span> <code class="function">relay_verilog</code> <span class="token">end</span>
72
- <code class="constant">Counter</code>.<code class="function">count</code>.<code class="function">intVal</code>.<code class="function">should_equal</code> <code class="constant">MAX</code>
73
- <span class="token">end</span>
74
-
75
- <code class="function">specify</code> <code class="literal">"should overflow upon increment"</code> <span class="token">do</span>
76
- <code class="function">relay_verilog</code> <em><span class="remark"># increment the counter</span></em>
77
- <code class="constant">Counter</code>.<code class="function">count</code>.<code class="function">intVal</code>.<code class="function">should_equal</code> <code class="literal">0</code>
78
- <span class="token">end</span>
79
- <span class="token">end</span>
80
- </pre></div><div class="figure"><a id="fig..counter_xunit_spec.rb"></a><p class="title"><b>Figure 4.5. Specification implemented in xUnit format</b></p><pre class="programlisting">
81
- <em><span class="remark"># lowest upper bound of counter's value</span></em>
82
- <code class="constant">LIMIT</code> = <code class="literal">2</code> ** <code class="constant">Counter</code>.<code class="function">Size</code>.<code class="function">intVal</code>
83
-
84
- <em><span class="remark"># maximum allowed value for a counter</span></em>
85
- <code class="constant">MAX</code> = <code class="constant">LIMIT</code> - <code class="literal">1</code>
86
-
87
- <span class="token">class</span> <code class="constant">ResettedCounterValue</code> &lt; <code class="constant">Test</code>::<code class="constant">Unit</code>::<code class="constant">TestCase</code>
88
- <span class="token">def</span> <code class="function">setup</code>
89
- <code class="constant">Counter</code>.<code class="function">reset!</code>
90
- <span class="token">end</span>
91
-
92
- <span class="token">def</span> <code class="function">test_zero</code>
93
- <code class="function">assert_equal</code> <code class="literal">0</code>, <code class="constant">Counter</code>.<code class="function">count</code>.<code class="function">intVal</code>
94
- <span class="token">end</span>
95
-
96
- <span class="token">def</span> <code class="function">test_increment</code>
97
- <code class="constant">LIMIT</code>.<code class="function">times</code> <span class="token">do</span> |<code class="varname">i</code>|
98
- <code class="function">assert_equal</code> <code class="varname">i</code>, <code class="constant">Counter</code>.<code class="function">count</code>.<code class="function">intVal</code>
99
- <code class="function">relay_verilog</code> <em><span class="remark"># advance the clock</span></em>
100
- <span class="token">end</span>
101
- <span class="token">end</span>
102
- <span class="token">end</span>
103
-
104
- <span class="token">class</span> <code class="constant">MaximumCounterValue</code> &lt; <code class="constant">Test</code>::<code class="constant">Unit</code>::<code class="constant">TestCase</code>
105
- <span class="token">def</span> <code class="function">setup</code>
106
- <code class="constant">Counter</code>.<code class="function">reset!</code>
107
-
108
- <em><span class="remark"># increment the counter to maximum value</span></em>
109
- <code class="constant">MAX</code>.<code class="function">times</code> <span class="token">do</span> <code class="function">relay_verilog</code> <span class="token">end</span>
110
- <code class="function">assert_equal</code> <code class="constant">MAX</code>, <code class="constant">Counter</code>.<code class="function">count</code>.<code class="function">intVal</code>
111
- <span class="token">end</span>
112
-
113
- <span class="token">def</span> <code class="function">test_overflow</code>
114
- <code class="function">relay_verilog</code> <em><span class="remark"># increment the counter</span></em>
115
- <code class="function">assert_equal</code> <code class="literal">0</code>, <code class="constant">Counter</code>.<code class="function">count</code>.<code class="function">intVal</code>
116
- <span class="token">end</span>
117
- <span class="token">end</span>
118
- </pre></div><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Important: Before we continue…"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="images/important.png" /></td><th align="left">Before we continue…</th></tr><tr><td align="left" valign="top"><div class="itemizedlist"><ul type="disc"><li><p>Replace the contents of the file named <code class="filename">counter_rspec_spec.rb</code> with the source code shown in <a href="usage.tutorial.html#fig..counter_rspec_spec.rb" title="Figure 4.4. Specification implemented in rSpec format">Figure 4.4, “Specification implemented in rSpec format”</a>.</p></li><li><p>Replace the contents of the file named <code class="filename">counter_xunit_spec.rb</code> with the source code shown in <a href="usage.tutorial.html#fig..counter_xunit_spec.rb" title="Figure 4.5. Specification implemented in xUnit format">Figure 4.5, “Specification implemented in xUnit format”</a>.</p></li><li><p>Replace the contents of the files named <code class="filename">counter_rspec_design.rb</code> and <code class="filename">counter_xunit_design.rb</code> with the following code. This code defines the <code class="function">reset!</code> method which resets our Verilog design.</p><pre class="programlisting">
119
- <span class="token">def</span> <code class="constant">Counter</code>.<code class="function">reset!</code>
120
- <code class="function">reset</code>.<code class="function">intVal</code> = <code class="literal">1</code>
121
- <code class="function">relay_verilog</code> <em><span class="remark"># advance the clock</span></em>
122
- <code class="function">reset</code>.<code class="function">intVal</code> = <code class="literal">0</code>
123
- <span class="token">end</span>
124
- </pre></li></ul></div></td></tr></table></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tutorial.implement-proto"></a>Implement the prototype</h3></div></div></div><p>Now that we have a <a href="glossary.html#term..specification">Specification</a> against which to verify our <a href="glossary.html#term..design">Design</a>, let us build a prototype of our design. By doing so, we exercise our specification, experience potential problems that may arise when we later implement our design in Verilog, and gain confidence in our work. <a href="usage.tutorial.html#fig..counter_proto.rb" title="Figure 4.6. Ruby prototype of our Verilog design">Figure 4.6, “Ruby prototype of our Verilog design”</a> shows the completed prototype for our design.</p><div class="figure"><a id="fig..counter_proto.rb"></a><p class="title"><b>Figure 4.6. Ruby prototype of our Verilog design</b></p><pre class="programlisting">
125
- <span class="token">def</span> <code class="constant">Counter</code>.<code class="function">simulate!</code>
126
- <span class="token">if</span> <code class="function">reset</code>.<code class="function">intVal</code> == <code class="literal">1</code>
127
- <code class="function">count</code>.<code class="function">intVal</code> = <code class="literal">0</code>
128
- <span class="token">else</span>
129
- <code class="function">count</code>.<code class="function">intVal</code> += <code class="literal">1</code>
130
- <span class="token">end</span>
131
- <span class="token">end</span>
132
- </pre></div><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Important: Before we continue…"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="images/important.png" /></td><th align="left">Before we continue…</th></tr><tr><td align="left" valign="top"><p>Replace the contents of the files named <code class="filename">counter_rspec_proto.rb</code> and <code class="filename">counter_xunit_proto.rb</code> with the source code shown in <a href="usage.tutorial.html#fig..counter_proto.rb" title="Figure 4.6. Ruby prototype of our Verilog design">Figure 4.6, “Ruby prototype of our Verilog design”</a>.</p></td></tr></table></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tutorial.test-proto"></a>Verify the prototype</h3></div></div></div><p>Now that we have implemented our prototype, we are ready to verify it against our <a href="glossary.html#term..specification">Specification</a> by running the <a href="glossary.html#term..test">Test</a>. <a href="usage.tutorial.html#fig..test-proto.rspec" title="Figure 4.7. Running a test with specification in rSpec format">Figure 4.7, “Running a test with specification in rSpec format”</a> and <a href="usage.tutorial.html#fig..test-proto.unit-test" title="Figure 4.8. Running a test with specification in xUnit format">Figure 4.8, “Running a test with specification in xUnit format”</a> illustrate this process.</p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip: Reuse your past efforts!"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="images/tip.png" /></td><th align="left">Reuse your past efforts!</th></tr><tr><td align="left" valign="top"><p>The <span class="emphasis"><em>same</em></span> specification can be used to verify both prototype and design.</p></td></tr></table></div><p>Here, the <code class="varname">PROTOTYPE</code> environment variable is assigned a non-empty value while running the test, so that, instead of our design, our prototype is verified against our specification. You can also assign a value to <code class="varname">PROTOTYPE</code> before running the test, by using your shell's <span><strong class="command">export</strong></span> or <span><strong class="command">setenv</strong></span> command. Finally, the Icarus Verilog simulator, denoted by <em class="replaceable"><code>cver</code></em>, is used to run the simulation.</p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip: What can the test runner do?"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="images/tip.png" /></td><th align="left">What can the test runner do?</th></tr><tr><td align="left" valign="top"><p>If you invoke the test runner (1) without any arguments or (2) with the <code class="option">-T</code> option, it will show you a list of tasks that it can perform for you.</p></td></tr></table></div><div class="figure"><a id="fig..test-proto.rspec"></a><p class="title"><b>Figure 4.7. Running a test with specification in rSpec format</b></p><pre class="screen">
133
- <code class="prompt">$</code> <strong class="userinput"><code><span><strong class="command">rake <code class="option">-f</code> <em class="replaceable"><code>counter_rspec_runner.rake</code></em> <em class="replaceable"><code>cver</code></em> <code class="varname">PROTOTYPE</code>=<em class="replaceable"><code>1</code></em></strong></span></code></strong>
134
- <code class="computeroutput">counter_rspec: verifying prototype instead of design
135
-
136
- A resetted counter's value
137
- - should be zero
138
- - should increment by one count upon each rising clock edge
139
-
140
- A counter with the maximum value
141
- - should overflow upon increment
142
-
143
- Finished in 0.018199 seconds
144
-
145
- 3 specifications, 0 failures</code>
146
- </pre></div><div class="figure"><a id="fig..test-proto.unit-test"></a><p class="title"><b>Figure 4.8. Running a test with specification in xUnit format</b></p><pre class="screen">
147
- <code class="prompt">$</code> <strong class="userinput"><code><span><strong class="command">rake <code class="option">-f</code> <em class="replaceable"><code>counter_xunit_runner.rake</code></em> <em class="replaceable"><code>cver</code></em> <code class="varname">PROTOTYPE</code>=<em class="replaceable"><code>1</code></em></strong></span></code></strong>
148
- <code class="computeroutput">counter_xunit: verifying prototype instead of design
149
-
150
- Loaded suite counter_xunit_bench
151
- Started
152
- ...
153
- Finished in 0.040668 seconds.
154
-
155
- 3 tests, 35 assertions, 0 failures, 0 errors</code>
156
- </pre></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tutorial.implement-design"></a>Implement the design</h3></div></div></div><p>Now that we have implemented and verified our prototype, we are ready to implement our <a href="glossary.html#term..design">Design</a>. This is often quite simple because we translate <span class="emphasis"><em>existing</em></span> code from Ruby (our prototype) into Verilog (our design). <a href="usage.tutorial.html#fig..counter.v_impl" title="Figure 4.9. Implementation of a simple up-counter with synchronous reset">Figure 4.9, “Implementation of a simple up-counter with synchronous reset”</a> illustrates the result of this process. Once again, note the striking similarities between the implementation of our prototype and design.</p><div class="figure"><a id="fig..counter.v_impl"></a><p class="title"><b>Figure 4.9. Implementation of a simple up-counter with synchronous reset</b></p><pre class="programlisting">
157
- <span class="token">module</span> counter #(<span class="token">parameter</span> <code class="constant">Size</code> = <code class="literal">5</code>) (
158
- <span class="token">input</span> <code class="varname">clock</code>,
159
- <span class="token">input</span> <code class="varname">reset</code>,
160
- <span class="token">output</span> <span class="type">reg</span> [<code class="constant">Size</code> - <code class="literal">1</code> : <code class="literal">0</code>] <code class="varname">count</code>
161
- );
162
- <span class="token">always</span> @(<span class="token">posedge</span> <code class="varname">clock</code>) <span class="token">begin</span>
163
- <span class="token">if</span> (<code class="varname">reset</code>)
164
- <code class="varname">count</code> &lt;= <code class="literal">0</code>;
165
- <span class="token">else</span>
166
- <code class="varname">count</code> &lt;= <code class="varname">count</code> + <code class="literal">1</code>;
167
- <span class="token">end</span>
168
- <span class="token">endmodule</span>
169
- </pre></div><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Important: Before we continue…"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="images/important.png" /></td><th align="left">Before we continue…</th></tr><tr><td align="left" valign="top"><p>Replace the contents of the file named <code class="filename">counter.v</code> with the source code shown in <a href="usage.tutorial.html#fig..counter.v_impl" title="Figure 4.9. Implementation of a simple up-counter with synchronous reset">Figure 4.9, “Implementation of a simple up-counter with synchronous reset”</a>.</p></td></tr></table></div></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="usage.tutorial.test-design"></a>Verify the design</h3></div></div></div><p>Now that we have implemented our <a href="glossary.html#term..design">Design</a>, we are ready to verify it against our <a href="glossary.html#term..specification">Specification</a> by running the <a href="glossary.html#term..test">Test</a>. <a href="usage.tutorial.html#fig..test-design.rspec" title="Figure 4.10. Running a test with specification in rSpec format">Figure 4.10, “Running a test with specification in rSpec format”</a> and <a href="usage.tutorial.html#fig..test-design.unit-test" title="Figure 4.11. Running a test with specification in xUnit format">Figure 4.11, “Running a test with specification in xUnit format”</a> illustrate this process.</p><p>Here, the <code class="varname">PROTOTYPE</code> environment variable is <span class="emphasis"><em>not</em></span> specified while running the test, so that our design, instead of our prototype, is verified against our specification. You can also achieve this effect by assigning an empty value to <code class="varname">PROTOTYPE</code>, or by using your shell's <span><strong class="command">unset</strong></span> command. Finally, the GPL Cver Verilog simulator, denoted by <em class="replaceable"><code>cver</code></em>, is used to run the simulation.</p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip: Running multiple tests"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="images/tip.png" /></td><th align="left">Running multiple tests</th></tr><tr><td align="left" valign="top"><p>Create a file named <code class="filename">Rakefile</code> containing the following line.</p><pre class="programlisting">require 'ruby-vpi/runner_proxy'</pre><p>Now you can invoke all test runners in the current directory simply by executing <span><strong class="command">rake <em class="replaceable"><code>cver</code></em></strong></span> (where <em class="replaceable"><code>cver</code></em> denotes the GPL Cver simulator).</p></td></tr></table></div><div class="figure"><a id="fig..test-design.rspec"></a><p class="title"><b>Figure 4.10. Running a test with specification in rSpec format</b></p><pre class="screen">
170
- <code class="prompt">$</code> <strong class="userinput"><code><span><strong class="command">rake <code class="option">-f</code> <em class="replaceable"><code>counter_rspec_runner.rake</code></em> <em class="replaceable"><code>cver</code></em></strong></span></code></strong>
171
- <code class="computeroutput">A resetted counter's value
172
- - should be zero
173
- - should increment by one count upon each rising clock edge
174
-
175
- A counter with the maximum value
176
- - should overflow upon increment
177
-
178
- Finished in 0.005628 seconds
179
-
180
- 3 specifications, 0 failures</code>
181
- </pre></div><div class="figure"><a id="fig..test-design.unit-test"></a><p class="title"><b>Figure 4.11. Running a test with specification in xUnit format</b></p><pre class="screen">
182
- <code class="prompt">$</code> <strong class="userinput"><code><span><strong class="command">rake <code class="option">-f</code> <em class="replaceable"><code>counter_xunit_runner.rake</code></em> <em class="replaceable"><code>cver</code></em></strong></span></code></strong>
183
- <code class="computeroutput">Loaded suite counter_xunit_bench
184
- Started
185
- ...
186
- Finished in 0.006766 seconds.
187
-
188
- 3 tests, 35 assertions, 0 failures, 0 errors</code>
189
- </pre></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="usage.tools.html"><img src="images/prev.png" alt="Prev" /></a> </td><td width="20%" align="center"><a accesskey="u" href="usage.html"><img src="images/up.png" alt="Up" /></a></td><td width="40%" align="right"> <a accesskey="n" href="usage.examples.html"><img src="images/next.png" alt="Next" /></a></td></tr><tr><td width="40%" align="left" valign="top">Tools </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home" /></a></td><td width="40%" align="right" valign="top"> Examples</td></tr></table></div></body></html>
data/header.html DELETED
@@ -1,95 +0,0 @@
1
- <head>
2
- <link rel="stylesheet" type="text/css" href="style.css" />
3
- </head>
4
-
5
- <div class="variablelist">
6
- <dl>
7
-
8
- <dt>
9
- <span class="term">
10
- <a href="./doc/usage.tutorial.html" target="_top">Tutorial</a>
11
- </span>
12
- </dt>
13
- <dd>
14
- <p>Learn how to use Ruby-VPI quickly.</p>
15
- </dd>
16
-
17
- <dt>
18
- <span class="term">
19
- <a href="./doc/" target="_top">Manual</a>
20
- </span>
21
- </dt>
22
- <dd>
23
- <p>Complete documentation for users. <em>Start here!</em></p>
24
- </dd>
25
-
26
- <dt>
27
- <span class="term">
28
- <a href="./ref/" target="_top">Reference</a>
29
- </span>
30
- </dt>
31
- <dd>
32
- <p><span class="caps">API</span> reference documentation for Ruby libraries and C extension.</p>
33
- </dd>
34
-
35
- <dt>
36
- <span class="term">
37
- <a href="http://rubyforge.org/projects/ruby-vpi" target="_top">
38
- Facilities</a>
39
- </span>
40
- </dt>
41
- <dd>
42
- <p>
43
- Access the issue tracker, file downloads, support requests, discussion forums, and more at <a href="http://rubyforge.org" target="_top">
44
- RubyForge</a>.
45
- </p>
46
- </dd>
47
-
48
- <dt>
49
- <span class="term">
50
- <a href="http://ruby-vpi.rubyforge.org" target="_top">
51
- Project</a>
52
- </span>
53
- </dt>
54
- <dd>
55
- <p>
56
- Access more information at the project&#8217;s home page.
57
- </p>
58
- </dd>
59
-
60
- <dt>
61
- <span class="term">
62
- <a href="http://ruby-vpi.rubyforge.org/src/ruby-vpi" target="_top">
63
- Sources</a>
64
- </span>
65
- </dt>
66
- <dd>
67
- <p>
68
- Browse or access the source code repository.</p>
69
- </dd>
70
-
71
- <dt>
72
- <span class="term">
73
- <a href="http://ruby-vpi.rubyforge.org/talks" target="_top">
74
- Talks</a>
75
- </span>
76
- </dt>
77
- <dd>
78
- <p>
79
- Access public presentations about Ruby-VPI.</p>
80
- </dd>
81
-
82
- <dt>
83
- <span class="term">
84
- <a href="http://ruby-vpi.rubyforge.org/blog" target="_top">
85
- News</a>
86
- </span>
87
- </dt>
88
- <dd>
89
- <p>
90
- See what the developers are cooking up.</p>
91
- </dd>
92
-
93
- </dl>
94
- </div>
95
- </div>