ruby-vpi 7.0.0 → 7.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. data/HISTORY +19 -0
  2. data/README +3 -3
  3. data/Rakefile +147 -112
  4. data/bin/generate_test.rb +0 -2
  5. data/doc/src/manual.xml +11 -9
  6. data/doc/txt/manual.txt +14 -9
  7. data/doc/xhtml/background.organization.html +1 -1
  8. data/doc/xhtml/index.html +2 -2
  9. data/doc/xhtml/introduction.manifest.html +1 -1
  10. data/doc/xhtml/usage.installation.html +7 -1
  11. data/doc/xhtml/usage.tutorial.html +1 -1
  12. data/gem_extconf.rb +1 -1
  13. data/history.html +37 -0
  14. data/lib/ruby-vpi/runner.rb +77 -2
  15. data/lib/ruby-vpi.rb +0 -10
  16. data/readme.html +5 -3
  17. data/ref/c/annotated.html +1 -1
  18. data/ref/c/common_8h.html +1 -1
  19. data/ref/c/files.html +1 -1
  20. data/ref/c/functions.html +1 -1
  21. data/ref/c/functions_vars.html +1 -1
  22. data/ref/c/globals.html +1 -1
  23. data/ref/c/globals_0x63.html +1 -1
  24. data/ref/c/globals_0x65.html +1 -1
  25. data/ref/c/globals_0x66.html +1 -1
  26. data/ref/c/globals_0x70.html +1 -1
  27. data/ref/c/globals_0x72.html +1 -1
  28. data/ref/c/globals_0x73.html +1 -1
  29. data/ref/c/globals_0x74.html +1 -1
  30. data/ref/c/globals_0x76.html +1 -1
  31. data/ref/c/globals_0x78.html +1 -1
  32. data/ref/c/globals_defs.html +1 -1
  33. data/ref/c/globals_defs_0x65.html +1 -1
  34. data/ref/c/globals_defs_0x70.html +1 -1
  35. data/ref/c/globals_defs_0x76.html +1 -1
  36. data/ref/c/globals_defs_0x78.html +1 -1
  37. data/ref/c/globals_enum.html +1 -1
  38. data/ref/c/globals_eval.html +1 -1
  39. data/ref/c/globals_func.html +1 -1
  40. data/ref/c/globals_type.html +1 -1
  41. data/ref/c/globals_vars.html +1 -1
  42. data/ref/c/hierarchy.html +1 -1
  43. data/ref/c/index.html +1 -1
  44. data/ref/c/relay_8cin.html +1 -1
  45. data/ref/c/relay_8hin.html +1 -1
  46. data/ref/c/ruby-vpi_8c.html +1 -1
  47. data/ref/c/structrelay____RubyOptions____def.html +1 -1
  48. data/ref/c/structt__cb__data.html +1 -1
  49. data/ref/c/structt__vpi__delay.html +1 -1
  50. data/ref/c/structt__vpi__error__info.html +1 -1
  51. data/ref/c/structt__vpi__strengthval.html +1 -1
  52. data/ref/c/structt__vpi__systf__data.html +1 -1
  53. data/ref/c/structt__vpi__time.html +1 -1
  54. data/ref/c/structt__vpi__value.html +1 -1
  55. data/ref/c/structt__vpi__vecval.html +1 -1
  56. data/ref/c/structt__vpi__vlog__info.html +1 -1
  57. data/ref/c/swig_8cin.html +1 -1
  58. data/ref/c/swig_8hin.html +1 -1
  59. data/ref/c/verilog_8h.html +1 -1
  60. data/ref/c/vlog_8cin.html +1 -1
  61. data/ref/c/vlog_8hin.html +1 -1
  62. data/ref/c/vpi__user_8h.html +1 -1
  63. data/ref/ruby/classes/Counter.html +20 -20
  64. data/ref/ruby/classes/Counter.src/M000038.html +7 -9
  65. data/ref/ruby/classes/Counter.src/M000039.html +9 -7
  66. data/ref/ruby/classes/Counter.src/M000040.html +7 -9
  67. data/ref/ruby/classes/Counter.src/M000041.html +22 -0
  68. data/ref/ruby/classes/CounterProto.html +9 -9
  69. data/ref/ruby/classes/CounterProto.src/M000005.html +1 -1
  70. data/ref/ruby/classes/CounterProto.src/{M000004.html → M000006.html} +1 -1
  71. data/ref/ruby/classes/ERB.html +5 -5
  72. data/ref/ruby/classes/FileUtils.html +10 -10
  73. data/ref/ruby/classes/FileUtils.src/M000048.html +5 -5
  74. data/ref/ruby/classes/{InputGenerator.src/M000027.html → FileUtils.src/M000049.html} +4 -4
  75. data/ref/ruby/classes/Hw5UnitModel/Operation.html +15 -15
  76. data/ref/ruby/classes/Hw5UnitModel/Operation.src/M000012.html +12 -20
  77. data/ref/ruby/classes/Hw5UnitModel/Operation.src/M000013.html +20 -5
  78. data/ref/ruby/classes/Hw5UnitModel/Operation.src/M000014.html +18 -0
  79. data/ref/ruby/classes/Hw5UnitModel.html +24 -24
  80. data/ref/ruby/classes/Hw5UnitModel.src/M000009.html +7 -25
  81. data/ref/ruby/classes/Hw5UnitModel.src/M000010.html +25 -9
  82. data/ref/ruby/classes/Hw5UnitModel.src/M000011.html +22 -0
  83. data/ref/ruby/classes/Hw5_unit.html +5 -5
  84. data/ref/ruby/classes/Hw5_unit_spec.html +15 -15
  85. data/ref/ruby/classes/Hw5_unit_spec.src/M000024.html +8 -8
  86. data/ref/ruby/classes/Hw5_unit_spec.src/M000025.html +8 -54
  87. data/ref/ruby/classes/Hw5_unit_spec.src/M000026.html +67 -0
  88. data/ref/ruby/classes/InputGenerator.html +30 -30
  89. data/ref/ruby/classes/InputGenerator.src/M000028.html +5 -5
  90. data/ref/ruby/classes/InputGenerator.src/M000029.html +5 -6
  91. data/ref/ruby/classes/InputGenerator.src/M000030.html +6 -25
  92. data/ref/ruby/classes/InputGenerator.src/M000031.html +25 -6
  93. data/ref/ruby/classes/InputGenerator.src/M000032.html +6 -6
  94. data/ref/ruby/classes/InputGenerator.src/M000033.html +19 -0
  95. data/ref/ruby/classes/MaximumCounterValue.html +10 -10
  96. data/ref/ruby/classes/MaximumCounterValue.src/M000036.html +10 -8
  97. data/ref/ruby/classes/MaximumCounterValue.src/M000037.html +21 -0
  98. data/ref/ruby/classes/ModuleInfo.html +10 -10
  99. data/ref/ruby/classes/ModuleInfo.src/M000019.html +31 -13
  100. data/ref/ruby/classes/ModuleInfo.src/M000020.html +26 -0
  101. data/ref/ruby/classes/OutputInfo.html +5 -10
  102. data/ref/ruby/classes/OutputInfo.src/{M000017.html → M000018.html} +36 -36
  103. data/ref/ruby/classes/ResettedCounterValue.html +15 -15
  104. data/ref/ruby/classes/ResettedCounterValue.src/M000015.html +6 -5
  105. data/ref/ruby/classes/ResettedCounterValue.src/M000016.html +5 -10
  106. data/ref/ruby/classes/ResettedCounterValue.src/M000017.html +23 -0
  107. data/ref/ruby/classes/RubyVPI.html +0 -46
  108. data/ref/ruby/classes/RubyVPI.src/M000050.html +24 -24
  109. data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.html +35 -35
  110. data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000042.html +9 -31
  111. data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000043.html +31 -69
  112. data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000044.html +69 -114
  113. data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000045.html +114 -13
  114. data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000046.html +13 -5
  115. data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000047.html +18 -0
  116. data/ref/ruby/classes/String.html +5 -5
  117. data/ref/ruby/classes/Template.html +5 -5
  118. data/ref/ruby/classes/TestHw5UnitModel.html +15 -15
  119. data/ref/ruby/classes/TestHw5UnitModel.src/M000021.html +6 -6
  120. data/ref/ruby/classes/TestHw5UnitModel.src/M000022.html +6 -51
  121. data/ref/ruby/classes/TestHw5UnitModel.src/M000023.html +64 -0
  122. data/ref/ruby/created.rid +1 -1
  123. data/ref/ruby/files/bin/generate_test_rb.html +6 -6
  124. data/ref/ruby/files/bin/generate_test_tpl/bench_rb.html +1 -1
  125. data/ref/ruby/files/bin/generate_test_tpl/design_rb.html +1 -1
  126. data/ref/ruby/files/bin/generate_test_tpl/proto_rb.html +1 -1
  127. data/ref/ruby/files/bin/generate_test_tpl/spec_rb.html +6 -6
  128. data/ref/ruby/files/bin/header_to_ruby_rb.html +1 -1
  129. data/ref/ruby/files/ext/extconf_rb.html +1 -1
  130. data/ref/ruby/files/gem_extconf_rb.html +1 -1
  131. data/ref/ruby/files/lib/ruby-vpi/erb_rb.html +1 -1
  132. data/ref/ruby/files/lib/ruby-vpi/rake_rb.html +1 -1
  133. data/ref/ruby/files/lib/ruby-vpi/rdoc_rb.html +1 -1
  134. data/ref/ruby/files/lib/ruby-vpi/rspec_rb.html +1 -1
  135. data/ref/ruby/files/lib/ruby-vpi/runner_proxy_rb.html +108 -0
  136. data/ref/ruby/files/lib/ruby-vpi/runner_rb.html +78 -2
  137. data/ref/ruby/files/lib/ruby-vpi/runner_rb.src/M000001.html +20 -0
  138. data/ref/ruby/files/lib/ruby-vpi/vpi_util_rb.html +1 -1
  139. data/ref/ruby/files/lib/ruby-vpi_rb.html +1 -1
  140. data/ref/ruby/files/samp/counter/counter_rspecTest_bench_rb.html +1 -1
  141. data/ref/ruby/files/samp/counter/counter_rspecTest_design_rb.html +1 -1
  142. data/ref/ruby/files/samp/counter/counter_rspecTest_proto_rb.html +1 -1
  143. data/ref/ruby/files/samp/counter/counter_rspecTest_spec_rb.html +1 -1
  144. data/ref/ruby/files/samp/counter/counter_unitTest_bench_rb.html +1 -1
  145. data/ref/ruby/files/samp/counter/counter_unitTest_design_rb.html +1 -1
  146. data/ref/ruby/files/samp/counter/counter_unitTest_proto_rb.html +1 -1
  147. data/ref/ruby/files/samp/counter/counter_unitTest_spec_rb.html +1 -1
  148. data/ref/ruby/files/samp/pipelined_alu/Hw5UnitModel_rb.html +1 -1
  149. data/ref/ruby/files/samp/pipelined_alu/InputGenerator_rb.html +1 -1
  150. data/ref/ruby/files/samp/pipelined_alu/TestHw5UnitModel_rb.html +1 -1
  151. data/ref/ruby/files/samp/pipelined_alu/hw5_unit_bench_rb.html +1 -1
  152. data/ref/ruby/files/samp/pipelined_alu/hw5_unit_design_rb.html +1 -1
  153. data/ref/ruby/files/samp/pipelined_alu/hw5_unit_spec_rb.html +1 -1
  154. data/ref/ruby/fr_file_index.html +1 -0
  155. data/ref/ruby/fr_method_index.html +48 -48
  156. data/samp/counter/Rakefile +1 -1
  157. data/samp/pipelined_alu/Rakefile +1 -1
  158. metadata +41 -41
  159. data/ref/ruby/classes/Counter.src/M000037.html +0 -20
  160. data/ref/ruby/classes/FileUtils.src/M000047.html +0 -18
  161. data/ref/ruby/classes/Hw5UnitModel/Operation.src/M000011.html +0 -25
  162. data/ref/ruby/classes/Hw5UnitModel.src/M000008.html +0 -20
  163. data/ref/ruby/classes/Hw5_unit_spec.src/M000023.html +0 -21
  164. data/ref/ruby/classes/MaximumCounterValue.src/M000035.html +0 -23
  165. data/ref/ruby/classes/ModuleInfo.src/M000018.html +0 -44
  166. data/ref/ruby/classes/ResettedCounterValue.src/M000014.html +0 -19
  167. data/ref/ruby/classes/RubyVPI.src/M000049.html +0 -18
  168. data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000041.html +0 -22
  169. data/ref/ruby/classes/TestHw5UnitModel.src/M000020.html +0 -19
  170. data/tpl/runner.rake +0 -96
  171. /data/{tpl/launcher.rake → lib/ruby-vpi/runner_proxy.rb} +0 -0
  172. /data/{tpl → lib/ruby-vpi}/synopsys_vcs.tab +0 -0
  173. /data/ref/ruby/classes/ERB.src/{M000034.html → M000035.html} +0 -0
  174. /data/ref/ruby/classes/Hw5UnitModel.src/{M000006.html → M000007.html} +0 -0
  175. /data/ref/ruby/classes/Hw5_unit.src/{M000003.html → M000004.html} +0 -0
  176. /data/ref/ruby/classes/String.src/{M000033.html → M000034.html} +0 -0
  177. /data/ref/ruby/classes/Template.src/{M000026.html → M000027.html} +0 -0
  178. /data/ref/ruby/files/bin/generate_test_rb.src/{M000001.html → M000002.html} +0 -0
  179. /data/ref/ruby/files/bin/generate_test_tpl/spec_rb.src/{M000002.html → M000003.html} +0 -0
