ruby-vpi 18.0.2 → 19.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +15 -19
- data/bin/generate/proto.rb +15 -10
- data/bin/ruby-vpi +2 -0
- data/doc/README +3 -5
- data/doc/Rakefile +3 -3
- data/doc/common.css +24 -136
- data/doc/common.tpl +48 -37
- data/doc/figures/figures.dia +19 -19
- data/doc/figures/ruby_relay.png +0 -0
- data/doc/history.html +252 -67
- data/doc/history.inc +98 -1
- data/doc/history.yaml +105 -0
- data/doc/intro.inc +43 -32
- data/doc/lib/doc_format.rb +19 -13
- data/doc/lib/doc_proxy.rb +7 -7
- data/doc/manual.doc +156 -117
- data/doc/manual.html +601 -560
- data/doc/memo.html +29 -25
- data/doc/print.css +63 -4
- data/doc/readme.doc +4 -6
- data/doc/readme.html +129 -111
- data/doc/rss.xml +168 -7
- data/doc/screen.css +146 -0
- data/doc/spacing.css +57 -0
- data/{samp → examples}/counter/RSpec/Rakefile +0 -0
- data/{samp → examples}/counter/RSpec/counter_design.rb +0 -0
- data/examples/counter/RSpec/counter_proto.rb +9 -0
- data/{samp → examples}/counter/RSpec/counter_runner.rake +0 -0
- data/{samp → examples}/counter/RSpec/counter_spec.rb +0 -0
- data/{samp → examples}/counter/Rakefile +0 -0
- data/{samp → examples}/counter/counter.v +0 -0
- data/{samp → examples}/counter/xUnit/Rakefile +0 -0
- data/{samp → examples}/counter/xUnit/counter_bench.rb +0 -0
- data/{samp → examples}/counter/xUnit/counter_bench.v +0 -0
- data/{samp → examples}/counter/xUnit/counter_design.rb +0 -0
- data/examples/counter/xUnit/counter_proto.rb +9 -0
- data/{samp → examples}/counter/xUnit/counter_runner.rake +0 -0
- data/{samp → examples}/counter/xUnit/counter_spec.rb +0 -0
- data/{samp → examples}/pipelined_alu/Hw5UnitModel.rb +0 -0
- data/{samp → examples}/pipelined_alu/README +0 -0
- data/{samp → examples}/pipelined_alu/Rakefile +0 -0
- data/{samp → examples}/pipelined_alu/TestHw5UnitModel.rb +0 -0
- data/{samp → examples}/pipelined_alu/hw5_unit.v +0 -0
- data/{samp → examples}/pipelined_alu/hw5_unit_design.rb +0 -7
- data/examples/pipelined_alu/hw5_unit_proto.rb +2 -0
- data/{samp → examples}/pipelined_alu/hw5_unit_runner.rake +0 -0
- data/{samp → examples}/pipelined_alu/hw5_unit_spec.rb +0 -0
- data/{samp → examples}/pipelined_alu/int_gen.rb +0 -0
- data/{samp → examples}/register_file/LICENSE +0 -0
- data/{samp → examples}/register_file/README +0 -0
- data/{samp → examples}/register_file/Rakefile +0 -0
- data/{samp → examples}/register_file/register_file.v +0 -0
- data/{samp → examples}/register_file/register_file_design.rb +0 -0
- data/examples/register_file/register_file_proto.rb +11 -0
- data/{samp → examples}/register_file/register_file_runner.rake +0 -0
- data/{samp → examples}/register_file/register_file_spec.rb +0 -0
- data/ext/main.c +5 -5
- data/ext/swig_vpi.i +6 -2
- data/lib/ruby-vpi/core/callback.rb +142 -0
- data/lib/ruby-vpi/core/edge.rb +128 -0
- data/lib/ruby-vpi/core/handle.rb +421 -0
- data/lib/ruby-vpi/core/scheduler.rb +244 -0
- data/lib/ruby-vpi/core/struct.rb +123 -0
- data/lib/ruby-vpi/core.rb +41 -0
- data/lib/ruby-vpi/rcov.rb +25 -12
- data/lib/ruby-vpi/runner.rb +30 -26
- data/lib/ruby-vpi/runner_boot_loader.rb +67 -37
- data/lib/ruby-vpi.rb +2 -2
- 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 +7 -5
- data/ref/ruby/classes/ERB.src/{M000026.html → M000024.html} +0 -0
- data/ref/ruby/classes/FileUtils.html +11 -11
- data/ref/ruby/classes/FileUtils.src/{M000027.html → M000025.html} +0 -0
- data/ref/ruby/classes/FileUtils.src/{M000028.html → M000026.html} +0 -0
- data/ref/ruby/classes/Float.html +8 -6
- data/ref/ruby/classes/Float.src/{M000021.html → M000019.html} +0 -0
- data/ref/ruby/classes/Integer.html +67 -65
- data/ref/ruby/classes/Integer.src/M000007.html +25 -0
- data/ref/ruby/classes/Integer.src/{M000014.html → M000008.html} +5 -5
- data/ref/ruby/classes/Integer.src/M000009.html +5 -12
- 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/M000015.html +25 -0
- data/ref/ruby/classes/Integer.src/M000016.html +31 -0
- data/ref/ruby/classes/Integer.src/M000017.html +12 -12
- data/ref/ruby/classes/Integer.src/M000018.html +17 -18
- data/ref/ruby/classes/Object.html +126 -0
- data/ref/ruby/classes/RDoc.html +5 -5
- data/ref/ruby/classes/RDoc.src/{M000061.html → M000081.html} +0 -0
- data/ref/ruby/classes/RubyVPI.html +50 -9
- data/ref/ruby/classes/String.html +22 -20
- data/ref/ruby/classes/String.src/M000020.html +36 -0
- data/ref/ruby/classes/String.src/M000021.html +41 -0
- data/ref/ruby/classes/String.src/M000022.html +5 -23
- data/ref/ruby/classes/String.src/M000023.html +5 -28
- data/ref/ruby/classes/{Vpi → VPI}/Handle.html +442 -140
- data/ref/ruby/classes/{Vpi/Handle.src/M000042.html → VPI/Handle.src/M000037.html} +4 -4
- data/ref/ruby/classes/VPI/Handle.src/M000038.html +21 -0
- data/ref/ruby/classes/VPI/Handle.src/M000039.html +18 -0
- data/ref/ruby/classes/{Vpi/Handle.src/M000036.html → VPI/Handle.src/M000040.html} +5 -5
- data/ref/ruby/classes/VPI/Handle.src/M000045.html +18 -0
- data/ref/ruby/classes/{Vpi/Handle.src/M000038.html → VPI/Handle.src/M000046.html} +5 -5
- data/ref/ruby/classes/VPI/Handle.src/M000057.html +18 -0
- data/ref/ruby/classes/{Vpi/Handle.src/M000040.html → VPI/Handle.src/M000058.html} +5 -5
- data/ref/ruby/classes/VPI/Handle.src/M000061.html +18 -0
- data/ref/ruby/classes/VPI/Handle.src/M000062.html +18 -0
- data/ref/ruby/classes/{Vpi/Handle.src/M000054.html → VPI/Handle.src/M000065.html} +11 -11
- data/ref/ruby/classes/VPI/Handle.src/M000067.html +21 -0
- data/ref/ruby/classes/VPI/Handle.src/M000068.html +28 -0
- data/ref/ruby/classes/VPI/Handle.src/M000069.html +50 -0
- data/ref/ruby/classes/{Vpi/Handle.src/M000048.html → VPI/Handle.src/M000070.html} +6 -6
- data/ref/ruby/classes/{Vpi/Handle.src/M000049.html → VPI/Handle.src/M000071.html} +6 -6
- data/ref/ruby/classes/{Vpi/Handle.src/M000050.html → VPI/Handle.src/M000072.html} +5 -5
- data/ref/ruby/classes/{Vpi/Handle.src/M000051.html → VPI/Handle.src/M000073.html} +17 -17
- data/ref/ruby/classes/VPI/Handle.src/M000075.html +18 -0
- data/ref/ruby/classes/VPI/Handle.src/M000076.html +40 -0
- data/ref/ruby/classes/{Vpi/Handle.src/M000056.html → VPI/Handle.src/M000077.html} +18 -18
- data/ref/ruby/classes/{Vpi → VPI}/S_vpi_time.html +22 -20
- data/ref/ruby/classes/VPI/S_vpi_time.src/M000078.html +18 -0
- data/ref/ruby/classes/VPI/S_vpi_time.src/M000079.html +19 -0
- data/ref/ruby/classes/{Vpi → VPI}/S_vpi_value.html +37 -23
- data/ref/ruby/classes/VPI/S_vpi_value.src/M000034.html +35 -0
- data/ref/ruby/classes/VPI/S_vpi_value.src/M000035.html +42 -0
- data/ref/ruby/classes/VPI/S_vpi_value.src/M000036.html +42 -0
- data/ref/ruby/classes/{Vpi.html → VPI.html} +129 -34
- data/ref/ruby/classes/VPI.src/M000027.html +19 -0
- data/ref/ruby/classes/VPI.src/M000028.html +18 -0
- data/ref/ruby/classes/VPI.src/M000029.html +19 -0
- data/ref/ruby/classes/VPI.src/M000031.html +25 -0
- data/ref/ruby/classes/VPI.src/M000032.html +26 -0
- data/ref/ruby/classes/VerilogParser/Module/Port.html +17 -15
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000004.html +23 -0
- data/ref/ruby/classes/VerilogParser/Module/Port.src/{M000007.html → M000005.html} +0 -0
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000006.html +5 -10
- data/ref/ruby/classes/VerilogParser/Module.html +7 -5
- data/ref/ruby/classes/VerilogParser/Module.src/{M000005.html → M000003.html} +0 -0
- data/ref/ruby/classes/VerilogParser.html +7 -5
- data/ref/ruby/classes/VerilogParser.src/{M000004.html → M000002.html} +0 -0
- data/ref/ruby/created.rid +1 -1
- data/ref/ruby/files/bin/generate_rb.html +2 -2
- data/ref/ruby/files/lib/ruby-vpi/{vpi_rb.html → core/callback_rb.html} +7 -8
- data/ref/ruby/files/lib/ruby-vpi/core/edge_rb.html +114 -0
- data/ref/ruby/files/lib/ruby-vpi/core/handle_rb.html +107 -0
- data/ref/ruby/files/lib/ruby-vpi/core/scheduler_rb.html +114 -0
- data/ref/ruby/files/lib/ruby-vpi/core/struct_rb.html +108 -0
- data/ref/ruby/files/lib/ruby-vpi/core_rb.html +121 -0
- data/ref/ruby/files/lib/ruby-vpi/rcov_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/runner_boot_loader_rb.html +5 -41
- data/ref/ruby/files/lib/ruby-vpi/runner_boot_loader_rb.src/M000001.html +3 -3
- data/ref/ruby/files/lib/ruby-vpi/runner_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi_rb.html +1 -1
- data/ref/ruby/fr_class_index.html +5 -4
- data/ref/ruby/fr_file_index.html +6 -1
- data/ref/ruby/fr_method_index.html +80 -60
- metadata +126 -103
- data/ext/swig_vpi.h +0 -924
- data/ext/swig_wrap.cin +0 -7083
- data/lib/ruby-vpi/vpi.rb +0 -651
- data/ref/ruby/classes/Integer.src/M000013.html +0 -18
- data/ref/ruby/classes/Integer.src/M000019.html +0 -25
- data/ref/ruby/classes/Integer.src/M000020.html +0 -30
- data/ref/ruby/classes/String.src/M000024.html +0 -18
- data/ref/ruby/classes/String.src/M000025.html +0 -18
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000008.html +0 -18
- data/ref/ruby/classes/Vpi/Handle.src/M000035.html +0 -18
- data/ref/ruby/classes/Vpi/Handle.src/M000037.html +0 -18
- data/ref/ruby/classes/Vpi/Handle.src/M000039.html +0 -18
- data/ref/ruby/classes/Vpi/Handle.src/M000041.html +0 -18
- data/ref/ruby/classes/Vpi/Handle.src/M000043.html +0 -21
- data/ref/ruby/classes/Vpi/Handle.src/M000044.html +0 -21
- data/ref/ruby/classes/Vpi/Handle.src/M000045.html +0 -22
- data/ref/ruby/classes/Vpi/Handle.src/M000046.html +0 -50
- data/ref/ruby/classes/Vpi/Handle.src/M000047.html +0 -91
- data/ref/ruby/classes/Vpi/Handle.src/M000053.html +0 -18
- data/ref/ruby/classes/Vpi/Handle.src/M000057.html +0 -40
- data/ref/ruby/classes/Vpi/S_vpi_time.src/M000058.html +0 -18
- data/ref/ruby/classes/Vpi/S_vpi_time.src/M000059.html +0 -19
- data/ref/ruby/classes/Vpi/S_vpi_value.src/M000032.html +0 -18
- data/ref/ruby/classes/Vpi/S_vpi_value.src/M000033.html +0 -18
- data/ref/ruby/classes/Vpi/S_vpi_value.src/M000034.html +0 -18
- data/ref/ruby/classes/Vpi.src/M000029.html +0 -28
- data/ref/ruby/classes/Vpi.src/M000030.html +0 -39
- data/ref/ruby/classes/Vpi.src/M000031.html +0 -20
- data/ref/ruby/files/lib/ruby-vpi/runner_boot_loader_rb.src/M000002.html +0 -18
- data/samp/counter/RSpec/counter_proto.rb +0 -10
- data/samp/counter/xUnit/counter_proto.rb +0 -10
- data/samp/pipelined_alu/hw5_unit_proto.rb +0 -4
- data/samp/register_file/register_file_proto.rb +0 -11
@@ -0,0 +1,25 @@
|
|
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>pack (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 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>
|
24
|
+
</body>
|
25
|
+
</html>
|
@@ -0,0 +1,31 @@
|
|
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>unpack (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 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>
|
30
|
+
</body>
|
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>
|
@@ -5,27 +5,26 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>split (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
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
91: <span class="ruby-keyword kw">end</span></pre>
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/integer.rb, line 121</span>
|
14
|
+
121: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">split</span> <span class="ruby-identifier">aWidth</span> = <span class="ruby-value">8</span>
|
15
|
+
122: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"width must be positive and non-zero"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">aWidth</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
16
|
+
123:
|
17
|
+
124: <span class="ruby-identifier">int</span>, <span class="ruby-identifier">bits</span> = <span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">length</span>
|
18
|
+
125: <span class="ruby-identifier">mask</span> = <span class="ruby-identifier">aWidth</span>.<span class="ruby-identifier">to_mask</span>
|
19
|
+
126: <span class="ruby-identifier">words</span> = []
|
20
|
+
127:
|
21
|
+
128: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">bits</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
22
|
+
129: <span class="ruby-identifier">words</span>.<span class="ruby-identifier">unshift</span> <span class="ruby-identifier">int</span> <span class="ruby-operator">&</span> <span class="ruby-identifier">mask</span>
|
23
|
+
130: <span class="ruby-identifier">int</span> <span class="ruby-operator">>>=</span> <span class="ruby-identifier">aWidth</span>
|
24
|
+
131: <span class="ruby-identifier">bits</span> <span class="ruby-operator">-=</span> <span class="ruby-identifier">aWidth</span>
|
25
|
+
132: <span class="ruby-keyword kw">end</span>
|
26
|
+
133:
|
27
|
+
134: <span class="ruby-identifier">words</span>
|
28
|
+
135: <span class="ruby-keyword kw">end</span></pre>
|
30
29
|
</body>
|
31
30
|
</html>
|
@@ -0,0 +1,126 @@
|
|
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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Object</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Object</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/lib/ruby-vpi/runner_boot_loader_rb.html">
|
59
|
+
lib/ruby-vpi/runner_boot_loader.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
<a href="Object.html">
|
69
|
+
Object
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
|
83
|
+
<div id="description">
|
84
|
+
<p>
|
85
|
+
load the design under test
|
86
|
+
</p>
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
|
91
|
+
</div>
|
92
|
+
|
93
|
+
|
94
|
+
</div>
|
95
|
+
|
96
|
+
|
97
|
+
<!-- if includes -->
|
98
|
+
<div id="includes">
|
99
|
+
<h3 class="section-bar">Included Modules</h3>
|
100
|
+
|
101
|
+
<div id="includes-list">
|
102
|
+
<span class="include-name"><a href="VPI.html">VPI</a></span>
|
103
|
+
</div>
|
104
|
+
</div>
|
105
|
+
|
106
|
+
<div id="section">
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
<!-- if method_list -->
|
116
|
+
|
117
|
+
|
118
|
+
</div>
|
119
|
+
|
120
|
+
|
121
|
+
<div id="validator-badges">
|
122
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
123
|
+
</div>
|
124
|
+
|
125
|
+
</body>
|
126
|
+
</html>
|
data/ref/ruby/classes/RDoc.html
CHANGED
@@ -80,7 +80,7 @@
|
|
80
80
|
<h3 class="section-bar">Methods</h3>
|
81
81
|
|
82
82
|
<div class="name-list">
|
83
|
-
<a href="#
|
83
|
+
<a href="#M000081">usage_from_file</a>
|
84
84
|
</div>
|
85
85
|
</div>
|
86
86
|
|
@@ -102,12 +102,12 @@
|
|
102
102
|
<div id="methods">
|
103
103
|
<h3 class="section-bar">Public Class methods</h3>
|
104
104
|
|
105
|
-
<div id="method-
|
106
|
-
<a name="
|
105
|
+
<div id="method-M000081" class="method-detail">
|
106
|
+
<a name="M000081"></a>
|
107
107
|
|
108
108
|
<div class="method-heading">
|
109
|
-
<a href="RDoc.src/
|
110
|
-
onclick="popupCode('RDoc.src/
|
109
|
+
<a href="RDoc.src/M000081.html" target="Code" class="method-signature"
|
110
|
+
onclick="popupCode('RDoc.src/M000081.html');return false;">
|
111
111
|
<span class="method-name">usage_from_file</span><span class="method-args">(input_file, *args)</span>
|
112
112
|
</a>
|
113
113
|
</div>
|
File without changes
|
@@ -62,6 +62,22 @@
|
|
62
62
|
<a href="../files/lib/ruby-vpi/rcov_rb.html">
|
63
63
|
lib/ruby-vpi/rcov.rb
|
64
64
|
</a>
|
65
|
+
<br />
|
66
|
+
<a href="../files/lib/ruby-vpi/core_rb.html">
|
67
|
+
lib/ruby-vpi/core.rb
|
68
|
+
</a>
|
69
|
+
<br />
|
70
|
+
<a href="../files/lib/ruby-vpi/core/edge_rb.html">
|
71
|
+
lib/ruby-vpi/core/edge.rb
|
72
|
+
</a>
|
73
|
+
<br />
|
74
|
+
<a href="../files/lib/ruby-vpi/core/callback_rb.html">
|
75
|
+
lib/ruby-vpi/core/callback.rb
|
76
|
+
</a>
|
77
|
+
<br />
|
78
|
+
<a href="../files/lib/ruby-vpi/core/scheduler_rb.html">
|
79
|
+
lib/ruby-vpi/core/scheduler.rb
|
80
|
+
</a>
|
65
81
|
<br />
|
66
82
|
</td>
|
67
83
|
</tr>
|
@@ -115,11 +131,6 @@ General project information.
|
|
115
131
|
<td>=</td>
|
116
132
|
<td class="context-item-value">"http://#{PROJECT_ID}.rubyforge.org"</td>
|
117
133
|
</tr>
|
118
|
-
<tr class="top-aligned-row context-row">
|
119
|
-
<td class="context-item-name">WEBSITE_URL</td>
|
120
|
-
<td>=</td>
|
121
|
-
<td class="context-item-value">PROJECT_URL + "/doc"</td>
|
122
|
-
</tr>
|
123
134
|
<tr class="top-aligned-row context-row">
|
124
135
|
<td class="context-item-name">PROJECT_SUMMARY</td>
|
125
136
|
<td>=</td>
|
@@ -146,14 +157,44 @@ List of supported Verilog simulators.
|
|
146
157
|
</td>
|
147
158
|
</tr>
|
148
159
|
<tr class="top-aligned-row context-row">
|
149
|
-
<td class="context-item-name">
|
160
|
+
<td class="context-item-name">SIMULATOR</td>
|
161
|
+
<td>=</td>
|
162
|
+
<td class="context-item-value">ENV['RUBYVPI_SIMULATOR'].to_sym</td>
|
163
|
+
</tr>
|
164
|
+
<tr class="top-aligned-row context-row">
|
165
|
+
<td class="context-item-name">USE_DEBUGGER</td>
|
166
|
+
<td>=</td>
|
167
|
+
<td class="context-item-value">ENV['DEBUGGER'].to_i == 1</td>
|
168
|
+
</tr>
|
169
|
+
<tr class="top-aligned-row context-row">
|
170
|
+
<td class="context-item-name">USE_COVERAGE</td>
|
171
|
+
<td>=</td>
|
172
|
+
<td class="context-item-value">ENV['COVERAGE'].to_i == 1</td>
|
173
|
+
</tr>
|
174
|
+
<tr class="top-aligned-row context-row">
|
175
|
+
<td class="context-item-name">USE_PROTOTYPE</td>
|
176
|
+
<td>=</td>
|
177
|
+
<td class="context-item-value">ENV['PROTOTYPE'].to_i == 1</td>
|
178
|
+
</tr>
|
179
|
+
<tr class="top-aligned-row context-row">
|
180
|
+
<td class="context-item-name">USE_PROFILER</td>
|
181
|
+
<td>=</td>
|
182
|
+
<td class="context-item-value">ENV['PROFILER'].to_i == 1</td>
|
183
|
+
</tr>
|
184
|
+
<tr class="top-aligned-row context-row">
|
185
|
+
<td class="context-item-name">Edge</td>
|
186
|
+
<td>=</td>
|
187
|
+
<td class="context-item-value">EdgeClass.instance</td>
|
188
|
+
</tr>
|
189
|
+
<tr class="top-aligned-row context-row">
|
190
|
+
<td class="context-item-name">Callback</td>
|
150
191
|
<td>=</td>
|
151
|
-
<td class="context-item-value">
|
192
|
+
<td class="context-item-value">CallbackClass.instance</td>
|
152
193
|
</tr>
|
153
194
|
<tr class="top-aligned-row context-row">
|
154
|
-
<td class="context-item-name">
|
195
|
+
<td class="context-item-name">Scheduler</td>
|
155
196
|
<td>=</td>
|
156
|
-
<td class="context-item-value">
|
197
|
+
<td class="context-item-value">SchedulerClass.instance</td>
|
157
198
|
</tr>
|
158
199
|
</table>
|
159
200
|
</div>
|
@@ -73,7 +73,9 @@
|
|
73
73
|
<tr class="top-aligned-row">
|
74
74
|
<td><strong>Parent:</strong></td>
|
75
75
|
<td>
|
76
|
+
<a href="Object.html">
|
76
77
|
Object
|
78
|
+
</a>
|
77
79
|
</td>
|
78
80
|
</tr>
|
79
81
|
</table>
|
@@ -100,10 +102,10 @@ A small utility library.
|
|
100
102
|
<h3 class="section-bar">Methods</h3>
|
101
103
|
|
102
104
|
<div class="name-list">
|
103
|
-
<a href="#
|
104
|
-
<a href="#
|
105
|
-
<a href="#
|
106
|
-
<a href="#
|
105
|
+
<a href="#M000023">rstrip_from</a>
|
106
|
+
<a href="#M000020">to_f</a>
|
107
|
+
<a href="#M000022">to_ruby_const_name</a>
|
108
|
+
<a href="#M000021">verilog_to_ruby</a>
|
107
109
|
</div>
|
108
110
|
</div>
|
109
111
|
|
@@ -125,12 +127,12 @@ A small utility library.
|
|
125
127
|
<div id="methods">
|
126
128
|
<h3 class="section-bar">Public Instance methods</h3>
|
127
129
|
|
128
|
-
<div id="method-
|
129
|
-
<a name="
|
130
|
+
<div id="method-M000023" class="method-detail">
|
131
|
+
<a name="M000023"></a>
|
130
132
|
|
131
133
|
<div class="method-heading">
|
132
|
-
<a href="String.src/
|
133
|
-
onclick="popupCode('String.src/
|
134
|
+
<a href="String.src/M000023.html" target="Code" class="method-signature"
|
135
|
+
onclick="popupCode('String.src/M000023.html');return false;">
|
134
136
|
<span class="method-name">rstrip_from</span><span class="method-args">(char)</span>
|
135
137
|
</a>
|
136
138
|
</div>
|
@@ -142,12 +144,12 @@ Strips off everything after the given character in this string.
|
|
142
144
|
</div>
|
143
145
|
</div>
|
144
146
|
|
145
|
-
<div id="method-
|
146
|
-
<a name="
|
147
|
+
<div id="method-M000020" class="method-detail">
|
148
|
+
<a name="M000020"></a>
|
147
149
|
|
148
150
|
<div class="method-heading">
|
149
|
-
<a href="String.src/
|
150
|
-
onclick="popupCode('String.src/
|
151
|
+
<a href="String.src/M000020.html" target="Code" class="method-signature"
|
152
|
+
onclick="popupCode('String.src/M000020.html');return false;">
|
151
153
|
<span class="method-name">to_f</span><span class="method-args">(aRadix = 10)</span>
|
152
154
|
</a>
|
153
155
|
</div>
|
@@ -160,12 +162,12 @@ The default radix is 10.
|
|
160
162
|
</div>
|
161
163
|
</div>
|
162
164
|
|
163
|
-
<div id="method-
|
164
|
-
<a name="
|
165
|
+
<div id="method-M000022" class="method-detail">
|
166
|
+
<a name="M000022"></a>
|
165
167
|
|
166
168
|
<div class="method-heading">
|
167
|
-
<a href="String.src/
|
168
|
-
onclick="popupCode('String.src/
|
169
|
+
<a href="String.src/M000022.html" target="Code" class="method-signature"
|
170
|
+
onclick="popupCode('String.src/M000022.html');return false;">
|
169
171
|
<span class="method-name">to_ruby_const_name</span><span class="method-args">()</span>
|
170
172
|
</a>
|
171
173
|
</div>
|
@@ -177,12 +179,12 @@ Converts this string into a valid Ruby constant name.
|
|
177
179
|
</div>
|
178
180
|
</div>
|
179
181
|
|
180
|
-
<div id="method-
|
181
|
-
<a name="
|
182
|
+
<div id="method-M000021" class="method-detail">
|
183
|
+
<a name="M000021"></a>
|
182
184
|
|
183
185
|
<div class="method-heading">
|
184
|
-
<a href="String.src/
|
185
|
-
onclick="popupCode('String.src/
|
186
|
+
<a href="String.src/M000021.html" target="Code" class="method-signature"
|
187
|
+
onclick="popupCode('String.src/M000021.html');return false;">
|
186
188
|
<span class="method-name">verilog_to_ruby</span><span class="method-args">()</span>
|
187
189
|
</a>
|
188
190
|
</div>
|
@@ -0,0 +1,36 @@
|
|
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_f (String)</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/float.rb, line 9</span>
|
14
|
+
9: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_f</span> <span class="ruby-identifier">aRadix</span> = <span class="ruby-value">10</span>
|
15
|
+
10: <span class="ruby-identifier">whole</span>, <span class="ruby-identifier">frac</span> = <span class="ruby-identifier">split</span>(<span class="ruby-value str">'.'</span>, <span class="ruby-value">2</span>)
|
16
|
+
11: <span class="ruby-identifier">whole</span> = <span class="ruby-identifier">whole</span>.<span class="ruby-identifier">to_i</span>(<span class="ruby-identifier">aRadix</span>).<span class="ruby-identifier">to_f</span>
|
17
|
+
12:
|
18
|
+
13: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">frac</span>
|
19
|
+
14: <span class="ruby-identifier">f</span> = <span class="ruby-value">0</span><span class="ruby-value">.0</span>
|
20
|
+
15:
|
21
|
+
16: <span class="ruby-identifier">frac</span>.<span class="ruby-identifier">length</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
22
|
+
17: <span class="ruby-identifier">power</span> = <span class="ruby-identifier">i</span>.<span class="ruby-identifier">next</span>
|
23
|
+
18: <span class="ruby-identifier">weight</span> = <span class="ruby-identifier">aRadix</span> <span class="ruby-operator">**</span> <span class="ruby-operator">-</span><span class="ruby-identifier">power</span>
|
24
|
+
19: <span class="ruby-identifier">digit</span> = <span class="ruby-identifier">frac</span>[<span class="ruby-identifier">i</span>, <span class="ruby-value">1</span>].<span class="ruby-identifier">to_i</span>(<span class="ruby-identifier">aRadix</span>)
|
25
|
+
20:
|
26
|
+
21: <span class="ruby-identifier">f</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">digit</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">weight</span>
|
27
|
+
22: <span class="ruby-keyword kw">end</span>
|
28
|
+
23:
|
29
|
+
24: <span class="ruby-identifier">f</span> = <span class="ruby-operator">-</span><span class="ruby-identifier">f</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^-/</span>
|
30
|
+
25: <span class="ruby-identifier">whole</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">f</span>
|
31
|
+
26: <span class="ruby-keyword kw">end</span>
|
32
|
+
27:
|
33
|
+
28: <span class="ruby-identifier">whole</span>
|
34
|
+
29: <span class="ruby-keyword kw">end</span></pre>
|
35
|
+
</body>
|
36
|
+
</html>
|
@@ -0,0 +1,41 @@
|
|
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>verilog_to_ruby (String)</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/verilog_parser.rb, line 70</span>
|
14
|
+
70: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">verilog_to_ruby</span>
|
15
|
+
71: <span class="ruby-identifier">content</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dup</span>
|
16
|
+
72:
|
17
|
+
73: <span class="ruby-comment cmt"># single-line comments</span>
|
18
|
+
74: <span class="ruby-identifier">content</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{//(.*)$}</span>, <span class="ruby-value str">'#\1'</span>
|
19
|
+
75:
|
20
|
+
76: <span class="ruby-comment cmt"># multi-line comments</span>
|
21
|
+
77: <span class="ruby-identifier">content</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{/\*.*?\*/}</span><span class="ruby-identifier">m</span>, <span class="ruby-value str">"\n=begin\n\\0\n=end\n"</span>
|
22
|
+
78:
|
23
|
+
79: <span class="ruby-comment cmt"># preprocessor directives</span>
|
24
|
+
80: <span class="ruby-identifier">content</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{`include}</span>, <span class="ruby-value str">'#\0'</span>
|
25
|
+
81:
|
26
|
+
82: <span class="ruby-identifier">content</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{`define\s+(\w+)\s+(.+)}</span> <span class="ruby-keyword kw">do</span>
|
27
|
+
83: <span class="ruby-node">"#{$1.to_ruby_const_name} = #{$2}"</span>
|
28
|
+
84: <span class="ruby-keyword kw">end</span>
|
29
|
+
85:
|
30
|
+
86: <span class="ruby-identifier">content</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{`+}</span>, <span class="ruby-value str">''</span>
|
31
|
+
87:
|
32
|
+
88: <span class="ruby-comment cmt"># numbers</span>
|
33
|
+
89: <span class="ruby-identifier">content</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{\d*\'([dohb]\w+)}</span>, <span class="ruby-value str">'0\1'</span>
|
34
|
+
90:
|
35
|
+
91: <span class="ruby-comment cmt"># ranges</span>
|
36
|
+
92: <span class="ruby-identifier">content</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{(\S)\s*:\s*(\S)}</span>, <span class="ruby-value str">'\1..\2'</span>
|
37
|
+
93:
|
38
|
+
94: <span class="ruby-identifier">content</span>
|
39
|
+
95: <span class="ruby-keyword kw">end</span></pre>
|
40
|
+
</body>
|
41
|
+
</html>
|
@@ -5,32 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>to_ruby_const_name (String)</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/
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
12:
|
18
|
-
13: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">frac</span>
|
19
|
-
14: <span class="ruby-identifier">f</span> = <span class="ruby-value">0</span><span class="ruby-value">.0</span>
|
20
|
-
15:
|
21
|
-
16: <span class="ruby-identifier">frac</span>.<span class="ruby-identifier">length</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
22
|
-
17: <span class="ruby-identifier">power</span> = <span class="ruby-identifier">i</span>.<span class="ruby-identifier">next</span>
|
23
|
-
18: <span class="ruby-identifier">weight</span> = <span class="ruby-identifier">aRadix</span> <span class="ruby-operator">**</span> <span class="ruby-operator">-</span><span class="ruby-identifier">power</span>
|
24
|
-
19: <span class="ruby-identifier">digit</span> = <span class="ruby-identifier">frac</span>[<span class="ruby-identifier">i</span>, <span class="ruby-value">1</span>].<span class="ruby-identifier">to_i</span>(<span class="ruby-identifier">aRadix</span>)
|
25
|
-
20:
|
26
|
-
21: <span class="ruby-identifier">f</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">digit</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">weight</span>
|
27
|
-
22: <span class="ruby-keyword kw">end</span>
|
28
|
-
23:
|
29
|
-
24: <span class="ruby-identifier">f</span> = <span class="ruby-operator">-</span><span class="ruby-identifier">f</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^-/</span>
|
30
|
-
25: <span class="ruby-identifier">whole</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">f</span>
|
31
|
-
26: <span class="ruby-keyword kw">end</span>
|
32
|
-
27:
|
33
|
-
28: <span class="ruby-identifier">whole</span>
|
34
|
-
29: <span class="ruby-keyword kw">end</span></pre>
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/util.rb, line 8</span>
|
14
|
+
8: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ruby_const_name</span>
|
15
|
+
9: <span class="ruby-keyword kw">self</span>[<span class="ruby-value">0</span>, <span class="ruby-value">1</span>].<span class="ruby-identifier">upcase</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
|
16
|
+
10: <span class="ruby-keyword kw">end</span></pre>
|
35
17
|
</body>
|
36
18
|
</html>
|