ruby-vpi 13.0.0 → 14.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. data/Rakefile +6 -1
  2. data/bin/generate_test_tpl/bench.rb +84 -1
  3. data/bin/generate_test_tpl/bench.v +8 -17
  4. data/bin/generate_test_tpl/proto.rb +1 -1
  5. data/doc/common.css +14 -41
  6. data/doc/common.tpl +1 -1
  7. data/doc/figures/figures.dia +274 -753
  8. data/doc/figures/organization_detailed.png +0 -0
  9. data/doc/figures/ruby_relay.png +0 -0
  10. data/doc/history.html +363 -276
  11. data/doc/history.yml +40 -0
  12. data/doc/intro.inc +37 -15
  13. data/doc/lib/doc_proxy.rb +24 -4
  14. data/doc/manual.doc +345 -196
  15. data/doc/manual.html +741 -497
  16. data/doc/memo.doc +15 -15
  17. data/doc/memo.html +28 -27
  18. data/doc/readme.doc +2 -2
  19. data/doc/readme.html +51 -15
  20. data/doc/rss.erb +1 -1
  21. data/doc/rss.xml +1624 -31
  22. data/ext/Rakefile +1 -6
  23. data/ext/main.c +8 -3
  24. data/ext/main.h +5 -0
  25. data/ext/relay.c +12 -12
  26. data/ext/relay.h +1 -6
  27. data/ext/swig_vpi.i +2 -2
  28. data/ext/swig_wrap.cin +37 -20
  29. data/ext/verilog.h +2 -2
  30. data/ext/vlog.c +10 -3
  31. data/ext/vlog.h +4 -4
  32. data/lib/ruby-vpi/vpi.rb +114 -0
  33. data/lib/ruby-vpi.rb +21 -59
  34. data/ref/c/annotated.html +1 -1
  35. data/ref/c/common_8h.html +1 -1
  36. data/ref/c/files.html +1 -1
  37. data/ref/c/functions.html +1 -1
  38. data/ref/c/functions_vars.html +1 -1
  39. data/ref/c/globals.html +1 -1
  40. data/ref/c/globals_0x63.html +1 -1
  41. data/ref/c/globals_0x65.html +1 -1
  42. data/ref/c/globals_0x66.html +1 -1
  43. data/ref/c/globals_0x6d.html +3 -2
  44. data/ref/c/globals_0x70.html +1 -1
  45. data/ref/c/globals_0x72.html +4 -5
  46. data/ref/c/globals_0x73.html +1 -1
  47. data/ref/c/globals_0x74.html +1 -1
  48. data/ref/c/globals_0x76.html +4 -2
  49. data/ref/c/globals_0x78.html +1 -1
  50. data/ref/c/globals_defs.html +1 -1
  51. data/ref/c/globals_defs_0x65.html +1 -1
  52. data/ref/c/globals_defs_0x70.html +1 -1
  53. data/ref/c/globals_defs_0x76.html +1 -1
  54. data/ref/c/globals_defs_0x78.html +1 -1
  55. data/ref/c/globals_enum.html +1 -1
  56. data/ref/c/globals_eval.html +1 -1
  57. data/ref/c/globals_func.html +8 -7
  58. data/ref/c/globals_type.html +1 -1
  59. data/ref/c/globals_vars.html +3 -2
  60. data/ref/c/index.html +1 -1
  61. data/ref/c/main_8c.html +26 -1
  62. data/ref/c/main_8h.html +26 -1
  63. data/ref/c/relay_8c.html +11 -35
  64. data/ref/c/relay_8h.html +3 -27
  65. data/ref/c/structt__cb__data.html +1 -1
  66. data/ref/c/structt__vpi__delay.html +1 -1
  67. data/ref/c/structt__vpi__error__info.html +1 -1
  68. data/ref/c/structt__vpi__strengthval.html +1 -1
  69. data/ref/c/structt__vpi__systf__data.html +1 -1
  70. data/ref/c/structt__vpi__time.html +1 -1
  71. data/ref/c/structt__vpi__value.html +1 -1
  72. data/ref/c/structt__vpi__vecval.html +1 -1
  73. data/ref/c/structt__vpi__vlog__info.html +1 -1
  74. data/ref/c/verilog_8h.html +5 -5
  75. data/ref/c/vlog_8c.html +44 -6
  76. data/ref/c/vlog_8h.html +7 -8
  77. data/ref/c/vpi__user_8h.html +1 -1
  78. data/ref/ruby/classes/RDoc.html +5 -5
  79. data/ref/ruby/classes/RDoc.src/{M000041.html → M000045.html} +0 -0
  80. data/ref/ruby/classes/RubyVpi.html +10 -28
  81. data/ref/ruby/classes/RubyVpi.src/M000029.html +101 -124
  82. data/ref/ruby/classes/Vpi/Handle.html +56 -56
  83. data/ref/ruby/classes/Vpi/Handle.src/M000034.html +5 -9
  84. data/ref/ruby/classes/Vpi/Handle.src/M000035.html +5 -31
  85. data/ref/ruby/classes/Vpi/Handle.src/M000036.html +5 -74
  86. data/ref/ruby/classes/Vpi/Handle.src/M000037.html +5 -17
  87. data/ref/ruby/classes/Vpi/Handle.src/M000038.html +9 -11
  88. data/ref/ruby/classes/Vpi/Handle.src/M000039.html +44 -0
  89. data/ref/ruby/classes/Vpi/Handle.src/M000040.html +74 -55
  90. data/ref/ruby/classes/Vpi/Handle.src/M000041.html +30 -0
  91. data/ref/ruby/classes/Vpi/Handle.src/M000042.html +24 -0
  92. data/ref/ruby/classes/Vpi/Handle.src/M000044.html +68 -0
  93. data/ref/ruby/classes/Vpi.html +149 -0
  94. data/ref/ruby/classes/Vpi.src/M000030.html +28 -0
  95. data/ref/ruby/classes/Vpi.src/M000031.html +18 -0
  96. data/ref/ruby/classes/Vpi.src/M000032.html +39 -0
  97. data/ref/ruby/classes/Vpi.src/M000033.html +22 -0
  98. data/ref/ruby/created.rid +1 -1
  99. data/ref/ruby/files/lib/ruby-vpi/vpi_rb.html +1 -1
  100. data/ref/ruby/files/lib/ruby-vpi_rb.html +2 -2
  101. data/ref/ruby/fr_method_index.html +18 -14
  102. data/samp/counter/counter_rspec_bench.rb +81 -1
  103. data/samp/counter/counter_rspec_bench.v +5 -12
  104. data/samp/counter/counter_rspec_design.rb +1 -2
  105. data/samp/counter/counter_rspec_proto.rb +1 -1
  106. data/samp/counter/counter_rspec_spec.rb +3 -3
  107. data/samp/counter/counter_xunit_bench.rb +81 -1
  108. data/samp/counter/counter_xunit_bench.v +5 -12
  109. data/samp/counter/counter_xunit_design.rb +1 -2
  110. data/samp/counter/counter_xunit_proto.rb +1 -1
  111. data/samp/counter/counter_xunit_spec.rb +3 -3
  112. data/samp/pipelined_alu/hw5_unit_test_bench.rb +81 -1
  113. data/samp/pipelined_alu/hw5_unit_test_bench.v +11 -18
  114. data/samp/pipelined_alu/hw5_unit_test_design.rb +1 -1
  115. data/samp/pipelined_alu/hw5_unit_test_proto.rb +1 -1
  116. data/samp/pipelined_alu/hw5_unit_test_spec.rb +1 -1
  117. metadata +12 -9
  118. data/doc/figures/ruby_init.png +0 -0
  119. data/ext/swig_vpi.h +0 -924
  120. data/ref/ruby/classes/Vpi/Handle.src/M000030.html +0 -18
  121. data/ref/ruby/classes/Vpi/Handle.src/M000031.html +0 -18
  122. data/ref/ruby/classes/Vpi/Handle.src/M000032.html +0 -18
  123. data/ref/ruby/classes/Vpi/Handle.src/M000033.html +0 -18
