ruby-vpi 16.0.1 → 17.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. data/LICENSE +19 -19
  2. data/README +1 -1
  3. data/Rakefile +35 -32
  4. data/bin/convert.rb +28 -0
  5. data/bin/generate/design.rb +16 -0
  6. data/bin/generate/proto.rb +13 -0
  7. data/bin/generate/runner.rake +33 -0
  8. data/bin/generate/spec.rb +45 -0
  9. data/bin/generate.rb +177 -0
  10. data/bin/ruby-vpi +56 -0
  11. data/doc/Rakefile +20 -4
  12. data/doc/common.css +92 -33
  13. data/doc/common.inc +13 -0
  14. data/doc/common.tpl +42 -28
  15. data/doc/history.doc +11 -11
  16. data/doc/history.html +769 -248
  17. data/doc/history.inc +909 -0
  18. data/doc/history.rb +9 -0
  19. data/doc/history.yaml +69 -0
  20. data/doc/intro.inc +170 -178
  21. data/doc/lib/doc_format.rb +57 -144
  22. data/doc/lib/doc_proxy.rb +504 -88
  23. data/doc/lib/erb_content.rb +8 -8
  24. data/doc/lib/erb_proxy.rb +17 -17
  25. data/doc/manual.doc +626 -777
  26. data/doc/manual.html +1541 -1031
  27. data/doc/memo.doc +38 -36
  28. data/doc/memo.html +64 -28
  29. data/doc/readme.doc +4 -31
  30. data/doc/readme.html +221 -163
  31. data/doc/rss.erb +1 -1
  32. data/doc/rss.xml +73 -1761
  33. data/ext/Rakefile +6 -5
  34. data/ext/main.c +17 -15
  35. data/ext/relay.c +4 -7
  36. data/ext/relay.h +2 -2
  37. data/ext/swig_vpi.h +2 -2
  38. data/ext/swig_vpi.i +1 -2
  39. data/ext/swig_wrap.cin +12 -16
  40. data/ext/vlog.c +5 -5
  41. data/ext/vlog.h +2 -2
  42. data/lib/ruby-vpi/erb.rb +3 -3
  43. data/lib/ruby-vpi/float.rb +2 -2
  44. data/lib/ruby-vpi/rcov.rb +5 -7
  45. data/lib/ruby-vpi/runner.rb +43 -41
  46. data/lib/ruby-vpi/runner_boot_loader.rb +117 -0
  47. data/lib/ruby-vpi/runner_proxy.rb +6 -8
  48. data/lib/ruby-vpi/util.rb +10 -0
  49. data/lib/ruby-vpi/verilog_parser.rb +28 -56
  50. data/lib/ruby-vpi/vpi.rb +168 -123
  51. data/lib/ruby-vpi.rb +22 -143
  52. data/ref/c/annotated.html +1 -1
  53. data/ref/c/common_8h.html +1 -1
  54. data/ref/c/files.html +1 -1
  55. data/ref/c/functions.html +1 -1
  56. data/ref/c/functions_vars.html +1 -1
  57. data/ref/c/globals.html +1 -1
  58. data/ref/c/globals_0x63.html +1 -1
  59. data/ref/c/globals_0x65.html +1 -1
  60. data/ref/c/globals_0x66.html +1 -1
  61. data/ref/c/globals_0x6d.html +1 -1
  62. data/ref/c/globals_0x70.html +1 -1
  63. data/ref/c/globals_0x72.html +1 -1
  64. data/ref/c/globals_0x73.html +1 -1
  65. data/ref/c/globals_0x74.html +1 -1
  66. data/ref/c/globals_0x76.html +1 -1
  67. data/ref/c/globals_0x78.html +1 -1
  68. data/ref/c/globals_defs.html +1 -1
  69. data/ref/c/globals_defs_0x65.html +1 -1
  70. data/ref/c/globals_defs_0x70.html +1 -1
  71. data/ref/c/globals_defs_0x76.html +1 -1
  72. data/ref/c/globals_defs_0x78.html +1 -1
  73. data/ref/c/globals_enum.html +1 -1
  74. data/ref/c/globals_eval.html +1 -1
  75. data/ref/c/globals_func.html +1 -1
  76. data/ref/c/globals_type.html +1 -1
  77. data/ref/c/globals_vars.html +1 -1
  78. data/ref/c/index.html +1 -1
  79. data/ref/c/main_8c.html +1 -1
  80. data/ref/c/main_8h.html +1 -1
  81. data/ref/c/relay_8c.html +1 -1
  82. data/ref/c/relay_8h.html +1 -1
  83. data/ref/c/structt__cb__data.html +1 -1
  84. data/ref/c/structt__vpi__delay.html +1 -1
  85. data/ref/c/structt__vpi__error__info.html +1 -1
  86. data/ref/c/structt__vpi__strengthval.html +1 -1
  87. data/ref/c/structt__vpi__systf__data.html +1 -1
  88. data/ref/c/structt__vpi__time.html +1 -1
  89. data/ref/c/structt__vpi__value.html +1 -1
  90. data/ref/c/structt__vpi__vecval.html +1 -1
  91. data/ref/c/structt__vpi__vlog__info.html +1 -1
  92. data/ref/c/verilog_8h.html +1 -1
  93. data/ref/c/vlog_8c.html +1 -1
  94. data/ref/c/vlog_8h.html +1 -1
  95. data/ref/c/vpi__user_8h.html +1 -1
  96. data/ref/ruby/classes/ERB.html +5 -5
  97. data/ref/ruby/classes/ERB.src/{M000024.html → M000026.html} +0 -0
  98. data/ref/ruby/classes/FileUtils.html +11 -11
  99. data/ref/ruby/classes/FileUtils.src/{M000025.html → M000027.html} +0 -0
  100. data/ref/ruby/classes/FileUtils.src/{M000026.html → M000028.html} +0 -0
  101. data/ref/ruby/classes/Float.html +6 -6
  102. data/ref/ruby/classes/Float.src/{M000020.html → M000021.html} +0 -0
  103. data/ref/ruby/classes/Integer.html +65 -65
  104. data/ref/ruby/classes/Integer.src/M000009.html +12 -5
  105. data/ref/ruby/classes/Integer.src/M000010.html +5 -5
  106. data/ref/ruby/classes/Integer.src/M000011.html +5 -5
  107. data/ref/ruby/classes/Integer.src/M000012.html +5 -5
  108. data/ref/ruby/classes/Integer.src/M000013.html +5 -5
  109. data/ref/ruby/classes/Integer.src/M000014.html +18 -0
  110. data/ref/ruby/classes/Integer.src/M000017.html +12 -18
  111. data/ref/ruby/classes/Integer.src/M000018.html +18 -12
  112. data/ref/ruby/classes/Integer.src/M000019.html +12 -17
  113. data/ref/ruby/classes/Integer.src/M000020.html +30 -0
  114. data/ref/ruby/classes/RDoc.html +5 -5
  115. data/ref/ruby/classes/RDoc.src/{M000053.html → M000058.html} +0 -0
  116. data/ref/ruby/classes/{RubyVpi/Config.html → RubyVPI.html} +20 -6
  117. data/ref/ruby/classes/String.html +34 -15
  118. data/ref/ruby/classes/String.src/M000022.html +5 -28
  119. data/ref/ruby/classes/String.src/M000023.html +5 -5
  120. data/ref/ruby/classes/String.src/{M000021.html → M000024.html} +0 -0
  121. data/ref/ruby/classes/String.src/M000025.html +41 -0
  122. data/ref/ruby/classes/VerilogParser/Module/Port.html +16 -36
  123. data/ref/ruby/classes/VerilogParser/Module/Port.src/M000006.html +10 -5
  124. data/ref/ruby/classes/VerilogParser/Module/Port.src/{M000004.html → M000007.html} +4 -4
  125. data/ref/ruby/classes/VerilogParser/Module/Port.src/{M000005.html → M000008.html} +4 -4
  126. data/ref/ruby/classes/VerilogParser/Module.html +28 -9
  127. data/ref/ruby/classes/VerilogParser/Module.src/M000005.html +29 -0
  128. data/ref/ruby/classes/VerilogParser.html +5 -39
  129. data/ref/ruby/classes/VerilogParser.src/M000004.html +26 -0
  130. data/ref/ruby/classes/Vpi/Handle.html +179 -77
  131. data/ref/ruby/classes/Vpi/Handle.src/M000035.html +18 -0
  132. data/ref/ruby/classes/Vpi/Handle.src/M000036.html +5 -5
  133. data/ref/ruby/classes/Vpi/Handle.src/M000037.html +5 -5
  134. data/ref/ruby/classes/Vpi/Handle.src/M000038.html +5 -5
  135. data/ref/ruby/classes/Vpi/Handle.src/M000039.html +5 -5
  136. data/ref/ruby/classes/Vpi/Handle.src/M000040.html +5 -8
  137. data/ref/ruby/classes/Vpi/Handle.src/M000041.html +5 -8
  138. data/ref/ruby/classes/Vpi/Handle.src/M000042.html +5 -9
  139. data/ref/ruby/classes/Vpi/Handle.src/M000043.html +8 -31
  140. data/ref/ruby/classes/Vpi/Handle.src/M000044.html +8 -74
  141. data/ref/ruby/classes/Vpi/Handle.src/M000045.html +9 -17
  142. data/ref/ruby/classes/Vpi/Handle.src/M000046.html +31 -11
  143. data/ref/ruby/classes/Vpi/Handle.src/M000047.html +86 -0
  144. data/ref/ruby/classes/Vpi/Handle.src/M000048.html +17 -18
  145. data/ref/ruby/classes/Vpi/Handle.src/M000050.html +18 -0
  146. data/ref/ruby/classes/Vpi/Handle.src/M000051.html +24 -0
  147. data/ref/ruby/classes/Vpi/Handle.src/M000053.html +31 -0
  148. data/ref/ruby/classes/Vpi/Handle.src/M000054.html +89 -0
  149. data/ref/ruby/classes/Vpi/S_vpi_time.html +16 -16
  150. data/ref/ruby/classes/Vpi/S_vpi_time.src/{M000050.html → M000055.html} +4 -4
  151. data/ref/ruby/classes/Vpi/S_vpi_time.src/{M000051.html → M000056.html} +5 -5
  152. data/ref/ruby/classes/Vpi/S_vpi_value.html +15 -15
  153. data/ref/ruby/classes/Vpi/S_vpi_value.src/{M000035.html → M000032.html} +5 -5
  154. data/ref/ruby/classes/Vpi/S_vpi_value.src/M000033.html +5 -5
  155. data/ref/ruby/classes/Vpi/S_vpi_value.src/M000034.html +5 -5
  156. data/ref/ruby/classes/Vpi.html +6 -42
  157. data/ref/ruby/classes/Vpi.src/M000029.html +15 -5
  158. data/ref/ruby/classes/Vpi.src/M000030.html +24 -24
  159. data/ref/ruby/classes/Vpi.src/M000031.html +6 -8
  160. data/ref/ruby/created.rid +1 -1
  161. data/ref/ruby/files/bin/{header_to_ruby_rb.html → convert_rb.html} +5 -5
  162. data/ref/ruby/files/bin/{generate_test_rb.html → generate_rb.html} +8 -21
  163. data/ref/ruby/files/lib/ruby-vpi/erb_rb.html +1 -1
  164. data/ref/ruby/files/lib/ruby-vpi/float_rb.html +1 -1
  165. data/ref/ruby/files/lib/ruby-vpi/integer_rb.html +1 -1
  166. data/ref/ruby/files/lib/ruby-vpi/rake_rb.html +1 -1
  167. data/ref/ruby/files/lib/ruby-vpi/rcov_rb.html +1 -1
  168. data/ref/ruby/files/lib/ruby-vpi/rdoc_rb.html +1 -1
  169. data/ref/ruby/files/lib/ruby-vpi/runner_boot_loader_rb.html +197 -0
  170. data/ref/ruby/files/lib/ruby-vpi/runner_boot_loader_rb.src/M000001.html +17 -0
  171. data/ref/ruby/files/lib/ruby-vpi/runner_boot_loader_rb.src/M000002.html +18 -0
  172. data/ref/ruby/files/lib/ruby-vpi/runner_proxy_rb.html +1 -1
  173. data/ref/ruby/files/lib/ruby-vpi/runner_rb.html +6 -19
  174. data/ref/ruby/files/lib/ruby-vpi/util_rb.html +101 -0
  175. data/ref/ruby/files/lib/ruby-vpi/verilog_parser_rb.html +8 -1
  176. data/ref/ruby/files/lib/ruby-vpi/vpi_rb.html +1 -1
  177. data/ref/ruby/files/lib/ruby-vpi_rb.html +2 -14
  178. data/ref/ruby/fr_class_index.html +1 -3
  179. data/ref/ruby/fr_file_index.html +4 -2
  180. data/ref/ruby/fr_method_index.html +56 -51
  181. data/ref/ruby/index.html +1 -1
  182. data/samp/counter/RSpec/Rakefile +1 -0
  183. data/samp/counter/RSpec/counter_design.rb +15 -0
  184. data/samp/counter/RSpec/counter_proto.rb +10 -0
  185. data/samp/counter/RSpec/counter_runner.rake +44 -0
  186. data/samp/counter/RSpec/counter_spec.rb +39 -0
  187. data/samp/counter/Rakefile +1 -1
  188. data/samp/counter/counter.v +7 -7
  189. data/samp/counter/xUnit/Rakefile +1 -0
  190. data/samp/counter/xUnit/counter_bench.rb +95 -0
  191. data/samp/counter/{counter_xunit_bench.v → xUnit/counter_bench.v} +0 -0
  192. data/samp/counter/xUnit/counter_design.rb +15 -0
  193. data/samp/counter/xUnit/counter_proto.rb +10 -0
  194. data/samp/counter/xUnit/counter_runner.rake +44 -0
  195. data/samp/counter/{counter_xunit_spec.rb → xUnit/counter_spec.rb} +9 -9
  196. data/samp/pipelined_alu/Rakefile +1 -1
  197. data/samp/pipelined_alu/TestHw5UnitModel.rb +4 -5
  198. data/samp/pipelined_alu/hw5_unit.v +55 -85
  199. data/samp/pipelined_alu/hw5_unit_design.rb +51 -0
  200. data/samp/pipelined_alu/hw5_unit_proto.rb +4 -0
  201. data/samp/pipelined_alu/hw5_unit_runner.rake +43 -0
  202. data/samp/pipelined_alu/hw5_unit_spec.rb +64 -0
  203. data/samp/register_file/LICENSE +20 -0
  204. data/samp/register_file/README +4 -0
  205. data/samp/register_file/Rakefile +1 -0
  206. data/samp/register_file/register_file.v +18 -0
  207. data/samp/register_file/register_file_design.rb +11 -0
  208. data/samp/register_file/register_file_proto.rb +11 -0
  209. data/samp/register_file/register_file_runner.rake +43 -0
  210. data/samp/register_file/register_file_spec.rb +58 -0
  211. metadata +78 -66
  212. data/bin/generate_test.rb +0 -200
  213. data/bin/generate_test_tpl/bench.rb +0 -89
  214. data/bin/generate_test_tpl/bench.v +0 -26
  215. data/bin/generate_test_tpl/design.rb +0 -11
  216. data/bin/generate_test_tpl/proto.rb +0 -16
  217. data/bin/generate_test_tpl/runner.rake +0 -42
  218. data/bin/generate_test_tpl/spec.rb +0 -37
  219. data/bin/header_to_ruby.rb +0 -27
  220. data/ref/ruby/classes/Integer.src/M000008.html +0 -25
  221. data/ref/ruby/classes/Integer.src/M000016.html +0 -25
  222. data/ref/ruby/classes/RubyVpi.html +0 -199
  223. data/ref/ruby/classes/RubyVpi.src/M000027.html +0 -121
  224. data/ref/ruby/classes/VerilogParser/Module/Parameter.html +0 -160
  225. data/ref/ruby/classes/VerilogParser/Module/Parameter.src/M000007.html +0 -19
  226. data/ref/ruby/classes/VerilogParser/Module/Port.src/M000003.html +0 -21
  227. data/ref/ruby/classes/VerilogParser/Module.src/M000002.html +0 -34
  228. data/ref/ruby/classes/VerilogParser.src/M000001.html +0 -34
  229. data/ref/ruby/classes/Vpi/Handle.src/M000049.html +0 -69
  230. data/ref/ruby/classes/Vpi.src/M000028.html +0 -28
  231. data/ref/ruby/classes/Vpi.src/M000032.html +0 -22
  232. data/samp/counter/counter_rspec_bench.rb +0 -86
  233. data/samp/counter/counter_rspec_bench.v +0 -9
  234. data/samp/counter/counter_rspec_design.rb +0 -8
  235. data/samp/counter/counter_rspec_proto.rb +0 -13
  236. data/samp/counter/counter_rspec_runner.rake +0 -52
  237. data/samp/counter/counter_rspec_spec.rb +0 -39
  238. data/samp/counter/counter_xunit_bench.rb +0 -86
  239. data/samp/counter/counter_xunit_design.rb +0 -8
  240. data/samp/counter/counter_xunit_proto.rb +0 -13
  241. data/samp/counter/counter_xunit_runner.rake +0 -52
  242. data/samp/pipelined_alu/hw5_unit_test_bench.rb +0 -86
  243. data/samp/pipelined_alu/hw5_unit_test_bench.v +0 -14
  244. data/samp/pipelined_alu/hw5_unit_test_design.rb +0 -61
  245. data/samp/pipelined_alu/hw5_unit_test_proto.rb +0 -7
  246. data/samp/pipelined_alu/hw5_unit_test_runner.rake +0 -52
  247. data/samp/pipelined_alu/hw5_unit_test_spec.rb +0 -68
