ruby-vpi 7.0.0 → 7.1.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/HISTORY +19 -0
- data/README +3 -3
- data/Rakefile +147 -112
- data/bin/generate_test.rb +0 -2
- data/doc/src/manual.xml +11 -9
- data/doc/txt/manual.txt +14 -9
- data/doc/xhtml/background.organization.html +1 -1
- data/doc/xhtml/index.html +2 -2
- data/doc/xhtml/introduction.manifest.html +1 -1
- data/doc/xhtml/usage.installation.html +7 -1
- data/doc/xhtml/usage.tutorial.html +1 -1
- data/gem_extconf.rb +1 -1
- data/history.html +37 -0
- data/lib/ruby-vpi/runner.rb +77 -2
- data/lib/ruby-vpi.rb +0 -10
- data/readme.html +5 -3
- 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_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/hierarchy.html +1 -1
- data/ref/c/index.html +1 -1
- data/ref/c/relay_8cin.html +1 -1
- data/ref/c/relay_8hin.html +1 -1
- data/ref/c/ruby-vpi_8c.html +1 -1
- data/ref/c/structrelay____RubyOptions____def.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/swig_8cin.html +1 -1
- data/ref/c/swig_8hin.html +1 -1
- data/ref/c/verilog_8h.html +1 -1
- data/ref/c/vlog_8cin.html +1 -1
- data/ref/c/vlog_8hin.html +1 -1
- data/ref/c/vpi__user_8h.html +1 -1
- data/ref/ruby/classes/Counter.html +20 -20
- data/ref/ruby/classes/Counter.src/M000038.html +7 -9
- data/ref/ruby/classes/Counter.src/M000039.html +9 -7
- data/ref/ruby/classes/Counter.src/M000040.html +7 -9
- data/ref/ruby/classes/Counter.src/M000041.html +22 -0
- data/ref/ruby/classes/CounterProto.html +9 -9
- data/ref/ruby/classes/CounterProto.src/M000005.html +1 -1
- data/ref/ruby/classes/CounterProto.src/{M000004.html → M000006.html} +1 -1
- data/ref/ruby/classes/ERB.html +5 -5
- data/ref/ruby/classes/FileUtils.html +10 -10
- data/ref/ruby/classes/FileUtils.src/M000048.html +5 -5
- data/ref/ruby/classes/{InputGenerator.src/M000027.html → FileUtils.src/M000049.html} +4 -4
- data/ref/ruby/classes/Hw5UnitModel/Operation.html +15 -15
- data/ref/ruby/classes/Hw5UnitModel/Operation.src/M000012.html +12 -20
- data/ref/ruby/classes/Hw5UnitModel/Operation.src/M000013.html +20 -5
- data/ref/ruby/classes/Hw5UnitModel/Operation.src/M000014.html +18 -0
- data/ref/ruby/classes/Hw5UnitModel.html +24 -24
- data/ref/ruby/classes/Hw5UnitModel.src/M000009.html +7 -25
- data/ref/ruby/classes/Hw5UnitModel.src/M000010.html +25 -9
- data/ref/ruby/classes/Hw5UnitModel.src/M000011.html +22 -0
- data/ref/ruby/classes/Hw5_unit.html +5 -5
- data/ref/ruby/classes/Hw5_unit_spec.html +15 -15
- data/ref/ruby/classes/Hw5_unit_spec.src/M000024.html +8 -8
- data/ref/ruby/classes/Hw5_unit_spec.src/M000025.html +8 -54
- data/ref/ruby/classes/Hw5_unit_spec.src/M000026.html +67 -0
- data/ref/ruby/classes/InputGenerator.html +30 -30
- data/ref/ruby/classes/InputGenerator.src/M000028.html +5 -5
- data/ref/ruby/classes/InputGenerator.src/M000029.html +5 -6
- data/ref/ruby/classes/InputGenerator.src/M000030.html +6 -25
- data/ref/ruby/classes/InputGenerator.src/M000031.html +25 -6
- data/ref/ruby/classes/InputGenerator.src/M000032.html +6 -6
- data/ref/ruby/classes/InputGenerator.src/M000033.html +19 -0
- data/ref/ruby/classes/MaximumCounterValue.html +10 -10
- data/ref/ruby/classes/MaximumCounterValue.src/M000036.html +10 -8
- data/ref/ruby/classes/MaximumCounterValue.src/M000037.html +21 -0
- data/ref/ruby/classes/ModuleInfo.html +10 -10
- data/ref/ruby/classes/ModuleInfo.src/M000019.html +31 -13
- data/ref/ruby/classes/ModuleInfo.src/M000020.html +26 -0
- data/ref/ruby/classes/OutputInfo.html +5 -10
- data/ref/ruby/classes/OutputInfo.src/{M000017.html → M000018.html} +36 -36
- data/ref/ruby/classes/ResettedCounterValue.html +15 -15
- data/ref/ruby/classes/ResettedCounterValue.src/M000015.html +6 -5
- data/ref/ruby/classes/ResettedCounterValue.src/M000016.html +5 -10
- data/ref/ruby/classes/ResettedCounterValue.src/M000017.html +23 -0
- data/ref/ruby/classes/RubyVPI.html +0 -46
- data/ref/ruby/classes/RubyVPI.src/M000050.html +24 -24
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.html +35 -35
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000042.html +9 -31
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000043.html +31 -69
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000044.html +69 -114
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000045.html +114 -13
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000046.html +13 -5
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000047.html +18 -0
- data/ref/ruby/classes/String.html +5 -5
- data/ref/ruby/classes/Template.html +5 -5
- data/ref/ruby/classes/TestHw5UnitModel.html +15 -15
- data/ref/ruby/classes/TestHw5UnitModel.src/M000021.html +6 -6
- data/ref/ruby/classes/TestHw5UnitModel.src/M000022.html +6 -51
- data/ref/ruby/classes/TestHw5UnitModel.src/M000023.html +64 -0
- data/ref/ruby/created.rid +1 -1
- data/ref/ruby/files/bin/generate_test_rb.html +6 -6
- data/ref/ruby/files/bin/generate_test_tpl/bench_rb.html +1 -1
- data/ref/ruby/files/bin/generate_test_tpl/design_rb.html +1 -1
- data/ref/ruby/files/bin/generate_test_tpl/proto_rb.html +1 -1
- data/ref/ruby/files/bin/generate_test_tpl/spec_rb.html +6 -6
- data/ref/ruby/files/bin/header_to_ruby_rb.html +1 -1
- data/ref/ruby/files/ext/extconf_rb.html +1 -1
- data/ref/ruby/files/gem_extconf_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/erb_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/rake_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/rdoc_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/rspec_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/runner_proxy_rb.html +108 -0
- data/ref/ruby/files/lib/ruby-vpi/runner_rb.html +78 -2
- data/ref/ruby/files/lib/ruby-vpi/runner_rb.src/M000001.html +20 -0
- data/ref/ruby/files/lib/ruby-vpi/vpi_util_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi_rb.html +1 -1
- data/ref/ruby/files/samp/counter/counter_rspecTest_bench_rb.html +1 -1
- data/ref/ruby/files/samp/counter/counter_rspecTest_design_rb.html +1 -1
- data/ref/ruby/files/samp/counter/counter_rspecTest_proto_rb.html +1 -1
- data/ref/ruby/files/samp/counter/counter_rspecTest_spec_rb.html +1 -1
- data/ref/ruby/files/samp/counter/counter_unitTest_bench_rb.html +1 -1
- data/ref/ruby/files/samp/counter/counter_unitTest_design_rb.html +1 -1
- data/ref/ruby/files/samp/counter/counter_unitTest_proto_rb.html +1 -1
- data/ref/ruby/files/samp/counter/counter_unitTest_spec_rb.html +1 -1
- data/ref/ruby/files/samp/pipelined_alu/Hw5UnitModel_rb.html +1 -1
- data/ref/ruby/files/samp/pipelined_alu/InputGenerator_rb.html +1 -1
- data/ref/ruby/files/samp/pipelined_alu/TestHw5UnitModel_rb.html +1 -1
- data/ref/ruby/files/samp/pipelined_alu/hw5_unit_bench_rb.html +1 -1
- data/ref/ruby/files/samp/pipelined_alu/hw5_unit_design_rb.html +1 -1
- data/ref/ruby/files/samp/pipelined_alu/hw5_unit_spec_rb.html +1 -1
- data/ref/ruby/fr_file_index.html +1 -0
- data/ref/ruby/fr_method_index.html +48 -48
- data/samp/counter/Rakefile +1 -1
- data/samp/pipelined_alu/Rakefile +1 -1
- metadata +41 -41
- data/ref/ruby/classes/Counter.src/M000037.html +0 -20
- data/ref/ruby/classes/FileUtils.src/M000047.html +0 -18
- data/ref/ruby/classes/Hw5UnitModel/Operation.src/M000011.html +0 -25
- data/ref/ruby/classes/Hw5UnitModel.src/M000008.html +0 -20
- data/ref/ruby/classes/Hw5_unit_spec.src/M000023.html +0 -21
- data/ref/ruby/classes/MaximumCounterValue.src/M000035.html +0 -23
- data/ref/ruby/classes/ModuleInfo.src/M000018.html +0 -44
- data/ref/ruby/classes/ResettedCounterValue.src/M000014.html +0 -19
- data/ref/ruby/classes/RubyVPI.src/M000049.html +0 -18
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000041.html +0 -22
- data/ref/ruby/classes/TestHw5UnitModel.src/M000020.html +0 -19
- data/tpl/runner.rake +0 -96
- /data/{tpl/launcher.rake → lib/ruby-vpi/runner_proxy.rb} +0 -0
- /data/{tpl → lib/ruby-vpi}/synopsys_vcs.tab +0 -0
- /data/ref/ruby/classes/ERB.src/{M000034.html → M000035.html} +0 -0
- /data/ref/ruby/classes/Hw5UnitModel.src/{M000006.html → M000007.html} +0 -0
- /data/ref/ruby/classes/Hw5_unit.src/{M000003.html → M000004.html} +0 -0
- /data/ref/ruby/classes/String.src/{M000033.html → M000034.html} +0 -0
- /data/ref/ruby/classes/Template.src/{M000026.html → M000027.html} +0 -0
- /data/ref/ruby/files/bin/generate_test_rb.src/{M000001.html → M000002.html} +0 -0
- /data/ref/ruby/files/bin/generate_test_tpl/spec_rb.src/{M000002.html → M000003.html} +0 -0
|
@@ -0,0 +1,67 @@
|
|
|
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>test_pipeline (Hw5_unit_spec)</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 samp/pipelined_alu/hw5_unit_spec.rb, line 71</span>
|
|
14
|
+
71: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_pipeline</span>
|
|
15
|
+
72: <span class="ruby-identifier">operationQueue</span> = []
|
|
16
|
+
73: <span class="ruby-identifier">numOperations</span> = <span class="ruby-value">0</span>
|
|
17
|
+
74:
|
|
18
|
+
75: <span class="ruby-keyword kw">begin</span>
|
|
19
|
+
76: <span class="ruby-comment cmt"># start a new operation</span>
|
|
20
|
+
77: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">numOperations</span> <span class="ruby-operator"><</span> <span class="ruby-constant">NUM_TESTS</span>
|
|
21
|
+
78: <span class="ruby-identifier">op</span> = <span class="ruby-constant">Hw5UnitModel</span><span class="ruby-operator">::</span><span class="ruby-constant">Operation</span>.<span class="ruby-identifier">new</span>(
|
|
22
|
+
79: <span class="ruby-constant">Hw5UnitModel</span><span class="ruby-operator">::</span><span class="ruby-constant">OPERATIONS</span>[<span class="ruby-identifier">rand</span>(<span class="ruby-constant">Hw5UnitModel</span><span class="ruby-operator">::</span><span class="ruby-constant">OPERATIONS</span>.<span class="ruby-identifier">size</span>)],
|
|
23
|
+
80: <span class="ruby-identifier">numOperations</span> <span class="ruby-operator">%</span> <span class="ruby-constant">OPERATION_TAG_LIMIT</span>,
|
|
24
|
+
81: <span class="ruby-ivar">@ig</span>.<span class="ruby-identifier">gen</span>.<span class="ruby-identifier">abs</span>,
|
|
25
|
+
82: <span class="ruby-ivar">@ig</span>.<span class="ruby-identifier">gen</span>.<span class="ruby-identifier">abs</span>
|
|
26
|
+
83: )
|
|
27
|
+
84:
|
|
28
|
+
85:
|
|
29
|
+
86: <span class="ruby-ivar">@design</span>.<span class="ruby-identifier">a</span>.<span class="ruby-identifier">intVal</span> = <span class="ruby-identifier">op</span>.<span class="ruby-identifier">arg1</span>
|
|
30
|
+
87: <span class="ruby-ivar">@design</span>.<span class="ruby-identifier">b</span>.<span class="ruby-identifier">intVal</span> = <span class="ruby-identifier">op</span>.<span class="ruby-identifier">arg2</span>
|
|
31
|
+
88: <span class="ruby-ivar">@design</span>.<span class="ruby-identifier">in_op</span>.<span class="ruby-identifier">intVal</span> = <span class="ruby-constant">OPERATION_ENCODINGS</span>[<span class="ruby-identifier">op</span>.<span class="ruby-identifier">type</span>]
|
|
32
|
+
89: <span class="ruby-ivar">@design</span>.<span class="ruby-identifier">in_databits</span>.<span class="ruby-identifier">intVal</span> = <span class="ruby-identifier">op</span>.<span class="ruby-identifier">tag</span>
|
|
33
|
+
90:
|
|
34
|
+
91:
|
|
35
|
+
92: <span class="ruby-identifier">operationQueue</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">op</span>
|
|
36
|
+
93: <span class="ruby-identifier">numOperations</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
|
37
|
+
94: <span class="ruby-keyword kw">end</span>
|
|
38
|
+
95:
|
|
39
|
+
96:
|
|
40
|
+
97: <span class="ruby-comment cmt"># simulate a clock cycle</span>
|
|
41
|
+
98: <span class="ruby-identifier">relay_verilog</span>
|
|
42
|
+
99:
|
|
43
|
+
100:
|
|
44
|
+
101: <span class="ruby-comment cmt"># verify the output when present</span>
|
|
45
|
+
102: <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@design</span>.<span class="ruby-identifier">out_databits</span>.<span class="ruby-identifier">hexStrVal</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/x/</span>
|
|
46
|
+
103: <span class="ruby-identifier">finishedOp</span> = <span class="ruby-constant">Hw5UnitModel</span><span class="ruby-operator">::</span><span class="ruby-constant">Operation</span>.<span class="ruby-identifier">new</span>(
|
|
47
|
+
104: <span class="ruby-constant">OPERATION_ENCODINGS</span>.<span class="ruby-identifier">index</span>(<span class="ruby-ivar">@design</span>.<span class="ruby-identifier">out_op</span>.<span class="ruby-identifier">intVal</span>),
|
|
48
|
+
105: <span class="ruby-ivar">@design</span>.<span class="ruby-identifier">out_databits</span>.<span class="ruby-identifier">intVal</span>
|
|
49
|
+
106: )
|
|
50
|
+
107: <span class="ruby-identifier">finishedOp</span>.<span class="ruby-identifier">result</span> = <span class="ruby-ivar">@design</span>.<span class="ruby-identifier">res</span>.<span class="ruby-identifier">intVal</span> <span class="ruby-operator">&</span> <span class="ruby-constant">VPI_INTEGER_MASK</span>
|
|
51
|
+
108:
|
|
52
|
+
109: <span class="ruby-identifier">expectedOp</span> = <span class="ruby-identifier">operationQueue</span>.<span class="ruby-identifier">shift</span>
|
|
53
|
+
110:
|
|
54
|
+
111:
|
|
55
|
+
112: <span class="ruby-identifier">assert_equal</span> <span class="ruby-identifier">expectedOp</span>.<span class="ruby-identifier">type</span>, <span class="ruby-identifier">finishedOp</span>.<span class="ruby-identifier">type</span>, <span class="ruby-value str">"incorrect operation"</span>
|
|
56
|
+
113: <span class="ruby-identifier">assert_equal</span> <span class="ruby-identifier">expectedOp</span>.<span class="ruby-identifier">tag</span>, <span class="ruby-identifier">finishedOp</span>.<span class="ruby-identifier">tag</span>, <span class="ruby-value str">"incorrect tag"</span>
|
|
57
|
+
114:
|
|
58
|
+
115:
|
|
59
|
+
116: <span class="ruby-comment cmt"># ignore the result of a NOP operation</span>
|
|
60
|
+
117: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">finishedOp</span>.<span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:nop</span>
|
|
61
|
+
118: <span class="ruby-identifier">assert_equal</span> <span class="ruby-identifier">expectedOp</span>.<span class="ruby-identifier">compute</span> <span class="ruby-operator">&</span> <span class="ruby-constant">VPI_INTEGER_MASK</span>, <span class="ruby-identifier">finishedOp</span>.<span class="ruby-identifier">result</span>, <span class="ruby-value str">"incorrect result"</span>
|
|
62
|
+
119: <span class="ruby-keyword kw">end</span>
|
|
63
|
+
120: <span class="ruby-keyword kw">end</span>
|
|
64
|
+
121: <span class="ruby-keyword kw">end</span> <span class="ruby-keyword kw">until</span> <span class="ruby-identifier">operationQueue</span>.<span class="ruby-identifier">empty?</span>
|
|
65
|
+
122: <span class="ruby-keyword kw">end</span></pre>
|
|
66
|
+
</body>
|
|
67
|
+
</html>
|
|
@@ -92,12 +92,12 @@ Generates random input sequences of configurable length.
|
|
|
92
92
|
<h3 class="section-bar">Methods</h3>
|
|
93
93
|
|
|
94
94
|
<div class="name-list">
|
|
95
|
-
<a href="#
|
|
96
|
-
<a href="#
|
|
97
|
-
<a href="#
|
|
98
|
-
<a href="#
|
|
99
|
-
<a href="#
|
|
100
|
-
<a href="#
|
|
95
|
+
<a href="#M000029">bits</a>
|
|
96
|
+
<a href="#M000030">bits=</a>
|
|
97
|
+
<a href="#M000031">gen</a>
|
|
98
|
+
<a href="#M000033">genPowerOfTwo</a>
|
|
99
|
+
<a href="#M000032">genPrime</a>
|
|
100
|
+
<a href="#M000028">new</a>
|
|
101
101
|
</div>
|
|
102
102
|
</div>
|
|
103
103
|
|
|
@@ -138,12 +138,12 @@ href="http://en.wikipedia.org/wiki/List_of_prime_numbers#The_first_1000_prime_nu
|
|
|
138
138
|
<div id="methods">
|
|
139
139
|
<h3 class="section-bar">Public Class methods</h3>
|
|
140
140
|
|
|
141
|
-
<div id="method-
|
|
142
|
-
<a name="
|
|
141
|
+
<div id="method-M000028" class="method-detail">
|
|
142
|
+
<a name="M000028"></a>
|
|
143
143
|
|
|
144
144
|
<div class="method-heading">
|
|
145
|
-
<a href="InputGenerator.src/
|
|
146
|
-
onclick="popupCode('InputGenerator.src/
|
|
145
|
+
<a href="InputGenerator.src/M000028.html" target="Code" class="method-signature"
|
|
146
|
+
onclick="popupCode('InputGenerator.src/M000028.html');return false;">
|
|
147
147
|
<span class="method-name">new</span><span class="method-args">(bits)</span>
|
|
148
148
|
</a>
|
|
149
149
|
</div>
|
|
@@ -158,12 +158,12 @@ sequence
|
|
|
158
158
|
|
|
159
159
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
160
160
|
|
|
161
|
-
<div id="method-
|
|
162
|
-
<a name="
|
|
161
|
+
<div id="method-M000029" class="method-detail">
|
|
162
|
+
<a name="M000029"></a>
|
|
163
163
|
|
|
164
164
|
<div class="method-heading">
|
|
165
|
-
<a href="InputGenerator.src/
|
|
166
|
-
onclick="popupCode('InputGenerator.src/
|
|
165
|
+
<a href="InputGenerator.src/M000029.html" target="Code" class="method-signature"
|
|
166
|
+
onclick="popupCode('InputGenerator.src/M000029.html');return false;">
|
|
167
167
|
<span class="method-name">bits</span><span class="method-args">()</span>
|
|
168
168
|
</a>
|
|
169
169
|
</div>
|
|
@@ -176,12 +176,12 @@ sequence
|
|
|
176
176
|
</div>
|
|
177
177
|
</div>
|
|
178
178
|
|
|
179
|
-
<div id="method-
|
|
180
|
-
<a name="
|
|
179
|
+
<div id="method-M000030" class="method-detail">
|
|
180
|
+
<a name="M000030"></a>
|
|
181
181
|
|
|
182
182
|
<div class="method-heading">
|
|
183
|
-
<a href="InputGenerator.src/
|
|
184
|
-
onclick="popupCode('InputGenerator.src/
|
|
183
|
+
<a href="InputGenerator.src/M000030.html" target="Code" class="method-signature"
|
|
184
|
+
onclick="popupCode('InputGenerator.src/M000030.html');return false;">
|
|
185
185
|
<span class="method-name">bits=</span><span class="method-args">(num)</span>
|
|
186
186
|
</a>
|
|
187
187
|
</div>
|
|
@@ -194,12 +194,12 @@ sequence
|
|
|
194
194
|
</div>
|
|
195
195
|
</div>
|
|
196
196
|
|
|
197
|
-
<div id="method-
|
|
198
|
-
<a name="
|
|
197
|
+
<div id="method-M000031" class="method-detail">
|
|
198
|
+
<a name="M000031"></a>
|
|
199
199
|
|
|
200
200
|
<div class="method-heading">
|
|
201
|
-
<a href="InputGenerator.src/
|
|
202
|
-
onclick="popupCode('InputGenerator.src/
|
|
201
|
+
<a href="InputGenerator.src/M000031.html" target="Code" class="method-signature"
|
|
202
|
+
onclick="popupCode('InputGenerator.src/M000031.html');return false;">
|
|
203
203
|
<span class="method-name">gen</span><span class="method-args">()</span>
|
|
204
204
|
</a>
|
|
205
205
|
</div>
|
|
@@ -211,12 +211,12 @@ generates a random input sequence
|
|
|
211
211
|
</div>
|
|
212
212
|
</div>
|
|
213
213
|
|
|
214
|
-
<div id="method-
|
|
215
|
-
<a name="
|
|
214
|
+
<div id="method-M000033" class="method-detail">
|
|
215
|
+
<a name="M000033"></a>
|
|
216
216
|
|
|
217
217
|
<div class="method-heading">
|
|
218
|
-
<a href="InputGenerator.src/
|
|
219
|
-
onclick="popupCode('InputGenerator.src/
|
|
218
|
+
<a href="InputGenerator.src/M000033.html" target="Code" class="method-signature"
|
|
219
|
+
onclick="popupCode('InputGenerator.src/M000033.html');return false;">
|
|
220
220
|
<span class="method-name">genPowerOfTwo</span><span class="method-args">()</span>
|
|
221
221
|
</a>
|
|
222
222
|
</div>
|
|
@@ -228,12 +228,12 @@ generates a random power-of-two number
|
|
|
228
228
|
</div>
|
|
229
229
|
</div>
|
|
230
230
|
|
|
231
|
-
<div id="method-
|
|
232
|
-
<a name="
|
|
231
|
+
<div id="method-M000032" class="method-detail">
|
|
232
|
+
<a name="M000032"></a>
|
|
233
233
|
|
|
234
234
|
<div class="method-heading">
|
|
235
|
-
<a href="InputGenerator.src/
|
|
236
|
-
onclick="popupCode('InputGenerator.src/
|
|
235
|
+
<a href="InputGenerator.src/M000032.html" target="Code" class="method-signature"
|
|
236
|
+
onclick="popupCode('InputGenerator.src/M000032.html');return false;">
|
|
237
237
|
<span class="method-name">genPrime</span><span class="method-args">()</span>
|
|
238
238
|
</a>
|
|
239
239
|
</div>
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>new (InputGenerator)</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 samp/pipelined_alu/InputGenerator.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File samp/pipelined_alu/InputGenerator.rb, line 32</span>
|
|
14
|
+
32: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">bits</span>)
|
|
15
|
+
33: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">bits</span> = <span class="ruby-identifier">bits</span>
|
|
16
|
+
34: <span class="ruby-keyword kw">end</span></pre>
|
|
17
17
|
</body>
|
|
18
18
|
</html>
|
|
@@ -5,15 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>bits
|
|
8
|
+
<title>bits (InputGenerator)</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 samp/pipelined_alu/InputGenerator.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
49: <span class="ruby-keyword kw">end</span></pre>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File samp/pipelined_alu/InputGenerator.rb, line 39</span>
|
|
14
|
+
39: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">bits</span>
|
|
15
|
+
40: <span class="ruby-ivar">@inputBits</span>
|
|
16
|
+
41: <span class="ruby-keyword kw">end</span></pre>
|
|
18
17
|
</body>
|
|
19
18
|
</html>
|
|
@@ -5,34 +5,15 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>bits= (InputGenerator)</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 samp/pipelined_alu/InputGenerator.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
58: <span class="ruby-keyword kw">when</span> <span class="ruby-value">0</span> <span class="ruby-comment cmt"># positive numbers</span>
|
|
19
|
-
59: <span class="ruby-identifier">rand</span>(<span class="ruby-ivar">@inputLimit</span>)
|
|
20
|
-
60:
|
|
21
|
-
61: <span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span> <span class="ruby-comment cmt"># negative numbers</span>
|
|
22
|
-
62: <span class="ruby-operator">-</span><span class="ruby-identifier">rand</span>(<span class="ruby-ivar">@inputLimit</span>)
|
|
23
|
-
63:
|
|
24
|
-
64: <span class="ruby-keyword kw">when</span> <span class="ruby-value">2</span> <span class="ruby-comment cmt"># zero</span>
|
|
25
|
-
65: <span class="ruby-value">0</span>
|
|
26
|
-
66:
|
|
27
|
-
67: <span class="ruby-keyword kw">when</span> <span class="ruby-value">3</span> <span class="ruby-comment cmt"># one</span>
|
|
28
|
-
68: <span class="ruby-value">1</span>
|
|
29
|
-
69:
|
|
30
|
-
70: <span class="ruby-keyword kw">when</span> <span class="ruby-value">4</span> <span class="ruby-comment cmt"># prime numbers</span>
|
|
31
|
-
71: <span class="ruby-identifier">genPrime</span>
|
|
32
|
-
72:
|
|
33
|
-
73: <span class="ruby-keyword kw">when</span> <span class="ruby-value">5</span> <span class="ruby-comment cmt"># power-of-two numbers</span>
|
|
34
|
-
74: <span class="ruby-identifier">genPowerOfTwo</span>
|
|
35
|
-
75: <span class="ruby-keyword kw">end</span>
|
|
36
|
-
76: <span class="ruby-keyword kw">end</span></pre>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File samp/pipelined_alu/InputGenerator.rb, line 46</span>
|
|
14
|
+
46: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">bits=</span>(<span class="ruby-identifier">num</span>)
|
|
15
|
+
47: <span class="ruby-ivar">@inputBits</span> = <span class="ruby-identifier">num</span>
|
|
16
|
+
48: <span class="ruby-ivar">@inputLimit</span> = <span class="ruby-value">2</span> <span class="ruby-operator">**</span> <span class="ruby-ivar">@inputBits</span>
|
|
17
|
+
49: <span class="ruby-keyword kw">end</span></pre>
|
|
37
18
|
</body>
|
|
38
19
|
</html>
|
|
@@ -5,15 +5,34 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>gen (InputGenerator)</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 samp/pipelined_alu/InputGenerator.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File samp/pipelined_alu/InputGenerator.rb, line 54</span>
|
|
14
|
+
54: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">gen</span>
|
|
15
|
+
55: <span class="ruby-comment cmt"># randomly select a specific kind of integer to generate</span>
|
|
16
|
+
56: <span class="ruby-comment cmt"># @note param to rand() is number of situations in this 'case' block</span>
|
|
17
|
+
57: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">rand</span>(<span class="ruby-value">6</span>)
|
|
18
|
+
58: <span class="ruby-keyword kw">when</span> <span class="ruby-value">0</span> <span class="ruby-comment cmt"># positive numbers</span>
|
|
19
|
+
59: <span class="ruby-identifier">rand</span>(<span class="ruby-ivar">@inputLimit</span>)
|
|
20
|
+
60:
|
|
21
|
+
61: <span class="ruby-keyword kw">when</span> <span class="ruby-value">1</span> <span class="ruby-comment cmt"># negative numbers</span>
|
|
22
|
+
62: <span class="ruby-operator">-</span><span class="ruby-identifier">rand</span>(<span class="ruby-ivar">@inputLimit</span>)
|
|
23
|
+
63:
|
|
24
|
+
64: <span class="ruby-keyword kw">when</span> <span class="ruby-value">2</span> <span class="ruby-comment cmt"># zero</span>
|
|
25
|
+
65: <span class="ruby-value">0</span>
|
|
26
|
+
66:
|
|
27
|
+
67: <span class="ruby-keyword kw">when</span> <span class="ruby-value">3</span> <span class="ruby-comment cmt"># one</span>
|
|
28
|
+
68: <span class="ruby-value">1</span>
|
|
29
|
+
69:
|
|
30
|
+
70: <span class="ruby-keyword kw">when</span> <span class="ruby-value">4</span> <span class="ruby-comment cmt"># prime numbers</span>
|
|
31
|
+
71: <span class="ruby-identifier">genPrime</span>
|
|
32
|
+
72:
|
|
33
|
+
73: <span class="ruby-keyword kw">when</span> <span class="ruby-value">5</span> <span class="ruby-comment cmt"># power-of-two numbers</span>
|
|
34
|
+
74: <span class="ruby-identifier">genPowerOfTwo</span>
|
|
35
|
+
75: <span class="ruby-keyword kw">end</span>
|
|
36
|
+
76: <span class="ruby-keyword kw">end</span></pre>
|
|
18
37
|
</body>
|
|
19
38
|
</html>
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>genPrime (InputGenerator)</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 samp/pipelined_alu/InputGenerator.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File samp/pipelined_alu/InputGenerator.rb, line 81</span>
|
|
14
|
+
81: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">genPrime</span>
|
|
15
|
+
82: <span class="ruby-identifier">prime</span> = <span class="ruby-constant">PrimeNums</span>[<span class="ruby-identifier">rand</span>(<span class="ruby-constant">PrimeNums</span>.<span class="ruby-identifier">size</span>)]
|
|
16
|
+
83: <span class="ruby-identifier">prime</span> <span class="ruby-operator"><</span> <span class="ruby-ivar">@inputLimit</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">prime</span> <span class="ruby-operator">:</span> <span class="ruby-value">2</span>
|
|
17
|
+
84: <span class="ruby-keyword kw">end</span></pre>
|
|
18
18
|
</body>
|
|
19
19
|
</html>
|
|
@@ -0,0 +1,19 @@
|
|
|
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>genPowerOfTwo (InputGenerator)</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 samp/pipelined_alu/InputGenerator.rb, line 89</span>
|
|
14
|
+
89: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">genPowerOfTwo</span>
|
|
15
|
+
90: <span class="ruby-identifier">power</span> = <span class="ruby-identifier">rand</span>(<span class="ruby-ivar">@inputBits</span>) <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
|
|
16
|
+
91: (<span class="ruby-value">2</span> <span class="ruby-operator">**</span> <span class="ruby-identifier">power</span>) <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
|
|
17
|
+
92: <span class="ruby-keyword kw">end</span></pre>
|
|
18
|
+
</body>
|
|
19
|
+
</html>
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
<h3 class="section-bar">Methods</h3>
|
|
87
87
|
|
|
88
88
|
<div class="name-list">
|
|
89
|
-
<a href="#
|
|
90
|
-
<a href="#
|
|
89
|
+
<a href="#M000036">setup</a>
|
|
90
|
+
<a href="#M000037">test_overflow</a>
|
|
91
91
|
</div>
|
|
92
92
|
</div>
|
|
93
93
|
|
|
@@ -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-M000036" class="method-detail">
|
|
120
|
+
<a name="M000036"></a>
|
|
121
121
|
|
|
122
122
|
<div class="method-heading">
|
|
123
|
-
<a href="MaximumCounterValue.src/
|
|
124
|
-
onclick="popupCode('MaximumCounterValue.src/
|
|
123
|
+
<a href="MaximumCounterValue.src/M000036.html" target="Code" class="method-signature"
|
|
124
|
+
onclick="popupCode('MaximumCounterValue.src/M000036.html');return false;">
|
|
125
125
|
<span class="method-name">setup</span><span class="method-args">()</span>
|
|
126
126
|
</a>
|
|
127
127
|
</div>
|
|
@@ -130,12 +130,12 @@
|
|
|
130
130
|
</div>
|
|
131
131
|
</div>
|
|
132
132
|
|
|
133
|
-
<div id="method-
|
|
134
|
-
<a name="
|
|
133
|
+
<div id="method-M000037" class="method-detail">
|
|
134
|
+
<a name="M000037"></a>
|
|
135
135
|
|
|
136
136
|
<div class="method-heading">
|
|
137
|
-
<a href="MaximumCounterValue.src/
|
|
138
|
-
onclick="popupCode('MaximumCounterValue.src/
|
|
137
|
+
<a href="MaximumCounterValue.src/M000037.html" target="Code" class="method-signature"
|
|
138
|
+
onclick="popupCode('MaximumCounterValue.src/M000037.html');return false;">
|
|
139
139
|
<span class="method-name">test_overflow</span><span class="method-args">()</span>
|
|
140
140
|
</a>
|
|
141
141
|
</div>
|
|
@@ -5,17 +5,19 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>setup (MaximumCounterValue)</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 samp/counter/counter_unitTest_spec.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File samp/counter/counter_unitTest_spec.rb, line 34</span>
|
|
14
|
+
34: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
|
|
15
|
+
35: <span class="ruby-ivar">@design</span> = <span class="ruby-constant">Counter</span>.<span class="ruby-identifier">new</span>
|
|
16
|
+
36: <span class="ruby-ivar">@design</span>.<span class="ruby-identifier">reset!</span>
|
|
17
|
+
37:
|
|
18
|
+
38: <span class="ruby-comment cmt"># increment the counter to maximum value</span>
|
|
19
|
+
39: <span class="ruby-constant">MAX</span>.<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-identifier">relay_verilog</span> <span class="ruby-keyword kw">end</span>
|
|
20
|
+
40: <span class="ruby-identifier">assert_equal</span> <span class="ruby-constant">MAX</span>, <span class="ruby-ivar">@design</span>.<span class="ruby-identifier">count</span>.<span class="ruby-identifier">intVal</span>
|
|
21
|
+
41: <span class="ruby-keyword kw">end</span></pre>
|
|
20
22
|
</body>
|
|
21
23
|
</html>
|
|
@@ -0,0 +1,21 @@
|
|
|
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>test_overflow (MaximumCounterValue)</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 samp/counter/counter_unitTest_spec.rb, line 43</span>
|
|
14
|
+
43: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">test_overflow</span>
|
|
15
|
+
44: <span class="ruby-comment cmt"># increment the counter</span>
|
|
16
|
+
45: <span class="ruby-identifier">relay_verilog</span>
|
|
17
|
+
46:
|
|
18
|
+
47: <span class="ruby-identifier">assert_equal</span> <span class="ruby-value">0</span>, <span class="ruby-ivar">@design</span>.<span class="ruby-identifier">count</span>.<span class="ruby-identifier">intVal</span>
|
|
19
|
+
48: <span class="ruby-keyword kw">end</span></pre>
|
|
20
|
+
</body>
|
|
21
|
+
</html>
|
|
@@ -92,8 +92,8 @@ Holds information about a parsed Verilog module.
|
|
|
92
92
|
<h3 class="section-bar">Methods</h3>
|
|
93
93
|
|
|
94
94
|
<div class="name-list">
|
|
95
|
-
<a href="#
|
|
96
|
-
<a href="#
|
|
95
|
+
<a href="#M000019">new</a>
|
|
96
|
+
<a href="#M000020">parse_declarations</a>
|
|
97
97
|
</div>
|
|
98
98
|
</div>
|
|
99
99
|
|
|
@@ -153,12 +153,12 @@ Holds information about a parsed Verilog module.
|
|
|
153
153
|
<div id="methods">
|
|
154
154
|
<h3 class="section-bar">Public Class methods</h3>
|
|
155
155
|
|
|
156
|
-
<div id="method-
|
|
157
|
-
<a name="
|
|
156
|
+
<div id="method-M000019" class="method-detail">
|
|
157
|
+
<a name="M000019"></a>
|
|
158
158
|
|
|
159
159
|
<div class="method-heading">
|
|
160
|
-
<a href="ModuleInfo.src/
|
|
161
|
-
onclick="popupCode('ModuleInfo.src/
|
|
160
|
+
<a href="ModuleInfo.src/M000019.html" target="Code" class="method-signature"
|
|
161
|
+
onclick="popupCode('ModuleInfo.src/M000019.html');return false;">
|
|
162
162
|
<span class="method-name">new</span><span class="method-args">(aDecl)</span>
|
|
163
163
|
</a>
|
|
164
164
|
</div>
|
|
@@ -167,12 +167,12 @@ Holds information about a parsed Verilog module.
|
|
|
167
167
|
</div>
|
|
168
168
|
</div>
|
|
169
169
|
|
|
170
|
-
<div id="method-
|
|
171
|
-
<a name="
|
|
170
|
+
<div id="method-M000020" class="method-detail">
|
|
171
|
+
<a name="M000020"></a>
|
|
172
172
|
|
|
173
173
|
<div class="method-heading">
|
|
174
|
-
<a href="ModuleInfo.src/
|
|
175
|
-
onclick="popupCode('ModuleInfo.src/
|
|
174
|
+
<a href="ModuleInfo.src/M000020.html" target="Code" class="method-signature"
|
|
175
|
+
onclick="popupCode('ModuleInfo.src/M000020.html');return false;">
|
|
176
176
|
<span class="method-name">parse_declarations</span><span class="method-args">(aInput)</span>
|
|
177
177
|
</a>
|
|
178
178
|
</div>
|
|
@@ -5,22 +5,40 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>new (ModuleInfo)</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 bin/generate_test.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File bin/generate_test.rb, line 84</span>
|
|
14
|
+
84: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">aDecl</span>
|
|
15
|
+
85: <span class="ruby-identifier">aDecl</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">%r{module\s+(\w+)\s*(\#\((.*?)\))?\s*\((.*?)\)\s*;}</span><span class="ruby-identifier">m</span>
|
|
16
|
+
86: <span class="ruby-ivar">@name</span>, <span class="ruby-identifier">paramDecl</span>, <span class="ruby-identifier">portDecl</span> = <span class="ruby-identifier">$1</span>, <span class="ruby-identifier">$3</span> <span class="ruby-operator">||</span> <span class="ruby-value str">''</span>, <span class="ruby-identifier">$4</span>
|
|
17
|
+
87:
|
|
18
|
+
88: <span class="ruby-comment cmt"># parse configuration parameters</span>
|
|
19
|
+
89: <span class="ruby-identifier">paramDecl</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{\bparameter\b}</span>, <span class="ruby-value str">''</span>
|
|
20
|
+
90: <span class="ruby-identifier">paramDecl</span>.<span class="ruby-identifier">strip!</span>
|
|
21
|
+
91:
|
|
22
|
+
92: <span class="ruby-ivar">@paramDecls</span> = <span class="ruby-identifier">paramDecl</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/,/</span>)
|
|
23
|
+
93:
|
|
24
|
+
94: <span class="ruby-ivar">@paramNames</span> = <span class="ruby-identifier">paramDecls</span>.<span class="ruby-identifier">inject</span>([]) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">acc</span>, <span class="ruby-identifier">decl</span><span class="ruby-operator">|</span>
|
|
25
|
+
95: <span class="ruby-identifier">acc</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">%r{\w+}</span>).<span class="ruby-identifier">first</span>
|
|
26
|
+
96: <span class="ruby-keyword kw">end</span>
|
|
27
|
+
97:
|
|
28
|
+
98: <span class="ruby-comment cmt"># parse signal parameters</span>
|
|
29
|
+
99: <span class="ruby-identifier">portDecl</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{\breg\b}</span>, <span class="ruby-value str">''</span>
|
|
30
|
+
100: <span class="ruby-identifier">portDecl</span>.<span class="ruby-identifier">strip!</span>
|
|
31
|
+
101:
|
|
32
|
+
102: <span class="ruby-ivar">@portDecls</span> = <span class="ruby-identifier">portDecl</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/,/</span>)
|
|
33
|
+
103:
|
|
34
|
+
104: <span class="ruby-ivar">@inputPortNames</span> = []
|
|
35
|
+
105:
|
|
36
|
+
106: <span class="ruby-ivar">@portNames</span> = <span class="ruby-identifier">portDecls</span>.<span class="ruby-identifier">inject</span>([]) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">acc</span>, <span class="ruby-identifier">decl</span><span class="ruby-operator">|</span>
|
|
37
|
+
107: <span class="ruby-identifier">name</span> = <span class="ruby-identifier">decl</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">%r{\w+}</span>).<span class="ruby-identifier">last</span>
|
|
38
|
+
108: <span class="ruby-ivar">@inputPortNames</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">name</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">decl</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\binput\b/</span>
|
|
39
|
+
109:
|
|
40
|
+
110: <span class="ruby-identifier">acc</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">name</span>
|
|
41
|
+
111: <span class="ruby-keyword kw">end</span>
|
|
42
|
+
112: <span class="ruby-keyword kw">end</span></pre>
|
|
25
43
|
</body>
|
|
26
44
|
</html>
|