@@ -5,22 +5,123 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>[] (SWIG::TYPE_p_unsigned_int)</title>
8
+ <title>method_missing (SWIG::TYPE_p_unsigned_int)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi_util.rb, line 293</span>
14
- 293: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span> <span class="ruby-identifier">aType</span>
15
- 294: <span class="ruby-identifier">handles</span> = []
16
- 295:
17
- 296: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">itr</span> = <span class="ruby-identifier">vpi_iterate</span>(<span class="ruby-identifier">aType</span>, <span class="ruby-keyword kw">self</span>)
18
- 297: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">h</span> = <span class="ruby-identifier">vpi_scan</span>(<span class="ruby-identifier">itr</span>)
19
- 298: <span class="ruby-identifier">handles</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">h</span>
20
- 299: <span class="ruby-keyword kw">end</span>
21
- 300: <span class="ruby-keyword kw">end</span>
22
- 301:
23
- 302: <span class="ruby-identifier">handles</span>
24
- 303: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi_util.rb, line 179</span>
14
+ 179: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span> <span class="ruby-identifier">aMsg</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
+ 180: <span class="ruby-identifier">methName</span> = <span class="ruby-identifier">aMsg</span>.<span class="ruby-identifier">to_s</span>
16
+ 181:
17
+ 182: <span class="ruby-comment cmt"># determine if property is being written</span>
18
+ 183: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">isAssign</span> = <span class="ruby-identifier">methName</span> <span class="ruby-operator">=~</span> <span class="ruby-constant">ASSIGN_REGEXP</span>
19
+ 184: <span class="ruby-identifier">methName</span>.<span class="ruby-identifier">sub!</span> <span class="ruby-constant">ASSIGN_REGEXP</span>, <span class="ruby-value str">''</span>
20
+ 185: <span class="ruby-keyword kw">end</span>
21
+ 186:
22
+ 187: <span class="ruby-comment cmt"># determine if property is being queried</span>
23
+ 188: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">isQuery</span> = <span class="ruby-identifier">methName</span> <span class="ruby-operator">=~</span> <span class="ruby-constant">QUERY_REGEXP</span>
24
+ 189: <span class="ruby-identifier">methName</span>.<span class="ruby-identifier">sub!</span> <span class="ruby-constant">QUERY_REGEXP</span>, <span class="ruby-value str">''</span>
25
+ 190: <span class="ruby-keyword kw">end</span>
26
+ 191:
27
+ 192: <span class="ruby-comment cmt"># parse Accessor parameter</span>
28
+ 193: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">accessor</span> = <span class="ruby-identifier">methName</span>[<span class="ruby-constant">HINT_REGEXP</span>, <span class="ruby-value">1</span>]
29
+ 194: <span class="ruby-identifier">methName</span>.<span class="ruby-identifier">sub!</span> <span class="ruby-constant">HINT_REGEXP</span>, <span class="ruby-value str">''</span>
30
+ 195: <span class="ruby-keyword kw">end</span>
31
+ 196:
32
+ 197: <span class="ruby-comment cmt"># parse Operation parameter</span>
33
+ 198: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">operation</span> = <span class="ruby-identifier">methName</span>[<span class="ruby-constant">PREFIX_REGEXP</span>, <span class="ruby-value">1</span>]
34
+ 199: <span class="ruby-identifier">methName</span>.<span class="ruby-identifier">sub!</span> <span class="ruby-constant">PREFIX_REGEXP</span>, <span class="ruby-value str">''</span>
35
+ 200: <span class="ruby-keyword kw">end</span>
36
+ 201:
37
+ 202: <span class="ruby-comment cmt"># resolve Property parameter into a valid VPI property</span>
38
+ 203: <span class="ruby-identifier">propName</span> = <span class="ruby-identifier">methName</span>[<span class="ruby-value">0</span>, <span class="ruby-value">1</span>].<span class="ruby-identifier">upcase</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">methName</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
39
+ 204: <span class="ruby-identifier">propName</span>.<span class="ruby-identifier">insert</span>(<span class="ruby-value">0</span>, <span class="ruby-value str">'Vpi'</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">methName</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^vpi/</span>
40
+ 205:
41
+ 206: <span class="ruby-identifier">puts</span> <span class="ruby-value str">''</span>, <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">caller</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n&quot;</span>), <span class="ruby-value str">''</span>, <span class="ruby-node">&quot;operation: #{operation}&quot;</span>, <span class="ruby-node">&quot;meth: #{aMsg}&quot;</span>, <span class="ruby-node">&quot;args: #{aArgs.inspect}&quot;</span>, <span class="ruby-node">&quot;name: #{methName}&quot;</span>, <span class="ruby-node">&quot;prop: #{propName}&quot;</span>, <span class="ruby-node">&quot;assign: #{isAssign}&quot;</span>, <span class="ruby-node">&quot;query: #{isQuery}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
42
+ 207:
43
+ 208: <span class="ruby-keyword kw">begin</span>
44
+ 209: <span class="ruby-identifier">prop</span> = <span class="ruby-constant">Vpi</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">propName</span>)
45
+ 210: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">NameError</span>
46
+ 211: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;invalid VPI property `#{propName}'&quot;</span>
47
+ 212: <span class="ruby-keyword kw">end</span>
48
+ 213:
49
+ 214: <span class="ruby-comment cmt"># access the VPI property</span>
50
+ 215: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">operation</span>
51
+ 216: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">operation</span>.<span class="ruby-identifier">to_sym</span>, <span class="ruby-identifier">prop</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">aArgs</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">aBlockArg</span>)
52
+ 217: <span class="ruby-keyword kw">else</span>
53
+ 218: <span class="ruby-identifier">loop</span> <span class="ruby-keyword kw">do</span>
54
+ 219: <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;looping, accessor: #{accessor}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
55
+ 220:
56
+ 221: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">accessor</span>
57
+ 222: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'d'</span> <span class="ruby-comment cmt"># delay values</span>
58
+ 223: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">isAssign</span>
59
+ 224: <span class="ruby-comment cmt"># TODO: vpi_put_delays</span>
60
+ 225: <span class="ruby-keyword kw">else</span>
61
+ 226: <span class="ruby-comment cmt"># TODO: vpi_get_delays</span>
62
+ 227: <span class="ruby-keyword kw">end</span>
63
+ 228:
64
+ 229: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'l'</span> <span class="ruby-comment cmt"># logic values</span>
65
+ 230: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">isAssign</span>
66
+ 231: <span class="ruby-identifier">value</span> = <span class="ruby-identifier">aArgs</span>.<span class="ruby-identifier">shift</span>
67
+ 232: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">put_value</span>(<span class="ruby-identifier">value</span>, <span class="ruby-identifier">prop</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">aArgs</span>)
68
+ 233: <span class="ruby-keyword kw">else</span>
69
+ 234: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">get_value</span>(<span class="ruby-identifier">prop</span>)
70
+ 235: <span class="ruby-keyword kw">end</span>
71
+ 236:
72
+ 237: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'i'</span> <span class="ruby-comment cmt"># integer values</span>
73
+ 238: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">vpi_get</span>(<span class="ruby-identifier">prop</span>, <span class="ruby-keyword kw">self</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">isAssign</span>
74
+ 239:
75
+ 240: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'b'</span> <span class="ruby-comment cmt"># boolean values</span>
76
+ 241: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">isAssign</span>
77
+ 242: <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>)
78
+ 243: <span class="ruby-keyword kw">return</span> <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>
79
+ 244: <span class="ruby-keyword kw">end</span>
80
+ 245:
81
+ 246: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'s'</span> <span class="ruby-comment cmt"># string values</span>
82
+ 247: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">vpi_get_str</span>(<span class="ruby-identifier">prop</span>, <span class="ruby-keyword kw">self</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">isAssign</span>
83
+ 248:
84
+ 249: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'h'</span> <span class="ruby-comment cmt"># handle values</span>
85
+ 250: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">vpi_handle</span>(<span class="ruby-identifier">prop</span>, <span class="ruby-keyword kw">self</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">isAssign</span>
86
+ 251:
87
+ 252: <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># accessor not specified. guess its value from property name</span>
88
+ 253: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">isQuery</span>
89
+ 254: <span class="ruby-identifier">accessor</span> = <span class="ruby-value str">'b'</span>
90
+ 255: <span class="ruby-keyword kw">redo</span>
91
+ 256: <span class="ruby-keyword kw">end</span>
92
+ 257:
93
+ 258: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">propName</span>
94
+ 259: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/Time$/</span>
95
+ 260: <span class="ruby-identifier">accessor</span> = <span class="ruby-value str">'d'</span>
96
+ 261: <span class="ruby-keyword kw">redo</span>
97
+ 262:
98
+ 263: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/Val$/</span>
99
+ 264: <span class="ruby-identifier">accessor</span> = <span class="ruby-value str">'l'</span>
100
+ 265: <span class="ruby-keyword kw">redo</span>
101
+ 266:
102
+ 267: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/Type$/</span>, <span class="ruby-regexp re">/Direction$/</span>, <span class="ruby-regexp re">/Index$/</span>, <span class="ruby-regexp re">/Size$/</span>, <span class="ruby-regexp re">/Strength\d?$/</span>, <span class="ruby-regexp re">/Polarity$/</span>, <span class="ruby-regexp re">/Edge$/</span>, <span class="ruby-regexp re">/Offset$/</span>, <span class="ruby-regexp re">/Mode$/</span>
103
+ 268: <span class="ruby-identifier">accessor</span> = <span class="ruby-value str">'i'</span>
104
+ 269: <span class="ruby-keyword kw">redo</span>
105
+ 270:
106
+ 271: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/Is[A-Z]/</span>, <span class="ruby-regexp re">/ed$/</span>
107
+ 272: <span class="ruby-identifier">accessor</span> = <span class="ruby-value str">'b'</span>
108
+ 273: <span class="ruby-keyword kw">redo</span>
109
+ 274:
110
+ 275: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/Name$/</span>, <span class="ruby-regexp re">/File$/</span>, <span class="ruby-regexp re">/Decompile$/</span>
111
+ 276: <span class="ruby-identifier">accessor</span> = <span class="ruby-value str">'s'</span>
112
+ 277: <span class="ruby-keyword kw">redo</span>
113
+ 278:
114
+ 279: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/Parent$/</span>, <span class="ruby-regexp re">/Inst$/</span>, <span class="ruby-regexp re">/Range$/</span>, <span class="ruby-regexp re">/Driver$/</span>, <span class="ruby-regexp re">/Net$/</span>, <span class="ruby-regexp re">/Load$/</span>, <span class="ruby-regexp re">/Conn$/</span>, <span class="ruby-regexp re">/Bit$/</span>, <span class="ruby-regexp re">/Word$/</span>, <span class="ruby-regexp re">/[LR]hs$/</span>, <span class="ruby-regexp re">/(In|Out)$/</span>, <span class="ruby-regexp re">/Term$/</span>, <span class="ruby-regexp re">/Argument$/</span>, <span class="ruby-regexp re">/Condition$/</span>, <span class="ruby-regexp re">/Use$/</span>, <span class="ruby-regexp re">/Operand$/</span>, <span class="ruby-regexp re">/Stmt$/</span>, <span class="ruby-regexp re">/Expr$/</span>, <span class="ruby-regexp re">/Scope$/</span>, <span class="ruby-regexp re">/Memory$/</span>, <span class="ruby-regexp re">/Delay$/</span>
115
+ 280: <span class="ruby-identifier">accessor</span> = <span class="ruby-value str">'h'</span>
116
+ 281: <span class="ruby-keyword kw">redo</span>
117
+ 282: <span class="ruby-keyword kw">end</span>
118
+ 283: <span class="ruby-keyword kw">end</span>
119
+ 284:
120
+ 285: <span class="ruby-keyword kw">break</span>
121
+ 286: <span class="ruby-keyword kw">end</span>
122
+ 287: <span class="ruby-keyword kw">end</span>
123
+ 288:
124
+ 289: <span class="ruby-identifier">raise</span> <span class="ruby-constant">NoMethodError</span>, <span class="ruby-node">&quot;unable to access VPI property `#{propName}' through method `#{aMsg}' with arguments `#{aArgs.inspect}' for handle #{self}&quot;</span>
125
+ 290: <span class="ruby-keyword kw">end</span></pre>
25
126
  </body>
26
127
  </html>
@@ -5,14 +5,22 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>each (SWIG::TYPE_p_unsigned_int)</title>
8
+ <title>[] (SWIG::TYPE_p_unsigned_int)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
10
  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi_util.rb, line 306</span>
14
- 306: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each</span> <span class="ruby-identifier">aType</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">aBlock</span> <span class="ruby-comment cmt"># :yields: handle</span>
15
- 307: <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">aType</span>].<span class="ruby-identifier">each</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">aBlock</span>)
16
- 308: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi_util.rb, line 293</span>
14
+ 293: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span> <span class="ruby-identifier">aType</span>
15
+ 294: <span class="ruby-identifier">handles</span> = []
16
+ 295:
17
+ 296: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">itr</span> = <span class="ruby-identifier">vpi_iterate</span>(<span class="ruby-identifier">aType</span>, <span class="ruby-keyword kw">self</span>)
18
+ 297: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">h</span> = <span class="ruby-identifier">vpi_scan</span>(<span class="ruby-identifier">itr</span>)
19
+ 298: <span class="ruby-identifier">handles</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">h</span>
20
+ 299: <span class="ruby-keyword kw">end</span>
21
+ 300: <span class="ruby-keyword kw">end</span>
22
+ 301:
23
+ 302: <span class="ruby-identifier">handles</span>
24
+ 303: <span class="ruby-keyword kw">end</span></pre>
17
25
  </body>
