ruby-vpi 15.0.2 → 16.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (208) hide show
  1. data/LICENSE +23 -340
  2. data/Rakefile +169 -192
  3. data/bin/generate_test.rb +26 -25
  4. data/bin/generate_test_tpl/runner.rake +4 -10
  5. data/bin/header_to_ruby.rb +3 -20
  6. data/doc/README +11 -0
  7. data/doc/Rakefile +8 -21
  8. data/doc/common.css +44 -10
  9. data/doc/common.tpl +5 -10
  10. data/doc/history.doc +8 -7
  11. data/doc/history.html +228 -560
  12. data/doc/history.rb +7 -11
  13. data/doc/{history.yml → history.yaml} +325 -128
  14. data/doc/images/{feed-icon.png → feed-icon-28x28.png} +0 -0
  15. data/doc/images/ruby/LICENSE +15 -0
  16. data/doc/images/ruby/logo-reflection.png +0 -0
  17. data/doc/images/ruby/logo-reflection.xcf +0 -0
  18. data/doc/images/ruby/logo.png +0 -0
  19. data/doc/images/{LICENSE → tango/LICENSE} +0 -0
  20. data/doc/images/{caution.png → tango/caution.png} +0 -0
  21. data/doc/images/{caution.svg → tango/caution.svg} +0 -0
  22. data/doc/images/{home.png → tango/home.png} +0 -0
  23. data/doc/images/{home.svg → tango/home.svg} +0 -0
  24. data/doc/images/{important.png → tango/important.png} +0 -0
  25. data/doc/images/{important.svg → tango/important.svg} +0 -0
  26. data/doc/images/{next.png → tango/next.png} +0 -0
  27. data/doc/images/{next.svg → tango/next.svg} +0 -0
  28. data/doc/images/{note.png → tango/note.png} +0 -0
  29. data/doc/images/{note.svg → tango/note.svg} +0 -0
  30. data/doc/images/{prev.png → tango/prev.png} +0 -0
  31. data/doc/images/{prev.svg → tango/prev.svg} +0 -0
  32. data/doc/images/{tip.png → tango/tip.png} +0 -0
  33. data/doc/images/{tip.svg → tango/tip.svg} +0 -0
  34. data/doc/images/{up.png → tango/up.png} +0 -0
  35. data/doc/images/{up.svg → tango/up.svg} +0 -0
  36. data/doc/images/{warning.png → tango/warning.png} +0 -0
  37. data/doc/images/{warning.svg → tango/warning.svg} +0 -0
  38. data/doc/intro.inc +105 -36
  39. data/doc/lib/doc_format.rb +151 -29
  40. data/doc/lib/doc_proxy.rb +28 -69
  41. data/doc/lib/erb_content.rb +10 -22
  42. data/doc/lib/erb_proxy.rb +13 -24
  43. data/doc/manual.doc +16 -60
  44. data/doc/manual.html +257 -340
  45. data/doc/memo.doc +2 -0
  46. data/doc/memo.html +11 -11
  47. data/doc/readme.doc +36 -2
  48. data/doc/readme.html +214 -51
  49. data/doc/rss.erb +3 -3
  50. data/doc/rss.xml +217 -269
  51. data/ext/Rakefile +7 -22
  52. data/ext/common.h +10 -21
  53. data/ext/extconf.rb +5 -0
  54. data/ext/main.c +2 -18
  55. data/ext/main.h +1 -16
  56. data/ext/relay.c +3 -17
  57. data/ext/relay.h +3 -17
  58. data/ext/verilog.h +6 -18
  59. data/ext/vlog.c +3 -21
  60. data/ext/vlog.h +3 -17
  61. data/lib/ruby-vpi/erb.rb +7 -20
  62. data/lib/ruby-vpi/float.rb +6 -20
  63. data/lib/ruby-vpi/integer.rb +27 -47
  64. data/lib/ruby-vpi/rake.rb +4 -19
  65. data/lib/ruby-vpi/rcov.rb +6 -21
  66. data/lib/ruby-vpi/rdoc.rb +3 -21
  67. data/lib/ruby-vpi/runner.rb +28 -29
  68. data/lib/ruby-vpi/runner_proxy.rb +5 -21
  69. data/lib/ruby-vpi/verilog_parser.rb +5 -20
  70. data/lib/ruby-vpi/vpi.rb +420 -376
  71. data/lib/ruby-vpi.rb +26 -32
  72. data/ref/c/annotated.html +1 -1
  73. data/ref/c/common_8h.html +1 -1
  74. data/ref/c/files.html +1 -1
  75. data/ref/c/functions.html +1 -1
  76. data/ref/c/functions_vars.html +1 -1
  77. data/ref/c/globals.html +1 -1
  78. data/ref/c/globals_0x63.html +1 -1
  79. data/ref/c/globals_0x65.html +1 -1
  80. data/ref/c/globals_0x66.html +1 -1
  81. data/ref/c/globals_0x6d.html +1 -1
  82. data/ref/c/globals_0x70.html +1 -1
  83. data/ref/c/globals_0x72.html +1 -1
  84. data/ref/c/globals_0x73.html +1 -1
  85. data/ref/c/globals_0x74.html +1 -1
  86. data/ref/c/globals_0x76.html +1 -1
  87. data/ref/c/globals_0x78.html +1 -1
  88. data/ref/c/globals_defs.html +1 -1
  89. data/ref/c/globals_defs_0x65.html +1 -1
  90. data/ref/c/globals_defs_0x70.html +1 -1
  91. data/ref/c/globals_defs_0x76.html +1 -1
  92. data/ref/c/globals_defs_0x78.html +1 -1
  93. data/ref/c/globals_enum.html +1 -1
  94. data/ref/c/globals_eval.html +1 -1
  95. data/ref/c/globals_func.html +1 -1
  96. data/ref/c/globals_type.html +1 -1
  97. data/ref/c/globals_vars.html +1 -1
  98. data/ref/c/index.html +1 -1
  99. data/ref/c/main_8c.html +1 -1
  100. data/ref/c/main_8h.html +1 -1
  101. data/ref/c/relay_8c.html +1 -1
  102. data/ref/c/relay_8h.html +1 -1
  103. data/ref/c/structt__cb__data.html +1 -1
  104. data/ref/c/structt__vpi__delay.html +1 -1
  105. data/ref/c/structt__vpi__error__info.html +1 -1
  106. data/ref/c/structt__vpi__strengthval.html +1 -1
  107. data/ref/c/structt__vpi__systf__data.html +1 -1
  108. data/ref/c/structt__vpi__time.html +1 -1
  109. data/ref/c/structt__vpi__value.html +1 -1
  110. data/ref/c/structt__vpi__vecval.html +1 -1
  111. data/ref/c/structt__vpi__vlog__info.html +1 -1
  112. data/ref/c/verilog_8h.html +1 -1
  113. data/ref/c/vlog_8c.html +1 -1
  114. data/ref/c/vlog_8h.html +1 -1
  115. data/ref/c/vpi__user_8h.html +1 -1
  116. data/ref/ruby/classes/ERB.html +5 -5
  117. data/ref/ruby/classes/ERB.src/{M000026.html → M000024.html} +15 -15
  118. data/ref/ruby/classes/FileUtils.html +10 -10
  119. data/ref/ruby/classes/FileUtils.src/{M000027.html → M000025.html} +4 -4
  120. data/ref/ruby/classes/FileUtils.src/{M000028.html → M000026.html} +4 -4
  121. data/ref/ruby/classes/Float.html +5 -5
  122. data/ref/ruby/classes/Float.src/{M000022.html → M000020.html} +5 -5
  123. data/ref/ruby/classes/Integer.html +20 -56
  124. data/ref/ruby/classes/Integer.src/M000008.html +11 -11
  125. data/ref/ruby/classes/Integer.src/M000009.html +4 -4
  126. data/ref/ruby/classes/Integer.src/M000010.html +4 -4
  127. data/ref/ruby/classes/Integer.src/M000011.html +4 -4
  128. data/ref/ruby/classes/Integer.src/M000012.html +4 -4
  129. data/ref/ruby/classes/Integer.src/M000013.html +4 -4
  130. data/ref/ruby/classes/Integer.src/M000016.html +12 -9
  131. data/ref/ruby/classes/Integer.src/M000017.html +18 -9
  132. data/ref/ruby/classes/Integer.src/M000018.html +12 -12
  133. data/ref/ruby/classes/Integer.src/M000019.html +17 -18
  134. data/ref/ruby/classes/RDoc.src/M000053.html +25 -25
  135. data/ref/ruby/classes/RubyVpi/Config.html +3 -3
  136. data/ref/ruby/classes/RubyVpi.html +11 -5
  137. data/ref/ruby/classes/RubyVpi.src/{M000029.html → M000027.html} +103 -101
  138. data/ref/ruby/classes/String.html +21 -15
  139. data/ref/ruby/classes/String.src/M000021.html +36 -0
  140. data/ref/ruby/classes/String.src/{M000024.html → M000022.html} +24 -24
  141. data/ref/ruby/classes/String.src/M000023.html +5 -23
  142. data/ref/ruby/classes/VerilogParser/Module/Parameter.src/M000007.html +5 -5
  143. data/ref/ruby/classes/VerilogParser/Module/Port.src/M000003.html +7 -7
  144. data/ref/ruby/classes/VerilogParser/Module/Port.src/M000004.html +4 -4
  145. data/ref/ruby/classes/VerilogParser/Module/Port.src/M000005.html +4 -4
  146. data/ref/ruby/classes/VerilogParser/Module/Port.src/M000006.html +4 -4
  147. data/ref/ruby/classes/VerilogParser/Module.src/M000002.html +20 -20
  148. data/ref/ruby/classes/VerilogParser.html +6 -0
  149. data/ref/ruby/classes/VerilogParser.src/M000001.html +20 -20
  150. data/ref/ruby/classes/Vpi/Handle.html +89 -88
  151. data/ref/ruby/classes/Vpi/Handle.src/M000036.html +18 -0
  152. data/ref/ruby/classes/Vpi/Handle.src/M000037.html +5 -5
  153. data/ref/ruby/classes/Vpi/Handle.src/M000038.html +5 -5
  154. data/ref/ruby/classes/Vpi/Handle.src/M000039.html +5 -5
  155. data/ref/ruby/classes/Vpi/Handle.src/M000040.html +8 -5
  156. data/ref/ruby/classes/Vpi/Handle.src/M000041.html +8 -8
  157. data/ref/ruby/classes/Vpi/Handle.src/M000042.html +7 -6
  158. data/ref/ruby/classes/Vpi/Handle.src/M000043.html +31 -9
  159. data/ref/ruby/classes/Vpi/Handle.src/M000044.html +74 -31
  160. data/ref/ruby/classes/Vpi/Handle.src/M000045.html +17 -74
  161. data/ref/ruby/classes/Vpi/Handle.src/M000046.html +11 -17
  162. data/ref/ruby/classes/Vpi/Handle.src/M000048.html +31 -0
  163. data/ref/ruby/classes/Vpi/Handle.src/M000049.html +53 -52
  164. data/ref/ruby/classes/Vpi/S_vpi_time.src/M000050.html +4 -4
  165. data/ref/ruby/classes/Vpi/S_vpi_time.src/M000051.html +5 -5
  166. data/ref/ruby/classes/Vpi/S_vpi_value.html +15 -15
  167. data/ref/ruby/classes/Vpi/S_vpi_value.src/{M000036.html → M000033.html} +5 -5
  168. data/ref/ruby/classes/Vpi/S_vpi_value.src/M000034.html +5 -5
  169. data/ref/ruby/classes/Vpi/S_vpi_value.src/M000035.html +5 -5
  170. data/ref/ruby/classes/Vpi.html +48 -19
  171. data/ref/ruby/classes/Vpi.src/M000028.html +28 -0
  172. data/ref/ruby/classes/Vpi.src/M000029.html +18 -0
  173. data/ref/ruby/classes/Vpi.src/M000030.html +25 -15
  174. data/ref/ruby/classes/Vpi.src/M000031.html +9 -5
  175. data/ref/ruby/classes/Vpi.src/M000032.html +9 -25
  176. data/ref/ruby/created.rid +1 -1
  177. data/ref/ruby/files/bin/generate_test_rb.html +2 -1
  178. data/ref/ruby/files/bin/header_to_ruby_rb.html +1 -1
  179. data/ref/ruby/files/lib/ruby-vpi/erb_rb.html +7 -1
  180. data/ref/ruby/files/lib/ruby-vpi/float_rb.html +7 -1
  181. data/ref/ruby/files/lib/ruby-vpi/integer_rb.html +7 -1
  182. data/ref/ruby/files/lib/ruby-vpi/rake_rb.html +7 -1
  183. data/ref/ruby/files/lib/ruby-vpi/rcov_rb.html +7 -1
  184. data/ref/ruby/files/lib/ruby-vpi/rdoc_rb.html +1 -1
  185. data/ref/ruby/files/lib/ruby-vpi/runner_proxy_rb.html +1 -1
  186. data/ref/ruby/files/lib/ruby-vpi/runner_rb.html +1 -1
  187. data/ref/ruby/files/lib/ruby-vpi/verilog_parser_rb.html +1 -1
  188. data/ref/ruby/files/lib/ruby-vpi/vpi_rb.html +1 -1
  189. data/ref/ruby/files/lib/ruby-vpi_rb.html +7 -1
  190. data/ref/ruby/fr_method_index.html +34 -34
  191. data/samp/counter/counter_rspec_runner.rake +4 -0
  192. data/samp/counter/counter_xunit_runner.rake +4 -0
  193. data/samp/pipelined_alu/Hw5UnitModel.rb +3 -19
  194. data/samp/pipelined_alu/README +38 -13
  195. data/samp/pipelined_alu/TestHw5UnitModel.rb +9 -20
  196. data/samp/pipelined_alu/hw5_unit.v +1 -16
  197. data/samp/pipelined_alu/hw5_unit_test_runner.rake +4 -0
  198. data/samp/pipelined_alu/hw5_unit_test_spec.rb +3 -20
  199. data/samp/pipelined_alu/int_gen.rb +6 -20
  200. metadata +47 -43
  201. data/doc/LICENSE +0 -397
  202. data/doc/images/feed-icon.LICENSE +0 -2
  203. data/doc/images/feed-icon.svg +0 -18
  204. data/ref/ruby/classes/Integer.src/M000020.html +0 -25
  205. data/ref/ruby/classes/Integer.src/M000021.html +0 -30
  206. data/ref/ruby/classes/String.src/M000025.html +0 -18
  207. data/ref/ruby/classes/Vpi/Handle.src/M000047.html +0 -24
  208. data/ref/ruby/classes/Vpi.src/M000033.html +0 -22