@@ -5,83 +5,14 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>put_value (Vpi::Handle)</title>
8
+ <title>z? (Vpi::Handle)</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.rb, line 113</span>
14
- 113: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">put_value</span> <span class="ruby-identifier">aValue</span>, <span class="ruby-identifier">aFormat</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">aTime</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">aDelay</span> = <span class="ruby-constant">VpiNoDelay</span>
15
- 114: <span class="ruby-identifier">aFormat</span> =
16
- 115: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">aFormat</span>
17
- 116: <span class="ruby-identifier">resolve_prop_type</span>(<span class="ruby-identifier">aFormat</span>)
18
- 117: <span class="ruby-keyword kw">else</span>
19
- 118: <span class="ruby-identifier">get_value_wrapper</span>(<span class="ruby-constant">VpiObjTypeVal</span>).<span class="ruby-identifier">format</span>
20
- 119: <span class="ruby-keyword kw">end</span>
21
- 120:
22
- 121: <span class="ruby-identifier">newVal</span> = <span class="ruby-constant">S_vpi_value</span>.<span class="ruby-identifier">new</span>
23
- 122: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">format</span> = <span class="ruby-identifier">aFormat</span>
24
- 123:
25
- 124: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">aFormat</span>
26
- 125: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiBinStrVal</span>, <span class="ruby-constant">VpiOctStrVal</span>, <span class="ruby-constant">VpiDecStrVal</span>, <span class="ruby-constant">VpiHexStrVal</span>, <span class="ruby-constant">VpiStringVal</span>
27
- 126: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">str</span> = <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_s</span>
28
- 127:
29
- 128: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiScalarVal</span>
30
- 129: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">scalar</span> = <span class="ruby-identifier">aValue</span>
31
- 130:
32
- 131: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiIntVal</span>
33
- 132: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">format</span> = <span class="ruby-constant">VpiHexStrVal</span>
34
- 133: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">str</span> = <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_i</span>.<span class="ruby-identifier">to_s</span>(<span class="ruby-value">16</span>)
35
- 134:
36
- 135: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiRealVal</span>
37
- 136: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">real</span> = <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_f</span>
38
- 137:
39
- 138: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiTimeVal</span>
40
- 139: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">time</span> = <span class="ruby-identifier">aValue</span>
41
- 140:
42
- 141: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiVectorVal</span>
43
- 142: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">vector</span> = <span class="ruby-identifier">aValue</span>
44
- 143:
45
- 144: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiStrengthVal</span>
46
- 145: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">strength</span> = <span class="ruby-identifier">aValue</span>
47
- 146:
48
- 147: <span class="ruby-keyword kw">else</span>
49
- 148: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;unknown S_vpi_value.format: #{newVal.format}&quot;</span>
50
- 149: <span class="ruby-keyword kw">end</span>
51
- 150:
52
- 151: <span class="ruby-identifier">vpi_put_value</span> <span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">newVal</span>, <span class="ruby-identifier">aTime</span>, <span class="ruby-identifier">aDelay</span>
53
- 152:
54
- 153: <span class="ruby-comment cmt"># ensure that value was written correctly</span>
55
- 154: <span class="ruby-identifier">readenVal</span> = <span class="ruby-identifier">get_value</span>(<span class="ruby-identifier">aFormat</span>)
56
- 155:
57
- 156: <span class="ruby-identifier">writtenCorrectly</span> =
58
- 157: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">aFormat</span>
59
- 158: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiBinStrVal</span>, <span class="ruby-constant">VpiOctStrVal</span>, <span class="ruby-constant">VpiDecStrVal</span>, <span class="ruby-constant">VpiHexStrVal</span>
60
- 159: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">aValue</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/[xz]/i</span> <span class="ruby-comment cmt"># TODO: verify 'z' behavior</span>
61
- 160: <span class="ruby-identifier">readenVal</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/[xz]/i</span>
62
- 161: <span class="ruby-keyword kw">else</span>
63
- 162: <span class="ruby-identifier">readenVal</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_s</span>
64
- 163: <span class="ruby-keyword kw">end</span>
65
- 164:
66
- 165: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiStringVal</span>
67
- 166: <span class="ruby-identifier">readenVal</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_s</span>
68
- 167:
69
- 168: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiIntVal</span>
70
- 169: <span class="ruby-comment cmt"># allow for register overflow when limit reached</span>
71
- 170: <span class="ruby-identifier">readenVal</span> <span class="ruby-operator">==</span> (<span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">%</span> (<span class="ruby-value">2</span> <span class="ruby-operator">**</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">vpiSize</span>))
72
- 171:
73
- 172: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiRealVal</span>
74
- 173: <span class="ruby-identifier">readenVal</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_f</span>
75
- 174:
76
- 175: <span class="ruby-keyword kw">else</span>
77
- 176: <span class="ruby-keyword kw">true</span>
78
- 177: <span class="ruby-keyword kw">end</span>
79
- 178:
80
- 179: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">writtenCorrectly</span>
81
- 180: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;value written (#{aValue.inspect}) does not match value read (#{readenVal.inspect}) from handle #{self}&quot;</span>
82
- 181: <span class="ruby-keyword kw">end</span>
83
- 182:
84
- 183: <span class="ruby-identifier">aValue</span>
85
- 184: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 75</span>
14
+ 75: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">z?</span>
15
+ 76: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">hexStrVal</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/z/i</span>
16
+ 77: <span class="ruby-keyword kw">end</span></pre>
86
17
  </body>
87
18
  </html>
@@ -5,26 +5,14 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>[] (Vpi::Handle)</title>
8
+ <title>z! (Vpi::Handle)</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.rb, line 187</span>
14
- 187: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span> <span class="ruby-operator">*</span><span class="ruby-identifier">aTypes</span>
15
- 188: <span class="ruby-identifier">handles</span> = []
16
- 189:
17
- 190: <span class="ruby-identifier">aTypes</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span>
18
- 191: <span class="ruby-identifier">t</span> = <span class="ruby-identifier">resolve_prop_type</span>(<span class="ruby-identifier">t</span>)
19
- 192:
20
- 193: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">itr</span> = <span class="ruby-identifier">vpi_iterate</span>(<span class="ruby-identifier">t</span>, <span class="ruby-keyword kw">self</span>)
21
- 194: <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>)
22
- 195: <span class="ruby-identifier">handles</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">h</span>
23
- 196: <span class="ruby-keyword kw">end</span>
24
- 197: <span class="ruby-keyword kw">end</span>
25
- 198: <span class="ruby-keyword kw">end</span>
26
- 199:
27
- 200: <span class="ruby-identifier">handles</span>
28
- 201: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 80</span>
14
+ 80: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">z!</span>
15
+ 81: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">hexStrVal</span> = <span class="ruby-value str">'z'</span>
16
+ 82: <span class="ruby-keyword kw">end</span></pre>
29
17
  </body>