18
26
  </html>
@@ -0,0 +1,18 @@
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>each (SWIG::TYPE_p_unsigned_int)</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_util.rb, line 306</span>
14
+ 306: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each</span> <span class="ruby-identifier">aType</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">aBlock</span> <span class="ruby-comment cmt"># :yields: handle</span>
15
+ 307: <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">aType</span>].<span class="ruby-identifier">each</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">aBlock</span>)
16
+ 308: <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -86,7 +86,7 @@
86
86
  <h3 class="section-bar">Methods</h3>
87
87
 
88
88
  <div class="name-list">
89
- <a href="#M000033">to_ruby</a>&nbsp;&nbsp;
89
+ <a href="#M000034">to_ruby</a>&nbsp;&nbsp;
90
90
  </div>
91
91
  </div>
92
92
 
@@ -108,12 +108,12 @@
108
108
  <div id="methods">
109
109
  <h3 class="section-bar">Public Instance methods</h3>
110
110
 
111
- <div id="method-M000033" class="method-detail">
112
- <a name="M000033"></a>
111
+ <div id="method-M000034" class="method-detail">
112
+ <a name="M000034"></a>
113
113
 
114
114
  <div class="method-heading">
115
- <a href="String.src/M000033.html" target="Code" class="method-signature"
116
- onclick="popupCode('String.src/M000033.html');return false;">
115
+ <a href="String.src/M000034.html" target="Code" class="method-signature"
116
+ onclick="popupCode('String.src/M000034.html');return false;">
117
117
  <span class="method-name">to_ruby</span><span class="method-args">()</span>