@@ -94,7 +94,7 @@ whereas &lt;% &#8230; %&gt; tags do <b>not</b> produce any output.
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="#M000024">new</a>&nbsp;&nbsp;
98
98
  </div>
99
99
  </div>
100
100
 
@@ -129,12 +129,12 @@ whereas &lt;% &#8230; %&gt; tags do <b>not</b> produce any output.
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-M000024" class="method-detail">
133
+ <a name="M000024"></a>
134
134
 
135
135
  <div class="method-heading">
136
- <a href="ERB.src/M000026.html" target="Code" class="method-signature"
137
- onclick="popupCode('ERB.src/M000026.html');return false;">
136
+ <a href="ERB.src/M000024.html" target="Code" class="method-signature"
137
+ onclick="popupCode('ERB.src/M000024.html');return false;">
138
138
  <span class="method-name">new</span><span class="method-args">(aInput, *aArgs)</span>
139
139
  </a>
140
140
  </div>
@@ -10,20 +10,20 @@
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/erb.rb, line 27</span>
14
- 27: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">aInput</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">aArgs</span>
15
- 28: <span class="ruby-comment cmt"># ensure that only &lt;%= ... %&gt; tags generate output</span>
16
- 29: <span class="ruby-identifier">input</span> = <span class="ruby-identifier">aInput</span>.<span class="ruby-identifier">gsub</span> <span class="ruby-regexp re">%r{&lt;%=.*?%&gt;}</span><span class="ruby-identifier">m</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
17
- 30: <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">$'</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\r?\n/</span>) <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
18
- 31: <span class="ruby-identifier">s</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">$&amp;</span>
19
- 32: <span class="ruby-keyword kw">else</span>
20
- 33: <span class="ruby-identifier">s</span>
21
- 34: <span class="ruby-keyword kw">end</span>
22
- 35: <span class="ruby-keyword kw">end</span>
23
- 36:
24
- 37: <span class="ruby-identifier">aArgs</span>[<span class="ruby-value">1</span>] = <span class="ruby-value str">'&gt;'</span>
25
- 38:
26
- 39: <span class="ruby-identifier">original_initialize</span> <span class="ruby-identifier">input</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">aArgs</span>
27
- 40: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/erb.rb, line 14</span>
14
+ 14: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">aInput</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">aArgs</span>
15
+ 15: <span class="ruby-comment cmt"># ensure that only &lt;%= ... %&gt; tags generate output</span>
16
+ 16: <span class="ruby-identifier">input</span> = <span class="ruby-identifier">aInput</span>.<span class="ruby-identifier">gsub</span> <span class="ruby-regexp re">%r{&lt;%=.*?%&gt;}</span><span class="ruby-identifier">m</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
17
+ 17: <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">$'</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\r?\n/</span>) <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
18
+ 18: <span class="ruby-identifier">s</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">$&amp;</span>
19
+ 19: <span class="ruby-keyword kw">else</span>
20
+ 20: <span class="ruby-identifier">s</span>
21
+ 21: <span class="ruby-keyword kw">end</span>
22
+ 22: <span class="ruby-keyword kw">end</span>
23
+ 23:
24
+ 24: <span class="ruby-identifier">aArgs</span>[<span class="ruby-value">1</span>] = <span class="ruby-value str">'&gt;'</span>
25
+ 25:
26
+ 26: <span class="ruby-identifier">original_initialize</span> <span class="ruby-identifier">input</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">aArgs</span>
27
+ 27: <span class="ruby-keyword kw">end</span></pre>
28
28
  </body>