30
18
  </html>
@@ -5,20 +5,18 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>inspect (Vpi::Handle)</title>
8
+ <title>get_value_wrapper (Vpi::Handle)</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.rb, line 204</span>
14
- 204: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inspect</span> <span class="ruby-operator">*</span><span class="ruby-identifier">aPropNames</span>
15
- 205: <span class="ruby-identifier">aPropNames</span>.<span class="ruby-identifier">unshift</span> <span class="ruby-identifier">:fullName</span>, <span class="ruby-identifier">:size</span>, <span class="ruby-identifier">:file</span>, <span class="ruby-identifier">:lineNo</span>
16
- 206:
17
- 207: <span class="ruby-identifier">aPropNames</span>.<span class="ruby-identifier">map!</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
18
- 208: <span class="ruby-node">&quot;#{name}=#{self.send(name.to_sym)}&quot;</span>
19
- 209: <span class="ruby-keyword kw">end</span>
20
- 210:
21
- 211: <span class="ruby-node">&quot;#&lt;Vpi::Handle #{vpiType_s} #{aPropNames.join(', ')}&gt;&quot;</span>
22
- 212: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 85</span>
14
+ 85: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_value_wrapper</span> <span class="ruby-identifier">aFormat</span>
15
+ 86: <span class="ruby-identifier">val</span> = <span class="ruby-constant">S_vpi_value</span>.<span class="ruby-identifier">new</span>
16
+ 87: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">format</span> = <span class="ruby-identifier">aFormat</span>
17
+ 88:
18
+ 89: <span class="ruby-identifier">vpi_get_value</span> <span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">val</span>
19
+ 90: <span class="ruby-identifier">val</span>
20
+ 91: <span class="ruby-keyword kw">end</span></pre>
23
21
  </body>