118
118
  </a>
119
119
  </div>
@@ -94,7 +94,7 @@
94
94
  <h3 class="section-bar">Methods</h3>
95
95
 
96
96
  <div class="name-list">
97
- <a href="#M000026">new</a>&nbsp;&nbsp;
97
+ <a href="#M000027">new</a>&nbsp;&nbsp;
98
98
  </div>
99
99
  </div>
100
100
 
@@ -129,12 +129,12 @@
129
129
  <div id="methods">
130
130
  <h3 class="section-bar">Public Class methods</h3>
131
131
 
132
- <div id="method-M000026" class="method-detail">
133
- <a name="M000026"></a>
132
+ <div id="method-M000027" class="method-detail">
133
+ <a name="M000027"></a>
134
134
 
135
135
  <div class="method-heading">
136
- <a href="Template.src/M000026.html" target="Code" class="method-signature"
137
- onclick="popupCode('Template.src/M000026.html');return false;">
136
+ <a href="Template.src/M000027.html" target="Code" class="method-signature"
137
+ onclick="popupCode('Template.src/M000027.html');return false;">
138
138
  <span class="method-name">new</span><span class="method-args">(aName)</span>
139
139
  </a>
140
140
  </div>
@@ -86,9 +86,9 @@
86
86
  <h3 class="section-bar">Methods</h3>