29
29
  </html>
@@ -80,8 +80,8 @@
80
80
  <h3 class="section-bar">Methods</h3>
81
81
 
82
82
  <div class="name-list">
83
- <a href="#M000028">collect_args</a>&nbsp;&nbsp;
84
- <a href="#M000027">sh</a>&nbsp;&nbsp;
83
+ <a href="#M000026">collect_args</a>&nbsp;&nbsp;
84
+ <a href="#M000025">sh</a>&nbsp;&nbsp;
85
85
  </div>
86
86
  </div>
87
87
 
@@ -116,12 +116,12 @@
116
116
  <div id="methods">
117
117
  <h3 class="section-bar">Public Instance methods</h3>
118
118
 
119
- <div id="method-M000028" class="method-detail">
120
- <a name="M000028"></a>
119
+ <div id="method-M000026" class="method-detail">
120
+ <a name="M000026"></a>
121
121
 
122
122
  <div class="method-heading">
123
- <a href="FileUtils.src/M000028.html" target="Code" class="method-signature"
124
- onclick="popupCode('FileUtils.src/M000028.html');return false;">
123
+ <a href="FileUtils.src/M000026.html" target="Code" class="method-signature"
124
+ onclick="popupCode('FileUtils.src/M000026.html');return false;">
125
125
  <span class="method-name">collect_args</span><span class="method-args">(*aArgs)</span>
