ruby-vpi 15.0.2 → 16.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +23 -340
- data/Rakefile +169 -192
- data/bin/generate_test.rb +26 -25
- data/bin/generate_test_tpl/runner.rake +4 -10
- data/bin/header_to_ruby.rb +3 -20
- data/doc/README +11 -0
- data/doc/Rakefile +8 -21
- data/doc/common.css +44 -10
- data/doc/common.tpl +5 -10
- data/doc/history.doc +8 -7
- data/doc/history.html +228 -560
- data/doc/history.rb +7 -11
- data/doc/{history.yml → history.yaml} +325 -128
- data/doc/images/{feed-icon.png → feed-icon-28x28.png} +0 -0
- data/doc/images/ruby/LICENSE +15 -0
- data/doc/images/ruby/logo-reflection.png +0 -0
- data/doc/images/ruby/logo-reflection.xcf +0 -0
- data/doc/images/ruby/logo.png +0 -0
- data/doc/images/{LICENSE → tango/LICENSE} +0 -0
- data/doc/images/{caution.png → tango/caution.png} +0 -0
- data/doc/images/{caution.svg → tango/caution.svg} +0 -0
- data/doc/images/{home.png → tango/home.png} +0 -0
- data/doc/images/{home.svg → tango/home.svg} +0 -0
- data/doc/images/{important.png → tango/important.png} +0 -0
- data/doc/images/{important.svg → tango/important.svg} +0 -0
- data/doc/images/{next.png → tango/next.png} +0 -0
- data/doc/images/{next.svg → tango/next.svg} +0 -0
- data/doc/images/{note.png → tango/note.png} +0 -0
- data/doc/images/{note.svg → tango/note.svg} +0 -0
- data/doc/images/{prev.png → tango/prev.png} +0 -0
- data/doc/images/{prev.svg → tango/prev.svg} +0 -0
- data/doc/images/{tip.png → tango/tip.png} +0 -0
- data/doc/images/{tip.svg → tango/tip.svg} +0 -0
- data/doc/images/{up.png → tango/up.png} +0 -0
- data/doc/images/{up.svg → tango/up.svg} +0 -0
- data/doc/images/{warning.png → tango/warning.png} +0 -0
- data/doc/images/{warning.svg → tango/warning.svg} +0 -0
- data/doc/intro.inc +105 -36
- data/doc/lib/doc_format.rb +151 -29
- data/doc/lib/doc_proxy.rb +28 -69
- data/doc/lib/erb_content.rb +10 -22
- data/doc/lib/erb_proxy.rb +13 -24
- data/doc/manual.doc +16 -60
- data/doc/manual.html +257 -340
- data/doc/memo.doc +2 -0
- data/doc/memo.html +11 -11
- data/doc/readme.doc +36 -2
- data/doc/readme.html +214 -51
- data/doc/rss.erb +3 -3
- data/doc/rss.xml +217 -269
- data/ext/Rakefile +7 -22
- data/ext/common.h +10 -21
- data/ext/extconf.rb +5 -0
- data/ext/main.c +2 -18
- data/ext/main.h +1 -16
- data/ext/relay.c +3 -17
- data/ext/relay.h +3 -17
- data/ext/verilog.h +6 -18
- data/ext/vlog.c +3 -21
- data/ext/vlog.h +3 -17
- data/lib/ruby-vpi/erb.rb +7 -20
- data/lib/ruby-vpi/float.rb +6 -20
- data/lib/ruby-vpi/integer.rb +27 -47
- data/lib/ruby-vpi/rake.rb +4 -19
- data/lib/ruby-vpi/rcov.rb +6 -21
- data/lib/ruby-vpi/rdoc.rb +3 -21
- data/lib/ruby-vpi/runner.rb +28 -29
- data/lib/ruby-vpi/runner_proxy.rb +5 -21
- data/lib/ruby-vpi/verilog_parser.rb +5 -20
- data/lib/ruby-vpi/vpi.rb +420 -376
- data/lib/ruby-vpi.rb +26 -32
- data/ref/c/annotated.html +1 -1
- data/ref/c/common_8h.html +1 -1
- data/ref/c/files.html +1 -1
- data/ref/c/functions.html +1 -1
- data/ref/c/functions_vars.html +1 -1
- data/ref/c/globals.html +1 -1
- data/ref/c/globals_0x63.html +1 -1
- data/ref/c/globals_0x65.html +1 -1
- data/ref/c/globals_0x66.html +1 -1
- data/ref/c/globals_0x6d.html +1 -1
- data/ref/c/globals_0x70.html +1 -1
- data/ref/c/globals_0x72.html +1 -1
- data/ref/c/globals_0x73.html +1 -1
- data/ref/c/globals_0x74.html +1 -1
- data/ref/c/globals_0x76.html +1 -1
- data/ref/c/globals_0x78.html +1 -1
- data/ref/c/globals_defs.html +1 -1
- data/ref/c/globals_defs_0x65.html +1 -1
- data/ref/c/globals_defs_0x70.html +1 -1
- data/ref/c/globals_defs_0x76.html +1 -1
- data/ref/c/globals_defs_0x78.html +1 -1
- data/ref/c/globals_enum.html +1 -1
- data/ref/c/globals_eval.html +1 -1
- data/ref/c/globals_func.html +1 -1
- data/ref/c/globals_type.html +1 -1
- data/ref/c/globals_vars.html +1 -1
- data/ref/c/index.html +1 -1
- data/ref/c/main_8c.html +1 -1
- data/ref/c/main_8h.html +1 -1
- data/ref/c/relay_8c.html +1 -1
- data/ref/c/relay_8h.html +1 -1
- data/ref/c/structt__cb__data.html +1 -1
- data/ref/c/structt__vpi__delay.html +1 -1
- data/ref/c/structt__vpi__error__info.html +1 -1
- data/ref/c/structt__vpi__strengthval.html +1 -1
- data/ref/c/structt__vpi__systf__data.html +1 -1
- data/ref/c/structt__vpi__time.html +1 -1
- data/ref/c/structt__vpi__value.html +1 -1
- data/ref/c/structt__vpi__vecval.html +1 -1
- data/ref/c/structt__vpi__vlog__info.html +1 -1
- data/ref/c/verilog_8h.html +1 -1
- data/ref/c/vlog_8c.html +1 -1
- data/ref/c/vlog_8h.html +1 -1
- data/ref/c/vpi__user_8h.html +1 -1
- data/ref/ruby/classes/ERB.html +5 -5
- data/ref/ruby/classes/ERB.src/{M000026.html → M000024.html} +15 -15
- data/ref/ruby/classes/FileUtils.html +10 -10
- data/ref/ruby/classes/FileUtils.src/{M000027.html → M000025.html} +4 -4
- data/ref/ruby/classes/FileUtils.src/{M000028.html → M000026.html} +4 -4
- data/ref/ruby/classes/Float.html +5 -5
- data/ref/ruby/classes/Float.src/{M000022.html → M000020.html} +5 -5
- data/ref/ruby/classes/Integer.html +20 -56
- data/ref/ruby/classes/Integer.src/M000008.html +11 -11
- data/ref/ruby/classes/Integer.src/M000009.html +4 -4
- data/ref/ruby/classes/Integer.src/M000010.html +4 -4
- data/ref/ruby/classes/Integer.src/M000011.html +4 -4
- data/ref/ruby/classes/Integer.src/M000012.html +4 -4
- data/ref/ruby/classes/Integer.src/M000013.html +4 -4
- data/ref/ruby/classes/Integer.src/M000016.html +12 -9
- data/ref/ruby/classes/Integer.src/M000017.html +18 -9
- data/ref/ruby/classes/Integer.src/M000018.html +12 -12
- data/ref/ruby/classes/Integer.src/M000019.html +17 -18
- data/ref/ruby/classes/RDoc.src/M000053.html +25 -25
- data/ref/ruby/classes/RubyVpi/Config.html +3 -3
- data/ref/ruby/classes/RubyVpi.html +11 -5
- data/ref/ruby/classes/RubyVpi.src/{M000029.html → M000027.html} +103 -101
- data/ref/ruby/classes/String.html +21 -15
- data/ref/ruby/classes/String.src/M000021.html +36 -0
- data/ref/ruby/classes/String.src/{M000024.html → M000022.html} +24 -24
- data/ref/ruby/classes/String.src/M000023.html +5 -23
- data/ref/ruby/classes/VerilogParser/Module/Parameter.src/M000007.html +5 -5
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000003.html +7 -7
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000004.html +4 -4
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000005.html +4 -4
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000006.html +4 -4
- data/ref/ruby/classes/VerilogParser/Module.src/M000002.html +20 -20
- data/ref/ruby/classes/VerilogParser.html +6 -0
- data/ref/ruby/classes/VerilogParser.src/M000001.html +20 -20
- data/ref/ruby/classes/Vpi/Handle.html +89 -88
- data/ref/ruby/classes/Vpi/Handle.src/M000036.html +18 -0
- data/ref/ruby/classes/Vpi/Handle.src/M000037.html +5 -5
- data/ref/ruby/classes/Vpi/Handle.src/M000038.html +5 -5
- data/ref/ruby/classes/Vpi/Handle.src/M000039.html +5 -5
- data/ref/ruby/classes/Vpi/Handle.src/M000040.html +8 -5
- data/ref/ruby/classes/Vpi/Handle.src/M000041.html +8 -8
- data/ref/ruby/classes/Vpi/Handle.src/M000042.html +7 -6
- data/ref/ruby/classes/Vpi/Handle.src/M000043.html +31 -9
- data/ref/ruby/classes/Vpi/Handle.src/M000044.html +74 -31
- data/ref/ruby/classes/Vpi/Handle.src/M000045.html +17 -74
- data/ref/ruby/classes/Vpi/Handle.src/M000046.html +11 -17
- data/ref/ruby/classes/Vpi/Handle.src/M000048.html +31 -0
- data/ref/ruby/classes/Vpi/Handle.src/M000049.html +53 -52
- data/ref/ruby/classes/Vpi/S_vpi_time.src/M000050.html +4 -4
- data/ref/ruby/classes/Vpi/S_vpi_time.src/M000051.html +5 -5
- data/ref/ruby/classes/Vpi/S_vpi_value.html +15 -15
- data/ref/ruby/classes/Vpi/S_vpi_value.src/{M000036.html → M000033.html} +5 -5
- data/ref/ruby/classes/Vpi/S_vpi_value.src/M000034.html +5 -5
- data/ref/ruby/classes/Vpi/S_vpi_value.src/M000035.html +5 -5
- data/ref/ruby/classes/Vpi.html +48 -19
- data/ref/ruby/classes/Vpi.src/M000028.html +28 -0
- data/ref/ruby/classes/Vpi.src/M000029.html +18 -0
- data/ref/ruby/classes/Vpi.src/M000030.html +25 -15
- data/ref/ruby/classes/Vpi.src/M000031.html +9 -5
- data/ref/ruby/classes/Vpi.src/M000032.html +9 -25
- data/ref/ruby/created.rid +1 -1
- data/ref/ruby/files/bin/generate_test_rb.html +2 -1
- data/ref/ruby/files/bin/header_to_ruby_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/erb_rb.html +7 -1
- data/ref/ruby/files/lib/ruby-vpi/float_rb.html +7 -1
- data/ref/ruby/files/lib/ruby-vpi/integer_rb.html +7 -1
- data/ref/ruby/files/lib/ruby-vpi/rake_rb.html +7 -1
- data/ref/ruby/files/lib/ruby-vpi/rcov_rb.html +7 -1
- data/ref/ruby/files/lib/ruby-vpi/rdoc_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/runner_proxy_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/runner_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/verilog_parser_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/vpi_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi_rb.html +7 -1
- data/ref/ruby/fr_method_index.html +34 -34
- data/samp/counter/counter_rspec_runner.rake +4 -0
- data/samp/counter/counter_xunit_runner.rake +4 -0
- data/samp/pipelined_alu/Hw5UnitModel.rb +3 -19
- data/samp/pipelined_alu/README +38 -13
- data/samp/pipelined_alu/TestHw5UnitModel.rb +9 -20
- data/samp/pipelined_alu/hw5_unit.v +1 -16
- data/samp/pipelined_alu/hw5_unit_test_runner.rake +4 -0
- data/samp/pipelined_alu/hw5_unit_test_spec.rb +3 -20
- data/samp/pipelined_alu/int_gen.rb +6 -20
- metadata +47 -43
- data/doc/LICENSE +0 -397
- data/doc/images/feed-icon.LICENSE +0 -2
- data/doc/images/feed-icon.svg +0 -18
- data/ref/ruby/classes/Integer.src/M000020.html +0 -25
- data/ref/ruby/classes/Integer.src/M000021.html +0 -30
- data/ref/ruby/classes/String.src/M000025.html +0 -18
- data/ref/ruby/classes/Vpi/Handle.src/M000047.html +0 -24
- data/ref/ruby/classes/Vpi.src/M000033.html +0 -22
data/ref/ruby/classes/ERB.html
CHANGED
|
@@ -94,7 +94,7 @@ whereas <% … %> 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="#
|
|
97
|
+
<a href="#M000024">new</a>
|
|
98
98
|
</div>
|
|
99
99
|
</div>
|
|
100
100
|
|
|
@@ -129,12 +129,12 @@ whereas <% … %> 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-
|
|
133
|
-
<a name="
|
|
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/
|
|
137
|
-
onclick="popupCode('ERB.src/
|
|
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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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 <%= ... %> 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{<%=.*?%>}</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"><<</span> <span class="ruby-identifier">$&</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">'>'</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="#
|
|
84
|
-
<a href="#
|
|
83
|
+
<a href="#M000026">collect_args</a>
|
|
84
|
+
<a href="#M000025">sh</a>
|
|
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-
|
|
120
|
-
<a name="
|
|
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/
|
|
124
|
-
onclick="popupCode('FileUtils.src/
|
|
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-
|
|
137
|
-
<a name="
|
|
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/
|
|
141
|
-
onclick="popupCode('FileUtils.src/
|
|
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, &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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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">&</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">&</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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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>
|
data/ref/ruby/classes/Float.html
CHANGED
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
<h3 class="section-bar">Methods</h3>
|
|
87
87
|
|
|
88
88
|
<div class="name-list">
|
|
89
|
-
<a href="#
|
|
89
|
+
<a href="#M000020">mantissa</a>
|
|
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-
|
|
112
|
-
<a name="
|
|
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/
|
|
116
|
-
onclick="popupCode('Float.src/
|
|
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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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="#
|
|
98
|
-
<a href="#M000016">ensure_min</a>
|
|
99
|
-
<a href="#M000020">extend_sign</a>
|
|
97
|
+
<a href="#M000018">extend_sign</a>
|
|
100
98
|
<a href="#M000009">length</a>
|
|
101
99
|
<a href="#M000010">limit</a>
|
|
102
100
|
<a href="#M000008">log2</a>
|
|
103
101
|
<a href="#M000012">mask</a>
|
|
104
102
|
<a href="#M000014">max</a>
|
|
105
|
-
<a href="#
|
|
106
|
-
<a href="#
|
|
103
|
+
<a href="#M000016">pack</a>
|
|
104
|
+
<a href="#M000019">split</a>
|
|
107
105
|
<a href="#M000011">to_limit</a>
|
|
108
106
|
<a href="#M000013">to_mask</a>
|
|
109
107
|
<a href="#M000015">to_max</a>
|
|
110
|
-
<a href="#
|
|
108
|
+
<a href="#M000017">unpack</a>
|
|
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-
|
|
133
|
-
<a name="
|
|
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/
|
|
171
|
-
onclick="popupCode('Integer.src/
|
|
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-
|
|
269
|
-
<a name="
|
|
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/
|
|
273
|
-
onclick="popupCode('Integer.src/
|
|
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-
|
|
288
|
-
<a name="
|
|
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/
|
|
292
|
-
onclick="popupCode('Integer.src/
|
|
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-
|
|
368
|
-
<a name="
|
|
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/
|
|
372
|
-
onclick="popupCode('Integer.src/
|
|
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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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">"integer must be positive"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span> <span class="ruby-operator"><</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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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>
|
|
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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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">></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">>=</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">"packed width #{aPackedWidth} must be at least #{bits} for integer #{self}"</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>
|
|
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
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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">>=</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">"packed width #{aPackedWidth} must be at least #{bits} for integer #{self}"</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">&</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">&</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>
|
|
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>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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">></span> <span class="ruby-value">0</span> <span class="ruby-operator">&&</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"><<</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">&</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>
|