87
87
 
88
88
  <div class="name-list">
89
- <a href="#M000020">setup</a>&nbsp;&nbsp;
90
- <a href="#M000022">testModel</a>&nbsp;&nbsp;
91
- <a href="#M000021">test_reset</a>&nbsp;&nbsp;
89
+ <a href="#M000021">setup</a>&nbsp;&nbsp;
90
+ <a href="#M000023">testModel</a>&nbsp;&nbsp;
91
+ <a href="#M000022">test_reset</a>&nbsp;&nbsp;
92
92
  </div>
93
93
  </div>
94
94
 
@@ -123,12 +123,12 @@
123
123
  <div id="methods">
124
124
  <h3 class="section-bar">Public Instance methods</h3>
125
125
 
126
- <div id="method-M000020" class="method-detail">
127
- <a name="M000020"></a>
126
+ <div id="method-M000021" class="method-detail">
127
+ <a name="M000021"></a>
128
128
 
129
129
  <div class="method-heading">
130
- <a href="TestHw5UnitModel.src/M000020.html" target="Code" class="method-signature"
131
- onclick="popupCode('TestHw5UnitModel.src/M000020.html');return false;">
130
+ <a href="TestHw5UnitModel.src/M000021.html" target="Code" class="method-signature"
131
+ onclick="popupCode('TestHw5UnitModel.src/M000021.html');return false;">
132
132
  <span class="method-name">setup</span><span class="method-args">()</span>