126
126
  </a>
127
127
  </div>
@@ -133,12 +133,12 @@ Collects the given arguments into a single, sparse array.
133
133
  </div>
134
134
  </div>
135
135
 
136
- <div id="method-M000027" class="method-detail">
137
- <a name="M000027"></a>
136
+ <div id="method-M000025" class="method-detail">
137
+ <a name="M000025"></a>
138
138
 
139
139
  <div class="method-heading">
140
- <a href="FileUtils.src/M000027.html" target="Code" class="method-signature"
141
- onclick="popupCode('FileUtils.src/M000027.html');return false;">
140
+ <a href="FileUtils.src/M000025.html" target="Code" class="method-signature"
141
+ onclick="popupCode('FileUtils.src/M000025.html');return false;">
142
142
  <span class="method-name">sh</span><span class="method-args">(*aArgs, &amp;aBlock)</span>
143
143
  </a>
144
144
  </div>
@@ -10,9 +10,9 @@
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/rake.rb, line 27</span>
14
- 27: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sh</span> <span class="ruby-operator">*</span><span class="ruby-identifier">aArgs</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">aBlock</span>
15
- 28: <span class="ruby-identifier">old_sh</span> <span class="ruby-operator">*</span><span class="ruby-identifier">collect_args</span>(<span class="ruby-identifier">aArgs</span>).<span class="ruby-identifier">reject</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">i</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">empty?</span>}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">aBlock</span>
16
- 29: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/rake.rb, line 12</span>
14
+ 12: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sh</span> <span class="ruby-operator">*</span><span class="ruby-identifier">aArgs</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">aBlock</span>
15
+ 13: <span class="ruby-identifier">old_sh</span> <span class="ruby-operator">*</span><span class="ruby-identifier">collect_args</span>(<span class="ruby-identifier">aArgs</span>).<span class="ruby-identifier">reject</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">i</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">empty?</span>}, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">aBlock</span>
16
+ 14: <span class="ruby-keyword kw">end</span></pre>
17
17
  </body>