24
22
  </html>
@@ -0,0 +1,44 @@
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>get_value (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 94</span>
14
+ 94: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_value</span> <span class="ruby-identifier">aFormat</span> = <span class="ruby-constant">VpiObjTypeVal</span>
15
+ 95: <span class="ruby-identifier">val</span> = <span class="ruby-identifier">get_value_wrapper</span>(<span class="ruby-identifier">resolve_prop_type</span>(<span class="ruby-identifier">aFormat</span>))
16
+ 96:
17
+ 97: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">format</span>
18
+ 98: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiBinStrVal</span>, <span class="ruby-constant">VpiOctStrVal</span>, <span class="ruby-constant">VpiDecStrVal</span>, <span class="ruby-constant">VpiHexStrVal</span>, <span class="ruby-constant">VpiStringVal</span>
19
+ 99: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">str</span>
20
+ 100:
21
+ 101: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiScalarVal</span>
22
+ 102: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">scalar</span>
23
+ 103:
24
+ 104: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiIntVal</span>
25
+ 105: <span class="ruby-identifier">get_value_wrapper</span>(<span class="ruby-constant">VpiHexStrVal</span>).<span class="ruby-identifier">value</span>.<span class="ruby-identifier">str</span>.<span class="ruby-identifier">to_i</span>(<span class="ruby-value">16</span>)
26
+ 106:
27
+ 107: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiRealVal</span>
28
+ 108: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">real</span>
29
+ 109:
30
+ 110: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiTimeVal</span>
31
+ 111: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">time</span>
32
+ 112:
33
+ 113: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiVectorVal</span>
34
+ 114: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">vector</span>
35
+ 115:
36
+ 116: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiStrengthVal</span>
37
+ 117: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">strength</span>
38
+ 118:
39
+ 119: <span class="ruby-keyword kw">else</span>
40
+ 120: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;unknown S_vpi_value.format: #{val.format}&quot;</span>
41
+ 121: <span class="ruby-keyword kw">end</span>
42
+ 122: <span class="ruby-keyword kw">end</span></pre>
43
+ </body>
44
+ </html>
@@ -5,64 +5,83 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>method_missing (Vpi::Handle)</title>
8
+ <title>put_value (Vpi::Handle)</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.rb, line 223</span>
14
- 223: <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
- 224: <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
- 225: <span class="ruby-comment cmt"># cache the child for future accesses, in order to cut down number of calls to method_missing</span>
17
- 226: (<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>
18
- 227: <span class="ruby-identifier">define_method</span> <span class="ruby-identifier">aMeth</span> <span class="ruby-keyword kw">do</span>
19
- 228: <span class="ruby-identifier">child</span>
20
- 229: <span class="ruby-keyword kw">end</span>
21
- 230: <span class="ruby-keyword kw">end</span>
22
- 231:
23
- 232: <span class="ruby-identifier">child</span>
24
- 233:
25
- 234: <span class="ruby-keyword kw">else</span>
26
- 235: <span class="ruby-identifier">prop</span> = <span class="ruby-ivar">@@propCache</span>[<span class="ruby-identifier">aMeth</span>]
27
- 236:
28
- 237: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">prop</span>.<span class="ruby-identifier">operation</span>
29
- 238: <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>)
30
- 239:
31
- 240: <span class="ruby-keyword kw">else</span>
32
- 241: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">prop</span>.<span class="ruby-identifier">accessor</span>
33
- 242: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:d</span> <span class="ruby-comment cmt"># delay values</span>
34
- 243: <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>
35
- 244: <span class="ruby-comment cmt"># TODO: vpi_put_delays</span>
36
- 245: <span class="ruby-comment cmt"># TODO: vpi_get_delays</span>
37
- 246:
38
- 247: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:l</span> <span class="ruby-comment cmt"># logic values</span>
39
- 248: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">prop</span>.<span class="ruby-identifier">assignment</span>
40
- 249: <span class="ruby-identifier">value</span> = <span class="ruby-identifier">aArgs</span>.<span class="ruby-identifier">shift</span>
41
- 250: <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>)
42
- 251: <span class="ruby-keyword kw">else</span>
43
- 252: <span class="ruby-identifier">get_value</span>(<span class="ruby-identifier">prop</span>.<span class="ruby-identifier">type</span>)
44
- 253: <span class="ruby-keyword kw">end</span>
45
- 254:
46
- 255: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:i</span> <span class="ruby-comment cmt"># integer values</span>
47
- 256: <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>
48
- 257:
49
- 258: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:b</span> <span class="ruby-comment cmt"># boolean values</span>
50
- 259: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">prop</span>.<span class="ruby-identifier">assignment</span>
51
- 260: <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>)
52
- 261: <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>
53
- 262: <span class="ruby-keyword kw">end</span>
54
- 263:
55
- 264: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:s</span> <span class="ruby-comment cmt"># string values</span>
56
- 265: <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>
57
- 266:
58
- 267: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:h</span> <span class="ruby-comment cmt"># handle values</span>
59
- 268: <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>
60
- 269:
61
- 270: <span class="ruby-keyword kw">else</span>
62
- 271: <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>
63
- 272: <span class="ruby-keyword kw">end</span>
64
- 273: <span class="ruby-keyword kw">end</span>
65
- 274: <span class="ruby-keyword kw">end</span>
66
- 275: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 125</span>
14
+ 125: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">put_value</span> <span class="ruby-identifier">aValue</span>, <span class="ruby-identifier">aFormat</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">aTime</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">aDelay</span> = <span class="ruby-constant">VpiNoDelay</span>
15
+ 126: <span class="ruby-identifier">aFormat</span> =
16
+ 127: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">aFormat</span>
17
+ 128: <span class="ruby-identifier">resolve_prop_type</span>(<span class="ruby-identifier">aFormat</span>)
18
+ 129: <span class="ruby-keyword kw">else</span>
19
+ 130: <span class="ruby-identifier">get_value_wrapper</span>(<span class="ruby-constant">VpiObjTypeVal</span>).<span class="ruby-identifier">format</span>
20
+ 131: <span class="ruby-keyword kw">end</span>
21
+ 132:
22
+ 133: <span class="ruby-identifier">newVal</span> = <span class="ruby-constant">S_vpi_value</span>.<span class="ruby-identifier">new</span>
23
+ 134: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">format</span> = <span class="ruby-identifier">aFormat</span>
24
+ 135:
25
+ 136: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">aFormat</span>
26
+ 137: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiBinStrVal</span>, <span class="ruby-constant">VpiOctStrVal</span>, <span class="ruby-constant">VpiDecStrVal</span>, <span class="ruby-constant">VpiHexStrVal</span>, <span class="ruby-constant">VpiStringVal</span>
27
+ 138: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">str</span> = <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_s</span>
28
+ 139:
29
+ 140: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiScalarVal</span>
30
+ 141: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">scalar</span> = <span class="ruby-identifier">aValue</span>
31
+ 142:
32
+ 143: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiIntVal</span>
33
+ 144: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">format</span> = <span class="ruby-constant">VpiHexStrVal</span>
34
+ 145: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">str</span> = <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_i</span>.<span class="ruby-identifier">to_s</span>(<span class="ruby-value">16</span>)
35
+ 146:
36
+ 147: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiRealVal</span>
37
+ 148: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">real</span> = <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_f</span>
38
+ 149:
39
+ 150: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiTimeVal</span>
40
+ 151: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">time</span> = <span class="ruby-identifier">aValue</span>
41
+ 152:
42
+ 153: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiVectorVal</span>
43
+ 154: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">vector</span> = <span class="ruby-identifier">aValue</span>
44
+ 155:
45
+ 156: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiStrengthVal</span>
46
+ 157: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">strength</span> = <span class="ruby-identifier">aValue</span>
47
+ 158:
48
+ 159: <span class="ruby-keyword kw">else</span>
49
+ 160: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;unknown S_vpi_value.format: #{newVal.format}&quot;</span>
50
+ 161: <span class="ruby-keyword kw">end</span>
51
+ 162:
52
+ 163: <span class="ruby-identifier">vpi_put_value</span> <span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">newVal</span>, <span class="ruby-identifier">aTime</span>, <span class="ruby-identifier">aDelay</span>
53
+ 164:
54
+ 165: <span class="ruby-comment cmt"># ensure that value was written correctly</span>
55
+ 166: <span class="ruby-identifier">readenVal</span> = <span class="ruby-identifier">get_value</span>(<span class="ruby-identifier">aFormat</span>)
56
+ 167:
57
+ 168: <span class="ruby-identifier">writtenCorrectly</span> =
58
+ 169: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">aFormat</span>
59
+ 170: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiBinStrVal</span>, <span class="ruby-constant">VpiOctStrVal</span>, <span class="ruby-constant">VpiDecStrVal</span>, <span class="ruby-constant">VpiHexStrVal</span>
60
+ 171: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">aValue</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/[xz]/i</span> <span class="ruby-comment cmt"># TODO: verify 'z' behavior</span>
61
+ 172: <span class="ruby-identifier">readenVal</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/[xz]/i</span>
62
+ 173: <span class="ruby-keyword kw">else</span>
63
+ 174: <span class="ruby-identifier">readenVal</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_s</span>
64
+ 175: <span class="ruby-keyword kw">end</span>
65
+ 176:
66
+ 177: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiStringVal</span>
67
+ 178: <span class="ruby-identifier">readenVal</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_s</span>
68
+ 179:
69
+ 180: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiIntVal</span>
70
+ 181: <span class="ruby-comment cmt"># allow for register overflow when limit reached</span>
71
+ 182: <span class="ruby-identifier">readenVal</span> <span class="ruby-operator">==</span> (<span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">%</span> (<span class="ruby-value">2</span> <span class="ruby-operator">**</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">vpiSize</span>))
72
+ 183:
73
+ 184: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiRealVal</span>
74
+ 185: <span class="ruby-identifier">readenVal</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_f</span>
75
+ 186:
76
+ 187: <span class="ruby-keyword kw">else</span>
77
+ 188: <span class="ruby-keyword kw">true</span>
78
+ 189: <span class="ruby-keyword kw">end</span>
79
+ 190:
80
+ 191: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">writtenCorrectly</span>
81
+ 192: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;value written (#{aValue.inspect}) does not match value read (#{readenVal.inspect}) from handle #{self}&quot;</span>
82
+ 193: <span class="ruby-keyword kw">end</span>
83
+ 194:
84
+ 195: <span class="ruby-identifier">aValue</span>
85
+ 196: <span class="ruby-keyword kw">end</span></pre>
67
86
  </body>
68
87
  </html>
@@ -0,0 +1,30 @@
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::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 199</span>
14
+ 199: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span> <span class="ruby-operator">*</span><span class="ruby-identifier">aTypes</span>
15
+ 200: <span class="ruby-identifier">handles</span> = []
16
+ 201:
17
+ 202: <span class="ruby-identifier">aTypes</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span>
18
+ 203: <span class="ruby-identifier">t</span> = <span class="ruby-identifier">resolve_prop_type</span>(<span class="ruby-identifier">t</span>)
19
+ 204:
20
+ 205: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">itr</span> = <span class="ruby-identifier">vpi_iterate</span>(<span class="ruby-identifier">t</span>, <span class="ruby-keyword kw">self</span>)
21
+ 206: <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>)
22
+ 207: <span class="ruby-identifier">handles</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">h</span>
23
+ 208: <span class="ruby-keyword kw">end</span>
24
+ 209: <span class="ruby-keyword kw">end</span>
25
+ 210: <span class="ruby-keyword kw">end</span>
26
+ 211:
27
+ 212: <span class="ruby-identifier">handles</span>
28
+ 213: <span class="ruby-keyword kw">end</span></pre>
29
+ </body>
30
+ </html>
@@ -0,0 +1,24 @@
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>inspect (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 216</span>
14
+ 216: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inspect</span> <span class="ruby-operator">*</span><span class="ruby-identifier">aPropNames</span>
15
+ 217: <span class="ruby-identifier">aPropNames</span>.<span class="ruby-identifier">unshift</span> <span class="ruby-identifier">:fullName</span>, <span class="ruby-identifier">:size</span>, <span class="ruby-identifier">:file</span>, <span class="ruby-identifier">:lineNo</span>
16
+ 218:
17
+ 219: <span class="ruby-identifier">aPropNames</span>.<span class="ruby-identifier">map!</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
18
+ 220: <span class="ruby-node">&quot;#{name}=#{self.send(name.to_sym)}&quot;</span>
19
+ 221: <span class="ruby-keyword kw">end</span>
20
+ 222:
21
+ 223: <span class="ruby-node">&quot;#&lt;Vpi::Handle #{vpiType_s} #{aPropNames.join(', ')}&gt;&quot;</span>
22
+ 224: <span class="ruby-keyword kw">end</span></pre>
23
+ </body>
24
+ </html>
@@ -0,0 +1,68 @@
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 237</span>
14
+ 237: <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
+ 238: <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
+ 239: <span class="ruby-comment cmt"># cache the child for future accesses, in order to cut down number of calls to method_missing</span>
17
+ 240: (<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>
18
+ 241: <span class="ruby-identifier">define_method</span> <span class="ruby-identifier">aMeth</span> <span class="ruby-keyword kw">do</span>
19
+ 242: <span class="ruby-identifier">child</span>
20
+ 243: <span class="ruby-keyword kw">end</span>
21
+ 244: <span class="ruby-keyword kw">end</span>
22
+ 245:
23
+ 246: <span class="ruby-identifier">child</span>
24
+ 247:
25
+ 248: <span class="ruby-keyword kw">else</span>
26
+ 249: <span class="ruby-identifier">prop</span> = <span class="ruby-ivar">@@propCache</span>[<span class="ruby-identifier">aMeth</span>]
27
+ 250:
28
+ 251: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">prop</span>.<span class="ruby-identifier">operation</span>
29
+ 252: <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>)
30
+ 253:
31
+ 254: <span class="ruby-keyword kw">else</span>
32
+ 255: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">prop</span>.<span class="ruby-identifier">accessor</span>
33
+ 256: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:d</span> <span class="ruby-comment cmt"># delay values</span>
34
+ 257: <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>
35
+ 258: <span class="ruby-comment cmt"># TODO: vpi_put_delays</span>
36
+ 259: <span class="ruby-comment cmt"># TODO: vpi_get_delays</span>
37
+ 260:
38
+ 261: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:l</span> <span class="ruby-comment cmt"># logic values</span>
39
+ 262: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">prop</span>.<span class="ruby-identifier">assignment</span>
40
+ 263: <span class="ruby-identifier">value</span> = <span class="ruby-identifier">aArgs</span>.<span class="ruby-identifier">shift</span>
41
+ 264: <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>)
42
+ 265: <span class="ruby-keyword kw">else</span>
43
+ 266: <span class="ruby-identifier">get_value</span>(<span class="ruby-identifier">prop</span>.<span class="ruby-identifier">type</span>)
44
+ 267: <span class="ruby-keyword kw">end</span>
45
+ 268:
46
+ 269: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:i</span> <span class="ruby-comment cmt"># integer values</span>
47
+ 270: <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>
48
+ 271:
49
+ 272: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:b</span> <span class="ruby-comment cmt"># boolean values</span>
50
+ 273: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">prop</span>.<span class="ruby-identifier">assignment</span>
51
+ 274: <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>)
52
+ 275: <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>
53
+ 276: <span class="ruby-keyword kw">end</span>
54
+ 277:
55
+ 278: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:s</span> <span class="ruby-comment cmt"># string values</span>
56
+ 279: <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>
57
+ 280:
58
+ 281: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:h</span> <span class="ruby-comment cmt"># handle values</span>
59
+ 282: <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>
60
+ 283:
61
+ 284: <span class="ruby-keyword kw">else</span>
62
+ 285: <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>
63
+ 286: <span class="ruby-keyword kw">end</span>
64
+ 287: <span class="ruby-keyword kw">end</span>
65
+ 288: <span class="ruby-keyword kw">end</span>
66
+ 289: <span class="ruby-keyword kw">end</span></pre>
67
+ </body>
68
+ </html>