133
133
  </a>
134
134
  </div>
@@ -137,12 +137,12 @@
137
137
  </div>
138
138
  </div>
139
139
 
140
- <div id="method-M000022" class="method-detail">
141
- <a name="M000022"></a>
140
+ <div id="method-M000023" class="method-detail">
141
+ <a name="M000023"></a>
142
142
 
143
143
  <div class="method-heading">
144
- <a href="TestHw5UnitModel.src/M000022.html" target="Code" class="method-signature"
145
- onclick="popupCode('TestHw5UnitModel.src/M000022.html');return false;">
144
+ <a href="TestHw5UnitModel.src/M000023.html" target="Code" class="method-signature"
145
+ onclick="popupCode('TestHw5UnitModel.src/M000023.html');return false;">
146
146
  <span class="method-name">testModel</span><span class="method-args">()</span>
147
147
  </a>
148
148
  </div>
@@ -151,12 +151,12 @@
151
151
  </div>
152
152
  </div>
153
153
 
154
- <div id="method-M000021" class="method-detail">
155
- <a name="M000021"></a>
154
+ <div id="method-M000022" class="method-detail">
155
+ <a name="M000022"></a>
156
156
 
157
157
  <div class="method-heading">
158
- <a href="TestHw5UnitModel.src/M000021.html" target="Code" class="method-signature"
159
- onclick="popupCode('TestHw5UnitModel.src/M000021.html');return false;">
158
+ <a href="TestHw5UnitModel.src/M000022.html" target="Code" class="method-signature"
159
+ onclick="popupCode('TestHw5UnitModel.src/M000022.html');return false;">
160
160
  <span class="method-name">test_reset</span><span class="method-args">()</span>
161
161
  </a>
162
162
  </div>
@@ -5,15 +5,15 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>test_reset (TestHw5UnitModel)</title>
8
+ <title>setup (TestHw5UnitModel)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre> <span class="ruby-comment cmt"># File samp/pipelined_alu/TestHw5UnitModel.rb, line 34</span>
14
- 34: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_reset</span>
15
- 35: <span class="ruby-ivar">@model</span>.<span class="ruby-identifier">reset</span>
16
- 36: <span class="ruby-identifier">assert_same</span> <span class="ruby-constant">Hw5UnitModel</span><span class="ruby-operator">::</span><span class="ruby-constant">NOP</span>, <span class="ruby-ivar">@model</span>.<span class="ruby-identifier">output</span>
17
- 37: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File samp/pipelined_alu/TestHw5UnitModel.rb, line 29</span>
14
+ 29: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
15
+ 30: <span class="ruby-ivar">@model</span> = <span class="ruby-constant">Hw5UnitModel</span>.<span class="ruby-identifier">new</span>
16
+ 31: <span class="ruby-ivar">@ingen</span> = <span class="ruby-constant">InputGenerator</span>.<span class="ruby-identifier">new</span> <span class="ruby-value">32</span>
17
+ 32: <span class="ruby-keyword kw">end</span></pre>
18
18
  </body>
19
19
  </html>
@@ -5,60 +5,15 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>testModel (TestHw5UnitModel)</title>
8
+ <title>test_reset (TestHw5UnitModel)</title>
9
9
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
10
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
11
  </head>
12
12
  <body class="standalone-code">
