ruby-vpi 13.0.0 → 14.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/Rakefile +6 -1
- data/bin/generate_test_tpl/bench.rb +84 -1
- data/bin/generate_test_tpl/bench.v +8 -17
- data/bin/generate_test_tpl/proto.rb +1 -1
- data/doc/common.css +14 -41
- data/doc/common.tpl +1 -1
- data/doc/figures/figures.dia +274 -753
- data/doc/figures/organization_detailed.png +0 -0
- data/doc/figures/ruby_relay.png +0 -0
- data/doc/history.html +363 -276
- data/doc/history.yml +40 -0
- data/doc/intro.inc +37 -15
- data/doc/lib/doc_proxy.rb +24 -4
- data/doc/manual.doc +345 -196
- data/doc/manual.html +741 -497
- data/doc/memo.doc +15 -15
- data/doc/memo.html +28 -27
- data/doc/readme.doc +2 -2
- data/doc/readme.html +51 -15
- data/doc/rss.erb +1 -1
- data/doc/rss.xml +1624 -31
- data/ext/Rakefile +1 -6
- data/ext/main.c +8 -3
- data/ext/main.h +5 -0
- data/ext/relay.c +12 -12
- data/ext/relay.h +1 -6
- data/ext/swig_vpi.i +2 -2
- data/ext/swig_wrap.cin +37 -20
- data/ext/verilog.h +2 -2
- data/ext/vlog.c +10 -3
- data/ext/vlog.h +4 -4
- data/lib/ruby-vpi/vpi.rb +114 -0
- data/lib/ruby-vpi.rb +21 -59
- 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 +3 -2
- data/ref/c/globals_0x70.html +1 -1
- data/ref/c/globals_0x72.html +4 -5
- data/ref/c/globals_0x73.html +1 -1
- data/ref/c/globals_0x74.html +1 -1
- data/ref/c/globals_0x76.html +4 -2
- 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 +8 -7
- data/ref/c/globals_type.html +1 -1
- data/ref/c/globals_vars.html +3 -2
- data/ref/c/index.html +1 -1
- data/ref/c/main_8c.html +26 -1
- data/ref/c/main_8h.html +26 -1
- data/ref/c/relay_8c.html +11 -35
- data/ref/c/relay_8h.html +3 -27
- 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 +5 -5
- data/ref/c/vlog_8c.html +44 -6
- data/ref/c/vlog_8h.html +7 -8
- data/ref/c/vpi__user_8h.html +1 -1
- data/ref/ruby/classes/RDoc.html +5 -5
- data/ref/ruby/classes/RDoc.src/{M000041.html → M000045.html} +0 -0
- data/ref/ruby/classes/RubyVpi.html +10 -28
- data/ref/ruby/classes/RubyVpi.src/M000029.html +101 -124
- data/ref/ruby/classes/Vpi/Handle.html +56 -56
- data/ref/ruby/classes/Vpi/Handle.src/M000034.html +5 -9
- data/ref/ruby/classes/Vpi/Handle.src/M000035.html +5 -31
- data/ref/ruby/classes/Vpi/Handle.src/M000036.html +5 -74
- data/ref/ruby/classes/Vpi/Handle.src/M000037.html +5 -17
- data/ref/ruby/classes/Vpi/Handle.src/M000038.html +9 -11
- data/ref/ruby/classes/Vpi/Handle.src/M000039.html +44 -0
- data/ref/ruby/classes/Vpi/Handle.src/M000040.html +74 -55
- data/ref/ruby/classes/Vpi/Handle.src/M000041.html +30 -0
- data/ref/ruby/classes/Vpi/Handle.src/M000042.html +24 -0
- data/ref/ruby/classes/Vpi/Handle.src/M000044.html +68 -0
- data/ref/ruby/classes/Vpi.html +149 -0
- data/ref/ruby/classes/Vpi.src/M000030.html +28 -0
- data/ref/ruby/classes/Vpi.src/M000031.html +18 -0
- data/ref/ruby/classes/Vpi.src/M000032.html +39 -0
- data/ref/ruby/classes/Vpi.src/M000033.html +22 -0
- data/ref/ruby/created.rid +1 -1
- data/ref/ruby/files/lib/ruby-vpi/vpi_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi_rb.html +2 -2
- data/ref/ruby/fr_method_index.html +18 -14
- data/samp/counter/counter_rspec_bench.rb +81 -1
- data/samp/counter/counter_rspec_bench.v +5 -12
- data/samp/counter/counter_rspec_design.rb +1 -2
- data/samp/counter/counter_rspec_proto.rb +1 -1
- data/samp/counter/counter_rspec_spec.rb +3 -3
- data/samp/counter/counter_xunit_bench.rb +81 -1
- data/samp/counter/counter_xunit_bench.v +5 -12
- data/samp/counter/counter_xunit_design.rb +1 -2
- data/samp/counter/counter_xunit_proto.rb +1 -1
- data/samp/counter/counter_xunit_spec.rb +3 -3
- data/samp/pipelined_alu/hw5_unit_test_bench.rb +81 -1
- data/samp/pipelined_alu/hw5_unit_test_bench.v +11 -18
- data/samp/pipelined_alu/hw5_unit_test_design.rb +1 -1
- data/samp/pipelined_alu/hw5_unit_test_proto.rb +1 -1
- data/samp/pipelined_alu/hw5_unit_test_spec.rb +1 -1
- metadata +12 -9
- data/doc/figures/ruby_init.png +0 -0
- data/ext/swig_vpi.h +0 -924
- data/ref/ruby/classes/Vpi/Handle.src/M000030.html +0 -18
- data/ref/ruby/classes/Vpi/Handle.src/M000031.html +0 -18
- data/ref/ruby/classes/Vpi/Handle.src/M000032.html +0 -18
- data/ref/ruby/classes/Vpi/Handle.src/M000033.html +0 -18
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
// This file is the Verilog side of the bench.
|
|
2
2
|
module counter_xunit_bench;
|
|
3
|
+
parameter Size = 5;
|
|
4
|
+
reg clock;
|
|
5
|
+
reg reset;
|
|
6
|
+
wire [Size - 1 : 0] count;
|
|
3
7
|
|
|
4
|
-
|
|
5
|
-
parameter Size = 5;
|
|
6
|
-
reg clock;
|
|
7
|
-
reg reset;
|
|
8
|
-
wire [Size - 1 : 0] count;
|
|
9
|
-
|
|
10
|
-
counter #(.Size(Size)) counter_xunit_bench_design(.clock(clock), .reset(reset), .count(count));
|
|
11
|
-
|
|
12
|
-
// generate clock for the design under test
|
|
13
|
-
initial clock = 0;
|
|
14
|
-
always #5 clock = !clock;
|
|
15
|
-
|
|
8
|
+
counter #(.Size(Size)) counter_xunit_bench_design(.clock(clock), .reset(reset), .count(count));
|
|
16
9
|
endmodule
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This is a prototype of the design under test.
|
|
2
2
|
|
|
3
|
-
# When prototyping is enabled,
|
|
3
|
+
# When prototyping is enabled, Vpi::simulate invokes this method
|
|
4
4
|
# instead of transferring control to the Verilog simulator.
|
|
5
5
|
def Counter.simulate!
|
|
6
6
|
if reset.intVal == 1
|
|
@@ -18,7 +18,7 @@ class ResettedCounterValue < Test::Unit::TestCase
|
|
|
18
18
|
def test_increment
|
|
19
19
|
LIMIT.times do |i|
|
|
20
20
|
assert_equal i, Counter.count.intVal
|
|
21
|
-
|
|
21
|
+
simulate # increment the counter
|
|
22
22
|
end
|
|
23
23
|
end
|
|
24
24
|
end
|
|
@@ -28,12 +28,12 @@ class MaximumCounterValue < Test::Unit::TestCase
|
|
|
28
28
|
Counter.reset!
|
|
29
29
|
|
|
30
30
|
# increment the counter to maximum value
|
|
31
|
-
MAX.times {
|
|
31
|
+
MAX.times {simulate}
|
|
32
32
|
assert_equal MAX, Counter.count.intVal
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def test_overflow
|
|
36
|
-
|
|
36
|
+
simulate # increment the counter
|
|
37
37
|
assert_equal 0, Counter.count.intVal
|
|
38
38
|
end
|
|
39
39
|
end
|
|
@@ -3,4 +3,84 @@
|
|
|
3
3
|
require 'rubygems'
|
|
4
4
|
require 'ruby-vpi'
|
|
5
5
|
|
|
6
|
-
RubyVpi.init_bench :Hw5_unit, :xUnit
|
|
6
|
+
RubyVpi.init_bench :Hw5_unit, :xUnit do
|
|
7
|
+
##
|
|
8
|
+
# This block is executed whenever Vpi::simulate is invoked.
|
|
9
|
+
#
|
|
10
|
+
# It simulates the design under test by (typically) toggling
|
|
11
|
+
# the clock signal, as demonstrated below.
|
|
12
|
+
##
|
|
13
|
+
|
|
14
|
+
##
|
|
15
|
+
# We are currently here (marked by the ! signs):
|
|
16
|
+
#
|
|
17
|
+
# !
|
|
18
|
+
# !
|
|
19
|
+
# ! ____ ____ ____ ____
|
|
20
|
+
# ___!/ \____/ \____/ \____/ \
|
|
21
|
+
# !
|
|
22
|
+
# !
|
|
23
|
+
#
|
|
24
|
+
##
|
|
25
|
+
|
|
26
|
+
Hw5_unit.clk.intVal = 1
|
|
27
|
+
|
|
28
|
+
##
|
|
29
|
+
# After setting the clock signal to high, we are here:
|
|
30
|
+
#
|
|
31
|
+
# !
|
|
32
|
+
# !
|
|
33
|
+
# !____ ____ ____ ____
|
|
34
|
+
# ____/! \____/ \____/ \____/ \
|
|
35
|
+
# !
|
|
36
|
+
# !
|
|
37
|
+
#
|
|
38
|
+
##
|
|
39
|
+
|
|
40
|
+
advance_time
|
|
41
|
+
|
|
42
|
+
##
|
|
43
|
+
# After advancing the time, we are here:
|
|
44
|
+
#
|
|
45
|
+
# !
|
|
46
|
+
# !
|
|
47
|
+
# ____! ____ ____ ____
|
|
48
|
+
# ____/ !\____/ \____/ \____/ \
|
|
49
|
+
# !
|
|
50
|
+
# !
|
|
51
|
+
#
|
|
52
|
+
##
|
|
53
|
+
|
|
54
|
+
Hw5_unit.clk.intVal = 0
|
|
55
|
+
|
|
56
|
+
##
|
|
57
|
+
# After setting the clock signal to low, we are here:
|
|
58
|
+
#
|
|
59
|
+
# !
|
|
60
|
+
# !
|
|
61
|
+
# ____ ! ____ ____ ____
|
|
62
|
+
# ____/ \!____/ \____/ \____/ \
|
|
63
|
+
# !
|
|
64
|
+
# !
|
|
65
|
+
#
|
|
66
|
+
##
|
|
67
|
+
|
|
68
|
+
advance_time
|
|
69
|
+
|
|
70
|
+
##
|
|
71
|
+
# After advancing the time, we are here:
|
|
72
|
+
#
|
|
73
|
+
#
|
|
74
|
+
# !
|
|
75
|
+
# !
|
|
76
|
+
# ____ ! ____ ____ ____
|
|
77
|
+
# ____/ \____!/ \____/ \____/ \
|
|
78
|
+
# !
|
|
79
|
+
# !
|
|
80
|
+
#
|
|
81
|
+
##
|
|
82
|
+
|
|
83
|
+
##
|
|
84
|
+
# This process repeats when Vpi::simulate is invoked again.
|
|
85
|
+
##
|
|
86
|
+
end
|
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
// This file is the Verilog side of the bench.
|
|
2
2
|
module hw5_unit_test_bench;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
hw5_unit hw5_unit_test_bench_design(.clk(clk), .reset(reset), .in_databits(in_databits), .a(a), .b(b), .in_op(in_op), .res(res), .out_databits(out_databits), .out_op(out_op));
|
|
16
|
-
|
|
17
|
-
// generate clock for the design under test
|
|
18
|
-
initial clk = 0;
|
|
19
|
-
always #5 clk = !clk;
|
|
20
|
-
|
|
3
|
+
reg clk;
|
|
4
|
+
reg reset;
|
|
5
|
+
reg [`DATABITS-1:0] in_databits;
|
|
6
|
+
reg [`WIDTH-1:0] a;
|
|
7
|
+
reg [`WIDTH-1:0] b;
|
|
8
|
+
reg [1:0] in_op;
|
|
9
|
+
wire [`WIDTH-1:0] res;
|
|
10
|
+
wire [`DATABITS-1:0] out_databits;
|
|
11
|
+
wire [1:0] out_op;
|
|
12
|
+
|
|
13
|
+
hw5_unit hw5_unit_test_bench_design(.clk(clk), .reset(reset), .in_databits(in_databits), .a(a), .b(b), .in_op(in_op), .res(res), .out_databits(out_databits), .out_op(out_op));
|
|
21
14
|
endmodule
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This is a prototype of the design under test.
|
|
2
2
|
|
|
3
|
-
# When prototyping is enabled,
|
|
3
|
+
# When prototyping is enabled, Vpi::simulate invokes this method
|
|
4
4
|
# instead of transferring control to the Verilog simulator.
|
|
5
5
|
def Hw5_unit.simulate!
|
|
6
6
|
raise NotImplementedError, "Prototype is not yet implemented."
|
metadata
CHANGED
|
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
|
3
3
|
specification_version: 1
|
|
4
4
|
name: ruby-vpi
|
|
5
5
|
version: !ruby/object:Gem::Version
|
|
6
|
-
version:
|
|
7
|
-
date: 2006-12-
|
|
6
|
+
version: 14.0.0
|
|
7
|
+
date: 2006-12-30 00:00:00 -08:00
|
|
8
8
|
summary: Ruby interface to IEEE 1364-2005 Verilog VPI
|
|
9
9
|
require_paths:
|
|
10
10
|
- lib
|
|
@@ -53,7 +53,6 @@ files:
|
|
|
53
53
|
- ext/relay.c
|
|
54
54
|
- ext/Doxyfile
|
|
55
55
|
- ext/vpi_user.h
|
|
56
|
-
- ext/swig_vpi.h
|
|
57
56
|
- ext/swig_wrap.cin
|
|
58
57
|
- bin/generate_test.rb
|
|
59
58
|
- bin/generate_test_tpl
|
|
@@ -97,7 +96,6 @@ files:
|
|
|
97
96
|
- doc/readme.html
|
|
98
97
|
- doc/rss.xml
|
|
99
98
|
- doc/figures/figures.dia
|
|
100
|
-
- doc/figures/ruby_init.png
|
|
101
99
|
- doc/figures/ruby_relay.png
|
|
102
100
|
- doc/figures/organization.png
|
|
103
101
|
- doc/figures/organization_detailed.png
|
|
@@ -239,6 +237,7 @@ files:
|
|
|
239
237
|
- ref/ruby/classes/ERB.src
|
|
240
238
|
- ref/ruby/classes/FileUtils.src
|
|
241
239
|
- ref/ruby/classes/RubyVpi.src
|
|
240
|
+
- ref/ruby/classes/Vpi.src
|
|
242
241
|
- ref/ruby/classes/Vpi
|
|
243
242
|
- ref/ruby/classes/RDoc.src
|
|
244
243
|
- ref/ruby/classes/VerilogParser.html
|
|
@@ -285,19 +284,23 @@ files:
|
|
|
285
284
|
- ref/ruby/classes/FileUtils.src/M000027.html
|
|
286
285
|
- ref/ruby/classes/FileUtils.src/M000028.html
|
|
287
286
|
- ref/ruby/classes/RubyVpi.src/M000029.html
|
|
287
|
+
- ref/ruby/classes/Vpi.src/M000030.html
|
|
288
|
+
- ref/ruby/classes/Vpi.src/M000031.html
|
|
289
|
+
- ref/ruby/classes/Vpi.src/M000032.html
|
|
290
|
+
- ref/ruby/classes/Vpi.src/M000033.html
|
|
288
291
|
- ref/ruby/classes/Vpi/Handle.src
|
|
289
292
|
- ref/ruby/classes/Vpi/Handle.html
|
|
290
|
-
- ref/ruby/classes/Vpi/Handle.src/M000030.html
|
|
291
|
-
- ref/ruby/classes/Vpi/Handle.src/M000031.html
|
|
292
|
-
- ref/ruby/classes/Vpi/Handle.src/M000032.html
|
|
293
|
-
- ref/ruby/classes/Vpi/Handle.src/M000033.html
|
|
294
293
|
- ref/ruby/classes/Vpi/Handle.src/M000034.html
|
|
295
294
|
- ref/ruby/classes/Vpi/Handle.src/M000035.html
|
|
296
295
|
- ref/ruby/classes/Vpi/Handle.src/M000036.html
|
|
297
296
|
- ref/ruby/classes/Vpi/Handle.src/M000037.html
|
|
298
297
|
- ref/ruby/classes/Vpi/Handle.src/M000038.html
|
|
298
|
+
- ref/ruby/classes/Vpi/Handle.src/M000039.html
|
|
299
299
|
- ref/ruby/classes/Vpi/Handle.src/M000040.html
|
|
300
|
-
- ref/ruby/classes/
|
|
300
|
+
- ref/ruby/classes/Vpi/Handle.src/M000041.html
|
|
301
|
+
- ref/ruby/classes/Vpi/Handle.src/M000042.html
|
|
302
|
+
- ref/ruby/classes/Vpi/Handle.src/M000044.html
|
|
303
|
+
- ref/ruby/classes/RDoc.src/M000045.html
|
|
301
304
|
- ref/ruby/classes/RubyVpi/Config.html
|
|
302
305
|
test_files: []
|
|
303
306
|
|
data/doc/figures/ruby_init.png
DELETED
|
Binary file
|