ruby-vpi 15.0.2 → 16.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +23 -340
- data/Rakefile +169 -192
- data/bin/generate_test.rb +26 -25
- data/bin/generate_test_tpl/runner.rake +4 -10
- data/bin/header_to_ruby.rb +3 -20
- data/doc/README +11 -0
- data/doc/Rakefile +8 -21
- data/doc/common.css +44 -10
- data/doc/common.tpl +5 -10
- data/doc/history.doc +8 -7
- data/doc/history.html +228 -560
- data/doc/history.rb +7 -11
- data/doc/{history.yml → history.yaml} +325 -128
- data/doc/images/{feed-icon.png → feed-icon-28x28.png} +0 -0
- data/doc/images/ruby/LICENSE +15 -0
- data/doc/images/ruby/logo-reflection.png +0 -0
- data/doc/images/ruby/logo-reflection.xcf +0 -0
- data/doc/images/ruby/logo.png +0 -0
- data/doc/images/{LICENSE → tango/LICENSE} +0 -0
- data/doc/images/{caution.png → tango/caution.png} +0 -0
- data/doc/images/{caution.svg → tango/caution.svg} +0 -0
- data/doc/images/{home.png → tango/home.png} +0 -0
- data/doc/images/{home.svg → tango/home.svg} +0 -0
- data/doc/images/{important.png → tango/important.png} +0 -0
- data/doc/images/{important.svg → tango/important.svg} +0 -0
- data/doc/images/{next.png → tango/next.png} +0 -0
- data/doc/images/{next.svg → tango/next.svg} +0 -0
- data/doc/images/{note.png → tango/note.png} +0 -0
- data/doc/images/{note.svg → tango/note.svg} +0 -0
- data/doc/images/{prev.png → tango/prev.png} +0 -0
- data/doc/images/{prev.svg → tango/prev.svg} +0 -0
- data/doc/images/{tip.png → tango/tip.png} +0 -0
- data/doc/images/{tip.svg → tango/tip.svg} +0 -0
- data/doc/images/{up.png → tango/up.png} +0 -0
- data/doc/images/{up.svg → tango/up.svg} +0 -0
- data/doc/images/{warning.png → tango/warning.png} +0 -0
- data/doc/images/{warning.svg → tango/warning.svg} +0 -0
- data/doc/intro.inc +105 -36
- data/doc/lib/doc_format.rb +151 -29
- data/doc/lib/doc_proxy.rb +28 -69
- data/doc/lib/erb_content.rb +10 -22
- data/doc/lib/erb_proxy.rb +13 -24
- data/doc/manual.doc +16 -60
- data/doc/manual.html +257 -340
- data/doc/memo.doc +2 -0
- data/doc/memo.html +11 -11
- data/doc/readme.doc +36 -2
- data/doc/readme.html +214 -51
- data/doc/rss.erb +3 -3
- data/doc/rss.xml +217 -269
- data/ext/Rakefile +7 -22
- data/ext/common.h +10 -21
- data/ext/extconf.rb +5 -0
- data/ext/main.c +2 -18
- data/ext/main.h +1 -16
- data/ext/relay.c +3 -17
- data/ext/relay.h +3 -17
- data/ext/verilog.h +6 -18
- data/ext/vlog.c +3 -21
- data/ext/vlog.h +3 -17
- data/lib/ruby-vpi/erb.rb +7 -20
- data/lib/ruby-vpi/float.rb +6 -20
- data/lib/ruby-vpi/integer.rb +27 -47
- data/lib/ruby-vpi/rake.rb +4 -19
- data/lib/ruby-vpi/rcov.rb +6 -21
- data/lib/ruby-vpi/rdoc.rb +3 -21
- data/lib/ruby-vpi/runner.rb +28 -29
- data/lib/ruby-vpi/runner_proxy.rb +5 -21
- data/lib/ruby-vpi/verilog_parser.rb +5 -20
- data/lib/ruby-vpi/vpi.rb +420 -376
- data/lib/ruby-vpi.rb +26 -32
- data/ref/c/annotated.html +1 -1
- data/ref/c/common_8h.html +1 -1
- data/ref/c/files.html +1 -1
- data/ref/c/functions.html +1 -1
- data/ref/c/functions_vars.html +1 -1
- data/ref/c/globals.html +1 -1
- data/ref/c/globals_0x63.html +1 -1
- data/ref/c/globals_0x65.html +1 -1
- data/ref/c/globals_0x66.html +1 -1
- data/ref/c/globals_0x6d.html +1 -1
- data/ref/c/globals_0x70.html +1 -1
- data/ref/c/globals_0x72.html +1 -1
- data/ref/c/globals_0x73.html +1 -1
- data/ref/c/globals_0x74.html +1 -1
- data/ref/c/globals_0x76.html +1 -1
- data/ref/c/globals_0x78.html +1 -1
- data/ref/c/globals_defs.html +1 -1
- data/ref/c/globals_defs_0x65.html +1 -1
- data/ref/c/globals_defs_0x70.html +1 -1
- data/ref/c/globals_defs_0x76.html +1 -1
- data/ref/c/globals_defs_0x78.html +1 -1
- data/ref/c/globals_enum.html +1 -1
- data/ref/c/globals_eval.html +1 -1
- data/ref/c/globals_func.html +1 -1
- data/ref/c/globals_type.html +1 -1
- data/ref/c/globals_vars.html +1 -1
- data/ref/c/index.html +1 -1
- data/ref/c/main_8c.html +1 -1
- data/ref/c/main_8h.html +1 -1
- data/ref/c/relay_8c.html +1 -1
- data/ref/c/relay_8h.html +1 -1
- data/ref/c/structt__cb__data.html +1 -1
- data/ref/c/structt__vpi__delay.html +1 -1
- data/ref/c/structt__vpi__error__info.html +1 -1
- data/ref/c/structt__vpi__strengthval.html +1 -1
- data/ref/c/structt__vpi__systf__data.html +1 -1
- data/ref/c/structt__vpi__time.html +1 -1
- data/ref/c/structt__vpi__value.html +1 -1
- data/ref/c/structt__vpi__vecval.html +1 -1
- data/ref/c/structt__vpi__vlog__info.html +1 -1
- data/ref/c/verilog_8h.html +1 -1
- data/ref/c/vlog_8c.html +1 -1
- data/ref/c/vlog_8h.html +1 -1
- data/ref/c/vpi__user_8h.html +1 -1
- data/ref/ruby/classes/ERB.html +5 -5
- data/ref/ruby/classes/ERB.src/{M000026.html → M000024.html} +15 -15
- data/ref/ruby/classes/FileUtils.html +10 -10
- data/ref/ruby/classes/FileUtils.src/{M000027.html → M000025.html} +4 -4
- data/ref/ruby/classes/FileUtils.src/{M000028.html → M000026.html} +4 -4
- data/ref/ruby/classes/Float.html +5 -5
- data/ref/ruby/classes/Float.src/{M000022.html → M000020.html} +5 -5
- data/ref/ruby/classes/Integer.html +20 -56
- data/ref/ruby/classes/Integer.src/M000008.html +11 -11
- data/ref/ruby/classes/Integer.src/M000009.html +4 -4
- data/ref/ruby/classes/Integer.src/M000010.html +4 -4
- data/ref/ruby/classes/Integer.src/M000011.html +4 -4
- data/ref/ruby/classes/Integer.src/M000012.html +4 -4
- data/ref/ruby/classes/Integer.src/M000013.html +4 -4
- data/ref/ruby/classes/Integer.src/M000016.html +12 -9
- data/ref/ruby/classes/Integer.src/M000017.html +18 -9
- data/ref/ruby/classes/Integer.src/M000018.html +12 -12
- data/ref/ruby/classes/Integer.src/M000019.html +17 -18
- data/ref/ruby/classes/RDoc.src/M000053.html +25 -25
- data/ref/ruby/classes/RubyVpi/Config.html +3 -3
- data/ref/ruby/classes/RubyVpi.html +11 -5
- data/ref/ruby/classes/RubyVpi.src/{M000029.html → M000027.html} +103 -101
- data/ref/ruby/classes/String.html +21 -15
- data/ref/ruby/classes/String.src/M000021.html +36 -0
- data/ref/ruby/classes/String.src/{M000024.html → M000022.html} +24 -24
- data/ref/ruby/classes/String.src/M000023.html +5 -23
- data/ref/ruby/classes/VerilogParser/Module/Parameter.src/M000007.html +5 -5
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000003.html +7 -7
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000004.html +4 -4
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000005.html +4 -4
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000006.html +4 -4
- data/ref/ruby/classes/VerilogParser/Module.src/M000002.html +20 -20
- data/ref/ruby/classes/VerilogParser.html +6 -0
- data/ref/ruby/classes/VerilogParser.src/M000001.html +20 -20
- data/ref/ruby/classes/Vpi/Handle.html +89 -88
- data/ref/ruby/classes/Vpi/Handle.src/M000036.html +18 -0
- data/ref/ruby/classes/Vpi/Handle.src/M000037.html +5 -5
- data/ref/ruby/classes/Vpi/Handle.src/M000038.html +5 -5
- data/ref/ruby/classes/Vpi/Handle.src/M000039.html +5 -5
- data/ref/ruby/classes/Vpi/Handle.src/M000040.html +8 -5
- data/ref/ruby/classes/Vpi/Handle.src/M000041.html +8 -8
- data/ref/ruby/classes/Vpi/Handle.src/M000042.html +7 -6
- data/ref/ruby/classes/Vpi/Handle.src/M000043.html +31 -9
- data/ref/ruby/classes/Vpi/Handle.src/M000044.html +74 -31
- data/ref/ruby/classes/Vpi/Handle.src/M000045.html +17 -74
- data/ref/ruby/classes/Vpi/Handle.src/M000046.html +11 -17
- data/ref/ruby/classes/Vpi/Handle.src/M000048.html +31 -0
- data/ref/ruby/classes/Vpi/Handle.src/M000049.html +53 -52
- data/ref/ruby/classes/Vpi/S_vpi_time.src/M000050.html +4 -4
- data/ref/ruby/classes/Vpi/S_vpi_time.src/M000051.html +5 -5
- data/ref/ruby/classes/Vpi/S_vpi_value.html +15 -15
- data/ref/ruby/classes/Vpi/S_vpi_value.src/{M000036.html → M000033.html} +5 -5
- data/ref/ruby/classes/Vpi/S_vpi_value.src/M000034.html +5 -5
- data/ref/ruby/classes/Vpi/S_vpi_value.src/M000035.html +5 -5
- data/ref/ruby/classes/Vpi.html +48 -19
- data/ref/ruby/classes/Vpi.src/M000028.html +28 -0
- data/ref/ruby/classes/Vpi.src/M000029.html +18 -0
- data/ref/ruby/classes/Vpi.src/M000030.html +25 -15
- data/ref/ruby/classes/Vpi.src/M000031.html +9 -5
- data/ref/ruby/classes/Vpi.src/M000032.html +9 -25
- data/ref/ruby/created.rid +1 -1
- data/ref/ruby/files/bin/generate_test_rb.html +2 -1
- data/ref/ruby/files/bin/header_to_ruby_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/erb_rb.html +7 -1
- data/ref/ruby/files/lib/ruby-vpi/float_rb.html +7 -1
- data/ref/ruby/files/lib/ruby-vpi/integer_rb.html +7 -1
- data/ref/ruby/files/lib/ruby-vpi/rake_rb.html +7 -1
- data/ref/ruby/files/lib/ruby-vpi/rcov_rb.html +7 -1
- data/ref/ruby/files/lib/ruby-vpi/rdoc_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/runner_proxy_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/runner_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/verilog_parser_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/vpi_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi_rb.html +7 -1
- data/ref/ruby/fr_method_index.html +34 -34
- data/samp/counter/counter_rspec_runner.rake +4 -0
- data/samp/counter/counter_xunit_runner.rake +4 -0
- data/samp/pipelined_alu/Hw5UnitModel.rb +3 -19
- data/samp/pipelined_alu/README +38 -13
- data/samp/pipelined_alu/TestHw5UnitModel.rb +9 -20
- data/samp/pipelined_alu/hw5_unit.v +1 -16
- data/samp/pipelined_alu/hw5_unit_test_runner.rake +4 -0
- data/samp/pipelined_alu/hw5_unit_test_spec.rb +3 -20
- data/samp/pipelined_alu/int_gen.rb +6 -20
- metadata +47 -43
- data/doc/LICENSE +0 -397
- data/doc/images/feed-icon.LICENSE +0 -2
- data/doc/images/feed-icon.svg +0 -18
- data/ref/ruby/classes/Integer.src/M000020.html +0 -25
- data/ref/ruby/classes/Integer.src/M000021.html +0 -30
- data/ref/ruby/classes/String.src/M000025.html +0 -18
- data/ref/ruby/classes/Vpi/Handle.src/M000047.html +0 -24
- data/ref/ruby/classes/Vpi.src/M000033.html +0 -22
|
@@ -20,59 +20,59 @@
|
|
|
20
20
|
<div id="index">
|
|
21
21
|
<h1 class="section-bar">Methods</h1>
|
|
22
22
|
<div id="index-entries">
|
|
23
|
-
<a href="classes/Vpi/Handle.html#
|
|
24
|
-
<a href="classes/Vpi.html#
|
|
25
|
-
<a href="classes/
|
|
26
|
-
<a href="classes/
|
|
27
|
-
<a href="classes/Integer.html#
|
|
28
|
-
<a href="classes/
|
|
29
|
-
<a href="classes/Vpi/Handle.html#
|
|
30
|
-
<a href="classes/
|
|
31
|
-
<a href="classes/RubyVpi.html#M000029">init_bench (RubyVpi)</a><br />
|
|
23
|
+
<a href="classes/Vpi/Handle.html#M000045">[] (Vpi::Handle)</a><br />
|
|
24
|
+
<a href="classes/Vpi.html#M000030">advance_time (Vpi)</a><br />
|
|
25
|
+
<a href="classes/Vpi/Handle.html#M000048">cbValueChange (Vpi::Handle)</a><br />
|
|
26
|
+
<a href="classes/FileUtils.html#M000026">collect_args (FileUtils)</a><br />
|
|
27
|
+
<a href="classes/Integer.html#M000018">extend_sign (Integer)</a><br />
|
|
28
|
+
<a href="classes/Vpi/Handle.html#M000043">get_value (Vpi::Handle)</a><br />
|
|
29
|
+
<a href="classes/Vpi/Handle.html#M000042">get_value_wrapper (Vpi::Handle)</a><br />
|
|
30
|
+
<a href="classes/RubyVpi.html#M000027">init_bench (RubyVpi)</a><br />
|
|
32
31
|
<a href="classes/VerilogParser/Module/Port.html#M000004">input? (VerilogParser::Module::Port)</a><br />
|
|
33
|
-
<a href="classes/Vpi/Handle.html#
|
|
32
|
+
<a href="classes/Vpi/Handle.html#M000046">inspect (Vpi::Handle)</a><br />
|
|
34
33
|
<a href="classes/Vpi/S_vpi_time.html#M000050">integer (Vpi::S_vpi_time)</a><br />
|
|
35
34
|
<a href="classes/Vpi/S_vpi_time.html#M000051">integer= (Vpi::S_vpi_time)</a><br />
|
|
36
35
|
<a href="classes/Integer.html#M000009">length (Integer)</a><br />
|
|
37
36
|
<a href="classes/Integer.html#M000010">limit (Integer)</a><br />
|
|
38
37
|
<a href="classes/Integer.html#M000008">log2 (Integer)</a><br />
|
|
39
|
-
<a href="classes/Float.html#
|
|
38
|
+
<a href="classes/Float.html#M000020">mantissa (Float)</a><br />
|
|
40
39
|
<a href="classes/Integer.html#M000012">mask (Integer)</a><br />
|
|
41
40
|
<a href="classes/Integer.html#M000014">max (Integer)</a><br />
|
|
42
41
|
<a href="classes/Vpi/Handle.html#M000049">method_missing (Vpi::Handle)</a><br />
|
|
43
|
-
<a href="classes/Vpi/Handle.html#
|
|
42
|
+
<a href="classes/Vpi/Handle.html#M000041">negedge? (Vpi::Handle)</a><br />
|
|
44
43
|
<a href="classes/VerilogParser.html#M000001">new (VerilogParser)</a><br />
|
|
44
|
+
<a href="classes/VerilogParser/Module/Parameter.html#M000007">new (VerilogParser::Module::Parameter)</a><br />
|
|
45
|
+
<a href="classes/Vpi.html#M000032">new (Vpi)</a><br />
|
|
46
|
+
<a href="classes/ERB.html#M000024">new (ERB)</a><br />
|
|
45
47
|
<a href="classes/VerilogParser/Module/Port.html#M000003">new (VerilogParser::Module::Port)</a><br />
|
|
46
48
|
<a href="classes/VerilogParser/Module.html#M000002">new (VerilogParser::Module)</a><br />
|
|
47
|
-
<a href="classes/VerilogParser/Module/Parameter.html#M000007">new (VerilogParser::Module::Parameter)</a><br />
|
|
48
|
-
<a href="classes/ERB.html#M000026">new (ERB)</a><br />
|
|
49
49
|
<a href="classes/VerilogParser/Module/Port.html#M000005">output? (VerilogParser::Module::Port)</a><br />
|
|
50
|
-
<a href="classes/Integer.html#
|
|
51
|
-
<a href="classes/Vpi/Handle.html#
|
|
52
|
-
<a href="classes/Vpi/Handle.html#
|
|
50
|
+
<a href="classes/Integer.html#M000016">pack (Integer)</a><br />
|
|
51
|
+
<a href="classes/Vpi/Handle.html#M000040">posedge? (Vpi::Handle)</a><br />
|
|
52
|
+
<a href="classes/Vpi/Handle.html#M000044">put_value (Vpi::Handle)</a><br />
|
|
53
53
|
<a href="classes/VerilogParser/Module/Port.html#M000006">reg? (VerilogParser::Module::Port)</a><br />
|
|
54
|
-
<a href="classes/FileUtils.html#
|
|
55
|
-
<a href="classes/Vpi.html#
|
|
56
|
-
<a href="classes/Vpi.html#
|
|
57
|
-
<a href="classes/Integer.html#
|
|
58
|
-
<a href="classes/Vpi/S_vpi_value.html#
|
|
59
|
-
<a href="classes/String.html#
|
|
54
|
+
<a href="classes/FileUtils.html#M000025">sh (FileUtils)</a><br />
|
|
55
|
+
<a href="classes/Vpi.html#M000029">simulate (Vpi)</a><br />
|
|
56
|
+
<a href="classes/Vpi.html#M000031">simulation_time (Vpi)</a><br />
|
|
57
|
+
<a href="classes/Integer.html#M000019">split (Integer)</a><br />
|
|
58
|
+
<a href="classes/Vpi/S_vpi_value.html#M000034">to_f (Vpi::S_vpi_value)</a><br />
|
|
59
|
+
<a href="classes/String.html#M000021">to_f (String)</a><br />
|
|
60
60
|
<a href="classes/Vpi/S_vpi_time.html#M000052">to_i (Vpi::S_vpi_time)</a><br />
|
|
61
|
-
<a href="classes/Vpi/S_vpi_value.html#
|
|
61
|
+
<a href="classes/Vpi/S_vpi_value.html#M000033">to_i (Vpi::S_vpi_value)</a><br />
|
|
62
62
|
<a href="classes/Integer.html#M000011">to_limit (Integer)</a><br />
|
|
63
63
|
<a href="classes/Integer.html#M000013">to_mask (Integer)</a><br />
|
|
64
64
|
<a href="classes/Integer.html#M000015">to_max (Integer)</a><br />
|
|
65
|
-
<a href="classes/String.html#
|
|
66
|
-
<a href="classes/Vpi/Handle.html#
|
|
67
|
-
<a href="classes/Vpi/S_vpi_value.html#
|
|
68
|
-
<a href="classes/Integer.html#
|
|
65
|
+
<a href="classes/String.html#M000023">to_ruby_const_name (String)</a><br />
|
|
66
|
+
<a href="classes/Vpi/Handle.html#M000047">to_s (Vpi::Handle)</a><br />
|
|
67
|
+
<a href="classes/Vpi/S_vpi_value.html#M000035">to_s (Vpi::S_vpi_value)</a><br />
|
|
68
|
+
<a href="classes/Integer.html#M000017">unpack (Integer)</a><br />
|
|
69
69
|
<a href="classes/RDoc.html#M000053">usage_from_file (RDoc)</a><br />
|
|
70
|
-
<a href="classes/String.html#
|
|
71
|
-
<a href="classes/Vpi.html#
|
|
72
|
-
<a href="classes/Vpi/Handle.html#
|
|
73
|
-
<a href="classes/Vpi/Handle.html#
|
|
74
|
-
<a href="classes/Vpi/Handle.html#
|
|
75
|
-
<a href="classes/Vpi/Handle.html#
|
|
70
|
+
<a href="classes/String.html#M000022">verilog_to_ruby (String)</a><br />
|
|
71
|
+
<a href="classes/Vpi.html#M000028">vpi_register_cb (Vpi)</a><br />
|
|
72
|
+
<a href="classes/Vpi/Handle.html#M000037">x! (Vpi::Handle)</a><br />
|
|
73
|
+
<a href="classes/Vpi/Handle.html#M000036">x? (Vpi::Handle)</a><br />
|
|
74
|
+
<a href="classes/Vpi/Handle.html#M000039">z! (Vpi::Handle)</a><br />
|
|
75
|
+
<a href="classes/Vpi/Handle.html#M000038">z? (Vpi::Handle)</a><br />
|
|
76
76
|
</div>
|
|
77
77
|
</div>
|
|
78
78
|
</body>
|
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
This file is part of Ruby-VPI.
|
|
5
|
-
|
|
6
|
-
Ruby-VPI is free software; you can redistribute it and/or
|
|
7
|
-
modify it under the terms of the GNU General Public License
|
|
8
|
-
as published by the Free Software Foundation; either version 2
|
|
9
|
-
of the License, or (at your option) any later version.
|
|
10
|
-
|
|
11
|
-
Ruby-VPI is distributed in the hope that it will be useful,
|
|
12
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU General Public License for more details.
|
|
15
|
-
|
|
16
|
-
You should have received a copy of the GNU General Public License
|
|
17
|
-
along with Ruby-VPI; if not, write to the Free Software Foundation,
|
|
18
|
-
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
19
|
-
=end
|
|
1
|
+
#--
|
|
2
|
+
# Copyright 2006 Suraj N. Kurapati
|
|
3
|
+
# See the file named LICENSE for details.
|
|
20
4
|
|
|
21
5
|
# Behavioral model of the hw5_unit Verilog module.
|
|
22
6
|
class Hw5UnitModel
|
data/samp/pipelined_alu/README
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
PIPELINED ALU
|
|
2
2
|
|
|
3
|
-
This example is my solution to a homework assignment for an Advanced Logic
|
|
3
|
+
This example is my solution to a homework assignment for an Advanced Logic
|
|
4
|
+
Design class I had taken during the Winter of 2006 at University of
|
|
5
|
+
California, Santa Cruz. Relevant portions of the problem have been revised and
|
|
6
|
+
reproduced here with permission from the instructor: professor Jose Renau.
|
|
4
7
|
|
|
5
8
|
|
|
6
9
|
|
|
@@ -44,13 +47,20 @@ PROBLEM
|
|
|
44
47
|
|
|
45
48
|
5. OP_MULT must have 3 cycles latency.
|
|
46
49
|
|
|
47
|
-
6. There is only one result (res). Since three operations can finish every
|
|
50
|
+
6. There is only one result (res). Since three operations can finish every
|
|
51
|
+
cycle, you need to buffer the other two. Note that since at most one operation
|
|
52
|
+
starts per cycle, a 3-entry buffer should be enough.
|
|
48
53
|
|
|
49
|
-
7. Each operation has an associated tag (in_databits) which you must pass back
|
|
54
|
+
7. Each operation has an associated tag (in_databits) which you must pass back
|
|
55
|
+
with the result (out_databits). For example, if a OP_MULT operation is started
|
|
56
|
+
with parameters a=2, b=4, in_databits=3; then after the multiplication
|
|
57
|
+
finishes three cycles later, the outputs should be res=8, out_databits=3,
|
|
58
|
+
out_op=OP_MULT.
|
|
50
59
|
|
|
51
60
|
8. The testbench used to verify this module must:
|
|
52
61
|
|
|
53
|
-
a. Test random combinations of positive, zero, one, prime numbers,
|
|
62
|
+
a. Test random combinations of positive, zero, one, prime numbers,
|
|
63
|
+
power-of-two values from powers 1 to 32, and random numbers.
|
|
54
64
|
|
|
55
65
|
b. Execute random combinations of add, subtract, and multiply operations.
|
|
56
66
|
|
|
@@ -60,7 +70,10 @@ PROBLEM
|
|
|
60
70
|
|
|
61
71
|
DESIGN
|
|
62
72
|
|
|
63
|
-
From the start, my approach was to use a single queue to solve the resource
|
|
73
|
+
From the start, my approach was to use a single queue to solve the resource
|
|
74
|
+
conflict (only one ALU can give an output per cycle). After drawing some
|
|
75
|
+
sketches and understanding the problem, I wrote the following algorithm to
|
|
76
|
+
solve the resource conflict:
|
|
64
77
|
|
|
65
78
|
def queue_results(a, b, c)
|
|
66
79
|
output a
|
|
@@ -68,7 +81,10 @@ DESIGN
|
|
|
68
81
|
end
|
|
69
82
|
|
|
70
83
|
|
|
71
|
-
We cannot perform all the operations in the queue_results method using only
|
|
84
|
+
We cannot perform all the operations in the queue_results method using only
|
|
85
|
+
one cycle. However, if the queue_results method is not implemented as shown,
|
|
86
|
+
then the design will not work---it will be chaotic and produce incoherent
|
|
87
|
+
results.
|
|
72
88
|
|
|
73
89
|
The trick is to satisfy the post-conditions of the queue_results method (one result is outputted and the other two have been queued) using multiple clock cycles:
|
|
74
90
|
|
|
@@ -88,15 +104,23 @@ DESIGN
|
|
|
88
104
|
2. enqueue c; output a
|
|
89
105
|
(nothing to remember)
|
|
90
106
|
|
|
91
|
-
Note that we cannot output the 'a' result during the first cycle because that
|
|
107
|
+
Note that we cannot output the 'a' result during the first cycle because that
|
|
108
|
+
would violate the post-conditions.
|
|
92
109
|
|
|
93
110
|
|
|
94
|
-
After gaining this understanding, I realized that a separate queue was wholly
|
|
111
|
+
After gaining this understanding, I realized that a separate queue was wholly
|
|
112
|
+
unnecessary. Instead, I could simply use pipeline registers to remember values
|
|
113
|
+
until they were needed (i.e. the 'a' result is output only in the last cycle).
|
|
95
114
|
|
|
96
|
-
This approach uses exactly the same number of pipeline registers (three in
|
|
115
|
+
This approach uses exactly the same number of pipeline registers (three in
|
|
116
|
+
this case) as the size of the queue suggested by the Professor. Also, this
|
|
117
|
+
approach uses less storage than the three-queues (one for each ALU output;
|
|
118
|
+
therefore 9 registers) approach suggested by the Professor.
|
|
97
119
|
|
|
98
120
|
|
|
99
|
-
Finally, I wrote a behavioral model (see MODEL section) of the RTL using Ruby
|
|
121
|
+
Finally, I wrote a behavioral model (see MODEL section) of the RTL using Ruby
|
|
122
|
+
and verified both my initial approach (magical single-cycle queueing of
|
|
123
|
+
multiple items) and its later improvement (the pipeline-register approach).
|
|
100
124
|
|
|
101
125
|
|
|
102
126
|
|
|
@@ -106,7 +130,8 @@ MODEL
|
|
|
106
130
|
$ ruby -w TestHw5UnitModel.rb # use the "-d" option for details
|
|
107
131
|
|
|
108
132
|
|
|
109
|
-
The model is written in Ruby and comes with a unit test which is similar to
|
|
133
|
+
The model is written in Ruby and comes with a unit test which is similar to
|
|
134
|
+
the Ruby-VPI test bench I wrote for the RTL implementation.
|
|
110
135
|
|
|
111
136
|
|
|
112
137
|
|
|
@@ -123,5 +148,5 @@ TEST BENCH
|
|
|
123
148
|
|
|
124
149
|
|
|
125
150
|
|
|
126
|
-
The test bench structure was ported from my unit test for the behavioral model
|
|
127
|
-
|
|
151
|
+
The test bench structure was ported from my unit test for the behavioral model
|
|
152
|
+
of hw5_unit.
|
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
This file is part of Ruby-VPI.
|
|
5
|
-
|
|
6
|
-
Ruby-VPI is free software; you can redistribute it and/or
|
|
7
|
-
modify it under the terms of the GNU General Public License
|
|
8
|
-
as published by the Free Software Foundation; either version 2
|
|
9
|
-
of the License, or (at your option) any later version.
|
|
10
|
-
|
|
11
|
-
Ruby-VPI is distributed in the hope that it will be useful,
|
|
12
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU General Public License for more details.
|
|
15
|
-
|
|
16
|
-
You should have received a copy of the GNU General Public License
|
|
17
|
-
along with Ruby-VPI; if not, write to the Free Software Foundation,
|
|
18
|
-
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
19
|
-
=end
|
|
1
|
+
#--
|
|
2
|
+
# Copyright 2006 Suraj N. Kurapati
|
|
3
|
+
# See the file named LICENSE for details.
|
|
20
4
|
|
|
21
5
|
require 'InputGenerator'
|
|
22
6
|
require 'Hw5UnitModel'
|
|
@@ -41,7 +25,12 @@ class TestHw5UnitModel < Test::Unit::TestCase
|
|
|
41
25
|
inputQueue = []
|
|
42
26
|
|
|
43
27
|
NUM_VECTORS.times do |i|
|
|
44
|
-
inputQueue << Hw5UnitModel::Operation.new(
|
|
28
|
+
inputQueue << Hw5UnitModel::Operation.new(
|
|
29
|
+
Hw5UnitModel::OPERATIONS[rand(Hw5UnitModel::OPERATIONS.size)],
|
|
30
|
+
i,
|
|
31
|
+
@ingen.gen.abs,
|
|
32
|
+
@ingen.gen.abs
|
|
33
|
+
)
|
|
45
34
|
end
|
|
46
35
|
|
|
47
36
|
|
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
Copyright 2006 Suraj N. Kurapati
|
|
3
|
-
|
|
4
|
-
This file is part of Ruby-VPI.
|
|
5
|
-
|
|
6
|
-
Ruby-VPI is free software; you can redistribute it and/or
|
|
7
|
-
modify it under the terms of the GNU General Public License
|
|
8
|
-
as published by the Free Software Foundation; either version 2
|
|
9
|
-
of the License, or (at your option) any later version.
|
|
10
|
-
|
|
11
|
-
Ruby-VPI is distributed in the hope that it will be useful,
|
|
12
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU General Public License for more details.
|
|
15
|
-
|
|
16
|
-
You should have received a copy of the GNU General Public License
|
|
17
|
-
along with Ruby-VPI; if not, write to the Free Software Foundation,
|
|
18
|
-
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
3
|
+
See the file named LICENSE for details.
|
|
19
4
|
*/
|
|
20
5
|
|
|
21
6
|
`define WIDTH 32
|
|
@@ -1,24 +1,7 @@
|
|
|
1
|
-
=begin
|
|
2
|
-
Copyright 2006 Suraj N. Kurapati
|
|
3
|
-
|
|
4
|
-
This file is part of Ruby-VPI.
|
|
5
|
-
|
|
6
|
-
Ruby-VPI is free software; you can redistribute it and/or
|
|
7
|
-
modify it under the terms of the GNU General Public License
|
|
8
|
-
as published by the Free Software Foundation; either version 2
|
|
9
|
-
of the License, or (at your option) any later version.
|
|
10
|
-
|
|
11
|
-
Ruby-VPI is distributed in the hope that it will be useful,
|
|
12
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU General Public License for more details.
|
|
15
|
-
|
|
16
|
-
You should have received a copy of the GNU General Public License
|
|
17
|
-
along with Ruby-VPI; if not, write to the Free Software Foundation,
|
|
18
|
-
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
19
|
-
=end
|
|
20
|
-
|
|
21
1
|
# This file is a behavioral specification for the design under test.
|
|
2
|
+
#--
|
|
3
|
+
# Copyright 2006 Suraj N. Kurapati
|
|
4
|
+
# See the file named LICENSE for details.
|
|
22
5
|
|
|
23
6
|
require 'int_gen'
|
|
24
7
|
|
|
@@ -1,22 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Ruby-VPI is free software; you can redistribute it and/or
|
|
7
|
-
modify it under the terms of the GNU General Public License
|
|
8
|
-
as published by the Free Software Foundation; either version 2
|
|
9
|
-
of the License, or (at your option) any later version.
|
|
10
|
-
|
|
11
|
-
Ruby-VPI is distributed in the hope that it will be useful,
|
|
12
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU General Public License for more details.
|
|
15
|
-
|
|
16
|
-
You should have received a copy of the GNU General Public License
|
|
17
|
-
along with Ruby-VPI; if not, write to the Free Software Foundation,
|
|
18
|
-
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
19
|
-
=end
|
|
1
|
+
# Library for generating integers.
|
|
2
|
+
#--
|
|
3
|
+
# Copyright 2006 Suraj N. Kurapati
|
|
4
|
+
# See the file named LICENSE for details.
|
|
20
5
|
|
|
21
6
|
# Generates random integers of configurable length.
|
|
22
7
|
class IntegerGenerator
|
|
@@ -27,7 +12,8 @@ class IntegerGenerator
|
|
|
27
12
|
|
|
28
13
|
attr_reader :bits
|
|
29
14
|
|
|
30
|
-
# Generates random integers that are representable by the given number of
|
|
15
|
+
# Generates random integers that are representable by the given number of
|
|
16
|
+
# bits.
|
|
31
17
|
def initialize aBits
|
|
32
18
|
@bits = aBits
|
|
33
19
|
@limit = 2 ** @bits
|
metadata
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
|
-
rubygems_version: 0.9.
|
|
2
|
+
rubygems_version: 0.9.2
|
|
3
3
|
specification_version: 1
|
|
4
4
|
name: ruby-vpi
|
|
5
5
|
version: !ruby/object:Gem::Version
|
|
6
|
-
version:
|
|
7
|
-
date: 2007-
|
|
6
|
+
version: 16.0.0
|
|
7
|
+
date: 2007-05-02 00:00:00 -07:00
|
|
8
8
|
summary: Ruby interface to IEEE 1364-2005 Verilog VPI
|
|
9
9
|
require_paths:
|
|
10
10
|
- lib
|
|
11
11
|
email:
|
|
12
12
|
homepage: http://ruby-vpi.rubyforge.org
|
|
13
13
|
rubyforge_project: ruby-vpi
|
|
14
|
-
description: Ruby-VPI is a Ruby interface to IEEE 1364-2005 Verilog VPI. It lets you create complex Verilog test benches easily and wholly in Ruby.
|
|
14
|
+
description: Ruby-VPI is a Ruby interface to IEEE 1364-2005 Verilog VPI and a platform for unit testing, rapid prototyping, and systems integration of Verilog modules through Ruby. It lets you create complex Verilog test benches easily and wholly in Ruby.
|
|
15
15
|
autorequire: ruby-vpi
|
|
16
16
|
default_executable:
|
|
17
17
|
bindir: bin
|
|
@@ -76,53 +76,57 @@ files:
|
|
|
76
76
|
- lib/ruby-vpi/float.rb
|
|
77
77
|
- lib/ruby-vpi/vpi.rb
|
|
78
78
|
- lib/ruby-vpi/verilog_parser.rb
|
|
79
|
-
- doc/history.
|
|
79
|
+
- doc/history.rb
|
|
80
80
|
- doc/Rakefile
|
|
81
81
|
- doc/figures
|
|
82
82
|
- doc/images
|
|
83
83
|
- doc/rss.erb
|
|
84
|
-
- doc/
|
|
84
|
+
- doc/rss.xml
|
|
85
85
|
- doc/memo.doc
|
|
86
86
|
- doc/manual.doc
|
|
87
87
|
- doc/history.doc
|
|
88
88
|
- doc/common.css
|
|
89
89
|
- doc/readme.doc
|
|
90
90
|
- doc/common.tpl
|
|
91
|
-
- doc/
|
|
91
|
+
- doc/memo.html
|
|
92
92
|
- doc/intro.inc
|
|
93
93
|
- doc/lib
|
|
94
|
-
- doc/memo.html
|
|
95
94
|
- doc/manual.html
|
|
96
95
|
- doc/history.html
|
|
97
96
|
- doc/readme.html
|
|
98
|
-
- doc/
|
|
97
|
+
- doc/history.yaml
|
|
98
|
+
- doc/README
|
|
99
99
|
- doc/print.css
|
|
100
100
|
- doc/figures/figures.dia
|
|
101
101
|
- doc/figures/ruby_relay.png
|
|
102
102
|
- doc/figures/organization.png
|
|
103
103
|
- doc/figures/organization_detailed.png
|
|
104
|
-
- doc/images/
|
|
105
|
-
- doc/images/
|
|
106
|
-
- doc/images/
|
|
107
|
-
- doc/images/
|
|
108
|
-
- doc/images/
|
|
109
|
-
- doc/images/
|
|
110
|
-
- doc/images/
|
|
111
|
-
- doc/images/
|
|
112
|
-
- doc/images/
|
|
113
|
-
- doc/images/important.
|
|
114
|
-
- doc/images/next.png
|
|
115
|
-
- doc/images/
|
|
116
|
-
- doc/images/
|
|
117
|
-
- doc/images/
|
|
118
|
-
- doc/images/
|
|
119
|
-
- doc/images/
|
|
120
|
-
- doc/images/
|
|
121
|
-
- doc/images/
|
|
122
|
-
- doc/images/
|
|
123
|
-
- doc/images/
|
|
124
|
-
- doc/images/
|
|
125
|
-
- doc/images/
|
|
104
|
+
- doc/images/feed-icon-28x28.png
|
|
105
|
+
- doc/images/ruby
|
|
106
|
+
- doc/images/tango
|
|
107
|
+
- doc/images/ruby/logo.png
|
|
108
|
+
- doc/images/ruby/LICENSE
|
|
109
|
+
- doc/images/ruby/logo-reflection.png
|
|
110
|
+
- doc/images/ruby/logo-reflection.xcf
|
|
111
|
+
- doc/images/tango/caution.png
|
|
112
|
+
- doc/images/tango/home.png
|
|
113
|
+
- doc/images/tango/important.png
|
|
114
|
+
- doc/images/tango/next.png
|
|
115
|
+
- doc/images/tango/note.png
|
|
116
|
+
- doc/images/tango/prev.png
|
|
117
|
+
- doc/images/tango/tip.png
|
|
118
|
+
- doc/images/tango/up.png
|
|
119
|
+
- doc/images/tango/warning.png
|
|
120
|
+
- doc/images/tango/caution.svg
|
|
121
|
+
- doc/images/tango/home.svg
|
|
122
|
+
- doc/images/tango/important.svg
|
|
123
|
+
- doc/images/tango/next.svg
|
|
124
|
+
- doc/images/tango/note.svg
|
|
125
|
+
- doc/images/tango/prev.svg
|
|
126
|
+
- doc/images/tango/tip.svg
|
|
127
|
+
- doc/images/tango/up.svg
|
|
128
|
+
- doc/images/tango/warning.svg
|
|
129
|
+
- doc/images/tango/LICENSE
|
|
126
130
|
- doc/lib/doc_format.rb
|
|
127
131
|
- doc/lib/doc_proxy.rb
|
|
128
132
|
- doc/lib/erb_content.rb
|
|
@@ -276,29 +280,29 @@ files:
|
|
|
276
280
|
- ref/ruby/classes/Integer.src/M000017.html
|
|
277
281
|
- ref/ruby/classes/Integer.src/M000018.html
|
|
278
282
|
- ref/ruby/classes/Integer.src/M000019.html
|
|
279
|
-
- ref/ruby/classes/
|
|
280
|
-
- ref/ruby/classes/
|
|
281
|
-
- ref/ruby/classes/
|
|
283
|
+
- ref/ruby/classes/Float.src/M000020.html
|
|
284
|
+
- ref/ruby/classes/String.src/M000021.html
|
|
285
|
+
- ref/ruby/classes/String.src/M000022.html
|
|
282
286
|
- ref/ruby/classes/String.src/M000023.html
|
|
283
|
-
- ref/ruby/classes/
|
|
284
|
-
- ref/ruby/classes/
|
|
285
|
-
- ref/ruby/classes/
|
|
286
|
-
- ref/ruby/classes/
|
|
287
|
-
- ref/ruby/classes/
|
|
288
|
-
- ref/ruby/classes/
|
|
287
|
+
- ref/ruby/classes/ERB.src/M000024.html
|
|
288
|
+
- ref/ruby/classes/FileUtils.src/M000025.html
|
|
289
|
+
- ref/ruby/classes/FileUtils.src/M000026.html
|
|
290
|
+
- ref/ruby/classes/RubyVpi.src/M000027.html
|
|
291
|
+
- ref/ruby/classes/Vpi.src/M000028.html
|
|
292
|
+
- ref/ruby/classes/Vpi.src/M000029.html
|
|
289
293
|
- ref/ruby/classes/Vpi.src/M000030.html
|
|
290
294
|
- ref/ruby/classes/Vpi.src/M000031.html
|
|
291
295
|
- ref/ruby/classes/Vpi.src/M000032.html
|
|
292
|
-
- ref/ruby/classes/Vpi.src/M000033.html
|
|
293
296
|
- ref/ruby/classes/Vpi/S_vpi_value.src
|
|
294
297
|
- ref/ruby/classes/Vpi/Handle.src
|
|
295
298
|
- ref/ruby/classes/Vpi/S_vpi_time.src
|
|
296
299
|
- ref/ruby/classes/Vpi/S_vpi_value.html
|
|
297
300
|
- ref/ruby/classes/Vpi/Handle.html
|
|
298
301
|
- ref/ruby/classes/Vpi/S_vpi_time.html
|
|
302
|
+
- ref/ruby/classes/Vpi/S_vpi_value.src/M000033.html
|
|
299
303
|
- ref/ruby/classes/Vpi/S_vpi_value.src/M000034.html
|
|
300
304
|
- ref/ruby/classes/Vpi/S_vpi_value.src/M000035.html
|
|
301
|
-
- ref/ruby/classes/Vpi/
|
|
305
|
+
- ref/ruby/classes/Vpi/Handle.src/M000036.html
|
|
302
306
|
- ref/ruby/classes/Vpi/Handle.src/M000037.html
|
|
303
307
|
- ref/ruby/classes/Vpi/Handle.src/M000038.html
|
|
304
308
|
- ref/ruby/classes/Vpi/Handle.src/M000039.html
|
|
@@ -309,7 +313,7 @@ files:
|
|
|
309
313
|
- ref/ruby/classes/Vpi/Handle.src/M000044.html
|
|
310
314
|
- ref/ruby/classes/Vpi/Handle.src/M000045.html
|
|
311
315
|
- ref/ruby/classes/Vpi/Handle.src/M000046.html
|
|
312
|
-
- ref/ruby/classes/Vpi/Handle.src/
|
|
316
|
+
- ref/ruby/classes/Vpi/Handle.src/M000048.html
|
|
313
317
|
- ref/ruby/classes/Vpi/Handle.src/M000049.html
|
|
314
318
|
- ref/ruby/classes/Vpi/S_vpi_time.src/M000050.html
|
|
315
319
|
- ref/ruby/classes/Vpi/S_vpi_time.src/M000051.html
|