ruby-vpi 11.1.1 → 12.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/generate_test.rb +12 -11
- data/bin/generate_test_tpl/bench.rb +0 -4
- data/bin/generate_test_tpl/bench.v +3 -6
- data/bin/generate_test_tpl/runner.rake +20 -4
- data/bin/generate_test_tpl/spec.rb +5 -7
- data/doc/common.css +110 -95
- data/doc/common.tpl +16 -17
- data/doc/history.html +350 -330
- data/doc/history.yml +49 -0
- data/doc/intro.inc +18 -4
- data/doc/lib/doc_proxy.rb +22 -32
- data/doc/manual.erb +90 -83
- data/doc/manual.html +298 -266
- data/doc/memo.html +31 -10
- data/doc/readme.html +26 -6
- data/ext/relay.c +24 -28
- data/ext/vlog.c +4 -15
- data/lib/ruby-vpi/rspec.rb +1 -1
- data/lib/ruby-vpi/runner.rb +12 -10
- data/lib/ruby-vpi/runner_proxy.rb +17 -6
- data/lib/ruby-vpi/verilog_parser.rb +11 -7
- data/lib/ruby-vpi/vpi.rb +11 -1
- data/lib/ruby-vpi.rb +4 -0
- data/ref/c/annotated.html +2 -2
- 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 +2 -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 +2 -2
- 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 +2 -2
- 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/relay_8c.html +2 -1
- data/ref/c/relay_8h.html +1 -1
- data/ref/c/structrelay____RubyOptions____def.html +8 -2
- 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_8c.html +1 -1
- data/ref/c/swig_8h.html +1 -1
- data/ref/c/verilog_8h.html +1 -1
- data/ref/c/vlog_8c.html +15 -15
- data/ref/c/vlog_8h.html +1 -1
- data/ref/c/vpi__user_8h.html +1 -1
- data/ref/ruby/classes/OutputInfo.html +1 -1
- data/ref/ruby/classes/OutputInfo.src/M000030.html +30 -30
- data/ref/ruby/classes/RDoc.html +5 -5
- data/ref/ruby/classes/RDoc.src/{M000097.html → M000099.html} +0 -0
- data/ref/ruby/classes/RubyVpi.src/M000085.html +43 -39
- data/ref/ruby/classes/String.src/M000033.html +26 -26
- data/ref/ruby/classes/String.src/M000034.html +4 -4
- data/ref/ruby/classes/Template.src/M000032.html +4 -4
- data/ref/ruby/classes/VerilogParser/Module/Parameter.src/M000011.html +5 -5
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000007.html +7 -7
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000008.html +4 -4
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000009.html +4 -4
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000010.html +4 -4
- data/ref/ruby/classes/VerilogParser/Module.src/M000006.html +15 -11
- data/ref/ruby/classes/Vpi/Handle/Property.html +5 -5
- data/ref/ruby/classes/Vpi/Handle/Property.src/{M000096.html → M000098.html} +61 -61
- data/ref/ruby/classes/Vpi/Handle.html +78 -43
- data/ref/ruby/classes/Vpi/Handle.src/M000088.html +3 -3
- data/ref/ruby/classes/Vpi/Handle.src/M000089.html +4 -8
- data/ref/ruby/classes/Vpi/Handle.src/M000090.html +5 -31
- data/ref/ruby/classes/Vpi/Handle.src/M000091.html +9 -74
- data/ref/ruby/classes/Vpi/Handle.src/M000092.html +31 -17
- data/ref/ruby/classes/Vpi/Handle.src/M000093.html +74 -11
- data/ref/ruby/classes/Vpi/Handle.src/M000094.html +30 -0
- data/ref/ruby/classes/Vpi/Handle.src/M000095.html +11 -55
- data/ref/ruby/classes/Vpi/Handle.src/M000097.html +68 -0
- data/ref/ruby/created.rid +1 -1
- data/ref/ruby/files/bin/generate_test_rb.html +8 -11
- data/ref/ruby/files/bin/generate_test_rb.src/M000001.html +4 -4
- data/ref/ruby/files/bin/generate_test_rb.src/M000002.html +22 -24
- data/ref/ruby/files/bin/header_to_ruby_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/float_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/integer_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/rspec_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 +2 -2
- data/ref/ruby/files/lib/ruby-vpi/runner_rb.src/M000003.html +10 -10
- data/ref/ruby/files/lib/ruby-vpi/runner_rb.src/M000004.html +12 -12
- 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 +2 -1
- data/ref/ruby/fr_method_index.html +20 -18
- data/samp/counter/counter_rspec_bench.v +3 -6
- data/samp/counter/counter_rspec_design.rb +2 -1
- data/samp/counter/counter_rspec_runner.rake +20 -4
- data/samp/counter/counter_rspec_spec.rb +4 -4
- data/samp/counter/counter_xunit_bench.v +3 -6
- data/samp/counter/counter_xunit_design.rb +2 -1
- data/samp/counter/counter_xunit_runner.rake +20 -4
- data/samp/pipelined_alu/hw5_unit_test_bench.v +3 -6
- data/samp/pipelined_alu/hw5_unit_test_runner.rake +20 -4
- metadata +21 -20
- data/doc/manual.rb +0 -5
@@ -21,7 +21,7 @@
|
|
21
21
|
<h1 class="section-bar">Methods</h1>
|
22
22
|
<div id="index-entries">
|
23
23
|
<a href="classes/XX/Document.html#M000082"><< (XX::Document)</a><br />
|
24
|
-
<a href="classes/Vpi/Handle.html#
|
24
|
+
<a href="classes/Vpi/Handle.html#M000094">[] (Vpi::Handle)</a><br />
|
25
25
|
<a href="classes/FileUtils.html#M000084">collect_args (FileUtils)</a><br />
|
26
26
|
<a href="classes/XX/Document.html#M000081">create (XX::Document)</a><br />
|
27
27
|
<a href="classes/Table.html#M000026">doc (Table)</a><br />
|
@@ -29,15 +29,15 @@
|
|
29
29
|
<a href="classes/Integer.html#M000020">ensure_min (Integer)</a><br />
|
30
30
|
<a href="files/lib/ruby-vpi/runner_rb.html#M000004">expand_include_dir_options (lib/ruby-vpi/runner.rb)</a><br />
|
31
31
|
<a href="classes/Integer.html#M000024">extend_sign (Integer)</a><br />
|
32
|
-
<a href="classes/Vpi/Handle.html#
|
33
|
-
<a href="classes/Vpi/Handle.html#
|
32
|
+
<a href="classes/Vpi/Handle.html#M000092">get_value (Vpi::Handle)</a><br />
|
33
|
+
<a href="classes/Vpi/Handle.html#M000091">get_value_wrapper (Vpi::Handle)</a><br />
|
34
34
|
<a href="classes/XX/HTML4/Strict.html#M000040">html4_ (XX::HTML4::Strict)</a><br />
|
35
35
|
<a href="classes/XX/HTML4/Transitional.html#M000039">html4_ (XX::HTML4::Transitional)</a><br />
|
36
36
|
<a href="classes/XX/HTML4.html#M000038">html4_ (XX::HTML4)</a><br />
|
37
37
|
<a href="classes/XX/Markup.html#M000045">included (XX::Markup)</a><br />
|
38
38
|
<a href="classes/RubyVpi.html#M000085">init_bench (RubyVpi)</a><br />
|
39
39
|
<a href="classes/VerilogParser/Module/Port.html#M000008">input? (VerilogParser::Module::Port)</a><br />
|
40
|
-
<a href="classes/Vpi/Handle.html#
|
40
|
+
<a href="classes/Vpi/Handle.html#M000095">inspect (Vpi::Handle)</a><br />
|
41
41
|
<a href="classes/Integer.html#M000013">length (Integer)</a><br />
|
42
42
|
<a href="classes/Integer.html#M000014">limit (Integer)</a><br />
|
43
43
|
<a href="classes/Integer.html#M000012">log2 (Integer)</a><br />
|
@@ -45,15 +45,15 @@
|
|
45
45
|
<a href="classes/Integer.html#M000016">mask (Integer)</a><br />
|
46
46
|
<a href="classes/Integer.html#M000018">max (Integer)</a><br />
|
47
47
|
<a href="classes/XX/Markup/InstanceMethods.html#M000054">method_missing (XX::Markup::InstanceMethods)</a><br />
|
48
|
-
<a href="classes/Vpi/Handle.html#
|
49
|
-
<a href="classes/
|
48
|
+
<a href="classes/Vpi/Handle.html#M000097">method_missing (Vpi::Handle)</a><br />
|
49
|
+
<a href="classes/OutputInfo.html#M000030">new (OutputInfo)</a><br />
|
50
50
|
<a href="classes/VerilogParser/Module/Port.html#M000007">new (VerilogParser::Module::Port)</a><br />
|
51
51
|
<a href="classes/VerilogParser/Module.html#M000006">new (VerilogParser::Module)</a><br />
|
52
|
-
<a href="classes/
|
52
|
+
<a href="classes/VerilogParser/Module/Parameter.html#M000011">new (VerilogParser::Module::Parameter)</a><br />
|
53
53
|
<a href="classes/VerilogParser.html#M000005">new (VerilogParser)</a><br />
|
54
54
|
<a href="classes/Template.html#M000032">new (Template)</a><br />
|
55
55
|
<a href="classes/XX/Document.html#M000074">new (XX::Document)</a><br />
|
56
|
-
<a href="classes/
|
56
|
+
<a href="classes/ERB.html#M000036">new (ERB)</a><br />
|
57
57
|
<a href="files/bin/generate_test_rb.html#M000001">notify (bin/generate_test.rb)</a><br />
|
58
58
|
<a href="files/lib/ruby-vpi/runner_rb.html#M000003">object_file_path (lib/ruby-vpi/runner.rb)</a><br />
|
59
59
|
<a href="classes/VerilogParser/Module/Port.html#M000009">output? (VerilogParser::Module::Port)</a><br />
|
@@ -61,9 +61,9 @@
|
|
61
61
|
<a href="classes/XX/Document.html#M000077">pop (XX::Document)</a><br />
|
62
62
|
<a href="classes/XX/Document.html#M000080">pretty (XX::Document)</a><br />
|
63
63
|
<a href="classes/XX/Document.html#M000076">push (XX::Document)</a><br />
|
64
|
-
<a href="classes/Vpi/Handle.html#
|
64
|
+
<a href="classes/Vpi/Handle.html#M000093">put_value (Vpi::Handle)</a><br />
|
65
65
|
<a href="classes/VerilogParser/Module/Port.html#M000010">reg? (VerilogParser::Module::Port)</a><br />
|
66
|
-
<a href="classes/Vpi/Handle/Property.html#
|
66
|
+
<a href="classes/Vpi/Handle/Property.html#M000098">resolve (Vpi::Handle::Property)</a><br />
|
67
67
|
<a href="classes/FileUtils.html#M000083">sh (FileUtils)</a><br />
|
68
68
|
<a href="classes/Integer.html#M000025">split (Integer)</a><br />
|
69
69
|
<a href="classes/String.html#M000035">to_f (String)</a><br />
|
@@ -72,21 +72,22 @@
|
|
72
72
|
<a href="classes/Integer.html#M000017">to_mask (Integer)</a><br />
|
73
73
|
<a href="classes/Integer.html#M000019">to_max (Integer)</a><br />
|
74
74
|
<a href="classes/String.html#M000034">to_ruby_const_name (String)</a><br />
|
75
|
-
<a href="classes/Vpi/Handle.html#
|
75
|
+
<a href="classes/Vpi/Handle.html#M000096">to_s (Vpi::Handle)</a><br />
|
76
76
|
<a href="classes/XX/Document.html#M000079">to_str (XX::Document)</a><br />
|
77
77
|
<a href="classes/Table.html#M000027">to_xhtml (Table)</a><br />
|
78
78
|
<a href="classes/Table.html#M000029">to_xml (Table)</a><br />
|
79
79
|
<a href="classes/XX/Document.html#M000075">top (XX::Document)</a><br />
|
80
80
|
<a href="classes/XX/Document.html#M000078">tracking_additions (XX::Document)</a><br />
|
81
81
|
<a href="classes/Integer.html#M000023">unpack (Integer)</a><br />
|
82
|
-
<a href="classes/RDoc.html#
|
82
|
+
<a href="classes/RDoc.html#M000099">usage_from_file (RDoc)</a><br />
|
83
83
|
<a href="classes/String.html#M000033">verilog_to_ruby (String)</a><br />
|
84
84
|
<a href="classes/RubyVpi.html#M000086">with_coverage_analysis (RubyVpi)</a><br />
|
85
85
|
<a href="files/bin/generate_test_rb.html#M000002">write_file (bin/generate_test.rb)</a><br />
|
86
|
+
<a href="classes/Vpi/Handle.html#M000088">x! (Vpi::Handle)</a><br />
|
86
87
|
<a href="classes/Vpi/Handle.html#M000087">x? (Vpi::Handle)</a><br />
|
87
|
-
<a href="classes/XX/XHTML.html#M000041">xhtml_ (XX::XHTML)</a><br />
|
88
88
|
<a href="classes/XX/XHTML/Strict.html#M000043">xhtml_ (XX::XHTML::Strict)</a><br />
|
89
89
|
<a href="classes/XX/XHTML/Transitional.html#M000042">xhtml_ (XX::XHTML::Transitional)</a><br />
|
90
|
+
<a href="classes/XX/XHTML.html#M000041">xhtml_ (XX::XHTML)</a><br />
|
90
91
|
<a href="classes/XX/XML.html#M000037">xml_ (XX::XML)</a><br />
|
91
92
|
<a href="classes/XX/XMLish.html#M000044">xmlish_ (XX::XMLish)</a><br />
|
92
93
|
<a href="classes/XX/Markup/ClassMethods.html#M000050">xx_ancestors (XX::Markup::ClassMethods)</a><br />
|
@@ -96,27 +97,28 @@
|
|
96
97
|
<a href="classes/XX/Markup/InstanceMethods.html#M000065">xx_class (XX::Markup::InstanceMethods)</a><br />
|
97
98
|
<a href="classes/XX/Markup/InstanceMethods.html#M000071">xx_config (XX::Markup::InstanceMethods)</a><br />
|
98
99
|
<a href="classes/XX/Markup/ClassMethods.html#M000051">xx_config (XX::Markup::ClassMethods)</a><br />
|
99
|
-
<a href="classes/XX/Markup/InstanceMethods.html#M000072">xx_config_for (XX::Markup::InstanceMethods)</a><br />
|
100
100
|
<a href="classes/XX/Markup/ClassMethods.html#M000052">xx_config_for (XX::Markup::ClassMethods)</a><br />
|
101
|
+
<a href="classes/XX/Markup/InstanceMethods.html#M000072">xx_config_for (XX::Markup::InstanceMethods)</a><br />
|
101
102
|
<a href="classes/XX/Markup/ClassMethods.html#M000053">xx_configure (XX::Markup::ClassMethods)</a><br />
|
102
103
|
<a href="classes/XX/Markup/InstanceMethods.html#M000073">xx_configure (XX::Markup::InstanceMethods)</a><br />
|
103
|
-
<a href="classes/XX/Markup/InstanceMethods.html#M000068">xx_define_tag_method (XX::Markup::InstanceMethods)</a><br />
|
104
104
|
<a href="classes/XX/Markup/ClassMethods.html#M000048">xx_define_tag_method (XX::Markup::ClassMethods)</a><br />
|
105
|
+
<a href="classes/XX/Markup/InstanceMethods.html#M000068">xx_define_tag_method (XX::Markup::InstanceMethods)</a><br />
|
105
106
|
<a href="classes/XX/Markup/InstanceMethods.html#M000067">xx_define_tmp_method (XX::Markup::InstanceMethods)</a><br />
|
106
107
|
<a href="classes/XX/Markup/ClassMethods.html#M000047">xx_define_tmp_method (XX::Markup::ClassMethods)</a><br />
|
107
108
|
<a href="classes/XX/Markup/InstanceMethods.html#M000058">xx_doc (XX::Markup::InstanceMethods)</a><br />
|
108
109
|
<a href="classes/XX/Markup/InstanceMethods.html#M000060">xx_markup_ (XX::Markup::InstanceMethods)</a><br />
|
109
110
|
<a href="classes/XX/Markup/InstanceMethods.html#M000063">xx_parse_attributes (XX::Markup::InstanceMethods)</a><br />
|
110
111
|
<a href="classes/XX/Markup/InstanceMethods.html#M000064">xx_parse_yaml_attributes (XX::Markup::InstanceMethods)</a><br />
|
111
|
-
<a href="classes/XX/Markup/InstanceMethods.html#M000069">xx_remove_tag_method (XX::Markup::InstanceMethods)</a><br />
|
112
112
|
<a href="classes/XX/Markup/ClassMethods.html#M000049">xx_remove_tag_method (XX::Markup::ClassMethods)</a><br />
|
113
|
+
<a href="classes/XX/Markup/InstanceMethods.html#M000069">xx_remove_tag_method (XX::Markup::InstanceMethods)</a><br />
|
113
114
|
<a href="classes/XX/Markup/InstanceMethods.html#M000055">xx_tag_ (XX::Markup::InstanceMethods)</a><br />
|
114
|
-
<a href="classes/XX/Markup/ClassMethods.html#M000046">xx_tag_method_name (XX::Markup::ClassMethods)</a><br />
|
115
115
|
<a href="classes/XX/Markup/InstanceMethods.html#M000066">xx_tag_method_name (XX::Markup::InstanceMethods)</a><br />
|
116
|
+
<a href="classes/XX/Markup/ClassMethods.html#M000046">xx_tag_method_name (XX::Markup::ClassMethods)</a><br />
|
116
117
|
<a href="classes/XX/Markup/InstanceMethods.html#M000059">xx_text_ (XX::Markup::InstanceMethods)</a><br />
|
117
118
|
<a href="classes/XX/Markup/InstanceMethods.html#M000056">xx_which (XX::Markup::InstanceMethods)</a><br />
|
118
119
|
<a href="classes/XX/Markup/InstanceMethods.html#M000057">xx_with_doc_in_effect (XX::Markup::InstanceMethods)</a><br />
|
119
|
-
<a href="classes/Vpi/Handle.html#
|
120
|
+
<a href="classes/Vpi/Handle.html#M000090">z! (Vpi::Handle)</a><br />
|
121
|
+
<a href="classes/Vpi/Handle.html#M000089">z? (Vpi::Handle)</a><br />
|
120
122
|
</div>
|
121
123
|
</div>
|
122
124
|
</body>
|
@@ -11,16 +11,13 @@ module counter_rspec_bench;
|
|
11
11
|
|
12
12
|
// connect to the Ruby side of this bench
|
13
13
|
initial begin
|
14
|
-
|
15
|
-
$ruby_init("ruby", "-w", "-rubygems", "counter_rspec_bench.rb");
|
14
|
+
$ruby_init("ruby", "-rubygems", "counter_rspec_bench.rb");
|
16
15
|
end
|
17
16
|
|
18
17
|
always begin
|
19
|
-
#
|
20
|
-
end
|
21
|
-
|
22
|
-
always @(posedge clock) begin
|
18
|
+
#1 clock = 0;
|
23
19
|
#1 $ruby_relay;
|
20
|
+
#1 clock = 1;
|
24
21
|
end
|
25
22
|
|
26
23
|
endmodule
|
@@ -1,21 +1,27 @@
|
|
1
1
|
# This file runs the test.
|
2
2
|
|
3
|
-
# These are source files that
|
3
|
+
# These are Verilog source files that need to be loaded
|
4
|
+
# by the simulator before they can be simulated.
|
4
5
|
SIMULATOR_SOURCES = [
|
5
6
|
'counter.v',
|
6
7
|
'counter_rspec_bench.v',
|
7
8
|
]
|
8
9
|
|
9
10
|
# These are paths to directories which contain the
|
10
|
-
# sources listed above,
|
11
|
+
# sources listed above, the files they `include, or both.
|
11
12
|
SIMULATOR_INCLUDES = []
|
12
13
|
|
13
14
|
# This specifies the "top module" that is to be simulated.
|
14
15
|
SIMULATOR_TARGET = 'counter_rspec_bench'
|
15
16
|
|
16
17
|
# These are command-line arguments for the simulator.
|
17
|
-
# They can be specified as a string or an array of strings
|
18
|
-
|
18
|
+
# They can be specified as a string or an array of strings:
|
19
|
+
#
|
20
|
+
# :cver => "this is one single argument",
|
21
|
+
# :cver => ['these', 'are', 'separate', 'arguments'],
|
22
|
+
# :cver => %w[these are also separate arguments],
|
23
|
+
#
|
24
|
+
SIMULATOR_ARGUMENTS = {
|
19
25
|
# GPL Cver
|
20
26
|
:cver => '',
|
21
27
|
|
@@ -29,4 +35,14 @@ SIMULATOR_ARGS = {
|
|
29
35
|
:vsim => '',
|
30
36
|
}
|
31
37
|
|
38
|
+
# This task is invoked _before_ the simulator runs.
|
39
|
+
# It can be used to make preprations, such as converting
|
40
|
+
# Verilog header files into Ruby, for the simulation.
|
41
|
+
task :setup do
|
42
|
+
# To learn how to write Rake tasks, please see:
|
43
|
+
# http://docs.rubyrake.org/read/chapter/4#page16
|
44
|
+
end
|
45
|
+
|
46
|
+
# This command loads the Ruby-VPI runner template, which
|
47
|
+
# runs the simulator according to the information above.
|
32
48
|
require 'ruby-vpi/runner'
|
@@ -12,12 +12,12 @@ context "A resetted counter's value" do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
specify "should be zero" do
|
15
|
-
Counter.count.intVal.
|
15
|
+
Counter.count.intVal.should == 0
|
16
16
|
end
|
17
17
|
|
18
18
|
specify "should increment by one count upon each rising clock edge" do
|
19
19
|
LIMIT.times do |i|
|
20
|
-
Counter.count.intVal.
|
20
|
+
Counter.count.intVal.should == i
|
21
21
|
relay_verilog # increment the counter
|
22
22
|
end
|
23
23
|
end
|
@@ -29,11 +29,11 @@ context "A counter with the maximum value" do
|
|
29
29
|
|
30
30
|
# increment the counter to maximum value
|
31
31
|
MAX.times {relay_verilog}
|
32
|
-
Counter.count.intVal.
|
32
|
+
Counter.count.intVal.should == MAX
|
33
33
|
end
|
34
34
|
|
35
35
|
specify "should overflow upon increment" do
|
36
36
|
relay_verilog # increment the counter
|
37
|
-
Counter.count.intVal.
|
37
|
+
Counter.count.intVal.should == 0
|
38
38
|
end
|
39
39
|
end
|
@@ -11,16 +11,13 @@ module counter_xunit_bench;
|
|
11
11
|
|
12
12
|
// connect to the Ruby side of this bench
|
13
13
|
initial begin
|
14
|
-
|
15
|
-
$ruby_init("ruby", "-w", "-rubygems", "counter_xunit_bench.rb");
|
14
|
+
$ruby_init("ruby", "-rubygems", "counter_xunit_bench.rb");
|
16
15
|
end
|
17
16
|
|
18
17
|
always begin
|
19
|
-
#
|
20
|
-
end
|
21
|
-
|
22
|
-
always @(posedge clock) begin
|
18
|
+
#1 clock = 0;
|
23
19
|
#1 $ruby_relay;
|
20
|
+
#1 clock = 1;
|
24
21
|
end
|
25
22
|
|
26
23
|
endmodule
|
@@ -1,21 +1,27 @@
|
|
1
1
|
# This file runs the test.
|
2
2
|
|
3
|
-
# These are source files that
|
3
|
+
# These are Verilog source files that need to be loaded
|
4
|
+
# by the simulator before they can be simulated.
|
4
5
|
SIMULATOR_SOURCES = [
|
5
6
|
'counter.v',
|
6
7
|
'counter_xunit_bench.v',
|
7
8
|
]
|
8
9
|
|
9
10
|
# These are paths to directories which contain the
|
10
|
-
# sources listed above,
|
11
|
+
# sources listed above, the files they `include, or both.
|
11
12
|
SIMULATOR_INCLUDES = []
|
12
13
|
|
13
14
|
# This specifies the "top module" that is to be simulated.
|
14
15
|
SIMULATOR_TARGET = 'counter_xunit_bench'
|
15
16
|
|
16
17
|
# These are command-line arguments for the simulator.
|
17
|
-
# They can be specified as a string or an array of strings
|
18
|
-
|
18
|
+
# They can be specified as a string or an array of strings:
|
19
|
+
#
|
20
|
+
# :cver => "this is one single argument",
|
21
|
+
# :cver => ['these', 'are', 'separate', 'arguments'],
|
22
|
+
# :cver => %w[these are also separate arguments],
|
23
|
+
#
|
24
|
+
SIMULATOR_ARGUMENTS = {
|
19
25
|
# GPL Cver
|
20
26
|
:cver => '',
|
21
27
|
|
@@ -29,4 +35,14 @@ SIMULATOR_ARGS = {
|
|
29
35
|
:vsim => '',
|
30
36
|
}
|
31
37
|
|
38
|
+
# This task is invoked _before_ the simulator runs.
|
39
|
+
# It can be used to make preprations, such as converting
|
40
|
+
# Verilog header files into Ruby, for the simulation.
|
41
|
+
task :setup do
|
42
|
+
# To learn how to write Rake tasks, please see:
|
43
|
+
# http://docs.rubyrake.org/read/chapter/4#page16
|
44
|
+
end
|
45
|
+
|
46
|
+
# This command loads the Ruby-VPI runner template, which
|
47
|
+
# runs the simulator according to the information above.
|
32
48
|
require 'ruby-vpi/runner'
|
@@ -16,16 +16,13 @@ module hw5_unit_test_bench;
|
|
16
16
|
|
17
17
|
// connect to the Ruby side of this bench
|
18
18
|
initial begin
|
19
|
-
|
20
|
-
$ruby_init("ruby", "-w", "-rubygems", "hw5_unit_test_bench.rb");
|
19
|
+
$ruby_init("ruby", "-rubygems", "hw5_unit_test_bench.rb");
|
21
20
|
end
|
22
21
|
|
23
22
|
always begin
|
24
|
-
#
|
25
|
-
end
|
26
|
-
|
27
|
-
always @(posedge clk) begin
|
23
|
+
#1 clk = 0;
|
28
24
|
#1 $ruby_relay;
|
25
|
+
#1 clk = 1;
|
29
26
|
end
|
30
27
|
|
31
28
|
endmodule
|
@@ -1,21 +1,27 @@
|
|
1
1
|
# This file runs the test.
|
2
2
|
|
3
|
-
# These are source files that
|
3
|
+
# These are Verilog source files that need to be loaded
|
4
|
+
# by the simulator before they can be simulated.
|
4
5
|
SIMULATOR_SOURCES = [
|
5
6
|
'hw5_unit.v',
|
6
7
|
'hw5_unit_test_bench.v',
|
7
8
|
]
|
8
9
|
|
9
10
|
# These are paths to directories which contain the
|
10
|
-
# sources listed above,
|
11
|
+
# sources listed above, the files they `include, or both.
|
11
12
|
SIMULATOR_INCLUDES = []
|
12
13
|
|
13
14
|
# This specifies the "top module" that is to be simulated.
|
14
15
|
SIMULATOR_TARGET = 'hw5_unit_test_bench'
|
15
16
|
|
16
17
|
# These are command-line arguments for the simulator.
|
17
|
-
# They can be specified as a string or an array of strings
|
18
|
-
|
18
|
+
# They can be specified as a string or an array of strings:
|
19
|
+
#
|
20
|
+
# :cver => "this is one single argument",
|
21
|
+
# :cver => ['these', 'are', 'separate', 'arguments'],
|
22
|
+
# :cver => %w[these are also separate arguments],
|
23
|
+
#
|
24
|
+
SIMULATOR_ARGUMENTS = {
|
19
25
|
# GPL Cver
|
20
26
|
:cver => '',
|
21
27
|
|
@@ -29,4 +35,14 @@ SIMULATOR_ARGS = {
|
|
29
35
|
:vsim => '',
|
30
36
|
}
|
31
37
|
|
38
|
+
# This task is invoked _before_ the simulator runs.
|
39
|
+
# It can be used to make preprations, such as converting
|
40
|
+
# Verilog header files into Ruby, for the simulation.
|
41
|
+
task :setup do
|
42
|
+
# To learn how to write Rake tasks, please see:
|
43
|
+
# http://docs.rubyrake.org/read/chapter/4#page16
|
44
|
+
end
|
45
|
+
|
46
|
+
# This command loads the Ruby-VPI runner template, which
|
47
|
+
# runs the simulator according to the information above.
|
32
48
|
require 'ruby-vpi/runner'
|
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-
|
6
|
+
version: 12.0.0
|
7
|
+
date: 2006-12-07 00:00:00 -08:00
|
8
8
|
summary: Ruby interface to Verilog VPI.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -37,8 +37,8 @@ files:
|
|
37
37
|
- ref
|
38
38
|
- doc
|
39
39
|
- samp
|
40
|
-
- gem_extconf.rb
|
41
40
|
- index.html
|
41
|
+
- gem_extconf.rb
|
42
42
|
- ext/swig_vpi.i
|
43
43
|
- ext/vlog.c
|
44
44
|
- ext/Rakefile
|
@@ -314,31 +314,32 @@ files:
|
|
314
314
|
- ref/ruby/classes/Vpi/Handle.src/M000091.html
|
315
315
|
- ref/ruby/classes/Vpi/Handle.src/M000092.html
|
316
316
|
- ref/ruby/classes/Vpi/Handle.src/M000093.html
|
317
|
+
- ref/ruby/classes/Vpi/Handle.src/M000094.html
|
317
318
|
- ref/ruby/classes/Vpi/Handle.src/M000095.html
|
319
|
+
- ref/ruby/classes/Vpi/Handle.src/M000097.html
|
318
320
|
- ref/ruby/classes/Vpi/Handle/Property.src
|
319
321
|
- ref/ruby/classes/Vpi/Handle/Property.html
|
320
|
-
- ref/ruby/classes/Vpi/Handle/Property.src/
|
321
|
-
- ref/ruby/classes/RDoc.src/
|
322
|
+
- ref/ruby/classes/Vpi/Handle/Property.src/M000098.html
|
323
|
+
- ref/ruby/classes/RDoc.src/M000099.html
|
322
324
|
- ref/ruby/classes/RubyVpi/Config.html
|
323
325
|
- doc/Rakefile
|
324
326
|
- doc/figures
|
325
327
|
- doc/images
|
326
|
-
- doc/
|
327
|
-
- doc/
|
328
|
-
- doc/manual.rb
|
329
|
-
- doc/common.tpl
|
328
|
+
- doc/manual.html
|
329
|
+
- doc/LICENSE
|
330
330
|
- doc/manual.erb
|
331
|
-
- doc/
|
332
|
-
- doc/
|
333
|
-
- doc/
|
331
|
+
- doc/history.erb
|
332
|
+
- doc/history.yml
|
333
|
+
- doc/memo.erb
|
334
|
+
- doc/readme.erb
|
334
335
|
- doc/common.css
|
336
|
+
- doc/history.html
|
337
|
+
- doc/common.tpl
|
335
338
|
- doc/history.rb
|
336
|
-
- doc/
|
339
|
+
- doc/intro.inc
|
340
|
+
- doc/lib
|
337
341
|
- doc/memo.html
|
338
|
-
- doc/
|
339
|
-
- doc/history.html
|
340
|
-
- doc/history.yml
|
341
|
-
- doc/LICENSE
|
342
|
+
- doc/readme.html
|
342
343
|
- doc/figures/ruby_init.png
|
343
344
|
- doc/figures/ruby_relay.png
|
344
345
|
- doc/figures/organization.png
|
@@ -389,11 +390,11 @@ files:
|
|
389
390
|
- samp/counter/counter_rspec_spec.rb
|
390
391
|
- samp/counter/counter_xunit_bench.rb
|
391
392
|
- samp/counter/counter_xunit_runner.rake
|
392
|
-
- samp/counter/
|
393
|
+
- samp/counter/counter_rspec_bench.rb
|
393
394
|
- samp/counter/counter_xunit_proto.rb
|
394
|
-
- samp/counter/counter_rspec_design.rb
|
395
395
|
- samp/counter/counter_rspec_bench.v
|
396
|
-
- samp/counter/
|
396
|
+
- samp/counter/counter_rspec_design.rb
|
397
|
+
- samp/counter/counter_xunit_spec.rb
|
397
398
|
- samp/counter/counter_rspec_runner.rake
|
398
399
|
test_files: []
|
399
400
|
|