18
18
  </html>
@@ -10,9 +10,9 @@
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/rake.rb, line 32</span>
14
- 32: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">collect_args</span> <span class="ruby-operator">*</span><span class="ruby-identifier">aArgs</span>
15
- 33: <span class="ruby-identifier">aArgs</span>.<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">compact</span>
16
- 34: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/rake.rb, line 17</span>
14
+ 17: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">collect_args</span> <span class="ruby-operator">*</span><span class="ruby-identifier">aArgs</span>
15
+ 18: <span class="ruby-identifier">aArgs</span>.<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">compact</span>
16
+ 19: <span class="ruby-keyword kw">end</span></pre>
17
17
  </body>
18
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="#M000022">mantissa</a>&nbsp;&nbsp;
89
+ <a href="#M000020">mantissa</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-M000022" class="method-detail">
112
- <a name="M000022"></a>
111
+ <div id="method-M000020" class="method-detail">
112
+ <a name="M000020"></a>
113
113
 
114
114
  <div class="method-heading">
115
- <a href="Float.src/M000022.html" target="Code" class="method-signature"
116
- onclick="popupCode('Float.src/M000022.html');return false;">
115
+ <a href="Float.src/M000020.html" target="Code" class="method-signature"
116
+ onclick="popupCode('Float.src/M000020.html');return false;">
117
117
  <span class="method-name">mantissa</span><span class="method-args">()</span>
118
118
  </a>
119
119
  </div>
@@ -10,10 +10,10 @@
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/float.rb, line 48</span>
14
- 48: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mantissa</span>
15
- 49: <span class="ruby-identifier">f</span> = <span class="ruby-identifier">abs</span>
16
- 50: <span class="ruby-identifier">f</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">floor</span>
17
- 51: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/float.rb, line 34</span>
14
+ 34: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mantissa</span>
15
+ 35: <span class="ruby-identifier">f</span> = <span class="ruby-identifier">abs</span>
16
+ 36: <span class="ruby-identifier">f</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">floor</span>
17
+ 37: <span class="ruby-keyword kw">end</span></pre>
18
18
  </body>
19
19
  </html>
@@ -94,20 +94,18 @@ Instead, they return the new value as their result.
94
94
  <h3 class="section-bar">Methods</h3>
95
95
 
96
96
  <div class="name-list">
97
- <a href="#M000017">ensure_max</a>&nbsp;&nbsp;
98
- <a href="#M000016">ensure_min</a>&nbsp;&nbsp;
99
- <a href="#M000020">extend_sign</a>&nbsp;&nbsp;
97
+ <a href="#M000018">extend_sign</a>&nbsp;&nbsp;
100
98
  <a href="#M000009">length</a>&nbsp;&nbsp;
101
99
  <a href="#M000010">limit</a>&nbsp;&nbsp;
102
100
  <a href="#M000008">log2</a>&nbsp;&nbsp;
103
101
  <a href="#M000012">mask</a>&nbsp;&nbsp;
104
102
  <a href="#M000014">max</a>&nbsp;&nbsp;
105
- <a href="#M000018">pack</a>&nbsp;&nbsp;
106
- <a href="#M000021">split</a>&nbsp;&nbsp;
103
+ <a href="#M000016">pack</a>&nbsp;&nbsp;
104
+ <a href="#M000019">split</a>&nbsp;&nbsp;
107
105
  <a href="#M000011">to_limit</a>&nbsp;&nbsp;