13
- <pre> <span class="ruby-comment cmt"># File samp/pipelined_alu/TestHw5UnitModel.rb, line 39</span>
14
- 39: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">testModel</span>
15
- 40: <span class="ruby-comment cmt"># generate input for module</span>
16
- 41: <span class="ruby-identifier">inputQueue</span> = []
17
- 42:
18
- 43: <span class="ruby-constant">NUM_VECTORS</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
19
- 44: <span class="ruby-identifier">inputQueue</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Hw5UnitModel</span><span class="ruby-operator">::</span><span class="ruby-constant">Operation</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Hw5UnitModel</span><span class="ruby-operator">::</span><span class="ruby-constant">OPERATIONS</span>[<span class="ruby-identifier">rand</span>(<span class="ruby-constant">Hw5UnitModel</span><span class="ruby-operator">::</span><span class="ruby-constant">OPERATIONS</span>.<span class="ruby-identifier">size</span>)], <span class="ruby-identifier">i</span>, <span class="ruby-ivar">@ingen</span>.<span class="ruby-identifier">gen</span>.<span class="ruby-identifier">abs</span>, <span class="ruby-ivar">@ingen</span>.<span class="ruby-identifier">gen</span>.<span class="ruby-identifier">abs</span>)
20
- 45: <span class="ruby-keyword kw">end</span>
21
- 46:
22
- 47:
23
- 48: <span class="ruby-comment cmt"># test the module</span>
24
- 49: <span class="ruby-identifier">outputQueue</span> = []
25
- 50: <span class="ruby-identifier">cycle</span> = <span class="ruby-value">0</span>
26
- 51:
27
- 52: <span class="ruby-keyword kw">until</span> <span class="ruby-identifier">inputQueue</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">outputQueue</span>.<span class="ruby-identifier">length</span>
28
- 53: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
29
- 54: <span class="ruby-identifier">print</span> <span class="ruby-value str">&quot;\n&quot;</span> <span class="ruby-operator">*</span> <span class="ruby-value">3</span>
30
- 55: <span class="ruby-identifier">p</span> <span class="ruby-node">&quot;&gt;&gt; cycle #{cycle}&quot;</span>
31
- 56: <span class="ruby-keyword kw">end</span>
32
- 57:
33
- 58:
34
- 59: <span class="ruby-comment cmt"># start a new operation</span>
35
- 60: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cycle</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">inputQueue</span>.<span class="ruby-identifier">length</span>
36
- 61: <span class="ruby-ivar">@model</span>.<span class="ruby-identifier">startOperation</span> <span class="ruby-identifier">inputQueue</span>[<span class="ruby-identifier">cycle</span>]
37
- 62: <span class="ruby-identifier">cycle</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
38
- 63: <span class="ruby-keyword kw">end</span>
39
- 64:
40
- 65:
41
- 66: <span class="ruby-comment cmt"># simulate a clock cycle</span>
42
- 67: <span class="ruby-ivar">@model</span>.<span class="ruby-identifier">cycle</span>
43
- 68:
44
- 69:
45
- 70: <span class="ruby-comment cmt"># verify the output</span>
46
- 71: <span class="ruby-identifier">output</span> = <span class="ruby-ivar">@model</span>.<span class="ruby-identifier">output</span>
47
- 72: <span class="ruby-identifier">p</span> <span class="ruby-value str">&quot;output:&quot;</span>, <span class="ruby-identifier">output</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
48
- 73:
49
- 74: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">output</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Hw5UnitModel</span><span class="ruby-operator">::</span><span class="ruby-constant">NOP</span>
50
- 75: <span class="ruby-identifier">assert_not_nil</span> <span class="ruby-identifier">inputQueue</span>.<span class="ruby-identifier">find</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">op</span><span class="ruby-operator">|</span> <span class="ruby-identifier">op</span>.<span class="ruby-identifier">tag</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">output</span>.<span class="ruby-identifier">tag</span> }, <span class="ruby-node">&quot;unknown tag on result: #{output.tag}&quot;</span>
51
- 76: <span class="ruby-identifier">assert_equal</span> <span class="ruby-identifier">output</span>.<span class="ruby-identifier">compute</span>, <span class="ruby-identifier">output</span>.<span class="ruby-identifier">result</span>, <span class="ruby-value str">&quot;incorrect result&quot;</span>
52
- 77:
53
- 78: <span class="ruby-identifier">outputQueue</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">output</span>
54
- 79: <span class="ruby-keyword kw">end</span>
55
- 80:
56
- 81:
57
- 82: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
58
- 83: <span class="ruby-identifier">puts</span>
59
- 84: <span class="ruby-identifier">pp</span> <span class="ruby-ivar">@model</span>
60
- 85: <span class="ruby-keyword kw">end</span>
61
- 86: <span class="ruby-keyword kw">end</span>
62
- 87: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File samp/pipelined_alu/TestHw5UnitModel.rb, line 34</span>
14
+ 34: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_reset</span>
15
+ 35: <span class="ruby-ivar">@model</span>.<span class="ruby-identifier">reset</span>
16
+ 36: <span class="ruby-identifier">assert_same</span> <span class="ruby-constant">Hw5UnitModel</span><span class="ruby-operator">::</span><span class="ruby-constant">NOP</span>, <span class="ruby-ivar">@model</span>.<span class="ruby-identifier">output</span>
17
+ 37: <span class="ruby-keyword kw">end</span></pre>
63
18
  </body>
64
19
  </html>
