ruby-vpi 16.0.1 → 17.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +19 -19
- data/README +1 -1
- data/Rakefile +35 -32
- data/bin/convert.rb +28 -0
- data/bin/generate/design.rb +16 -0
- data/bin/generate/proto.rb +13 -0
- data/bin/generate/runner.rake +33 -0
- data/bin/generate/spec.rb +45 -0
- data/bin/generate.rb +177 -0
- data/bin/ruby-vpi +56 -0
- data/doc/Rakefile +20 -4
- data/doc/common.css +92 -33
- data/doc/common.inc +13 -0
- data/doc/common.tpl +42 -28
- data/doc/history.doc +11 -11
- data/doc/history.html +769 -248
- data/doc/history.inc +909 -0
- data/doc/history.rb +9 -0
- data/doc/history.yaml +69 -0
- data/doc/intro.inc +170 -178
- data/doc/lib/doc_format.rb +57 -144
- data/doc/lib/doc_proxy.rb +504 -88
- data/doc/lib/erb_content.rb +8 -8
- data/doc/lib/erb_proxy.rb +17 -17
- data/doc/manual.doc +626 -777
- data/doc/manual.html +1541 -1031
- data/doc/memo.doc +38 -36
- data/doc/memo.html +64 -28
- data/doc/readme.doc +4 -31
- data/doc/readme.html +221 -163
- data/doc/rss.erb +1 -1
- data/doc/rss.xml +73 -1761
- data/ext/Rakefile +6 -5
- data/ext/main.c +17 -15
- data/ext/relay.c +4 -7
- data/ext/relay.h +2 -2
- data/ext/swig_vpi.h +2 -2
- data/ext/swig_vpi.i +1 -2
- data/ext/swig_wrap.cin +12 -16
- data/ext/vlog.c +5 -5
- data/ext/vlog.h +2 -2
- data/lib/ruby-vpi/erb.rb +3 -3
- data/lib/ruby-vpi/float.rb +2 -2
- data/lib/ruby-vpi/rcov.rb +5 -7
- data/lib/ruby-vpi/runner.rb +43 -41
- data/lib/ruby-vpi/runner_boot_loader.rb +117 -0
- data/lib/ruby-vpi/runner_proxy.rb +6 -8
- data/lib/ruby-vpi/util.rb +10 -0
- data/lib/ruby-vpi/verilog_parser.rb +28 -56
- data/lib/ruby-vpi/vpi.rb +168 -123
- data/lib/ruby-vpi.rb +22 -143
- 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/{M000024.html → M000026.html} +0 -0
- data/ref/ruby/classes/FileUtils.html +11 -11
- data/ref/ruby/classes/FileUtils.src/{M000025.html → M000027.html} +0 -0
- data/ref/ruby/classes/FileUtils.src/{M000026.html → M000028.html} +0 -0
- data/ref/ruby/classes/Float.html +6 -6
- data/ref/ruby/classes/Float.src/{M000020.html → M000021.html} +0 -0
- data/ref/ruby/classes/Integer.html +65 -65
- data/ref/ruby/classes/Integer.src/M000009.html +12 -5
- data/ref/ruby/classes/Integer.src/M000010.html +5 -5
- data/ref/ruby/classes/Integer.src/M000011.html +5 -5
- data/ref/ruby/classes/Integer.src/M000012.html +5 -5
- data/ref/ruby/classes/Integer.src/M000013.html +5 -5
- data/ref/ruby/classes/Integer.src/M000014.html +18 -0
- data/ref/ruby/classes/Integer.src/M000017.html +12 -18
- data/ref/ruby/classes/Integer.src/M000018.html +18 -12
- data/ref/ruby/classes/Integer.src/M000019.html +12 -17
- data/ref/ruby/classes/Integer.src/M000020.html +30 -0
- data/ref/ruby/classes/RDoc.html +5 -5
- data/ref/ruby/classes/RDoc.src/{M000053.html → M000058.html} +0 -0
- data/ref/ruby/classes/{RubyVpi/Config.html → RubyVPI.html} +20 -6
- data/ref/ruby/classes/String.html +34 -15
- data/ref/ruby/classes/String.src/M000022.html +5 -28
- data/ref/ruby/classes/String.src/M000023.html +5 -5
- data/ref/ruby/classes/String.src/{M000021.html → M000024.html} +0 -0
- data/ref/ruby/classes/String.src/M000025.html +41 -0
- data/ref/ruby/classes/VerilogParser/Module/Port.html +16 -36
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000006.html +10 -5
- data/ref/ruby/classes/VerilogParser/Module/Port.src/{M000004.html → M000007.html} +4 -4
- data/ref/ruby/classes/VerilogParser/Module/Port.src/{M000005.html → M000008.html} +4 -4
- data/ref/ruby/classes/VerilogParser/Module.html +28 -9
- data/ref/ruby/classes/VerilogParser/Module.src/M000005.html +29 -0
- data/ref/ruby/classes/VerilogParser.html +5 -39
- data/ref/ruby/classes/VerilogParser.src/M000004.html +26 -0
- data/ref/ruby/classes/Vpi/Handle.html +179 -77
- data/ref/ruby/classes/Vpi/Handle.src/M000035.html +18 -0
- data/ref/ruby/classes/Vpi/Handle.src/M000036.html +5 -5
- 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 +5 -8
- data/ref/ruby/classes/Vpi/Handle.src/M000041.html +5 -8
- data/ref/ruby/classes/Vpi/Handle.src/M000042.html +5 -9
- data/ref/ruby/classes/Vpi/Handle.src/M000043.html +8 -31
- data/ref/ruby/classes/Vpi/Handle.src/M000044.html +8 -74
- data/ref/ruby/classes/Vpi/Handle.src/M000045.html +9 -17
- data/ref/ruby/classes/Vpi/Handle.src/M000046.html +31 -11
- data/ref/ruby/classes/Vpi/Handle.src/M000047.html +86 -0
- data/ref/ruby/classes/Vpi/Handle.src/M000048.html +17 -18
- data/ref/ruby/classes/Vpi/Handle.src/M000050.html +18 -0
- data/ref/ruby/classes/Vpi/Handle.src/M000051.html +24 -0
- data/ref/ruby/classes/Vpi/Handle.src/M000053.html +31 -0
- data/ref/ruby/classes/Vpi/Handle.src/M000054.html +89 -0
- data/ref/ruby/classes/Vpi/S_vpi_time.html +16 -16
- data/ref/ruby/classes/Vpi/S_vpi_time.src/{M000050.html → M000055.html} +4 -4
- data/ref/ruby/classes/Vpi/S_vpi_time.src/{M000051.html → M000056.html} +5 -5
- data/ref/ruby/classes/Vpi/S_vpi_value.html +15 -15
- data/ref/ruby/classes/Vpi/S_vpi_value.src/{M000035.html → M000032.html} +5 -5
- data/ref/ruby/classes/Vpi/S_vpi_value.src/M000033.html +5 -5
- data/ref/ruby/classes/Vpi/S_vpi_value.src/M000034.html +5 -5
- data/ref/ruby/classes/Vpi.html +6 -42
- data/ref/ruby/classes/Vpi.src/M000029.html +15 -5
- data/ref/ruby/classes/Vpi.src/M000030.html +24 -24
- data/ref/ruby/classes/Vpi.src/M000031.html +6 -8
- data/ref/ruby/created.rid +1 -1
- data/ref/ruby/files/bin/{header_to_ruby_rb.html → convert_rb.html} +5 -5
- data/ref/ruby/files/bin/{generate_test_rb.html → generate_rb.html} +8 -21
- data/ref/ruby/files/lib/ruby-vpi/erb_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/float_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/integer_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/rake_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/rcov_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/rdoc_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/runner_boot_loader_rb.html +197 -0
- data/ref/ruby/files/lib/ruby-vpi/runner_boot_loader_rb.src/M000001.html +17 -0
- data/ref/ruby/files/lib/ruby-vpi/runner_boot_loader_rb.src/M000002.html +18 -0
- data/ref/ruby/files/lib/ruby-vpi/runner_proxy_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/runner_rb.html +6 -19
- data/ref/ruby/files/lib/ruby-vpi/util_rb.html +101 -0
- data/ref/ruby/files/lib/ruby-vpi/verilog_parser_rb.html +8 -1
- data/ref/ruby/files/lib/ruby-vpi/vpi_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi_rb.html +2 -14
- data/ref/ruby/fr_class_index.html +1 -3
- data/ref/ruby/fr_file_index.html +4 -2
- data/ref/ruby/fr_method_index.html +56 -51
- data/ref/ruby/index.html +1 -1
- data/samp/counter/RSpec/Rakefile +1 -0
- data/samp/counter/RSpec/counter_design.rb +15 -0
- data/samp/counter/RSpec/counter_proto.rb +10 -0
- data/samp/counter/RSpec/counter_runner.rake +44 -0
- data/samp/counter/RSpec/counter_spec.rb +39 -0
- data/samp/counter/Rakefile +1 -1
- data/samp/counter/counter.v +7 -7
- data/samp/counter/xUnit/Rakefile +1 -0
- data/samp/counter/xUnit/counter_bench.rb +95 -0
- data/samp/counter/{counter_xunit_bench.v → xUnit/counter_bench.v} +0 -0
- data/samp/counter/xUnit/counter_design.rb +15 -0
- data/samp/counter/xUnit/counter_proto.rb +10 -0
- data/samp/counter/xUnit/counter_runner.rake +44 -0
- data/samp/counter/{counter_xunit_spec.rb → xUnit/counter_spec.rb} +9 -9
- data/samp/pipelined_alu/Rakefile +1 -1
- data/samp/pipelined_alu/TestHw5UnitModel.rb +4 -5
- data/samp/pipelined_alu/hw5_unit.v +55 -85
- data/samp/pipelined_alu/hw5_unit_design.rb +51 -0
- data/samp/pipelined_alu/hw5_unit_proto.rb +4 -0
- data/samp/pipelined_alu/hw5_unit_runner.rake +43 -0
- data/samp/pipelined_alu/hw5_unit_spec.rb +64 -0
- data/samp/register_file/LICENSE +20 -0
- data/samp/register_file/README +4 -0
- data/samp/register_file/Rakefile +1 -0
- data/samp/register_file/register_file.v +18 -0
- data/samp/register_file/register_file_design.rb +11 -0
- data/samp/register_file/register_file_proto.rb +11 -0
- data/samp/register_file/register_file_runner.rake +43 -0
- data/samp/register_file/register_file_spec.rb +58 -0
- metadata +78 -66
- data/bin/generate_test.rb +0 -200
- data/bin/generate_test_tpl/bench.rb +0 -89
- data/bin/generate_test_tpl/bench.v +0 -26
- data/bin/generate_test_tpl/design.rb +0 -11
- data/bin/generate_test_tpl/proto.rb +0 -16
- data/bin/generate_test_tpl/runner.rake +0 -42
- data/bin/generate_test_tpl/spec.rb +0 -37
- data/bin/header_to_ruby.rb +0 -27
- data/ref/ruby/classes/Integer.src/M000008.html +0 -25
- data/ref/ruby/classes/Integer.src/M000016.html +0 -25
- data/ref/ruby/classes/RubyVpi.html +0 -199
- data/ref/ruby/classes/RubyVpi.src/M000027.html +0 -121
- data/ref/ruby/classes/VerilogParser/Module/Parameter.html +0 -160
- data/ref/ruby/classes/VerilogParser/Module/Parameter.src/M000007.html +0 -19
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000003.html +0 -21
- data/ref/ruby/classes/VerilogParser/Module.src/M000002.html +0 -34
- data/ref/ruby/classes/VerilogParser.src/M000001.html +0 -34
- data/ref/ruby/classes/Vpi/Handle.src/M000049.html +0 -69
- data/ref/ruby/classes/Vpi.src/M000028.html +0 -28
- data/ref/ruby/classes/Vpi.src/M000032.html +0 -22
- data/samp/counter/counter_rspec_bench.rb +0 -86
- data/samp/counter/counter_rspec_bench.v +0 -9
- data/samp/counter/counter_rspec_design.rb +0 -8
- data/samp/counter/counter_rspec_proto.rb +0 -13
- data/samp/counter/counter_rspec_runner.rake +0 -52
- data/samp/counter/counter_rspec_spec.rb +0 -39
- data/samp/counter/counter_xunit_bench.rb +0 -86
- data/samp/counter/counter_xunit_design.rb +0 -8
- data/samp/counter/counter_xunit_proto.rb +0 -13
- data/samp/counter/counter_xunit_runner.rake +0 -52
- data/samp/pipelined_alu/hw5_unit_test_bench.rb +0 -86
- data/samp/pipelined_alu/hw5_unit_test_bench.v +0 -14
- data/samp/pipelined_alu/hw5_unit_test_design.rb +0 -61
- data/samp/pipelined_alu/hw5_unit_test_proto.rb +0 -7
- data/samp/pipelined_alu/hw5_unit_test_runner.rake +0 -52
- data/samp/pipelined_alu/hw5_unit_test_spec.rb +0 -68
data/ref/c/vlog_8c.html
CHANGED
@@ -154,7 +154,7 @@ Registers a callback at start of simulation to vlog_relay_main();.
|
|
154
154
|
|
155
155
|
</div>
|
156
156
|
</div><p>
|
157
|
-
<hr size="1"><address style="align: right;"><small>Generated on Sun
|
157
|
+
<hr size="1"><address style="align: right;"><small>Generated on Sun Jul 22 17:47:50 2007 for Ruby-VPI by
|
158
158
|
<a href="http://www.doxygen.org/index.html">
|
159
159
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address>
|
160
160
|
</body>
|
data/ref/c/vlog_8h.html
CHANGED
@@ -77,7 +77,7 @@ Returns the data corresponding to the callback that caused the relay from Verilo
|
|
77
77
|
|
78
78
|
</div>
|
79
79
|
</div><p>
|
80
|
-
<hr size="1"><address style="align: right;"><small>Generated on Sun
|
80
|
+
<hr size="1"><address style="align: right;"><small>Generated on Sun Jul 22 17:47:50 2007 for Ruby-VPI by
|
81
81
|
<a href="http://www.doxygen.org/index.html">
|
82
82
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address>
|
83
83
|
</body>
|
data/ref/c/vpi__user_8h.html
CHANGED
@@ -8732,7 +8732,7 @@ alias 1364-1995 system function subtypes to 1364-2001 function subtypes
|
|
8732
8732
|
|
8733
8733
|
</div>
|
8734
8734
|
</div><p>
|
8735
|
-
<hr size="1"><address style="align: right;"><small>Generated on Sun
|
8735
|
+
<hr size="1"><address style="align: right;"><small>Generated on Sun Jul 22 17:47:51 2007 for Ruby-VPI by
|
8736
8736
|
<a href="http://www.doxygen.org/index.html">
|
8737
8737
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address>
|
8738
8738
|
</body>
|
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="#M000026">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-M000026" class="method-detail">
|
133
|
+
<a name="M000026"></a>
|
134
134
|
|
135
135
|
<div class="method-heading">
|
136
|
-
<a href="ERB.src/
|
137
|
-
onclick="popupCode('ERB.src/
|
136
|
+
<a href="ERB.src/M000026.html" target="Code" class="method-signature"
|
137
|
+
onclick="popupCode('ERB.src/M000026.html');return false;">
|
138
138
|
<span class="method-name">new</span><span class="method-args">(aInput, *aArgs)</span>
|
139
139
|
</a>
|
140
140
|
</div>
|
File without changes
|
@@ -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="#M000028">collect_args</a>
|
84
|
+
<a href="#M000027">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-M000028" class="method-detail">
|
120
|
+
<a name="M000028"></a>
|
121
121
|
|
122
122
|
<div class="method-heading">
|
123
|
-
<a href="FileUtils.src/
|
124
|
-
onclick="popupCode('FileUtils.src/
|
123
|
+
<a href="FileUtils.src/M000028.html" target="Code" class="method-signature"
|
124
|
+
onclick="popupCode('FileUtils.src/M000028.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,19 +133,19 @@ 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-M000027" class="method-detail">
|
137
|
+
<a name="M000027"></a>
|
138
138
|
|
139
139
|
<div class="method-heading">
|
140
|
-
<a href="FileUtils.src/
|
141
|
-
onclick="popupCode('FileUtils.src/
|
140
|
+
<a href="FileUtils.src/M000027.html" target="Code" class="method-signature"
|
141
|
+
onclick="popupCode('FileUtils.src/M000027.html');return false;">
|
142
142
|
<span class="method-name">sh</span><span class="method-args">(*aArgs, &aBlock)</span>
|
143
143
|
</a>
|
144
144
|
</div>
|
145
145
|
|
146
146
|
<div class="method-description">
|
147
147
|
<p>
|
148
|
-
An improved <a href="FileUtils.html#
|
148
|
+
An improved <a href="FileUtils.html#M000027">sh</a>() that also accepts
|
149
149
|
arrays as arguments.
|
150
150
|
</p>
|
151
151
|
</div>
|
File without changes
|
File without changes
|
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="#M000021">mantissa</a>
|
90
90
|
</div>
|
91
91
|
</div>
|
92
92
|
|
@@ -108,19 +108,19 @@
|
|
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-M000021" class="method-detail">
|
112
|
+
<a name="M000021"></a>
|
113
113
|
|
114
114
|
<div class="method-heading">
|
115
|
-
<a href="Float.src/
|
116
|
-
onclick="popupCode('Float.src/
|
115
|
+
<a href="Float.src/M000021.html" target="Code" class="method-signature"
|
116
|
+
onclick="popupCode('Float.src/M000021.html');return false;">
|
117
117
|
<span class="method-name">mantissa</span><span class="method-args">()</span>
|
118
118
|
</a>
|
119
119
|
</div>
|
120
120
|
|
121
121
|
<div class="method-description">
|
122
122
|
<p>
|
123
|
-
Returns the <a href="Float.html#
|
123
|
+
Returns the <a href="Float.html#M000021">mantissa</a> of this floating
|
124
124
|
point number
|
125
125
|
</p>
|
126
126
|
</div>
|
File without changes
|
@@ -94,18 +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="#
|
99
|
-
<a href="#
|
100
|
-
<a href="#
|
101
|
-
<a href="#
|
102
|
-
<a href="#
|
103
|
-
<a href="#
|
104
|
-
<a href="#
|
105
|
-
<a href="#
|
106
|
-
<a href="#
|
107
|
-
<a href="#
|
108
|
-
<a href="#
|
97
|
+
<a href="#M000019">extend_sign</a>
|
98
|
+
<a href="#M000010">length</a>
|
99
|
+
<a href="#M000011">limit</a>
|
100
|
+
<a href="#M000009">log2</a>
|
101
|
+
<a href="#M000013">mask</a>
|
102
|
+
<a href="#M000015">max</a>
|
103
|
+
<a href="#M000017">pack</a>
|
104
|
+
<a href="#M000020">split</a>
|
105
|
+
<a href="#M000012">to_limit</a>
|
106
|
+
<a href="#M000014">to_mask</a>
|
107
|
+
<a href="#M000016">to_max</a>
|
108
|
+
<a href="#M000018">unpack</a>
|
109
109
|
</div>
|
110
110
|
</div>
|
111
111
|
|
@@ -127,12 +127,12 @@ Instead, they return the new value as their result.
|
|
127
127
|
<div id="methods">
|
128
128
|
<h3 class="section-bar">Public Instance methods</h3>
|
129
129
|
|
130
|
-
<div id="method-
|
131
|
-
<a name="
|
130
|
+
<div id="method-M000019" class="method-detail">
|
131
|
+
<a name="M000019"></a>
|
132
132
|
|
133
133
|
<div class="method-heading">
|
134
|
-
<a href="Integer.src/
|
135
|
-
onclick="popupCode('Integer.src/
|
134
|
+
<a href="Integer.src/M000019.html" target="Code" class="method-signature"
|
135
|
+
onclick="popupCode('Integer.src/M000019.html');return false;">
|
136
136
|
<span class="method-name">extend_sign</span><span class="method-args">(aOrigWidth, aExtWidth)</span>
|
137
137
|
</a>
|
138
138
|
</div>
|
@@ -146,12 +146,12 @@ bits).
|
|
146
146
|
</div>
|
147
147
|
</div>
|
148
148
|
|
149
|
-
<div id="method-
|
150
|
-
<a name="
|
149
|
+
<div id="method-M000010" class="method-detail">
|
150
|
+
<a name="M000010"></a>
|
151
151
|
|
152
152
|
<div class="method-heading">
|
153
|
-
<a href="Integer.src/
|
154
|
-
onclick="popupCode('Integer.src/
|
153
|
+
<a href="Integer.src/M000010.html" target="Code" class="method-signature"
|
154
|
+
onclick="popupCode('Integer.src/M000010.html');return false;">
|
155
155
|
<span class="method-name">length</span><span class="method-args">()</span>
|
156
156
|
</a>
|
157
157
|
</div>
|
@@ -163,12 +163,12 @@ Returns the minimum number of bits necessary to represent this integer.
|
|
163
163
|
</div>
|
164
164
|
</div>
|
165
165
|
|
166
|
-
<div id="method-
|
167
|
-
<a name="
|
166
|
+
<div id="method-M000011" class="method-detail">
|
167
|
+
<a name="M000011"></a>
|
168
168
|
|
169
169
|
<div class="method-heading">
|
170
|
-
<a href="Integer.src/
|
171
|
-
onclick="popupCode('Integer.src/
|
170
|
+
<a href="Integer.src/M000011.html" target="Code" class="method-signature"
|
171
|
+
onclick="popupCode('Integer.src/M000011.html');return false;">
|
172
172
|
<span class="method-name">limit</span><span class="method-args">()</span>
|
173
173
|
</a>
|
174
174
|
</div>
|
@@ -176,18 +176,18 @@ Returns the minimum number of bits necessary to represent this integer.
|
|
176
176
|
<div class="method-description">
|
177
177
|
<p>
|
178
178
|
Returns the lowest upper-bound of this integer. This integer cannot reach
|
179
|
-
the <a href="Integer.html#
|
179
|
+
the <a href="Integer.html#M000011">limit</a> without occupying more bits in
|
180
180
|
its binary representation.
|
181
181
|
</p>
|
182
182
|
</div>
|
183
183
|
</div>
|
184
184
|
|
185
|
-
<div id="method-
|
186
|
-
<a name="
|
185
|
+
<div id="method-M000009" class="method-detail">
|
186
|
+
<a name="M000009"></a>
|
187
187
|
|
188
188
|
<div class="method-heading">
|
189
|
-
<a href="Integer.src/
|
190
|
-
onclick="popupCode('Integer.src/
|
189
|
+
<a href="Integer.src/M000009.html" target="Code" class="method-signature"
|
190
|
+
onclick="popupCode('Integer.src/M000009.html');return false;">
|
191
191
|
<span class="method-name">log2</span><span class="method-args">()</span>
|
192
192
|
</a>
|
193
193
|
</div>
|
@@ -199,26 +199,26 @@ Returns the ceiling of the logarithm (base 2) of this positive integer.
|
|
199
199
|
</div>
|
200
200
|
</div>
|
201
201
|
|
202
|
-
<div id="method-
|
203
|
-
<a name="
|
202
|
+
<div id="method-M000013" class="method-detail">
|
203
|
+
<a name="M000013"></a>
|
204
204
|
|
205
205
|
<div class="method-heading">
|
206
|
-
<a href="Integer.src/
|
207
|
-
onclick="popupCode('Integer.src/
|
206
|
+
<a href="Integer.src/M000013.html" target="Code" class="method-signature"
|
207
|
+
onclick="popupCode('Integer.src/M000013.html');return false;">
|
208
208
|
<span class="method-name">mask</span><span class="method-args">()</span>
|
209
209
|
</a>
|
210
210
|
</div>
|
211
211
|
|
212
212
|
<div class="method-description">
|
213
213
|
<p>
|
214
|
-
Returns a bit-<a href="Integer.html#
|
214
|
+
Returns a bit-<a href="Integer.html#M000013">mask</a> capable of masking
|
215
215
|
this integer.
|
216
216
|
</p>
|
217
217
|
</div>
|
218
218
|
</div>
|
219
219
|
|
220
|
-
<div id="method-
|
221
|
-
<a name="
|
220
|
+
<div id="method-M000015" class="method-detail">
|
221
|
+
<a name="M000015"></a>
|
222
222
|
|
223
223
|
<div class="method-heading">
|
224
224
|
<span class="method-name">max</span><span class="method-args">()</span>
|
@@ -226,37 +226,37 @@ this integer.
|
|
226
226
|
|
227
227
|
<div class="method-description">
|
228
228
|
<p>
|
229
|
-
Alias for <a href="Integer.html#
|
229
|
+
Alias for <a href="Integer.html#M000013">mask</a>
|
230
230
|
</p>
|
231
231
|
</div>
|
232
232
|
</div>
|
233
233
|
|
234
|
-
<div id="method-
|
235
|
-
<a name="
|
234
|
+
<div id="method-M000017" class="method-detail">
|
235
|
+
<a name="M000017"></a>
|
236
236
|
|
237
237
|
<div class="method-heading">
|
238
|
-
<a href="Integer.src/
|
239
|
-
onclick="popupCode('Integer.src/
|
238
|
+
<a href="Integer.src/M000017.html" target="Code" class="method-signature"
|
239
|
+
onclick="popupCode('Integer.src/M000017.html');return false;">
|
240
240
|
<span class="method-name">pack</span><span class="method-args">(aPackedWidth)</span>
|
241
241
|
</a>
|
242
242
|
</div>
|
243
243
|
|
244
244
|
<div class="method-description">
|
245
245
|
<p>
|
246
|
-
Transforms this infinite-<a href="Integer.html#
|
247
|
-
integer into a fixed-<a href="Integer.html#
|
246
|
+
Transforms this infinite-<a href="Integer.html#M000010">length</a> Ruby
|
247
|
+
integer into a fixed-<a href="Integer.html#M000010">length</a> integer
|
248
248
|
(represented in two‘s complement form) that has the given width
|
249
249
|
(number of bits).
|
250
250
|
</p>
|
251
251
|
</div>
|
252
252
|
</div>
|
253
253
|
|
254
|
-
<div id="method-
|
255
|
-
<a name="
|
254
|
+
<div id="method-M000020" class="method-detail">
|
255
|
+
<a name="M000020"></a>
|
256
256
|
|
257
257
|
<div class="method-heading">
|
258
|
-
<a href="Integer.src/
|
259
|
-
onclick="popupCode('Integer.src/
|
258
|
+
<a href="Integer.src/M000020.html" target="Code" class="method-signature"
|
259
|
+
onclick="popupCode('Integer.src/M000020.html');return false;">
|
260
260
|
<span class="method-name">split</span><span class="method-args">(aWidth = 8)</span>
|
261
261
|
</a>
|
262
262
|
</div>
|
@@ -281,12 +281,12 @@ binary numbers; for example:
|
|
281
281
|
</div>
|
282
282
|
</div>
|
283
283
|
|
284
|
-
<div id="method-
|
285
|
-
<a name="
|
284
|
+
<div id="method-M000012" class="method-detail">
|
285
|
+
<a name="M000012"></a>
|
286
286
|
|
287
287
|
<div class="method-heading">
|
288
|
-
<a href="Integer.src/
|
289
|
-
onclick="popupCode('Integer.src/
|
288
|
+
<a href="Integer.src/M000012.html" target="Code" class="method-signature"
|
289
|
+
onclick="popupCode('Integer.src/M000012.html');return false;">
|
290
290
|
<span class="method-name">to_limit</span><span class="method-args">()</span>
|
291
291
|
</a>
|
292
292
|
</div>
|
@@ -299,26 +299,26 @@ bits.
|
|
299
299
|
</div>
|
300
300
|
</div>
|
301
301
|
|
302
|
-
<div id="method-
|
303
|
-
<a name="
|
302
|
+
<div id="method-M000014" class="method-detail">
|
303
|
+
<a name="M000014"></a>
|
304
304
|
|
305
305
|
<div class="method-heading">
|
306
|
-
<a href="Integer.src/
|
307
|
-
onclick="popupCode('Integer.src/
|
306
|
+
<a href="Integer.src/M000014.html" target="Code" class="method-signature"
|
307
|
+
onclick="popupCode('Integer.src/M000014.html');return false;">
|
308
308
|
<span class="method-name">to_mask</span><span class="method-args">()</span>
|
309
309
|
</a>
|
310
310
|
</div>
|
311
311
|
|
312
312
|
<div class="method-description">
|
313
313
|
<p>
|
314
|
-
Returns a bit-<a href="Integer.html#
|
314
|
+
Returns a bit-<a href="Integer.html#M000013">mask</a> capable of masking an
|
315
315
|
integer with <b>this</b> number of bits.
|
316
316
|
</p>
|
317
317
|
</div>
|
318
318
|
</div>
|
319
319
|
|
320
|
-
<div id="method-
|
321
|
-
<a name="
|
320
|
+
<div id="method-M000016" class="method-detail">
|
321
|
+
<a name="M000016"></a>
|
322
322
|
|
323
323
|
<div class="method-heading">
|
324
324
|
<span class="method-name">to_max</span><span class="method-args">()</span>
|
@@ -326,26 +326,26 @@ integer with <b>this</b> number of bits.
|
|
326
326
|
|
327
327
|
<div class="method-description">
|
328
328
|
<p>
|
329
|
-
Alias for <a href="Integer.html#
|
329
|
+
Alias for <a href="Integer.html#M000014">to_mask</a>
|
330
330
|
</p>
|
331
331
|
</div>
|
332
332
|
</div>
|
333
333
|
|
334
|
-
<div id="method-
|
335
|
-
<a name="
|
334
|
+
<div id="method-M000018" class="method-detail">
|
335
|
+
<a name="M000018"></a>
|
336
336
|
|
337
337
|
<div class="method-heading">
|
338
|
-
<a href="Integer.src/
|
339
|
-
onclick="popupCode('Integer.src/
|
338
|
+
<a href="Integer.src/M000018.html" target="Code" class="method-signature"
|
339
|
+
onclick="popupCode('Integer.src/M000018.html');return false;">
|
340
340
|
<span class="method-name">unpack</span><span class="method-args">(aPackedWidth)</span>
|
341
341
|
</a>
|
342
342
|
</div>
|
343
343
|
|
344
344
|
<div class="method-description">
|
345
345
|
<p>
|
346
|
-
Transforms this fixed-<a href="Integer.html#
|
346
|
+
Transforms this fixed-<a href="Integer.html#M000010">length</a> integer
|
347
347
|
(represented in two‘s complement form) that has the given width
|
348
|
-
(number of bits) into an infinite-<a href="Integer.html#
|
348
|
+
(number of bits) into an infinite-<a href="Integer.html#M000010">length</a>
|
349
349
|
Ruby integer.
|
350
350
|
</p>
|
351
351
|
</div>
|
@@ -5,14 +5,21 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>log2 (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
|
-
|
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>
|
17
24
|
</body>
|
18
25
|
</html>
|
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>length (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
|
-
|
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>
|
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>limit (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
|
-
|
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>
|
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>to_limit (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
|
-
|
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>
|
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>mask (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
|
-
|
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>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>to_mask (Integer)</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/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
|
+
</body>
|
18
|
+
</html>
|
@@ -5,27 +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
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
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>
|
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>
|
30
24
|
</body>
|
31
25
|
</html>
|