108
106
  <a href="#M000013">to_mask</a>&nbsp;&nbsp;
109
107
  <a href="#M000015">to_max</a>&nbsp;&nbsp;
110
- <a href="#M000019">unpack</a>&nbsp;&nbsp;
108
+ <a href="#M000017">unpack</a>&nbsp;&nbsp;
111
109
  </div>
112
110
  </div>
113
111
 
@@ -129,46 +127,12 @@ Instead, they return the new value as their result.
129
127
  <div id="methods">
130
128
  <h3 class="section-bar">Public Instance methods</h3>
131
129
 
132
- <div id="method-M000017" class="method-detail">
133
- <a name="M000017"></a>
134
-
135
- <div class="method-heading">
136
- <a href="Integer.src/M000017.html" target="Code" class="method-signature"
137
- onclick="popupCode('Integer.src/M000017.html');return false;">
138
- <span class="method-name">ensure_max</span><span class="method-args">(aLimit)</span>
139
- </a>
140
- </div>
141
-
142
- <div class="method-description">
143
- <p>
144
- Ensures that this integer is no greater than the given limit.
145
- </p>
146
- </div>
147
- </div>
148
-
149
- <div id="method-M000016" class="method-detail">
150
- <a name="M000016"></a>
151
-
152
- <div class="method-heading">
153
- <a href="Integer.src/M000016.html" target="Code" class="method-signature"
154
- onclick="popupCode('Integer.src/M000016.html');return false;">
155
- <span class="method-name">ensure_min</span><span class="method-args">(aLimit)</span>
156
- </a>
157
- </div>
158
-
159
- <div class="method-description">
160
- <p>
161
- Ensures that this integer is no less than the given limit.
162
- </p>
163
- </div>
164
- </div>
165
-
166
- <div id="method-M000020" class="method-detail">
167
- <a name="M000020"></a>
130
+ <div id="method-M000018" class="method-detail">
131
+ <a name="M000018"></a>
168
132
 
169
133
  <div class="method-heading">
170
- <a href="Integer.src/M000020.html" target="Code" class="method-signature"
171
- onclick="popupCode('Integer.src/M000020.html');return false;">
134
+ <a href="Integer.src/M000018.html" target="Code" class="method-signature"
135
+ onclick="popupCode('Integer.src/M000018.html');return false;">
172
136
  <span class="method-name">extend_sign</span><span class="method-args">(aOrigWidth, aExtWidth)</span>
173
137
  </a>
174
138
  </div>
@@ -265,12 +229,12 @@ Alias for <a href="Integer.html#M000012">mask</a>
265
229
  </div>
266
230
  </div>
267
231
 
268
- <div id="method-M000018" class="method-detail">
269
- <a name="M000018"></a>
232
+ <div id="method-M000016" class="method-detail">
233
+ <a name="M000016"></a>
270
234
 
271
235
  <div class="method-heading">
272
- <a href="Integer.src/M000018.html" target="Code" class="method-signature"
273
- onclick="popupCode('Integer.src/M000018.html');return false;">
236
+ <a href="Integer.src/M000016.html" target="Code" class="method-signature"
237
+ onclick="popupCode('Integer.src/M000016.html');return false;">
274
238
  <span class="method-name">pack</span><span class="method-args">(aPackedWidth)</span>
275
239
  </a>
276
240
  </div>
@@ -284,12 +248,12 @@ Transforms this infinite-length Ruby integer into a fixed-length integer
284
248
  </div>
285
249
  </div>
286
250
 
287
- <div id="method-M000021" class="method-detail">
288
- <a name="M000021"></a>
251
+ <div id="method-M000019" class="method-detail">
252
+ <a name="M000019"></a>
289
253
 
290
254
  <div class="method-heading">
291
- <a href="Integer.src/M000021.html" target="Code" class="method-signature"
292
- onclick="popupCode('Integer.src/M000021.html');return false;">
255
+ <a href="Integer.src/M000019.html" target="Code" class="method-signature"
256
+ onclick="popupCode('Integer.src/M000019.html');return false;">
293
257
  <span class="method-name">split</span><span class="method-args">(aWidth = 8)</span>
294
258
  </a>
295
259
  </div>
@@ -364,12 +328,12 @@ Alias for <a href="Integer.html#M000013">to_mask</a>
364
328
  </div>
365
329
  </div>
366
330
 
367
- <div id="method-M000019" class="method-detail">
368
- <a name="M000019"></a>
331
+ <div id="method-M000017" class="method-detail">
332
+ <a name="M000017"></a>
369
333
 
370
334
  <div class="method-heading">
371
- <a href="Integer.src/M000019.html" target="Code" class="method-signature"
372
- onclick="popupCode('Integer.src/M000019.html');return false;">
335
+ <a href="Integer.src/M000017.html" target="Code" class="method-signature"
336
+ onclick="popupCode('Integer.src/M000017.html');return false;">
373
337
  <span class="method-name">unpack</span><span class="method-args">(aPackedWidth)</span>