@@ -1,34 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>new (VerilogParser::Module)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/verilog_parser.rb, line 36</span>
14
- 36: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">aDecl</span>
15
- 37: <span class="ruby-ivar">@decl</span> = <span class="ruby-identifier">aDecl</span>.<span class="ruby-identifier">strip</span>
16
- 38:
17
- 39: <span class="ruby-ivar">@decl</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">%r{module\s+(\w+)\s*(?:\#\((.*?)\))?\s*\((.*?)\)\s*;}</span><span class="ruby-identifier">m</span>
18
- 40: <span class="ruby-ivar">@name</span>, <span class="ruby-identifier">paramDecls</span>, <span class="ruby-identifier">portDecls</span> = <span class="ruby-identifier">$1</span>, <span class="ruby-identifier">$2</span>, <span class="ruby-identifier">$3</span>
19
- 41:
20
- 42: <span class="ruby-ivar">@parameters</span> =
21
- 43: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">paramDecls</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">%r{\bparameter\b(.*)$}</span>
22
- 44: <span class="ruby-identifier">$1</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">','</span>).<span class="ruby-identifier">map!</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">decl</span><span class="ruby-operator">|</span>
23
- 45: <span class="ruby-constant">Parameter</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">decl</span>
24
- 46: <span class="ruby-keyword kw">end</span>
25
- 47: <span class="ruby-keyword kw">else</span>
26
- 48: []
27
- 49: <span class="ruby-keyword kw">end</span>
28
- 50:
29
- 51: <span class="ruby-ivar">@ports</span> = <span class="ruby-identifier">portDecls</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">','</span>).<span class="ruby-identifier">map!</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">decl</span><span class="ruby-operator">|</span>
30
- 52: <span class="ruby-constant">Port</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">decl</span>
31
- 53: <span class="ruby-keyword kw">end</span>
32
- 54: <span class="ruby-keyword kw">end</span></pre>
33
- </body>
34
- </html>
@@ -1,34 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>new (VerilogParser)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/verilog_parser.rb, line 10</span>
14
- 10: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">aInput</span>
15
- 11: <span class="ruby-identifier">input</span> = <span class="ruby-identifier">aInput</span>.<span class="ruby-identifier">dup</span>
16
- 12:
17
- 13: <span class="ruby-comment cmt"># strip comments</span>
18
- 14: <span class="ruby-identifier">input</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{//.*$}</span>, <span class="ruby-value str">''</span>
19
- 15: <span class="ruby-identifier">input</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{/\*.*?\*/}</span><span class="ruby-identifier">m</span>, <span class="ruby-value str">''</span>
20
- 16:
21
- 17: <span class="ruby-ivar">@modules</span> = <span class="ruby-identifier">input</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">%r{module.*?;}</span><span class="ruby-identifier">m</span>).<span class="ruby-identifier">map!</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">decl</span><span class="ruby-operator">|</span>
22
- 18: <span class="ruby-constant">Module</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">decl</span>
23
- 19: <span class="ruby-keyword kw">end</span>
24
- 20:
25
- 21: <span class="ruby-ivar">@constants</span> = <span class="ruby-identifier">input</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">%r{(`define\s+(\w+)\s+(.+))}</span>).<span class="ruby-identifier">map!</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">matches</span><span class="ruby-operator">|</span>
26
- 22: <span class="ruby-constant">Constant</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">matches</span>)
27
- 23: <span class="ruby-keyword kw">end</span>
28
- 24:
29
- 25: <span class="ruby-ivar">@includes</span> = <span class="ruby-identifier">input</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">%r{(`include\s*(\S+))}</span>).<span class="ruby-identifier">map!</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">matches</span><span class="ruby-operator">|</span>
30
- 26: <span class="ruby-constant">Include</span>.<span class="ruby-identifier">new</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">matches</span>)
31
- 27: <span class="ruby-keyword kw">end</span>
32
- 28: <span class="ruby-keyword kw">end</span></pre>
33
- </body>
34
- </html>
@@ -1,69 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>method_missing (Vpi::Handle)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 270</span>
14
- 270: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span> <span class="ruby-identifier">aMeth</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">aArgs</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">aBlockArg</span>
15
- 271: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">child</span> = <span class="ruby-identifier">vpi_handle_by_name</span>(<span class="ruby-identifier">aMeth</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-keyword kw">self</span>)
16
- 272: <span class="ruby-comment cmt"># cache the child for future accesses, in order to cut down number of</span>
17
- 273: <span class="ruby-comment cmt"># calls to method_missing</span>
18
- 274: (<span class="ruby-keyword kw">class</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">self</span>; <span class="ruby-keyword kw">end</span>).<span class="ruby-identifier">class_eval</span> <span class="ruby-keyword kw">do</span>
19
- 275: <span class="ruby-identifier">define_method</span> <span class="ruby-identifier">aMeth</span> <span class="ruby-keyword kw">do</span>
20
- 276: <span class="ruby-identifier">child</span>
21
- 277: <span class="ruby-keyword kw">end</span>
22
- 278: <span class="ruby-keyword kw">end</span>
23
- 279:
24
- 280: <span class="ruby-identifier">child</span>
25
- 281:
26
- 282: <span class="ruby-keyword kw">else</span>
27
- 283: <span class="ruby-identifier">prop</span> = <span class="ruby-ivar">@@propCache</span>[<span class="ruby-identifier">aMeth</span>]
28
- 284:
29
- 285: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">prop</span>.<span class="ruby-identifier">operation</span>
30
- 286: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">prop</span>.<span class="ruby-identifier">operation</span>, <span class="ruby-identifier">prop</span>.<span class="ruby-identifier">type</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">aArgs</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">aBlockArg</span>)
31
- 287:
32
- 288: <span class="ruby-keyword kw">else</span>
33
- 289: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">prop</span>.<span class="ruby-identifier">accessor</span>
34
- 290: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:d</span> <span class="ruby-comment cmt"># delay values</span>
35
- 291: <span class="ruby-identifier">raise</span> <span class="ruby-constant">NotImplementedError</span>, <span class="ruby-value str">'processing of delay values is not yet implemented.'</span>
36
- 292: <span class="ruby-comment cmt"># TODO: vpi_put_delays</span>
37
- 293: <span class="ruby-comment cmt"># TODO: vpi_get_delays</span>
38
- 294:
39
- 295: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:l</span> <span class="ruby-comment cmt"># logic values</span>
40
- 296: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">prop</span>.<span class="ruby-identifier">assignment</span>
41
- 297: <span class="ruby-identifier">value</span> = <span class="ruby-identifier">aArgs</span>.<span class="ruby-identifier">shift</span>
42
- 298: <span class="ruby-identifier">put_value</span>(<span class="ruby-identifier">value</span>, <span class="ruby-identifier">prop</span>.<span class="ruby-identifier">type</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">aArgs</span>)
43
- 299: <span class="ruby-keyword kw">else</span>
44
- 300: <span class="ruby-identifier">get_value</span>(<span class="ruby-identifier">prop</span>.<span class="ruby-identifier">type</span>)
45
- 301: <span class="ruby-keyword kw">end</span>
46
- 302:
47
- 303: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:i</span> <span class="ruby-comment cmt"># integer values</span>
48
- 304: <span class="ruby-identifier">vpi_get</span>(<span class="ruby-identifier">prop</span>.<span class="ruby-identifier">type</span>, <span class="ruby-keyword kw">self</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">prop</span>.<span class="ruby-identifier">assignment</span>
49
- 305:
50
- 306: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:b</span> <span class="ruby-comment cmt"># boolean values</span>
51
- 307: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">prop</span>.<span class="ruby-identifier">assignment</span>
52
- 308: <span class="ruby-identifier">value</span> = <span class="ruby-identifier">vpi_get</span>(<span class="ruby-identifier">prop</span>, <span class="ruby-keyword kw">self</span>)
53
- 309: <span class="ruby-identifier">value</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">value</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>) <span class="ruby-comment cmt"># zero is false in C</span>
54
- 310: <span class="ruby-keyword kw">end</span>
55
- 311:
56
- 312: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:s</span> <span class="ruby-comment cmt"># string values</span>
57
- 313: <span class="ruby-identifier">vpi_get_str</span>(<span class="ruby-identifier">prop</span>.<span class="ruby-identifier">type</span>, <span class="ruby-keyword kw">self</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">prop</span>.<span class="ruby-identifier">assignment</span>
58
- 314:
59
- 315: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:h</span> <span class="ruby-comment cmt"># handle values</span>
60
- 316: <span class="ruby-identifier">vpi_handle</span>(<span class="ruby-identifier">prop</span>.<span class="ruby-identifier">type</span>, <span class="ruby-keyword kw">self</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">prop</span>.<span class="ruby-identifier">assignment</span>
61
- 317:
62
- 318: <span class="ruby-keyword kw">else</span>
63
- 319: <span class="ruby-identifier">raise</span> <span class="ruby-constant">NoMethodError</span>, <span class="ruby-node">&quot;unable to access VPI property #{prop.name.inspect} through method #{aMeth.inspect} with arguments #{aArgs.inspect} for handle #{self}&quot;</span>
64
- 320: <span class="ruby-keyword kw">end</span>
65
- 321: <span class="ruby-keyword kw">end</span>
66
- 322: <span class="ruby-keyword kw">end</span>
67
- 323: <span class="ruby-keyword kw">end</span></pre>
68
- </body>
69
- </html>
@@ -1,28 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>vpi_register_cb (Vpi)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 424</span>
14
- 424: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">vpi_register_cb</span> <span class="ruby-identifier">aData</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">aHandler</span> <span class="ruby-comment cmt"># :yields: Vpi::S_cb_data</span>
15
- 425: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">&quot;block must be given&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block_given?</span>
16
- 426:
17
- 427: <span class="ruby-identifier">key</span> = <span class="ruby-identifier">aHandler</span>.<span class="ruby-identifier">object_id</span>.<span class="ruby-identifier">to_s</span>
18
- 428:
19
- 429: <span class="ruby-comment cmt"># register the callback with Verilog</span>
20
- 430: <span class="ruby-identifier">aData</span>.<span class="ruby-identifier">user_data</span> = <span class="ruby-identifier">key</span>
21
- 431: <span class="ruby-identifier">aData</span>.<span class="ruby-identifier">cb_rtn</span> = <span class="ruby-constant">Vlog_relay_ruby</span>
22
- 432: <span class="ruby-identifier">token</span> = <span class="ruby-identifier">vpi_register_cb_old</span>(<span class="ruby-identifier">aData</span>)
23
- 433:
24
- 434: <span class="ruby-ivar">@@callbacks</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-constant">Callback</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">aHandler</span>, <span class="ruby-identifier">token</span>)
25
- 435: <span class="ruby-identifier">token</span>
26
- 436: <span class="ruby-keyword kw">end</span></pre>
27
- </body>
28
- </html>
@@ -1,22 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>new (Vpi)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 552</span>
14
- 552: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">aMembers</span> = {}
15
- 553: <span class="ruby-identifier">old_initialize</span>
16
- 554:
17
- 555: <span class="ruby-identifier">aMembers</span>.<span class="ruby-identifier">each_pair</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
18
- 556: <span class="ruby-identifier">__send__</span> <span class="ruby-node">&quot;#{k}=&quot;</span>, <span class="ruby-identifier">v</span>
19
- 557: <span class="ruby-keyword kw">end</span>
20
- 558: <span class="ruby-keyword kw">end</span></pre>
21
- </body>
22
- </html>
@@ -1,86 +0,0 @@
1
- # This file is the Ruby side of the bench.
2
-
3
- require 'rubygems'
4
- require 'ruby-vpi'
5
-
6
- RubyVpi.init_bench :Counter, :rSpec do
7
- ##
8
- # This block is executed whenever Vpi::simulate is invoked.
9
- #
10
- # It simulates the design under test. This is typically done
11
- # by toggling the clock signal, as demonstrated below.
12
- ##
13
-
14
- ##
15
- # We are currently here (marked by the ! signs):
16
- #
17
- # !
18
- # !
19
- # ! ____ ____ ____ ____
20
- # ___!/ \____/ \____/ \____/ \
21
- # !
22
- # !
23
- #
24
- ##
25
-
26
- Counter.clock.intVal = 1
27
-
28
- ##
29
- # After setting the clock signal to high, we are here:
30
- #
31
- # !
32
- # !
33
- # !____ ____ ____ ____
34
- # ____/! \____/ \____/ \____/ \
35
- # !
36
- # !
37
- #
38
- ##
39
-
40
- advance_time
41
-
42
- ##
43
- # After advancing the time, we are here:
44
- #
45
- # !
46
- # !
47
- # ____! ____ ____ ____
48
- # ____/ !\____/ \____/ \____/ \
49
- # !
50
- # !
51
- #
52
- ##
53
-
54
- Counter.clock.intVal = 0
55
-
56
- ##
57
- # After setting the clock signal to low, we are here:
58
- #
59
- # !
60
- # !
61
- # ____ ! ____ ____ ____
62
- # ____/ \!____/ \____/ \____/ \
63
- # !
64
- # !
65
- #
66
- ##
67
-
68
- advance_time
69
-
70
- ##
71
- # After advancing the time, we are here:
72
- #
73
- #
74
- # !
75
- # !
76
- # ____ ! ____ ____ ____
77
- # ____/ \____!/ \____/ \____/ \
78
- # !
79
- # !
80
- #
81
- ##
82
-
83
- ##
84
- # This process repeats when Vpi::simulate is invoked again.
85
- ##
86
- end
@@ -1,9 +0,0 @@
1
- // This file is the Verilog side of the bench.
2
- module counter_rspec_bench;
3
- parameter Size = 5;
4
- reg clock;
5
- reg reset;
6
- wire [Size - 1 : 0] count;
7
-
8
- counter #(.Size(Size)) counter_rspec_bench_design(.clock(clock), .reset(reset), .count(count));
9
- endmodule
@@ -1,8 +0,0 @@
1
- # This is a Ruby interface to the design under test.
2
-
3
- # This method resets the design under test.
4
- def Counter.reset!
5
- reset.intVal = 1
6
- simulate
7
- reset.intVal = 0
8
- end
@@ -1,13 +0,0 @@
1
- # This is a prototype of the design under test.
2
-
3
- # When prototyping is enabled, Vpi::advance_time invokes this
4
- # method instead of transferring control to the Verilog simulator.
5
- def Counter.simulate!
6
- if clock.posedge?
7
- if reset.intVal == 1
8
- count.intVal = 0
9
- else
10
- count.intVal += 1
11
- end
12
- end
13
- end
@@ -1,52 +0,0 @@
1
- # This file runs the test.
2
-
3
- # These are Verilog source files that need to be loaded
4
- # by the simulator before they can be simulated.
5
- SIMULATOR_SOURCES = [
6
- 'counter.v',
7
- 'counter_rspec_bench.v',
8
- ]
9
-
10
- # These are paths to directories which contain the
11
- # sources listed above, the files they `include, or both.
12
- SIMULATOR_INCLUDES = []
13
-
14
- # This specifies the "top module" that is to be simulated.
15
- SIMULATOR_TARGET = 'counter_rspec_bench'
16
-
17
- # These are command-line arguments for the simulator.
18
- # They can be specified as a string or an array of strings:
19
- #
20
- # :cver => "this is one single argument",
21
- # :cver => ['these', 'are', 'separate', 'arguments'],
22
- # :cver => %w[these are also separate arguments],
23
- #
24
- SIMULATOR_ARGUMENTS = {
25
- # GPL Cver
26
- :cver => '',
27
-
28
- # Icarus Verilog
29
- :ivl => '',
30
-
31
- # Synopsys VCS
32
- :vcs => '',
33
-
34
- # Mentor Modelsim
35
- :vsim => '',
36
-
37
- # Cadence NC-Sim
38
- :ncsim => '',
39
-
40
- }
41
-
42
- # This task is invoked _before_ the simulator runs.
43
- # It can be used to make preprations, such as converting
44
- # Verilog header files into Ruby, for the simulation.
45
- task :setup do
46
- # To learn how to write Rake tasks, please see:
47
- # http://docs.rubyrake.org/read/chapter/4#page16
48
- end
49
-
50
- # This command loads the Ruby-VPI runner template, which
51
- # runs the simulator according to the information above.
52
- require 'ruby-vpi/runner'
@@ -1,39 +0,0 @@
1
- # This file is a behavioral specification for the design under test.
2
-
3
- # lowest upper bound of counter's value
4
- LIMIT = 2 ** Counter.Size.intVal
5
-
6
- # maximum allowed value for a counter
7
- MAX = LIMIT - 1
8
-
9
- context "A resetted counter's value" do
10
- setup do
11
- Counter.reset!
12
- end
13
-
14
- specify "should be zero" do
15
- Counter.count.intVal.should == 0
16
- end
17
-
18
- specify "should increment by one count upon each rising clock edge" do
19
- LIMIT.times do |i|
20
- Counter.count.intVal.should == i
21
- simulate # increment the counter
22
- end
23
- end
24
- end
25
-
26
- context "A counter with the maximum value" do
27
- setup do
28
- Counter.reset!
29
-
30
- # increment the counter to maximum value
31
- MAX.times {simulate}
32
- Counter.count.intVal.should == MAX
33
- end
34
-
35
- specify "should overflow upon increment" do
36
- simulate # increment the counter
37
- Counter.count.intVal.should == 0
38
- end
39
- end
@@ -1,86 +0,0 @@
1
- # This file is the Ruby side of the bench.
2
-
3
- require 'rubygems'
4
- require 'ruby-vpi'
5
-
6
- RubyVpi.init_bench :Counter, :xUnit do
7
- ##
8
- # This block is executed whenever Vpi::simulate is invoked.
9
- #
10
- # It simulates the design under test. This is typically done
11
- # by toggling the clock signal, as demonstrated below.
12
- ##
13
-
14
- ##
15
- # We are currently here (marked by the ! signs):
16
- #
17
- # !
18
- # !
19
- # ! ____ ____ ____ ____
20
- # ___!/ \____/ \____/ \____/ \
21
- # !
22
- # !
23
- #
24
- ##
25
-
26
- Counter.clock.intVal = 1
27
-
28
- ##
29
- # After setting the clock signal to high, we are here:
30
- #
31
- # !
32
- # !
33
- # !____ ____ ____ ____
34
- # ____/! \____/ \____/ \____/ \
35
- # !
36
- # !
37
- #
38
- ##
39
-
40
- advance_time
41
-
42
- ##
43
- # After advancing the time, we are here:
44
- #
45
- # !
46
- # !
47
- # ____! ____ ____ ____
48
- # ____/ !\____/ \____/ \____/ \
49
- # !
50
- # !
51
- #
52
- ##
53
-
54
- Counter.clock.intVal = 0
55
-
56
- ##
57
- # After setting the clock signal to low, we are here:
58
- #
59
- # !
60
- # !
61
- # ____ ! ____ ____ ____
62
- # ____/ \!____/ \____/ \____/ \
63
- # !
64
- # !
65
- #
66
- ##
67
-
68
- advance_time
69
-
70
- ##
71
- # After advancing the time, we are here:
72
- #
73
- #
74
- # !
75
- # !
76
- # ____ ! ____ ____ ____
77
- # ____/ \____!/ \____/ \____/ \
78
- # !
79
- # !
80
- #
81
- ##
82
-
83
- ##
84
- # This process repeats when Vpi::simulate is invoked again.
85
- ##
86
- end
@@ -1,8 +0,0 @@
1
- # This is a Ruby interface to the design under test.
2
-
3
- # This method resets the design under test.
4
- def Counter.reset!
5
- reset.intVal = 1
6
- simulate
7
- reset.intVal = 0
8
- end
@@ -1,13 +0,0 @@
1
- # This is a prototype of the design under test.
2
-
3
- # When prototyping is enabled, Vpi::advance_time invokes this
4
- # method instead of transferring control to the Verilog simulator.
5
- def Counter.simulate!
6
- if clock.posedge?
7
- if reset.intVal == 1
8
- count.intVal = 0
9
- else
10
- count.intVal += 1
11
- end
12
- end
13
- end
@@ -1,52 +0,0 @@
1
- # This file runs the test.
2
-
3
- # These are Verilog source files that need to be loaded
4
- # by the simulator before they can be simulated.
5
- SIMULATOR_SOURCES = [
6
- 'counter.v',
7
- 'counter_xunit_bench.v',
8
- ]
9
-
10
- # These are paths to directories which contain the
11
- # sources listed above, the files they `include, or both.
12
- SIMULATOR_INCLUDES = []
13
-
14
- # This specifies the "top module" that is to be simulated.
15
- SIMULATOR_TARGET = 'counter_xunit_bench'
16
-
17
- # These are command-line arguments for the simulator.
18
- # They can be specified as a string or an array of strings:
19
- #
20
- # :cver => "this is one single argument",
21
- # :cver => ['these', 'are', 'separate', 'arguments'],
22
- # :cver => %w[these are also separate arguments],
23
- #
24
- SIMULATOR_ARGUMENTS = {
25
- # GPL Cver
26
- :cver => '',
27
-
28
- # Icarus Verilog
29
- :ivl => '',
30
-
31
- # Synopsys VCS
32
- :vcs => '',
33
-
34
- # Mentor Modelsim
35
- :vsim => '',
36
-
37
- # Cadence NC-Sim
38
- :ncsim => '',
39
-
40
- }
41
-
42
- # This task is invoked _before_ the simulator runs.
43
- # It can be used to make preprations, such as converting
44
- # Verilog header files into Ruby, for the simulation.
45
- task :setup do
46
- # To learn how to write Rake tasks, please see:
47
- # http://docs.rubyrake.org/read/chapter/4#page16
48
- end
49
-
50
- # This command loads the Ruby-VPI runner template, which
51
- # runs the simulator according to the information above.
52
- require 'ruby-vpi/runner'