@@ -0,0 +1,64 @@
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>testModel (TestHw5UnitModel)</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 samp/pipelined_alu/TestHw5UnitModel.rb, line 39</span>
14
+ 39: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">testModel</span>
15
+ 40: <span class="ruby-comment cmt"># generate input for module</span>
16
+ 41: <span class="ruby-identifier">inputQueue</span> = []
17
+ 42:
18
+ 43: <span class="ruby-constant">NUM_VECTORS</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
19
+ 44: <span class="ruby-identifier">inputQueue</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Hw5UnitModel</span><span class="ruby-operator">::</span><span class="ruby-constant">Operation</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">Hw5UnitModel</span><span class="ruby-operator">::</span><span class="ruby-constant">OPERATIONS</span>[<span class="ruby-identifier">rand</span>(<span class="ruby-constant">Hw5UnitModel</span><span class="ruby-operator">::</span><span class="ruby-constant">OPERATIONS</span>.<span class="ruby-identifier">size</span>)], <span class="ruby-identifier">i</span>, <span class="ruby-ivar">@ingen</span>.<span class="ruby-identifier">gen</span>.<span class="ruby-identifier">abs</span>, <span class="ruby-ivar">@ingen</span>.<span class="ruby-identifier">gen</span>.<span class="ruby-identifier">abs</span>)
20
+ 45: <span class="ruby-keyword kw">end</span>
21
+ 46:
22
+ 47:
23
+ 48: <span class="ruby-comment cmt"># test the module</span>
24
+ 49: <span class="ruby-identifier">outputQueue</span> = []
25
+ 50: <span class="ruby-identifier">cycle</span> = <span class="ruby-value">0</span>
26
+ 51:
27
+ 52: <span class="ruby-keyword kw">until</span> <span class="ruby-identifier">inputQueue</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">outputQueue</span>.<span class="ruby-identifier">length</span>
28
+ 53: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
29
+ 54: <span class="ruby-identifier">print</span> <span class="ruby-value str">&quot;\n&quot;</span> <span class="ruby-operator">*</span> <span class="ruby-value">3</span>
30
+ 55: <span class="ruby-identifier">p</span> <span class="ruby-node">&quot;&gt;&gt; cycle #{cycle}&quot;</span>
31
+ 56: <span class="ruby-keyword kw">end</span>
32
+ 57:
33
+ 58:
34
+ 59: <span class="ruby-comment cmt"># start a new operation</span>
35
+ 60: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">cycle</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">inputQueue</span>.<span class="ruby-identifier">length</span>
36
+ 61: <span class="ruby-ivar">@model</span>.<span class="ruby-identifier">startOperation</span> <span class="ruby-identifier">inputQueue</span>[<span class="ruby-identifier">cycle</span>]
37
+ 62: <span class="ruby-identifier">cycle</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
38
+ 63: <span class="ruby-keyword kw">end</span>
39
+ 64:
40
+ 65:
41
+ 66: <span class="ruby-comment cmt"># simulate a clock cycle</span>
42
+ 67: <span class="ruby-ivar">@model</span>.<span class="ruby-identifier">cycle</span>
43
+ 68:
44
+ 69:
45
+ 70: <span class="ruby-comment cmt"># verify the output</span>
46
+ 71: <span class="ruby-identifier">output</span> = <span class="ruby-ivar">@model</span>.<span class="ruby-identifier">output</span>
47
+ 72: <span class="ruby-identifier">p</span> <span class="ruby-value str">&quot;output:&quot;</span>, <span class="ruby-identifier">output</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
48
+ 73:
49
+ 74: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">output</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Hw5UnitModel</span><span class="ruby-operator">::</span><span class="ruby-constant">NOP</span>
50
+ 75: <span class="ruby-identifier">assert_not_nil</span> <span class="ruby-identifier">inputQueue</span>.<span class="ruby-identifier">find</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">op</span><span class="ruby-operator">|</span> <span class="ruby-identifier">op</span>.<span class="ruby-identifier">tag</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">output</span>.<span class="ruby-identifier">tag</span> }, <span class="ruby-node">&quot;unknown tag on result: #{output.tag}&quot;</span>
51
+ 76: <span class="ruby-identifier">assert_equal</span> <span class="ruby-identifier">output</span>.<span class="ruby-identifier">compute</span>, <span class="ruby-identifier">output</span>.<span class="ruby-identifier">result</span>, <span class="ruby-value str">&quot;incorrect result&quot;</span>
52
+ 77:
53
+ 78: <span class="ruby-identifier">outputQueue</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">output</span>
54
+ 79: <span class="ruby-keyword kw">end</span>
55
+ 80:
56
+ 81:
57
+ 82: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
58
+ 83: <span class="ruby-identifier">puts</span>
59
+ 84: <span class="ruby-identifier">pp</span> <span class="ruby-ivar">@model</span>
60
+ 85: <span class="ruby-keyword kw">end</span>
61
+ 86: <span class="ruby-keyword kw">end</span>
62
+ 87: <span class="ruby-keyword kw">end</span></pre>
63
+ </body>
64
+ </html>
data/ref/ruby/created.rid CHANGED
@@ -1 +1 @@
1
- Tue Aug 29 11:48:55 PDT 2006
1
+ Tue Aug 29 22:50:47 PDT 2006
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Tue Aug 29 11:48:52 PDT 2006</td>
59
+ <td>Tue Aug 29 22:50:44 PDT 2006</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -138,7 +138,7 @@ backed-up file has a tilde (~) appended to its name.
138
138
  <h3 class="section-bar">Methods</h3>
139
139
 
140
140
  <div class="name-list">
141
- <a href="#M000001">write_file</a>&nbsp;&nbsp;
141
+ <a href="#M000002">write_file</a>&nbsp;&nbsp;
142
142
  </div>
143
143
  </div>
144
144
 
@@ -203,12 +203,12 @@ obtain templates for output generation
203
203
  <div id="methods">
204
204
  <h3 class="section-bar">Public Instance methods</h3>
205
205
 
206
- <div id="method-M000001" class="method-detail">
207
- <a name="M000001"></a>
206
+ <div id="method-M000002" class="method-detail">
207
+ <a name="M000002"></a>
208
208
 
209
209
  <div class="method-heading">
210
- <a href="generate_test_rb.src/M000001.html" target="Code" class="method-signature"
211
- onclick="popupCode('generate_test_rb.src/M000001.html');return false;">
210
+ <a href="generate_test_rb.src/M000002.html" target="Code" class="method-signature"
211
+ onclick="popupCode('generate_test_rb.src/M000002.html');return false;">
212
212
  <span class="method-name">write_file</span><span class="method-args">(aPath, aContent)</span>
213
213
  </a>
214
214
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Tue Aug 29 11:48:52 PDT 2006</td>
59
+ <td>Tue Aug 29 22:50:44 PDT 2006</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Tue Aug 29 11:48:52 PDT 2006</td>
59
+ <td>Tue Aug 29 22:50:44 PDT 2006</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>
@@ -56,7 +56,7 @@
56
56
  </tr>
57
57
  <tr class="top-aligned-row">
58
58
  <td><strong>Last Update:</strong></td>
59
- <td>Tue Aug 29 11:48:52 PDT 2006</td>
59
+ <td>Tue Aug 29 22:50:44 PDT 2006</td>
60
60
  </tr>
61
61
  </table>
62
62
  </div>