374
338
  </a>
375
339
  </div>
@@ -10,16 +10,16 @@
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/integer.rb, line 24</span>
14
- 24: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log2</span>
15
- 25: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;integer must be positive&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
16
- 26: <span class="ruby-identifier">bin</span> = <span class="ruby-identifier">to_s</span>(<span class="ruby-value">2</span>)
17
- 27:
18
- 28: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">bin</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^10+$/</span>
19
- 29: <span class="ruby-identifier">bin</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
20
- 30: <span class="ruby-keyword kw">else</span>
21
- 31: <span class="ruby-identifier">bin</span>.<span class="ruby-identifier">length</span>
22
- 32: <span class="ruby-keyword kw">end</span>
23
- 33: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/integer.rb, line 11</span>
14
+ 11: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log2</span>
15
+ 12: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;integer must be positive&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
16
+ 13: <span class="ruby-identifier">bin</span> = <span class="ruby-identifier">to_s</span>(<span class="ruby-value">2</span>)
17
+ 14:
18
+ 15: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">bin</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^10+$/</span>
19
+ 16: <span class="ruby-identifier">bin</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
20
+ 17: <span class="ruby-keyword kw">else</span>
21
+ 18: <span class="ruby-identifier">bin</span>.<span class="ruby-identifier">length</span>
22
+ 19: <span class="ruby-keyword kw">end</span>
23
+ 20: <span class="ruby-keyword kw">end</span></pre>
24
24
  </body>
25
25
  </html>
@@ -10,9 +10,9 @@
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/integer.rb, line 36</span>
14
- 36: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">length</span>
15
- 37: <span class="ruby-identifier">to_s</span>(<span class="ruby-value">2</span>).<span class="ruby-identifier">length</span>
16
- 38: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/integer.rb, line 23</span>
14
+ 23: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">length</span>
15
+ 24: <span class="ruby-identifier">to_s</span>(<span class="ruby-value">2</span>).<span class="ruby-identifier">length</span>
16
+ 25: <span class="ruby-keyword kw">end</span></pre>
17
17
  </body>
18
18
  </html>
@@ -10,9 +10,9 @@
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/integer.rb, line 41</span>
14
- 41: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">limit</span>
15
- 42: <span class="ruby-identifier">length</span>.<span class="ruby-identifier">to_limit</span>
16
- 43: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/integer.rb, line 29</span>
14
+ 29: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">limit</span>
15
+ 30: <span class="ruby-identifier">length</span>.<span class="ruby-identifier">to_limit</span>
16
+ 31: <span class="ruby-keyword kw">end</span></pre>
17
17
  </body>
18
18
  </html>
@@ -10,9 +10,9 @@
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/integer.rb, line 46</span>
14
- 46: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_limit</span>
15
- 47: <span class="ruby-value">2</span> <span class="ruby-operator">**</span> <span class="ruby-keyword kw">self</span>
16
- 48: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/integer.rb, line 34</span>
14
+ 34: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_limit</span>
15
+ 35: <span class="ruby-value">2</span> <span class="ruby-operator">**</span> <span class="ruby-keyword kw">self</span>
16
+ 36: <span class="ruby-keyword kw">end</span></pre>
17
17
  </body>
18
18
  </html>
@@ -10,9 +10,9 @@
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/integer.rb, line 52</span>
14
- 52: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mask</span>
15
- 53: <span class="ruby-identifier">length</span>.<span class="ruby-identifier">to_mask</span>
16
- 54: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/integer.rb, line 40</span>
14
+ 40: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mask</span>
15
+ 41: <span class="ruby-identifier">length</span>.<span class="ruby-identifier">to_mask</span>
16
+ 42: <span class="ruby-keyword kw">end</span></pre>
17
17
  </body>
18
18
  </html>
@@ -10,9 +10,9 @@
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/integer.rb, line 57</span>
14
- 57: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_mask</span>
15
- 58: <span class="ruby-identifier">to_limit</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
16
- 59: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/integer.rb, line 45</span>
14
+ 45: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_mask</span>
15
+ 46: <span class="ruby-identifier">to_limit</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
16
+ 47: <span class="ruby-keyword kw">end</span></pre>
17
17
  </body>
18
18
  </html>
@@ -5,18 +5,21 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>ensure_min (Integer)</title>
8
+ <title>pack (Integer)</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/integer.rb, line 70</span>
14
- 70: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ensure_min</span> <span class="ruby-identifier">aLimit</span>
15
- 71: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">aLimit</span>
16
- 72: <span class="ruby-identifier">aLimit</span>
17
- 73: <span class="ruby-keyword kw">else</span>
18
- 74: <span class="ruby-keyword kw">self</span>
19
- 75: <span class="ruby-keyword kw">end</span>
20
- 76: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/integer.rb, line 62</span>
14
+ 62: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pack</span> <span class="ruby-identifier">aPackedWidth</span>
15
+ 63: <span class="ruby-identifier">bits</span> = <span class="ruby-identifier">length</span>
16
+ 64: <span class="ruby-identifier">bits</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-comment cmt"># positive integers also have a sign bit (zero)</span>
17
+ 65:
18
+ 66: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">aPackedWidth</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">bits</span>
19
+ 67: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;packed width #{aPackedWidth} must be at least #{bits} for integer #{self}&quot;</span>
20
+ 68: <span class="ruby-keyword kw">end</span>
21
+ 69:
22
+ 70: <span class="ruby-identifier">extend_sign</span>(<span class="ruby-identifier">bits</span>, <span class="ruby-identifier">aPackedWidth</span>)
23
+ 71: <span class="ruby-keyword kw">end</span></pre>
21
24
  </body>
