ruby-vpi 8.2.0 → 9.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/HEADER +0 -19
- data/HISTORY +40 -0
- data/README +20 -2
- data/Rakefile +38 -42
- data/bin/generate_test.rb +50 -35
- data/bin/generate_test_tpl/bench.rb +3 -3
- data/bin/generate_test_tpl/bench.v +1 -1
- data/bin/generate_test_tpl/runner.rake +3 -2
- data/bin/generate_test_tpl/spec.rb +2 -2
- data/doc/background.organization.html +1 -1
- data/doc/glossary.html +1 -1
- data/doc/index.html +2 -2
- data/doc/manual.txt +163 -83
- data/doc/problems.html +1 -1
- data/doc/problems.ruby.html +1 -1
- data/doc/src/manual.xml +132 -49
- data/doc/usage.examples.html +1 -1
- data/doc/usage.html +1 -1
- data/doc/usage.installation.html +2 -2
- data/doc/usage.recommendations.html +3 -0
- data/doc/usage.requirements.html +1 -1
- data/doc/usage.tutorial.html +46 -42
- data/ext/extconf.rb +5 -2
- data/ext/relay.c +138 -0
- data/ext/{relay.hin → relay.h} +7 -7
- data/ext/{swig.cin → swig.c} +5 -7
- data/ext/{swig.hin → swig.h} +4 -4
- data/ext/verilog.h +1 -2
- data/ext/vlog.c +86 -0
- data/ext/{vlog.hin → vlog.h} +9 -12
- data/header.html +0 -31
- data/header.part.html +0 -31
- data/history.html +72 -31
- data/history.part.html +72 -0
- data/lib/ruby-vpi.rb +16 -0
- data/lib/ruby-vpi/runner.rb +34 -16
- data/memo.html +0 -31
- data/readme.html +33 -33
- data/readme.part.html +34 -3
- data/ref/c/annotated.html +1 -1
- data/ref/c/common_8h.html +1 -1
- data/ref/c/files.html +7 -8
- data/ref/c/functions.html +2 -2
- data/ref/c/functions_vars.html +2 -2
- 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 +9 -9
- data/ref/c/globals_0x73.html +3 -3
- data/ref/c/globals_0x74.html +1 -1
- data/ref/c/globals_0x76.html +5 -5
- 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 +11 -11
- data/ref/c/globals_type.html +1 -1
- data/ref/c/globals_vars.html +5 -5
- data/ref/c/index.html +1 -1
- data/ref/c/relay_8c.html +214 -0
- data/ref/c/{relay_8hin.html → relay_8h.html} +23 -23
- data/ref/c/structrelay____RubyOptions____def.html +6 -6
- 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 +80 -0
- data/ref/c/{swig_8hin.html → swig_8h.html} +13 -13
- data/ref/c/verilog_8h.html +3 -3
- data/ref/c/{vlog_8cin.html → vlog_8c.html} +30 -21
- data/ref/c/{vlog_8hin.html → vlog_8h.html} +12 -12
- data/ref/c/vpi__user_8h.html +1 -1
- data/ref/ruby/classes/ERB.html +5 -5
- data/ref/ruby/classes/ERB.src/{M000033.html → M000034.html} +0 -0
- data/ref/ruby/classes/FileUtils.html +10 -10
- data/ref/ruby/classes/FileUtils.src/M000089.html +5 -5
- data/ref/ruby/classes/FileUtils.src/M000090.html +18 -0
- data/ref/ruby/classes/Integer.html +68 -68
- data/ref/ruby/classes/Integer.src/M000012.html +12 -5
- data/ref/ruby/classes/Integer.src/M000013.html +5 -5
- data/ref/ruby/classes/Integer.src/M000014.html +5 -5
- data/ref/ruby/classes/Integer.src/M000015.html +5 -5
- data/ref/ruby/classes/Integer.src/M000016.html +5 -5
- data/ref/ruby/classes/Integer.src/M000017.html +18 -0
- data/ref/ruby/classes/Integer.src/M000020.html +9 -9
- data/ref/ruby/classes/Integer.src/M000021.html +9 -12
- data/ref/ruby/classes/Integer.src/M000022.html +12 -18
- data/ref/ruby/classes/Integer.src/M000023.html +18 -12
- data/ref/ruby/classes/Integer.src/M000024.html +12 -17
- data/ref/ruby/classes/Integer.src/M000025.html +30 -0
- data/ref/ruby/classes/OutputInfo.html +6 -6
- data/ref/ruby/classes/OutputInfo.src/{M000029.html → M000030.html} +37 -37
- data/ref/ruby/classes/RDoc.html +5 -5
- data/ref/ruby/classes/RDoc.src/{M000092.html → M000093.html} +0 -0
- data/ref/ruby/classes/RubyVpi.html +16 -10
- data/ref/ruby/classes/RubyVpi.src/M000091.html +37 -7
- data/ref/ruby/classes/RubyVpi.src/M000092.html +20 -0
- data/ref/ruby/classes/RubyVpi/Config.html +148 -0
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.html +45 -45
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000081.html +5 -5
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000082.html +5 -9
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000083.html +9 -31
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000084.html +31 -69
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000085.html +69 -114
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000086.html +114 -13
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000087.html +13 -5
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000088.html +18 -0
- data/ref/ruby/classes/String.html +10 -10
- data/ref/ruby/classes/String.src/M000032.html +28 -5
- data/ref/ruby/classes/String.src/M000033.html +18 -0
- data/ref/ruby/classes/Table.html +20 -20
- data/ref/ruby/classes/Table.src/M000026.html +25 -5
- data/ref/ruby/classes/Table.src/M000027.html +5 -5
- data/ref/ruby/classes/Table.src/M000028.html +5 -5
- data/ref/ruby/classes/Table.src/M000029.html +18 -0
- data/ref/ruby/classes/Template.html +5 -5
- data/ref/ruby/classes/Template.src/{M000030.html → M000031.html} +4 -4
- data/ref/ruby/classes/VerilogParser.html +5 -5
- data/ref/ruby/classes/VerilogParser.src/{M000004.html → M000005.html} +0 -0
- data/ref/ruby/classes/VerilogParser/Module.html +5 -5
- data/ref/ruby/classes/VerilogParser/Module.src/{M000005.html → M000006.html} +0 -0
- data/ref/ruby/classes/VerilogParser/Module/Parameter.html +5 -5
- data/ref/ruby/classes/VerilogParser/Module/Parameter.src/{M000010.html → M000011.html} +0 -0
- data/ref/ruby/classes/VerilogParser/Module/Port.html +20 -20
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000007.html +8 -5
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000008.html +5 -5
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000009.html +5 -5
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000010.html +18 -0
- data/ref/ruby/classes/XX/Document.html +45 -45
- data/ref/ruby/classes/XX/Document.src/M000072.html +9 -7
- data/ref/ruby/classes/XX/Document.src/M000073.html +7 -7
- data/ref/ruby/classes/XX/Document.src/M000074.html +7 -7
- data/ref/ruby/classes/XX/Document.src/M000075.html +7 -9
- data/ref/ruby/classes/XX/Document.src/M000076.html +9 -8
- data/ref/ruby/classes/XX/Document.src/M000077.html +8 -8
- data/ref/ruby/classes/XX/Document.src/M000078.html +8 -21
- data/ref/ruby/classes/XX/Document.src/M000079.html +21 -85
- data/ref/ruby/classes/XX/Document.src/M000080.html +98 -0
- data/ref/ruby/classes/XX/HTML4.html +5 -5
- data/ref/ruby/classes/XX/HTML4.src/{M000035.html → M000036.html} +0 -0
- data/ref/ruby/classes/XX/HTML4/Strict.html +5 -5
- data/ref/ruby/classes/XX/HTML4/Strict.src/{M000037.html → M000038.html} +0 -0
- data/ref/ruby/classes/XX/HTML4/Transitional.html +5 -5
- data/ref/ruby/classes/XX/HTML4/Transitional.src/{M000036.html → M000037.html} +0 -0
- data/ref/ruby/classes/XX/Markup.html +5 -5
- data/ref/ruby/classes/XX/Markup.src/{M000042.html → M000043.html} +0 -0
- data/ref/ruby/classes/XX/Markup/ClassMethods.html +40 -40
- data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000044.html +9 -7
- data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000045.html +7 -12
- data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000046.html +12 -7
- data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000047.html +7 -14
- data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000048.html +14 -7
- data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000049.html +7 -14
- data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000050.html +14 -9
- data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000051.html +22 -0
- data/ref/ruby/classes/XX/Markup/InstanceMethods.html +100 -100
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000052.html +43 -20
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000053.html +20 -18
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000054.html +18 -35
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000055.html +35 -7
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000056.html +7 -18
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000057.html +18 -19
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000058.html +19 -19
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000059.html +19 -15
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000060.html +15 -10
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000061.html +10 -13
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000062.html +13 -7
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000063.html +7 -7
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000064.html +7 -7
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000065.html +7 -7
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000066.html +7 -7
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000067.html +7 -8
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000068.html +8 -7
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000069.html +7 -7
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000070.html +7 -7
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000071.html +20 -0
- data/ref/ruby/classes/XX/XHTML.html +5 -5
- data/ref/ruby/classes/XX/XHTML.src/{M000038.html → M000039.html} +0 -0
- data/ref/ruby/classes/XX/XHTML/Strict.html +5 -5
- data/ref/ruby/classes/XX/XHTML/Strict.src/{M000040.html → M000041.html} +0 -0
- data/ref/ruby/classes/XX/XHTML/Transitional.html +5 -5
- data/ref/ruby/classes/XX/XHTML/Transitional.src/{M000039.html → M000040.html} +0 -0
- data/ref/ruby/classes/XX/XML.html +5 -5
- data/ref/ruby/classes/XX/XML.src/{M000034.html → M000035.html} +0 -0
- data/ref/ruby/classes/XX/XMLish.html +5 -5
- data/ref/ruby/classes/XX/XMLish.src/{M000041.html → M000042.html} +0 -0
- data/ref/ruby/created.rid +1 -1
- data/ref/ruby/files/bin/generate_test_rb.html +49 -9
- data/ref/ruby/files/bin/generate_test_rb.src/M000001.html +5 -16
- data/ref/ruby/files/bin/generate_test_rb.src/M000002.html +39 -0
- data/ref/ruby/files/bin/header_to_ruby_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/erb_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/integer_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/rake_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/rcov_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 +1 -1
- data/ref/ruby/files/lib/ruby-vpi/runner_rb.html +22 -21
- data/ref/ruby/files/lib/ruby-vpi/runner_rb.src/M000003.html +11 -13
- data/ref/ruby/files/lib/ruby-vpi/runner_rb.src/M000004.html +26 -0
- 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/xx_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi_rb.html +1 -1
- data/ref/ruby/fr_class_index.html +1 -0
- data/ref/ruby/fr_method_index.html +93 -92
- data/samp/counter/{counter_rspecTest_bench.rb → counter_rspec_bench.rb} +2 -2
- data/samp/counter/{counter_rspecTest_bench.v → counter_rspec_bench.v} +3 -3
- data/samp/counter/{counter_unitTest_design.rb → counter_rspec_design.rb} +3 -3
- data/samp/counter/{counter_rspecTest_proto.rb → counter_rspec_proto.rb} +0 -0
- data/samp/counter/{counter_unitTest_runner.rake → counter_rspec_runner.rake} +5 -4
- data/samp/counter/{counter_rspecTest_spec.rb → counter_rspec_spec.rb} +0 -0
- data/samp/counter/{counter_unitTest_bench.rb → counter_xunit_bench.rb} +2 -2
- data/samp/counter/{counter_unitTest_bench.v → counter_xunit_bench.v} +3 -3
- data/samp/counter/{counter_rspecTest_design.rb → counter_xunit_design.rb} +3 -3
- data/samp/counter/{counter_unitTest_proto.rb → counter_xunit_proto.rb} +0 -0
- data/samp/counter/{counter_rspecTest_runner.rake → counter_xunit_runner.rake} +5 -4
- data/samp/counter/{counter_unitTest_spec.rb → counter_xunit_spec.rb} +0 -0
- data/samp/pipelined_alu/hw5_unit_test_runner.rake +3 -2
- metadata +177 -177
- data/ext/README +0 -124
- data/ext/relay.cin +0 -146
- data/ext/ruby-vpi.c +0 -36
- data/ext/vlog.cin +0 -92
- data/lib/ruby-vpi/synopsys_vcs.tab +0 -2
- data/ref/c/relay_8cin.html +0 -204
- data/ref/c/ruby-vpi_8c.html +0 -34
- data/ref/c/swig_8cin.html +0 -75
- data/ref/ruby/classes/FileUtils.src/M000088.html +0 -18
- data/ref/ruby/classes/Integer.src/M000011.html +0 -25
- data/ref/ruby/classes/Integer.src/M000019.html +0 -22
- data/ref/ruby/classes/RubyVpi.src/M000090.html +0 -50
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000080.html +0 -18
- data/ref/ruby/classes/String.src/M000031.html +0 -41
- data/ref/ruby/classes/Table.src/M000025.html +0 -38
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000006.html +0 -21
- data/ref/ruby/classes/XX/Document.src/M000071.html +0 -22
- data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000043.html +0 -22
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000051.html +0 -56
- data/ref/ruby/files/lib/ruby-vpi/runner_rb.src/M000002.html +0 -20
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
<%
|
4
4
|
case aOutputInfo.specFormat
|
5
|
-
when :
|
5
|
+
when :xUnit
|
6
6
|
%>
|
7
7
|
class <%= aOutputInfo.specClassName %> < Test::Unit::TestCase
|
8
8
|
include Vpi
|
@@ -17,7 +17,7 @@ class <%= aOutputInfo.specClassName %> < Test::Unit::TestCase
|
|
17
17
|
<% end %>
|
18
18
|
end
|
19
19
|
<%
|
20
|
-
when :
|
20
|
+
when :rSpec
|
21
21
|
%>
|
22
22
|
include Vpi
|
23
23
|
|
@@ -7,4 +7,4 @@
|
|
7
7
|
<span class="type">va_list</span> *<code class="varname">p</code> = &<code class="varname">ap</code>;
|
8
8
|
}
|
9
9
|
</pre></li></ul></div><p>
|
10
|
-
</p><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="organization.vpi.util"></a><span class="acronym">VPI</span> utility layer</h4></div></div></div><p>From a user's perspective, the <span class="acronym">VPI</span> utility layer greatly enhances the ability to interact with handles. One simply invokes a handle's methods, which are carefully named in the following manner, to access its <span class="acronym">VPI</span> properties.</p><div class="table"><a id="table..handle-property-accessor-naming-format"></a><p class="title"><b>Table 2.1. Naming format for accessing a handle's <span class="acronym">VPI</span> properties</b></p><table summary="Naming format for accessing a handle's VPI properties" border="1"><colgroup><col /><col /><col /><col /><col /><col /></colgroup><thead><tr><th>Operation</th><th>_</th><th>Property</th><th>_</th><th>Accessor</th><th>Addendum</th></tr></thead><tbody><tr><td colspan="2">optional</td><td>required</td><td colspan="2">optional</td><td>optional</td></tr></tbody></table></div><div class="variablelist"><dl><dt><span class="term">Operation</span></dt><dd><p>This parameter suggests a method that should be invoked in the context of the Property parameter.</p></dd><dt><span class="term">Property</span></dt><dd><p>This parameter suggests which <span class="acronym">VPI</span> property should be accessed. The first letter of this parameter's value should be lower case, and the <span class="emphasis"><em>vpi</em></span> prefix—common to all <span class="acronym">VPI</span> properties—can be omitted.</p><p>For example, the <span class="acronym">VPI</span> property <span class="emphasis"><em>vpiFullName</em></span> is considered equivalent to <span class="emphasis"><em>fullName</em></span> but not equivalent to either <span class="emphasis"><em>FullName</em></span> or <span class="emphasis"><em>full_name</em></span>.</p></dd><dt><span class="term">Accessor</span></dt><dd><p>This parameter suggests which <span class="acronym">VPI</span> function should be used to access the <span class="acronym">VPI</span> property. When this parameter is not specified, the <span class="acronym">VPI</span> utility layer will attempt to <span class="emphasis"><em>guess</em></span> the value of this parameter (<a href="../../ref/ruby/classes/SWIG/TYPE_p_unsigned_int.html" target="_top">see the source code</a> of the <code class="code"><code class="constant">SWIG</code>::<code class="constant">TYPE_p_unsigned_int</code>#<code class="function">method_missing</code></code> method for details).</p><div class="table"><a id="id2488062"></a><p class="title"><b>Table 2.2. Possible accessors and their implications</b></p><table summary="Possible accessors and their implications" border="1"><colgroup></colgroup><thead><tr><th>Accessor</th><th>Kind of value accessed</th><th><span class="acronym">VPI</span> functions used to access the value</th></tr></thead><tbody><tr><td>d</td><td>delay</td><td><code class="function">vpi_get_delays</code>, <code class="function">vpi_put_delays</code></td></tr><tr><td>l</td><td>logic</td><td><code class="function">vpi_get_value</code>, <code class="function">vpi_put_value</code></td></tr><tr><td>i</td><td>integer</td><td><code class="function">vpi_get</code></td></tr><tr><td>b</td><td>boolean</td><td><code class="function">vpi_get</code></td></tr><tr><td>s</td><td>string</td><td><code class="function">vpi_get_str</code></td></tr><tr><td>h</td><td>handle</td><td><code class="function">vpi_handle</code></td></tr></tbody></table></div></dd><dt><span class="term">Addendum</span></dt><dd><p>When this parameter is a question mark (<span class="emphasis"><em>?</em></span>), it suggests that the specified <span class="acronym">VPI</span> property should be queried as a boolean value. This produces the same effect as specifying <span class="emphasis"><em>b</em></span> for the Accessor parameter.</p><p>When this parameter is an equal sign (<span class="emphasis"><em>=</em></span>), it suggests that the specified <span class="acronym">VPI</span> property should be written to.</p></dd></dl></div><div class="example"><a id="ex..handle-property-accessor-naming-format"></a><p class="title"><b>Example 2.1. Accessing a handle's <span class="acronym">VPI</span> properties</b></p><div class="informaltable"><table border="1"><colgroup><col /><col /><col /><col /><col /><col /></colgroup><thead><tr><th rowspan="2">Ruby expression</th><th colspan="6">Naming format</th><th rowspan="2">Description</th></tr><tr><th>Operation</th><th>_</th><th>Property</th><th>_</th><th>Accessor</th><th>Addendum</th></tr></thead><tbody><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">each_vpiNet</code> {|<code class="varname">net</code>| <code class="function">puts</code> <code class="varname">net</code>.<code class="function">fullName</code>}</code></td><td>each</td><td>_</td><td>vpiNet</td><td> </td><td> </td><td> </td><td rowspan="2">These expressions print the full name of each <code class="constant">vpiNet</code> object associated with the handle.</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">each_net</code> {|<code class="varname">net</code>| <code class="function">puts</code> <code class="varname">net</code>.<code class="function">fullName</code>}</code></td><td>each</td><td>_</td><td>net</td><td> </td><td> </td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiIntVal</code></code></td><td> </td><td> </td><td>vpiIntVal</td><td> </td><td> </td><td> </td><td rowspan="4">These expressions access the logic value of the handle's <code class="constant">vpiIntVal</code> property.</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiIntVal_l</code></code></td><td> </td><td> </td><td>vpiIntVal</td><td>_</td><td>l</td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">intVal</code></code></td><td> </td><td> </td><td>intVal</td><td> </td><td> </td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">intVal_l</code></code></td><td> </td><td> </td><td>intVal</td><td>_</td><td>l</td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiIntVal</code> = <code class="literal">15</code></code></td><td> </td><td> </td><td>vpiIntVal</td><td> </td><td> </td><td>=</td><td rowspan="4">These expressions assign the number 15 to the logic value of the handle's <code class="constant">vpiIntVal</code> property.</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiIntVal_l</code> = <code class="literal">15</code></code></td><td> </td><td> </td><td>vpiIntVal</td><td>_</td><td>l</td><td>=</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">intVal</code> = <code class="literal">15</code></code></td><td> </td><td> </td><td>intVal</td><td> </td><td> </td><td>=</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">intVal</code>_l = <code class="literal">15</code></code></td><td> </td><td> </td><td>intVal</td><td>_</td><td>l</td><td>=</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiType</code></code></td><td> </td><td> </td><td>vpiType</td><td> </td><td> </td><td> </td><td rowspan="4">These expressions access the integer value of the handle's <code class="constant">vpiType</code> property.</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiType_i</code></code></td><td> </td><td> </td><td>vpiType</td><td>_</td><td>i</td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">type</code></code></td><td> </td><td> </td><td>type</td><td> </td><td> </td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">type_i</code></code></td><td> </td><td> </td><td>type</td><td>_</td><td>i</td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiProtected</code></code></td><td> </td><td> </td><td>vpiProtected</td><td> </td><td> </td><td> </td><td rowspan="6">These expressions access the boolean value of the handle's <code class="constant">vpiProtected</code> property.</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiProtected_b</code></code></td><td> </td><td> </td><td>vpiProtected</td><td>_</td><td>b</td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiProtected?</code></code></td><td> </td><td> </td><td>vpiProtected</td><td> </td><td> </td><td>?</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">protected</code></code></td><td> </td><td> </td><td>protected</td><td> </td><td> </td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">protected_b</code></code></td><td> </td><td> </td><td>protected</td><td>_</td><td>b</td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">protected?</code></code></td><td> </td><td> </td><td>protected</td><td> </td><td> </td><td>?</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiFullName</code></code></td><td> </td><td> </td><td>vpiFullName</td><td> </td><td> </td><td> </td><td rowspan="4">These expressions access the string value of the handle's <code class="constant">vpiFullName</code> property.</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiFullName_s</code></code></td><td> </td><td> </td><td>vpiFullName</td><td>_</td><td>s</td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">fullName</code></code></td><td> </td><td> </td><td>fullName</td><td> </td><td> </td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">fullName_s</code></code></td><td> </td><td> </td><td>fullName</td><td>_</td><td>s</td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiParent</code></code></td><td> </td><td> </td><td>vpiParent</td><td> </td><td> </td><td> </td><td rowspan="4">These expressions access the handle value of the handle's <code class="constant">vpiParent</code> property.</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiParent_h</code></code></td><td> </td><td> </td><td>vpiParent</td><td>_</td><td>h</td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">parent</code></code></td><td> </td><td> </td><td>parent</td><td> </td><td> </td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">parent_h</code></code></td><td> </td><td> </td><td>parent</td><td>_</td><td>h</td><td> </td></tr></tbody></table></div></div></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="background.terminology.html"><img src="images/prev.png" alt="Prev" /></a> </td><td width="20%" align="center"><a accesskey="u" href="background.html"><img src="images/up.png" alt="Up" /></a></td><td width="40%" align="right"> <a accesskey="n" href="background.running-tests.html"><img src="images/next.png" alt="Next" /></a></td></tr><tr><td width="40%" align="left" valign="top">Terminology </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home" /></a></td><td width="40%" align="right" valign="top"> Running a test</td></tr></table></div></body></html>
|
10
|
+
</p><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="organization.vpi.util"></a><span class="acronym">VPI</span> utility layer</h4></div></div></div><p>From a user's perspective, the <span class="acronym">VPI</span> utility layer greatly enhances the ability to interact with handles. One simply invokes a handle's methods, which are carefully named in the following manner, to access its <span class="acronym">VPI</span> properties.</p><div class="table"><a id="table..handle-property-accessor-naming-format"></a><p class="title"><b>Table 2.1. Naming format for accessing a handle's <span class="acronym">VPI</span> properties</b></p><table summary="Naming format for accessing a handle's VPI properties" border="1"><colgroup><col /><col /><col /><col /><col /><col /></colgroup><thead><tr><th>Operation</th><th>_</th><th>Property</th><th>_</th><th>Accessor</th><th>Addendum</th></tr></thead><tbody><tr><td colspan="2">optional</td><td>required</td><td colspan="2">optional</td><td>optional</td></tr></tbody></table></div><div class="variablelist"><dl><dt><span class="term">Operation</span></dt><dd><p>This parameter suggests a method that should be invoked in the context of the Property parameter.</p></dd><dt><span class="term">Property</span></dt><dd><p>This parameter suggests which <span class="acronym">VPI</span> property should be accessed. The first letter of this parameter's value should be lower case, and the <span class="emphasis"><em>vpi</em></span> prefix—common to all <span class="acronym">VPI</span> properties—can be omitted.</p><p>For example, the <span class="acronym">VPI</span> property <span class="emphasis"><em>vpiFullName</em></span> is considered equivalent to <span class="emphasis"><em>fullName</em></span> but not equivalent to either <span class="emphasis"><em>FullName</em></span> or <span class="emphasis"><em>full_name</em></span>.</p></dd><dt><span class="term">Accessor</span></dt><dd><p>This parameter suggests which <span class="acronym">VPI</span> function should be used to access the <span class="acronym">VPI</span> property. When this parameter is not specified, the <span class="acronym">VPI</span> utility layer will attempt to <span class="emphasis"><em>guess</em></span> the value of this parameter (<a href="../../ref/ruby/classes/SWIG/TYPE_p_unsigned_int.html" target="_top">see the source code</a> of the <code class="code"><code class="constant">SWIG</code>::<code class="constant">TYPE_p_unsigned_int</code>#<code class="function">method_missing</code></code> method for details).</p><div class="table"><a id="id2488052"></a><p class="title"><b>Table 2.2. Possible accessors and their implications</b></p><table summary="Possible accessors and their implications" border="1"><colgroup></colgroup><thead><tr><th>Accessor</th><th>Kind of value accessed</th><th><span class="acronym">VPI</span> functions used to access the value</th></tr></thead><tbody><tr><td>d</td><td>delay</td><td><code class="function">vpi_get_delays</code>, <code class="function">vpi_put_delays</code></td></tr><tr><td>l</td><td>logic</td><td><code class="function">vpi_get_value</code>, <code class="function">vpi_put_value</code></td></tr><tr><td>i</td><td>integer</td><td><code class="function">vpi_get</code></td></tr><tr><td>b</td><td>boolean</td><td><code class="function">vpi_get</code></td></tr><tr><td>s</td><td>string</td><td><code class="function">vpi_get_str</code></td></tr><tr><td>h</td><td>handle</td><td><code class="function">vpi_handle</code></td></tr></tbody></table></div></dd><dt><span class="term">Addendum</span></dt><dd><p>When this parameter is a question mark (<span class="emphasis"><em>?</em></span>), it suggests that the specified <span class="acronym">VPI</span> property should be queried as a boolean value. This produces the same effect as specifying <span class="emphasis"><em>b</em></span> for the Accessor parameter.</p><p>When this parameter is an equal sign (<span class="emphasis"><em>=</em></span>), it suggests that the specified <span class="acronym">VPI</span> property should be written to.</p></dd></dl></div><div class="example"><a id="ex..handle-property-accessor-naming-format"></a><p class="title"><b>Example 2.1. Accessing a handle's <span class="acronym">VPI</span> properties</b></p><div class="informaltable"><table border="1"><colgroup><col /><col /><col /><col /><col /><col /></colgroup><thead><tr><th rowspan="2">Ruby expression</th><th colspan="6">Naming format</th><th rowspan="2">Description</th></tr><tr><th>Operation</th><th>_</th><th>Property</th><th>_</th><th>Accessor</th><th>Addendum</th></tr></thead><tbody><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">each_vpiNet</code> {|<code class="varname">net</code>| <code class="function">puts</code> <code class="varname">net</code>.<code class="function">fullName</code>}</code></td><td>each</td><td>_</td><td>vpiNet</td><td> </td><td> </td><td> </td><td rowspan="2">These expressions print the full name of each <code class="constant">vpiNet</code> object associated with the handle.</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">each_net</code> {|<code class="varname">net</code>| <code class="function">puts</code> <code class="varname">net</code>.<code class="function">fullName</code>}</code></td><td>each</td><td>_</td><td>net</td><td> </td><td> </td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiIntVal</code></code></td><td> </td><td> </td><td>vpiIntVal</td><td> </td><td> </td><td> </td><td rowspan="4">These expressions access the logic value of the handle's <code class="constant">vpiIntVal</code> property.</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiIntVal_l</code></code></td><td> </td><td> </td><td>vpiIntVal</td><td>_</td><td>l</td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">intVal</code></code></td><td> </td><td> </td><td>intVal</td><td> </td><td> </td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">intVal_l</code></code></td><td> </td><td> </td><td>intVal</td><td>_</td><td>l</td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiIntVal</code> = <code class="literal">15</code></code></td><td> </td><td> </td><td>vpiIntVal</td><td> </td><td> </td><td>=</td><td rowspan="4">These expressions assign the number 15 to the logic value of the handle's <code class="constant">vpiIntVal</code> property.</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiIntVal_l</code> = <code class="literal">15</code></code></td><td> </td><td> </td><td>vpiIntVal</td><td>_</td><td>l</td><td>=</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">intVal</code> = <code class="literal">15</code></code></td><td> </td><td> </td><td>intVal</td><td> </td><td> </td><td>=</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">intVal</code>_l = <code class="literal">15</code></code></td><td> </td><td> </td><td>intVal</td><td>_</td><td>l</td><td>=</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiType</code></code></td><td> </td><td> </td><td>vpiType</td><td> </td><td> </td><td> </td><td rowspan="4">These expressions access the integer value of the handle's <code class="constant">vpiType</code> property.</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiType_i</code></code></td><td> </td><td> </td><td>vpiType</td><td>_</td><td>i</td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">type</code></code></td><td> </td><td> </td><td>type</td><td> </td><td> </td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">type_i</code></code></td><td> </td><td> </td><td>type</td><td>_</td><td>i</td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiProtected</code></code></td><td> </td><td> </td><td>vpiProtected</td><td> </td><td> </td><td> </td><td rowspan="6">These expressions access the boolean value of the handle's <code class="constant">vpiProtected</code> property.</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiProtected_b</code></code></td><td> </td><td> </td><td>vpiProtected</td><td>_</td><td>b</td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiProtected?</code></code></td><td> </td><td> </td><td>vpiProtected</td><td> </td><td> </td><td>?</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">protected</code></code></td><td> </td><td> </td><td>protected</td><td> </td><td> </td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">protected_b</code></code></td><td> </td><td> </td><td>protected</td><td>_</td><td>b</td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">protected?</code></code></td><td> </td><td> </td><td>protected</td><td> </td><td> </td><td>?</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiFullName</code></code></td><td> </td><td> </td><td>vpiFullName</td><td> </td><td> </td><td> </td><td rowspan="4">These expressions access the string value of the handle's <code class="constant">vpiFullName</code> property.</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiFullName_s</code></code></td><td> </td><td> </td><td>vpiFullName</td><td>_</td><td>s</td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">fullName</code></code></td><td> </td><td> </td><td>fullName</td><td> </td><td> </td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">fullName_s</code></code></td><td> </td><td> </td><td>fullName</td><td>_</td><td>s</td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiParent</code></code></td><td> </td><td> </td><td>vpiParent</td><td> </td><td> </td><td> </td><td rowspan="4">These expressions access the handle value of the handle's <code class="constant">vpiParent</code> property.</td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">vpiParent_h</code></code></td><td> </td><td> </td><td>vpiParent</td><td>_</td><td>h</td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">parent</code></code></td><td> </td><td> </td><td>parent</td><td> </td><td> </td><td> </td></tr><tr><td><code class="code"><code class="varname">handle</code>.<code class="function">parent_h</code></code></td><td> </td><td> </td><td>parent</td><td>_</td><td>h</td><td> </td></tr></tbody></table></div></div></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="background.terminology.html"><img src="images/prev.png" alt="Prev" /></a> </td><td width="20%" align="center"><a accesskey="u" href="background.html"><img src="images/up.png" alt="Up" /></a></td><td width="40%" align="right"> <a accesskey="n" href="background.running-tests.html"><img src="images/next.png" alt="Next" /></a></td></tr><tr><td width="40%" align="left" valign="top">Terminology </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home" /></a></td><td width="40%" align="right" valign="top"> Running a test</td></tr></table></div></body></html>
|
data/doc/glossary.html
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
2
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Glossary</title><link rel="stylesheet" href="styles/manual.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.68.1" /><link rel="start" href="index.html" title="Ruby-VPI user manual" /><link rel="up" href="index.html" title="Ruby-VPI user manual" /><link rel="prev" href="problems.vsim.html" title="Mentor Modelsim" /><link rel="next" href="gfdl.html" title="Appendix A. GNU Free Documentation License" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Glossary</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="problems.vsim.html"><img src="images/prev.png" alt="Prev" /></a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="gfdl.html"><img src="images/next.png" alt="Next" /></a></td></tr></table><hr /></div><div class="glossary"><div class="titlepage"><div><div><h2 class="title"><a id="glossary"></a>Glossary</h2></div></div></div><div class="glossdiv"><h3 class="title">B</h3><dl><dt><a id="term..bench"></a>Bench</dt><dd><p>An environment in which a <a href="glossary.html#term..design">Design</a> is verified against a <a href="glossary.html#term..specification">Specification</a>. Often, it is used to emulate conditions in which the design will be eventually deployed.</p></dd><dt><a id="term..BDD"></a><span class="acronym">BDD</span></dt><dd><p>Behavior driven development.</p><p>A software development methodology which emphasizes thinking in terms of behavior when designing, implementing, and verifying software. See the <a href="http://behaviour-driven.org/" target="_top">official wiki</a> for more information.</p><p>See Also <a href="glossary.html#term..TDD">TDD</a>, <a href="glossary.html#term..rspec">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Glossary</title><link rel="stylesheet" href="styles/manual.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.68.1" /><link rel="start" href="index.html" title="Ruby-VPI user manual" /><link rel="up" href="index.html" title="Ruby-VPI user manual" /><link rel="prev" href="problems.vsim.html" title="Mentor Modelsim" /><link rel="next" href="gfdl.html" title="Appendix A. GNU Free Documentation License" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Glossary</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="problems.vsim.html"><img src="images/prev.png" alt="Prev" /></a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="gfdl.html"><img src="images/next.png" alt="Next" /></a></td></tr></table><hr /></div><div class="glossary"><div class="titlepage"><div><div><h2 class="title"><a id="glossary"></a>Glossary</h2></div></div></div><div class="glossdiv"><h3 class="title">B</h3><dl><dt><a id="term..bench"></a>Bench</dt><dd><p>An environment in which a <a href="glossary.html#term..design">Design</a> is verified against a <a href="glossary.html#term..specification">Specification</a>. Often, it is used to emulate conditions in which the design will be eventually deployed.</p></dd><dt><a id="term..BDD"></a><span class="acronym">BDD</span></dt><dd><p>Behavior driven development.</p><p>A software development methodology which emphasizes thinking in terms of behavior when designing, implementing, and verifying software. See the <a href="http://behaviour-driven.org/" target="_top">official wiki</a> for more information.</p><p>See Also <a href="glossary.html#term..TDD">TDD</a>, <a href="glossary.html#term..rspec">rSpec</a>.</p></dd></dl></div><div class="glossdiv"><h3 class="title">D</h3><dl><dt><a id="term..design"></a>Design</dt><dd><p>An idea or entity that is verified against a <a href="glossary.html#term..specification">Specification</a> in order to ensure correctness or soundness of its being. In other words, it is the thing being checked: does it work or not?</p></dd></dl></div><div class="glossdiv"><h3 class="title">E</h3><dl><dt><a id="term..expectation"></a>Expectation</dt><dd><p>The desired response to some stimulus.</p></dd></dl></div><div class="glossdiv"><h3 class="title">H</h3><dl><dt><a id="term..handle"></a>Handle</dt><dd><p>An object in a Verilog simulation. For example, a handle can represent a wire, register, module, if-statement, expression, and so on.</p></dd></dl></div><div class="glossdiv"><h3 class="title">R</h3><dl><dt><a id="term..rake"></a>Rake</dt><dd><div class="blockquote"><table border="0" width="100%" cellspacing="0" cellpadding="0" class="blockquote" summary="Block quote"><tr><td width="10%" valign="top"> </td><td width="80%" valign="top"><p>Rake is a build tool, written in Ruby, using Ruby as a build language. Rake is similar to make in scope and purpose.</p></td><td width="10%" valign="top"> </td></tr><tr><td width="10%" valign="top"> </td><td colspan="2" align="right" valign="top">--<span class="attribution"><a href="http://docs.rubyrake.org/" target="_top">Rake documentation</a></span></td></tr></table></div><p>See the <a href="http://rake.rubyforge.org/" target="_top">Rake website</a> for more information.</p></dd><dt><a id="term..rspec"></a>rSpec</dt><dd><p>Ruby framework for BDD. See the <a href="http://rspec.rubyforge.org" target="_top">rSpec website</a> and <a href="http://rspec.rubyforge.org/tutorials/index.html" target="_top">rSpec tutorial</a> for more information.</p><p>See Also <a href="glossary.html#term..BDD"><span class="acronym">BDD</span></a>.</p></dd></dl></div><div class="glossdiv"><h3 class="title">S</h3><dl><dt><a id="term..specification"></a>Specification</dt><dd><p>A set of <a href="glossary.html#term..expectation">Expectation</a>s which define the desired behavior of a <a href="glossary.html#term..design">Design</a> when it is subjected to certain conditions.</p></dd></dl></div><div class="glossdiv"><h3 class="title">T</h3><dl><dt><a id="term..TDD"></a>TDD</dt><dd><p>Test Driven Development.</p><p>See Also <a href="glossary.html#term..BDD"><span class="acronym">BDD</span></a>.</p></dd><dt><a id="term..test"></a>Test</dt><dd><p>Something that checks if a <a href="glossary.html#term..design">Design</a> satisfies a <a href="glossary.html#term..specification">Specification</a>.</p><p>See Also <a href="glossary.html#term..test-bench">Test bench</a>.</p></dd><dt><a id="term..test-bench"></a>Test bench</dt><dd><p>An allusion to <a href="background.terminology.html" title="Terminology">a bench in an electronics laboratory</a>, or so it seems.</p><p>See Also <a href="glossary.html#term..test">Test</a>.</p></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="problems.vsim.html"><img src="images/prev.png" alt="Prev" /></a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="gfdl.html"><img src="images/next.png" alt="Next" /></a></td></tr><tr><td width="40%" align="left" valign="top">Mentor Modelsim </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home" /></a></td><td width="40%" align="right" valign="top"> Appendix A. GNU Free Documentation License</td></tr></table></div></body></html>
|
data/doc/index.html
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
2
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Ruby-VPI user manual</title><link rel="stylesheet" href="styles/manual.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.68.1" /><meta name="description" content="This manual explains how to use Ruby-VPI. You can find the newest version of this manual at the Ruby-VPI website." /><link rel="start" href="index.html" title="Ruby-VPI user manual" /><link rel="next" href="introduction.html" title="Chapter 1. Introduction" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="application">Ruby-VPI</span> user manual</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="introduction.html"><img src="images/next.png" alt="Next" /></a></td></tr></table><hr /></div><div class="book" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="
|
4
|
-
your documents</a></span></dt></dl></dd></dl></div><div class="list-of-figures"><p><b>List of Figures</b></p><dl><dt>2.1. <a href="background.organization.html#fig..organization">Overall organization of a test</a></dt><dt>2.2. <a href="background.organization.html#fig..organization.detail">Detailed organization of a test</a></dt><dt>2.3. <a href="background.running-tests.html#fig..ruby_init">Initialization of a test</a></dt><dt>2.4. <a href="background.running-tests.html#fig..ruby_relay">Execution of a test</a></dt><dt>3.1. <a href="usage.tutorial.html#fig..counter.v_decl">Declaration of a simple up-counter with synchronous reset</a></dt><dt>3.2. <a href="usage.tutorial.html#fig..generate-test.rspec">Generating a test with specification in
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Ruby-VPI user manual</title><link rel="stylesheet" href="styles/manual.css" type="text/css" /><meta name="generator" content="DocBook XSL Stylesheets V1.68.1" /><meta name="description" content="This manual explains how to use Ruby-VPI. You can find the newest version of this manual at the Ruby-VPI website." /><link rel="start" href="index.html" title="Ruby-VPI user manual" /><link rel="next" href="introduction.html" title="Chapter 1. Introduction" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="application">Ruby-VPI</span> user manual</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="introduction.html"><img src="images/next.png" alt="Next" /></a></td></tr></table><hr /></div><div class="book" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="id2472600"></a><span class="application">Ruby-VPI</span> user manual</h1></div><div><p class="copyright">Copyright © 2006 Suraj N. Kurapati</p></div><div><p class="copyright">Copyright © 2005, 2006 <a href="http://tango.freedesktop.org" target="_top">Tango Desktop Project</a> <em><span class="remark">for admonition and navigation graphics released under <a href="images/COPYING" target="_top">this license</a>.</span></em></p></div><div><p class="copyright">Copyright © 1999, 2000, 2001 Norman Walsh <em><span class="remark">for DocBook graphics released under <a href="images/copyright" target="_top">this license</a>.</span></em></p></div><div><div class="legalnotice"><a id="id2516377"></a><p>Permission is granted to copy, distribute and/or modify this document under the terms of the <span class="acronym">GNU</span> Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "<span class="acronym">GNU</span> Free Documentation License".</p></div></div><div><div class="abstract"><p class="title"><b>Abstract</b></p><p>This manual explains how to use <span class="application">Ruby-VPI</span>. You can find the newest version of this manual at the <a href="http://ruby-vpi.rubyforge.org" target="_top"><span class="application">Ruby-VPI</span> website</a>.</p></div></div></div><hr /></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="introduction.html">1. Introduction</a></span></dt><dd><dl><dt><span class="section"><a href="introduction.license.html">License</a></span></dt><dt><span class="section"><a href="introduction.manifest.html">Manifest</a></span></dt><dt><span class="section"><a href="introduction.resources.html">Resources</a></span></dt><dt><span class="section"><a href="introduction.related-works.html">Related works</a></span></dt><dd><dl><dt><span class="section"><a href="introduction.related-works.html#introduction.related-works.pli">Ye olde PLI</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="background.html">2. Background</a></span></dt><dd><dl><dt><span class="section"><a href="background.methodology.html">Methodology</a></span></dt><dt><span class="section"><a href="background.terminology.html">Terminology</a></span></dt><dt><span class="section"><a href="background.organization.html">Organization</a></span></dt><dd><dl><dt><span class="section"><a href="background.organization.html#organization.vpi">Interface to <span class="acronym">VPI</span></a></span></dt></dl></dd><dt><span class="section"><a href="background.running-tests.html">Running a test</a></span></dt><dd><dl><dt><span class="section"><a href="background.running-tests.html#background.running-tests.init">Initialization</a></span></dt><dt><span class="section"><a href="background.running-tests.html#background.running-tests.exec">Execution</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="usage.html">3. Usage</a></span></dt><dd><dl><dt><span class="section"><a href="usage.requirements.html">Requirements</a></span></dt><dt><span class="section"><a href="usage.recommendations.html">Recommendations</a></span></dt><dt><span class="section"><a href="usage.installation.html">Installation and maintenance</a></span></dt><dd><dl><dt><span class="section"><a href="usage.installation.html#usage.installation.windows">Installing on Windows</a></span></dt></dl></dd><dt><span class="section"><a href="usage.tools.html">Tools</a></span></dt><dd><dl><dt><span class="section"><a href="usage.tools.html#usage.tools.generate-test">Automated test generation</a></span></dt><dt><span class="section"><a href="usage.tools.html#usage.tools.verilog-ruby-conv">Verilog to Ruby conversion</a></span></dt></dl></dd><dt><span class="section"><a href="usage.examples.html">Examples</a></span></dt><dt><span class="section"><a href="usage.tutorial.html">Tutorial</a></span></dt><dd><dl><dt><span class="section"><a href="usage.tutorial.html#usage.tutorial.declare-design">Start with a design</a></span></dt><dt><span class="section"><a href="usage.tutorial.html#usage.tutorial.generate-test">Generate a test</a></span></dt><dt><span class="section"><a href="usage.tutorial.html#usage.tutorial.specification">Specify your expectations</a></span></dt><dt><span class="section"><a href="usage.tutorial.html#usage.tutorial.implement-proto">Implement the prototype</a></span></dt><dt><span class="section"><a href="usage.tutorial.html#usage.tutorial.test-proto">Verify the prototype</a></span></dt><dt><span class="section"><a href="usage.tutorial.html#usage.tutorial.implement-design">Implement the design</a></span></dt><dt><span class="section"><a href="usage.tutorial.html#usage.tutorial.test-design">Verify the design</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="problems.html">4. Known problems</a></span></dt><dd><dl><dt><span class="section"><a href="problems.ruby.html">Ruby</a></span></dt><dd><dl><dt><span class="section"><a href="problems.ruby.html#problems.ruby.SystemStackError">SystemStackError</a></span></dt><dt><span class="section"><a href="problems.ruby.html#problems.ruby.xUnit">test/unit</a></span></dt></dl></dd><dt><span class="section"><a href="problem.ivl.html">Icarus Verilog</a></span></dt><dd><dl><dt><span class="section"><a href="problem.ivl.html#problems.ivl.vpi_handle_by_name">vpi_handle_by_name</a></span></dt><dt><span class="section"><a href="problem.ivl.html#problems.ivl.vpi_reset">Vpi::reset</a></span></dt></dl></dd><dt><span class="section"><a href="problems.vsim.html">Mentor Modelsim</a></span></dt><dd><dl><dt><span class="section"><a href="problems.vsim.html#problems.vsim.ruby_run">ruby_run()</a></span></dt></dl></dd></dl></dd><dt><span class="glossary"><a href="glossary.html">Glossary</a></span></dt><dt><span class="appendix"><a href="gfdl.html">A. GNU Free Documentation License</a></span></dt><dd><dl><dt><span class="section"><a href="gfdl-0.html">PREAMBLE</a></span></dt><dt><span class="section"><a href="gfdl-1.html">APPLICABILITY AND DEFINITIONS</a></span></dt><dt><span class="section"><a href="gfdl-2.html">VERBATIM COPYING</a></span></dt><dt><span class="section"><a href="gfdl-3.html">COPYING IN QUANTITY</a></span></dt><dt><span class="section"><a href="gfdl-4.html">MODIFICATIONS</a></span></dt><dt><span class="section"><a href="gfdl-5.html">COMBINING DOCUMENTS</a></span></dt><dt><span class="section"><a href="gfdl-6.html">COLLECTIONS OF DOCUMENTS</a></span></dt><dt><span class="section"><a href="gfdl-7.html">AGGREGATION WITH INDEPENDENT WORKS</a></span></dt><dt><span class="section"><a href="gfdl-8.html">TRANSLATION</a></span></dt><dt><span class="section"><a href="gfdl-9.html">TERMINATION</a></span></dt><dt><span class="section"><a href="gfdl-10.html">FUTURE REVISIONS OF THIS LICENSE</a></span></dt><dt><span class="section"><a href="gfdl-addendum.html">ADDENDUM: How to use this License for
|
4
|
+
your documents</a></span></dt></dl></dd></dl></div><div class="list-of-figures"><p><b>List of Figures</b></p><dl><dt>2.1. <a href="background.organization.html#fig..organization">Overall organization of a test</a></dt><dt>2.2. <a href="background.organization.html#fig..organization.detail">Detailed organization of a test</a></dt><dt>2.3. <a href="background.running-tests.html#fig..ruby_init">Initialization of a test</a></dt><dt>2.4. <a href="background.running-tests.html#fig..ruby_relay">Execution of a test</a></dt><dt>3.1. <a href="usage.tutorial.html#fig..counter.v_decl">Declaration of a simple up-counter with synchronous reset</a></dt><dt>3.2. <a href="usage.tutorial.html#fig..generate-test.rspec">Generating a test with specification in rSpec format</a></dt><dt>3.3. <a href="usage.tutorial.html#fig..generate-test.unit-test">Generating a test with specification in xUnit format</a></dt><dt>3.4. <a href="usage.tutorial.html#fig..counter_rspec_spec.rb">Specification implemented in rSpec format</a></dt><dt>3.5. <a href="usage.tutorial.html#fig..counter_xunit_spec.rb">Specification implemented in xUnit format</a></dt><dt>3.6. <a href="usage.tutorial.html#fig..counter_proto.rb">Ruby prototype of our Verilog design</a></dt><dt>3.7. <a href="usage.tutorial.html#fig..test-proto.rspec">Running a test with specification in rSpec format</a></dt><dt>3.8. <a href="usage.tutorial.html#fig..test-proto.unit-test">Running a test with specification in xUnit format</a></dt><dt>3.9. <a href="usage.tutorial.html#fig..counter.v_impl">Implementation of a simple up-counter with synchronous reset</a></dt><dt>3.10. <a href="usage.tutorial.html#fig..test-design.rspec">Running a test with specification in rSpec format</a></dt><dt>3.11. <a href="usage.tutorial.html#fig..test-design.unit-test">Running a test with specification in xUnit format</a></dt></dl></div><div class="list-of-tables"><p><b>List of Tables</b></p><dl><dt>2.1. <a href="background.organization.html#table..handle-property-accessor-naming-format">Naming format for accessing a handle's <span class="acronym">VPI</span> properties</a></dt><dt>2.2. <a href="background.organization.html#id2488052">Possible accessors and their implications</a></dt></dl></div><div class="list-of-examples"><p><b>List of Examples</b></p><dl><dt>2.1. <a href="background.organization.html#ex..handle-property-accessor-naming-format">Accessing a handle's <span class="acronym">VPI</span> properties</a></dt><dt>4.1. <a href="problem.ivl.html#ex..TestFoo">Part of a bench which instantiates a Verilog design</a></dt><dt>4.2. <a href="problem.ivl.html#ex..TestFoo_bad">Bad design with unconnected registers</a></dt><dt>4.3. <a href="problem.ivl.html#ex..TestFoo_fix">Fixed design with wired registers</a></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="introduction.html"><img src="images/next.png" alt="Next" /></a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> Chapter 1. Introduction</td></tr></table></div></body></html>
|
data/doc/manual.txt
CHANGED
@@ -48,7 +48,11 @@ Table of Contents
|
|
48
48
|
3. Usage
|
49
49
|
|
50
50
|
Requirements
|
51
|
+
Recommendations
|
51
52
|
Installation and maintenance
|
53
|
+
|
54
|
+
Installing on Windows
|
55
|
+
|
52
56
|
Tools
|
53
57
|
|
54
58
|
Automated test generation
|
@@ -104,16 +108,16 @@ List of Figures
|
|
104
108
|
2.3. Initialization of a test
|
105
109
|
2.4. Execution of a test
|
106
110
|
3.1. Declaration of a simple up-counter with synchronous reset
|
107
|
-
3.2. Generating a test with specification in
|
108
|
-
3.3. Generating a test with specification in
|
109
|
-
3.4. Specification implemented in
|
110
|
-
3.5. Specification implemented in
|
111
|
+
3.2. Generating a test with specification in rSpec format
|
112
|
+
3.3. Generating a test with specification in xUnit format
|
113
|
+
3.4. Specification implemented in rSpec format
|
114
|
+
3.5. Specification implemented in xUnit format
|
111
115
|
3.6. Ruby prototype of our Verilog design
|
112
|
-
3.7. Running a test with specification in
|
113
|
-
3.8. Running a test with specification in
|
116
|
+
3.7. Running a test with specification in rSpec format
|
117
|
+
3.8. Running a test with specification in xUnit format
|
114
118
|
3.9. Implementation of a simple up-counter with synchronous reset
|
115
|
-
3.10. Running a test with specification in
|
116
|
-
3.11. Running a test with specification in
|
119
|
+
3.10. Running a test with specification in rSpec format
|
120
|
+
3.11. Running a test with specification in xUnit format
|
117
121
|
|
118
122
|
List of Tables
|
119
123
|
|
@@ -561,7 +565,11 @@ Chapter 3. Usage
|
|
561
565
|
Table of Contents
|
562
566
|
|
563
567
|
Requirements
|
568
|
+
Recommendations
|
564
569
|
Installation and maintenance
|
570
|
+
|
571
|
+
Installing on Windows
|
572
|
+
|
565
573
|
Tools
|
566
574
|
|
567
575
|
Automated test generation
|
@@ -597,11 +605,11 @@ Verilog simulator
|
|
597
605
|
|
598
606
|
Synopsys VCS
|
599
607
|
|
600
|
-
|
608
|
+
Any version that supports the -load option is acceptable.
|
601
609
|
|
602
610
|
Mentor Modelsim
|
603
611
|
|
604
|
-
|
612
|
+
Any version that supports the -pli option is acceptable.
|
605
613
|
|
606
614
|
make
|
607
615
|
|
@@ -628,6 +636,39 @@ RubyGems
|
|
628
636
|
Any recent version should be acceptable. You can install RubyGems by
|
629
637
|
following these instructions.
|
630
638
|
|
639
|
+
Recommendations
|
640
|
+
|
641
|
+
The following software may make your interactions with Ruby-VPI more pleasant.
|
642
|
+
|
643
|
+
Text merging tool
|
644
|
+
|
645
|
+
An interactive text merging tool can greatly simplify the process of
|
646
|
+
transferring wanted changes from one file to another. In particular, such
|
647
|
+
tools are especially beneficial when using the automated test generator.
|
648
|
+
Below are a list of popular text merging tools.
|
649
|
+
|
650
|
+
imediff2
|
651
|
+
|
652
|
+
A textual, fullscreen two-way merging tool, which works in a terminal.
|
653
|
+
Useful when working remotely via SSH.
|
654
|
+
|
655
|
+
kdiff3
|
656
|
+
|
657
|
+
A graphical, three-way merging tool for KDE.
|
658
|
+
|
659
|
+
meld
|
660
|
+
|
661
|
+
A graphical, three-way merging tool for GNOME.
|
662
|
+
|
663
|
+
tkdiff
|
664
|
+
|
665
|
+
A graphical, two-way merging tool that uses the cross-platform Tk
|
666
|
+
windowing toolkit.
|
667
|
+
|
668
|
+
xxdiff
|
669
|
+
|
670
|
+
A graphical, three-way merging tool.
|
671
|
+
|
631
672
|
Installation and maintenance
|
632
673
|
|
633
674
|
Once you have satisfied the necessary requirements, you can install Ruby-VPI by
|
@@ -647,6 +688,32 @@ Furthermore, you can upgrade to the latest release of Ruby-VPI by running the
|
|
647
688
|
command gem update ruby-vpi. Finally, you can learn more about using and
|
648
689
|
manipulating RubyGems in the RubyGems user manual.
|
649
690
|
|
691
|
+
Installing on Windows
|
692
|
+
|
693
|
+
1. Install Cygwin, the Linux-like environment for Windows.
|
694
|
+
|
695
|
+
2. Search for object files whose names end with .so, .o, or .dll in your
|
696
|
+
Verilog simulator's installation directory.
|
697
|
+
|
698
|
+
3. Determine which object files, among those found in the previous step,
|
699
|
+
contain symbols whose names begin with _vpi^[1] by running the command for
|
700
|
+
x in *.{o,so,dll}; do nm $x | grep -q '[Tt] _vpi' > /dev/null && echo $x;
|
701
|
+
done in Cygwin.
|
702
|
+
|
703
|
+
If you are using Mentor Modelsim, the desired object file can be found at a
|
704
|
+
path similar to C:\Modeltech\win32\libvsim.dll.
|
705
|
+
|
706
|
+
If you are using GPL Cver, the desired object file can be found at a path
|
707
|
+
similar to C:\gplcver\objs\v_vpi.o.
|
708
|
+
|
709
|
+
4. Assign the path of the object file (determined in the previous step) to the
|
710
|
+
LDFLAGS environment variable. For example, if the object file's path is /
|
711
|
+
life/long/journey, then you would run the command export LDFLAGS=/life/long
|
712
|
+
/journey in Cygwin.
|
713
|
+
|
714
|
+
5. You may now install Ruby-VPI by running the command gem install ruby-vpi in
|
715
|
+
Cygwin.
|
716
|
+
|
650
717
|
Tools
|
651
718
|
|
652
719
|
The bin directory contains various utilities which ease the process of writing
|
@@ -671,12 +738,12 @@ can be used. Each example has an associated Rakefile which simplifies the
|
|
671
738
|
process of running it. Therefore, simply navigate into an example directory and
|
672
739
|
run the command rake to get started.
|
673
740
|
|
674
|
-
Also, some example specifications make use of BDD through the
|
675
|
-
See the the section called “Methodology” for a discussion of
|
741
|
+
Also, some example specifications make use of BDD through the rSpec library.
|
742
|
+
See the the section called “Methodology” for a discussion of rSpec.
|
676
743
|
|
677
744
|
Tutorial
|
678
745
|
|
679
|
-
Procedure 3.
|
746
|
+
Procedure 3.2. Typical way of using Ruby-VPI
|
680
747
|
|
681
748
|
1. Declare the design, which is a Verilog module, using Verilog 2001 syntax.
|
682
749
|
|
@@ -733,19 +800,18 @@ Generate a test
|
|
733
800
|
|
734
801
|
Now that we have a Design to verify, let us generate a Test for it using the
|
735
802
|
automated test generator tool. This tool allows us to implement our
|
736
|
-
Specification in either
|
737
|
-
represents a different software development methodology:
|
738
|
-
|
739
|
-
methodology.
|
803
|
+
Specification in either rSpec, xUnit, or our very own format. Each format
|
804
|
+
represents a different software development methodology: rSpec represents BDD,
|
805
|
+
xUnit represents TDD, and our own format can represent another methodology.
|
740
806
|
|
741
807
|
[Note] Note
|
742
808
|
In this tutorial, you will see how specifications are implemented in
|
743
|
-
both
|
809
|
+
both rSpec and xUnit formats.
|
744
810
|
|
745
811
|
Once we have decided how we want to implement our specification, we can proceed
|
746
812
|
to generate a test for our design. Figure 3.2, “Generating a test with
|
747
|
-
specification in
|
748
|
-
specification in
|
813
|
+
specification in rSpec format” and Figure 3.3, “Generating a test with
|
814
|
+
specification in xUnit format” illustrate this process. Here, the test
|
749
815
|
generation tool produces a test composed of the following parts:
|
750
816
|
|
751
817
|
Runner
|
@@ -774,37 +840,40 @@ The reason for dividing a single test into these parts is mainly to decouple
|
|
774
840
|
the design from the specification. This allows you to focus on writing the
|
775
841
|
specification while the remainder is automatically generated by the tool. For
|
776
842
|
example, when the interface of a Verilog module changes, you would simply
|
777
|
-
re-run this tool and incorporate those changes
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
843
|
+
re-run this tool and incorporate those changes into the test without diverting
|
844
|
+
your focus from the specification.
|
845
|
+
|
846
|
+
Figure 3.2. Generating a test with specification in rSpec format
|
847
|
+
|
848
|
+
$ generate_test.rb counter.v --rspec --name rspec
|
849
|
+
|
850
|
+
name rspec
|
851
|
+
format rSpec
|
852
|
+
|
853
|
+
module counter
|
854
|
+
create counter_rspec_runner.rake
|
855
|
+
create counter_rspec_bench.v
|
856
|
+
create counter_rspec_bench.rb
|
857
|
+
create counter_rspec_design.rb
|
858
|
+
create counter_rspec_proto.rb
|
859
|
+
create counter_rspec_spec.rb
|
860
|
+
|
861
|
+
|
862
|
+
Figure 3.3. Generating a test with specification in xUnit format
|
863
|
+
|
864
|
+
$ generate_test.rb counter.v --xunit --name xunit
|
865
|
+
|
866
|
+
name xunit
|
867
|
+
format xUnit
|
868
|
+
|
869
|
+
module counter
|
870
|
+
create counter_xunit_runner.rake
|
871
|
+
create counter_xunit_bench.v
|
872
|
+
create counter_xunit_bench.rb
|
873
|
+
create counter_xunit_design.rb
|
874
|
+
create counter_xunit_proto.rb
|
875
|
+
create counter_xunit_spec.rb
|
876
|
+
|
808
877
|
|
809
878
|
Specify your expectations
|
810
879
|
|
@@ -824,13 +893,13 @@ The following is a reasonable set of expectations for our simple counter:
|
|
824
893
|
|
825
894
|
Now that we have identified a set of expectations for our design, we are ready
|
826
895
|
to implement them in our specification. Figure 3.4, “Specification implemented
|
827
|
-
in
|
828
|
-
|
896
|
+
in rSpec format” and Figure 3.5, “Specification implemented in xUnit format”
|
897
|
+
illustrate this process. Note the striking similarities between our
|
829
898
|
expectations and their implementation.
|
830
899
|
|
831
900
|
[Important] Before we continue…
|
832
901
|
● Append the following code to the files named
|
833
|
-
|
902
|
+
counter_rspec_design.rb and counter_xunit_design.rb.
|
834
903
|
|
835
904
|
class Counter
|
836
905
|
def reset!
|
@@ -840,15 +909,15 @@ expectations and their implementation.
|
|
840
909
|
end
|
841
910
|
end
|
842
911
|
|
843
|
-
● Replace the contents of the file named
|
844
|
-
|
845
|
-
|
912
|
+
● Replace the contents of the file named counter_rspec_spec.rb
|
913
|
+
with the source code shown in Figure 3.4, “Specification
|
914
|
+
implemented in rSpec format”.
|
846
915
|
|
847
|
-
● Replace the contents of the file named
|
916
|
+
● Replace the contents of the file named counter_xunit_spec.rb
|
848
917
|
with the source code shown in Figure 3.5, “Specification
|
849
|
-
implemented in
|
918
|
+
implemented in xUnit format”.
|
850
919
|
|
851
|
-
Figure 3.4. Specification implemented in
|
920
|
+
Figure 3.4. Specification implemented in rSpec format
|
852
921
|
|
853
922
|
LIMIT = 2 ** Counter::Size # lowest upper bound of counter's value
|
854
923
|
MAX = LIMIT - 1 # maximum allowed value for a counter
|
@@ -889,7 +958,7 @@ context "A counter with the maximum value" do
|
|
889
958
|
end
|
890
959
|
end
|
891
960
|
|
892
|
-
Figure 3.5. Specification implemented in
|
961
|
+
Figure 3.5. Specification implemented in xUnit format
|
893
962
|
|
894
963
|
LIMIT = 2 ** Counter::Size # lowest upper bound of counter's value
|
895
964
|
MAX = LIMIT - 1 # maximum allowed value for a counter
|
@@ -941,9 +1010,9 @@ in Verilog, and gain confidence in our work. Figure 3.6, “Ruby prototype of o
|
|
941
1010
|
Verilog design” shows the completed prototype for our design.
|
942
1011
|
|
943
1012
|
[Important] Before we continue…
|
944
|
-
Replace the contents of the files named
|
945
|
-
|
946
|
-
|
1013
|
+
Replace the contents of the files named counter_rspec_proto.rb and
|
1014
|
+
counter_xunit_proto.rb with the source code shown in Figure 3.6,
|
1015
|
+
“Ruby prototype of our Verilog design”.
|
947
1016
|
|
948
1017
|
Figure 3.6. Ruby prototype of our Verilog design
|
949
1018
|
|
@@ -961,8 +1030,8 @@ Verify the prototype
|
|
961
1030
|
|
962
1031
|
Now that we have implemented our prototype, we are ready to verify it against
|
963
1032
|
our Specification by running the Test. Figure 3.7, “Running a test with
|
964
|
-
specification in
|
965
|
-
specification in
|
1033
|
+
specification in rSpec format” and Figure 3.8, “Running a test with
|
1034
|
+
specification in xUnit format” illustrate this process.
|
966
1035
|
|
967
1036
|
[Tip] Tip
|
968
1037
|
The same specification can be used to verify both prototype and design.
|
@@ -973,10 +1042,10 @@ against our specification. You can also assign a value to PROTOTYPE before
|
|
973
1042
|
running the test, by using your shell's export or setenv command. Finally, the
|
974
1043
|
Icarus Verilog simulator, denoted by ivl, is used to run the simulation.
|
975
1044
|
|
976
|
-
Figure 3.7. Running a test with specification in
|
1045
|
+
Figure 3.7. Running a test with specification in rSpec format
|
977
1046
|
|
978
|
-
$ rake -f
|
979
|
-
|
1047
|
+
$ rake -f counter_rspec_runner.rake ivl PROTOTYPE=1
|
1048
|
+
counter_rspec: verifying prototype instead of design
|
980
1049
|
|
981
1050
|
A resetted counter's value
|
982
1051
|
- should be zero
|
@@ -989,12 +1058,12 @@ Finished in 0.018199 seconds
|
|
989
1058
|
|
990
1059
|
3 specifications, 0 failures
|
991
1060
|
|
992
|
-
Figure 3.8. Running a test with specification in
|
1061
|
+
Figure 3.8. Running a test with specification in xUnit format
|
993
1062
|
|
994
|
-
$ rake -f
|
995
|
-
|
1063
|
+
$ rake -f counter_xunit_runner.rake ivl PROTOTYPE=1
|
1064
|
+
counter_xunit: verifying prototype instead of design
|
996
1065
|
|
997
|
-
Loaded suite
|
1066
|
+
Loaded suite counter_xunit_bench
|
998
1067
|
Started
|
999
1068
|
...
|
1000
1069
|
Finished in 0.040668 seconds.
|
@@ -1034,8 +1103,8 @@ Verify the design
|
|
1034
1103
|
|
1035
1104
|
Now that we have implemented our Design, we are ready to verify it against our
|
1036
1105
|
Specification by running the Test. Figure 3.10, “Running a test with
|
1037
|
-
specification in
|
1038
|
-
specification in
|
1106
|
+
specification in rSpec format” and Figure 3.11, “Running a test with
|
1107
|
+
specification in xUnit format” illustrate this process.
|
1039
1108
|
|
1040
1109
|
Here, the PROTOTYPE environment variable is not specified while running the
|
1041
1110
|
test, so that our design, instead of our prototype, is verified against our
|
@@ -1043,9 +1112,9 @@ specification. You can also achieve this effect by assigning an empty value to
|
|
1043
1112
|
PROTOTYPE, or by using your shell's unset command. Finally, the Icarus Verilog
|
1044
1113
|
simulator, denoted by ivl, is used to run the simulation.
|
1045
1114
|
|
1046
|
-
Figure 3.10. Running a test with specification in
|
1115
|
+
Figure 3.10. Running a test with specification in rSpec format
|
1047
1116
|
|
1048
|
-
$ rake -f
|
1117
|
+
$ rake -f counter_rspec_runner.rake ivl
|
1049
1118
|
A resetted counter's value
|
1050
1119
|
- should be zero
|
1051
1120
|
- should increment by one count upon each rising clock edge
|
@@ -1057,16 +1126,27 @@ Finished in 0.005628 seconds
|
|
1057
1126
|
|
1058
1127
|
3 specifications, 0 failures
|
1059
1128
|
|
1060
|
-
Figure 3.11. Running a test with specification in
|
1129
|
+
Figure 3.11. Running a test with specification in xUnit format
|
1061
1130
|
|
1062
|
-
$ rake -f
|
1063
|
-
Loaded suite
|
1131
|
+
$ rake -f counter_xunit_runner.rake ivl
|
1132
|
+
Loaded suite counter_xunit_bench
|
1064
1133
|
Started
|
1065
1134
|
...
|
1066
1135
|
Finished in 0.006766 seconds.
|
1067
1136
|
|
1068
1137
|
3 tests, 35 assertions, 0 failures, 0 errors
|
1069
1138
|
|
1139
|
+
|
1140
|
+
━━━━━━━━━━━━━━
|
1141
|
+
|
1142
|
+
^[1] Because Ruby-VPI makes use of the Verilog VPI C-language interface, it
|
1143
|
+
links to symbols whose names begin with _vpi. It is possible for these symbols
|
1144
|
+
to be undefined when Ruby-VPI is compiled under GNU/Linux and similar operating
|
1145
|
+
systems. In contrast, one cannot compile a shared object file with references
|
1146
|
+
to undefined symbols under Windows. Thus, we must find a Verilog simulator's
|
1147
|
+
shared object file, which contains definitions of all VPI symbols, and give
|
1148
|
+
this file to the linker when compiling Ruby-VPI.
|
1149
|
+
|
1070
1150
|
Chapter 4. Known problems
|
1071
1151
|
|
1072
1152
|
Table of Contents
|
@@ -1208,7 +1288,7 @@ BDD
|
|
1208
1288
|
behavior when designing, implementing, and verifying software. See the
|
1209
1289
|
official wiki for more information.
|
1210
1290
|
|
1211
|
-
See Also TDD,
|
1291
|
+
See Also TDD, rSpec.
|
1212
1292
|
|
1213
1293
|
D
|
1214
1294
|
|
@@ -1242,9 +1322,9 @@ Rake
|
|
1242
1322
|
|
1243
1323
|
See the Rake website for more information.
|
1244
1324
|
|
1245
|
-
|
1325
|
+
rSpec
|
1246
1326
|
|
1247
|
-
Ruby framework for BDD. See the
|
1327
|
+
Ruby framework for BDD. See the rSpec website and rSpec tutorial for more
|
1248
1328
|
information.
|
1249
1329
|
|
1250
1330
|
See Also BDD.
|