22
25
  </html>
@@ -5,18 +5,27 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>ensure_max (Integer)</title>
8
+ <title>unpack (Integer)</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/integer.rb, line 79</span>
14
- 79: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ensure_max</span> <span class="ruby-identifier">aLimit</span>
15
- 80: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">aLimit</span>
16
- 81: <span class="ruby-identifier">aLimit</span>
17
- 82: <span class="ruby-keyword kw">else</span>
18
- 83: <span class="ruby-keyword kw">self</span>
19
- 84: <span class="ruby-keyword kw">end</span>
20
- 85: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/integer.rb, line 76</span>
14
+ 76: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unpack</span> <span class="ruby-identifier">aPackedWidth</span>
15
+ 77: <span class="ruby-identifier">bits</span> = <span class="ruby-identifier">length</span>
16
+ 78:
17
+ 79: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">aPackedWidth</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">bits</span>
18
+ 80: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;packed width #{aPackedWidth} must be at least #{bits} for integer #{self}&quot;</span>
19
+ 81: <span class="ruby-keyword kw">end</span>
20
+ 82:
21
+ 83: <span class="ruby-identifier">mask</span> = <span class="ruby-identifier">aPackedWidth</span>.<span class="ruby-identifier">to_mask</span>
22
+ 84: <span class="ruby-identifier">result</span> = <span class="ruby-keyword kw">self</span> <span class="ruby-operator">&amp;</span> <span class="ruby-identifier">mask</span>
23
+ 85:
24
+ 86: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">result</span>[<span class="ruby-identifier">aPackedWidth</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
25
+ 87: <span class="ruby-operator">-</span>((<span class="ruby-operator">-</span><span class="ruby-identifier">result</span>) <span class="ruby-operator">&amp;</span> <span class="ruby-identifier">mask</span>)
26
+ 88: <span class="ruby-keyword kw">else</span>
27
+ 89: <span class="ruby-identifier">result</span>
28
+ 90: <span class="ruby-keyword kw">end</span>
29
+ 91: <span class="ruby-keyword kw">end</span></pre>
21
30
  </body>
22
31
  </html>
@@ -5,21 +5,21 @@
5
5
 
6
6
  <html>
7
7
  <head>
8
- <title>pack (Integer)</title>
8
+ <title>extend_sign (Integer)</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/integer.rb, line 89</span>
14
- 89: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pack</span> <span class="ruby-identifier">aPackedWidth</span>
15
- 90: <span class="ruby-identifier">bits</span> = <span class="ruby-identifier">length</span>
16
- 91: <span class="ruby-identifier">bits</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-comment cmt"># positive integers also have a sign bit (zero)</span>
17
- 92:
18
- 93: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">aPackedWidth</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">bits</span>
19
- 94: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;packed width #{aPackedWidth} must be at least #{bits} for integer #{self}&quot;</span>
20
- 95: <span class="ruby-keyword kw">end</span>
21
- 96:
22
- 97: <span class="ruby-identifier">extend_sign</span>(<span class="ruby-identifier">bits</span>, <span class="ruby-identifier">aPackedWidth</span>)
23
- 98: <span class="ruby-keyword kw">end</span></pre>
13
+ <pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/integer.rb, line 97</span>
14
+ 97: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">extend_sign</span> <span class="ruby-identifier">aOrigWidth</span>, <span class="ruby-identifier">aExtWidth</span>
15
+ 98: <span class="ruby-identifier">result</span> = <span class="ruby-keyword kw">self</span>
16
+ 99: <span class="ruby-identifier">maskWidth</span> = <span class="ruby-identifier">aExtWidth</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">aOrigWidth</span>
17
+ 100:
18
+ 101: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">maskWidth</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">result</span>[<span class="ruby-identifier">aOrigWidth</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
19
+ 102: <span class="ruby-identifier">result</span> <span class="ruby-operator">|=</span> (<span class="ruby-identifier">maskWidth</span>.<span class="ruby-identifier">to_mask</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">aOrigWidth</span>)
20
+ 103: <span class="ruby-keyword kw">end</span>
21
+ 104:
22
+ 105: <span class="ruby-identifier">result</span> <span class="ruby-operator">&amp;</span> <span class="ruby-identifier">aExtWidth</span>.<span class="ruby-identifier">to_mask</span>
23
+ 106: <span class="ruby-keyword kw">end</span></pre>
24
24
  </body>
25
25
  </html>