ruby-vpi 9.0.0 → 10.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +120 -56
- data/MEMO +8 -0
- data/README +1 -1
- data/Rakefile +2 -2
- data/bin/generate_test.rb +11 -12
- data/bin/generate_test_tpl/bench.rb +2 -2
- data/bin/generate_test_tpl/bench.v +1 -4
- data/bin/generate_test_tpl/design.rb +6 -20
- data/bin/generate_test_tpl/proto.rb +5 -3
- data/bin/generate_test_tpl/runner.rake +2 -1
- data/bin/generate_test_tpl/spec.rb +5 -12
- data/doc/background.organization.html +1 -1
- data/doc/background.running-tests.html +1 -1
- data/doc/index.html +2 -2
- data/doc/manual.txt +276 -223
- data/doc/problem.ivl.html +3 -3
- data/doc/problems.html +1 -1
- data/doc/problems.ruby.html +1 -1
- data/doc/problems.vsim.html +1 -1
- data/doc/setup.html +3 -0
- data/doc/setup.installation.html +9 -0
- data/doc/setup.maintenance.html +3 -0
- data/doc/setup.reqs.html +3 -0
- data/doc/src/manual.xml +232 -195
- data/doc/styles/manual.css +8 -0
- data/doc/usage.examples.html +1 -1
- data/doc/usage.html +1 -1
- data/doc/usage.tools.html +7 -1
- data/doc/usage.tutorial.html +50 -56
- data/history.html +195 -77
- data/history.part.html +195 -77
- data/lib/ruby-vpi/vpi.rb +13 -1
- data/lib/ruby-vpi.rb +18 -7
- data/memo.html +19 -0
- data/memo.part.html +19 -0
- data/readme.html +1 -1
- data/readme.part.html +1 -1
- data/samp/counter/counter_rspec_bench.rb +2 -2
- data/samp/counter/counter_rspec_bench.v +1 -4
- data/samp/counter/counter_rspec_design.rb +4 -18
- data/samp/counter/counter_rspec_proto.rb +7 -5
- data/samp/counter/counter_rspec_runner.rake +2 -1
- data/samp/counter/counter_rspec_spec.rb +8 -12
- data/samp/counter/counter_xunit_bench.rb +2 -2
- data/samp/counter/counter_xunit_bench.v +1 -4
- data/samp/counter/counter_xunit_design.rb +4 -18
- data/samp/counter/counter_xunit_proto.rb +7 -5
- data/samp/counter/counter_xunit_runner.rake +2 -1
- data/samp/counter/counter_xunit_spec.rb +8 -14
- data/samp/pipelined_alu/hw5_unit_test_bench.rb +3 -3
- data/samp/pipelined_alu/hw5_unit_test_bench.v +1 -4
- data/samp/pipelined_alu/hw5_unit_test_design.rb +49 -65
- data/samp/pipelined_alu/hw5_unit_test_proto.rb +9 -5
- data/samp/pipelined_alu/hw5_unit_test_runner.rake +2 -1
- data/samp/pipelined_alu/hw5_unit_test_spec.rb +18 -21
- metadata +8 -242
- data/doc/usage.installation.html +0 -9
- data/doc/usage.recommendations.html +0 -3
- data/doc/usage.requirements.html +0 -3
- data/ref/c/annotated.html +0 -35
- data/ref/c/common_8h.html +0 -146
- data/ref/c/doxygen.css +0 -358
- data/ref/c/doxygen.png +0 -0
- data/ref/c/files.html +0 -34
- data/ref/c/functions.html +0 -134
- data/ref/c/functions_vars.html +0 -134
- data/ref/c/globals.html +0 -55
- data/ref/c/globals_0x63.html +0 -86
- data/ref/c/globals_0x65.html +0 -55
- data/ref/c/globals_0x66.html +0 -55
- data/ref/c/globals_0x70.html +0 -71
- data/ref/c/globals_0x72.html +0 -62
- data/ref/c/globals_0x73.html +0 -65
- data/ref/c/globals_0x74.html +0 -55
- data/ref/c/globals_0x76.html +0 -472
- data/ref/c/globals_0x78.html +0 -55
- data/ref/c/globals_defs.html +0 -81
- data/ref/c/globals_defs_0x65.html +0 -50
- data/ref/c/globals_defs_0x70.html +0 -51
- data/ref/c/globals_defs_0x76.html +0 -463
- data/ref/c/globals_defs_0x78.html +0 -50
- data/ref/c/globals_enum.html +0 -39
- data/ref/c/globals_eval.html +0 -40
- data/ref/c/globals_func.html +0 -49
- data/ref/c/globals_type.html +0 -63
- data/ref/c/globals_vars.html +0 -42
- data/ref/c/index.html +0 -20
- data/ref/c/relay_8c.html +0 -214
- data/ref/c/relay_8h.html +0 -129
- data/ref/c/structrelay____RubyOptions____def.html +0 -67
- data/ref/c/structt__cb__data.html +0 -151
- data/ref/c/structt__vpi__delay.html +0 -134
- data/ref/c/structt__vpi__error__info.html +0 -151
- data/ref/c/structt__vpi__strengthval.html +0 -83
- data/ref/c/structt__vpi__systf__data.html +0 -151
- data/ref/c/structt__vpi__time.html +0 -100
- data/ref/c/structt__vpi__value.html +0 -204
- data/ref/c/structt__vpi__vecval.html +0 -66
- data/ref/c/structt__vpi__vlog__info.html +0 -100
- data/ref/c/swig_8c.html +0 -80
- data/ref/c/swig_8h.html +0 -83
- data/ref/c/tab_b.gif +0 -0
- data/ref/c/tab_l.gif +0 -0
- data/ref/c/tab_r.gif +0 -0
- data/ref/c/tabs.css +0 -102
- data/ref/c/verilog_8h.html +0 -117
- data/ref/c/vlog_8c.html +0 -168
- data/ref/c/vlog_8h.html +0 -128
- data/ref/c/vpi__user_8h.html +0 -8739
- data/ref/ruby/classes/ERB.html +0 -158
- data/ref/ruby/classes/ERB.src/M000034.html +0 -29
- data/ref/ruby/classes/FileUtils.html +0 -165
- data/ref/ruby/classes/FileUtils.src/M000089.html +0 -18
- data/ref/ruby/classes/FileUtils.src/M000090.html +0 -18
- data/ref/ruby/classes/Integer.html +0 -398
- data/ref/ruby/classes/Integer.src/M000012.html +0 -25
- data/ref/ruby/classes/Integer.src/M000013.html +0 -18
- data/ref/ruby/classes/Integer.src/M000014.html +0 -18
- data/ref/ruby/classes/Integer.src/M000015.html +0 -18
- data/ref/ruby/classes/Integer.src/M000016.html +0 -18
- data/ref/ruby/classes/Integer.src/M000017.html +0 -18
- data/ref/ruby/classes/Integer.src/M000020.html +0 -22
- data/ref/ruby/classes/Integer.src/M000021.html +0 -22
- data/ref/ruby/classes/Integer.src/M000022.html +0 -25
- data/ref/ruby/classes/Integer.src/M000023.html +0 -31
- data/ref/ruby/classes/Integer.src/M000024.html +0 -25
- data/ref/ruby/classes/Integer.src/M000025.html +0 -30
- data/ref/ruby/classes/OutputInfo.html +0 -299
- data/ref/ruby/classes/OutputInfo.src/M000030.html +0 -51
- data/ref/ruby/classes/RDoc.html +0 -135
- data/ref/ruby/classes/RDoc.src/M000093.html +0 -40
- data/ref/ruby/classes/RubyVpi/Config.html +0 -148
- data/ref/ruby/classes/RubyVpi.html +0 -186
- data/ref/ruby/classes/RubyVpi.src/M000091.html +0 -50
- data/ref/ruby/classes/RubyVpi.src/M000092.html +0 -20
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.html +0 -407
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000081.html +0 -18
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000082.html +0 -18
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000083.html +0 -22
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000084.html +0 -44
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000085.html +0 -82
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000086.html +0 -127
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000087.html +0 -26
- data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000088.html +0 -18
- data/ref/ruby/classes/SWIG.html +0 -111
- data/ref/ruby/classes/String.html +0 -158
- data/ref/ruby/classes/String.src/M000032.html +0 -41
- data/ref/ruby/classes/String.src/M000033.html +0 -18
- data/ref/ruby/classes/Table.html +0 -191
- data/ref/ruby/classes/Table.src/M000026.html +0 -38
- data/ref/ruby/classes/Table.src/M000027.html +0 -18
- data/ref/ruby/classes/Table.src/M000028.html +0 -18
- data/ref/ruby/classes/Table.src/M000029.html +0 -18
- data/ref/ruby/classes/Template.html +0 -158
- data/ref/ruby/classes/Template.src/M000031.html +0 -18
- data/ref/ruby/classes/VerilogParser/Module/Parameter.html +0 -160
- data/ref/ruby/classes/VerilogParser/Module/Parameter.src/M000011.html +0 -21
- data/ref/ruby/classes/VerilogParser/Module/Port.html +0 -207
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000007.html +0 -21
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000008.html +0 -18
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000009.html +0 -18
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000010.html +0 -18
- data/ref/ruby/classes/VerilogParser/Module.html +0 -172
- data/ref/ruby/classes/VerilogParser/Module.src/M000006.html +0 -29
- data/ref/ruby/classes/VerilogParser.html +0 -187
- data/ref/ruby/classes/VerilogParser.src/M000005.html +0 -34
- data/ref/ruby/classes/XX/Document.html +0 -295
- data/ref/ruby/classes/XX/Document.src/M000072.html +0 -22
- data/ref/ruby/classes/XX/Document.src/M000073.html +0 -20
- data/ref/ruby/classes/XX/Document.src/M000074.html +0 -20
- data/ref/ruby/classes/XX/Document.src/M000075.html +0 -20
- data/ref/ruby/classes/XX/Document.src/M000076.html +0 -22
- data/ref/ruby/classes/XX/Document.src/M000077.html +0 -21
- data/ref/ruby/classes/XX/Document.src/M000078.html +0 -21
- data/ref/ruby/classes/XX/Document.src/M000079.html +0 -34
- data/ref/ruby/classes/XX/Document.src/M000080.html +0 -98
- data/ref/ruby/classes/XX/HTML4/Strict.html +0 -138
- data/ref/ruby/classes/XX/HTML4/Strict.src/M000038.html +0 -20
- data/ref/ruby/classes/XX/HTML4/Transitional.html +0 -138
- data/ref/ruby/classes/XX/HTML4/Transitional.src/M000037.html +0 -20
- data/ref/ruby/classes/XX/HTML4.html +0 -145
- data/ref/ruby/classes/XX/HTML4.src/M000036.html +0 -20
- data/ref/ruby/classes/XX/Markup/ClassMethods.html +0 -236
- data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000044.html +0 -22
- data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000045.html +0 -20
- data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000046.html +0 -25
- data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000047.html +0 -20
- data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000048.html +0 -27
- data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000049.html +0 -20
- data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000050.html +0 -27
- data/ref/ruby/classes/XX/Markup/ClassMethods.src/M000051.html +0 -22
- data/ref/ruby/classes/XX/Markup/Error.html +0 -111
- data/ref/ruby/classes/XX/Markup/InstanceMethods.html +0 -474
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000052.html +0 -56
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000053.html +0 -33
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000054.html +0 -31
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000055.html +0 -48
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000056.html +0 -20
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000057.html +0 -31
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000058.html +0 -32
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000059.html +0 -32
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000060.html +0 -28
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000061.html +0 -23
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000062.html +0 -26
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000063.html +0 -20
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000064.html +0 -20
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000065.html +0 -20
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000066.html +0 -20
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000067.html +0 -20
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000068.html +0 -21
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000069.html +0 -20
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000070.html +0 -20
- data/ref/ruby/classes/XX/Markup/InstanceMethods.src/M000071.html +0 -20
- data/ref/ruby/classes/XX/Markup.html +0 -160
- data/ref/ruby/classes/XX/Markup.src/M000043.html +0 -28
- data/ref/ruby/classes/XX/XHTML/Strict.html +0 -138
- data/ref/ruby/classes/XX/XHTML/Strict.src/M000041.html +0 -20
- data/ref/ruby/classes/XX/XHTML/Transitional.html +0 -138
- data/ref/ruby/classes/XX/XHTML/Transitional.src/M000040.html +0 -20
- data/ref/ruby/classes/XX/XHTML.html +0 -145
- data/ref/ruby/classes/XX/XHTML.src/M000039.html +0 -36
- data/ref/ruby/classes/XX/XML.html +0 -138
- data/ref/ruby/classes/XX/XML.src/M000035.html +0 -20
- data/ref/ruby/classes/XX/XMLish.html +0 -138
- data/ref/ruby/classes/XX/XMLish.src/M000042.html +0 -18
- data/ref/ruby/classes/XX.html +0 -138
- data/ref/ruby/created.rid +0 -1
- data/ref/ruby/files/bin/generate_test_rb.html +0 -245
- data/ref/ruby/files/bin/generate_test_rb.src/M000001.html +0 -18
- data/ref/ruby/files/bin/generate_test_rb.src/M000002.html +0 -39
- data/ref/ruby/files/bin/header_to_ruby_rb.html +0 -125
- data/ref/ruby/files/lib/ruby-vpi/erb_rb.html +0 -108
- data/ref/ruby/files/lib/ruby-vpi/integer_rb.html +0 -101
- data/ref/ruby/files/lib/ruby-vpi/rake_rb.html +0 -108
- data/ref/ruby/files/lib/ruby-vpi/rcov_rb.html +0 -111
- data/ref/ruby/files/lib/ruby-vpi/rdoc_rb.html +0 -108
- data/ref/ruby/files/lib/ruby-vpi/rspec_rb.html +0 -115
- data/ref/ruby/files/lib/ruby-vpi/runner_proxy_rb.html +0 -108
- data/ref/ruby/files/lib/ruby-vpi/runner_rb.html +0 -208
- data/ref/ruby/files/lib/ruby-vpi/runner_rb.src/M000003.html +0 -24
- data/ref/ruby/files/lib/ruby-vpi/runner_rb.src/M000004.html +0 -26
- data/ref/ruby/files/lib/ruby-vpi/verilog_parser_rb.html +0 -107
- data/ref/ruby/files/lib/ruby-vpi/vpi_rb.html +0 -108
- data/ref/ruby/files/lib/ruby-vpi/xx_rb.html +0 -148
- data/ref/ruby/files/lib/ruby-vpi_rb.html +0 -109
- data/ref/ruby/fr_class_index.html +0 -56
- data/ref/ruby/fr_file_index.html +0 -40
- data/ref/ruby/fr_method_index.html +0 -119
- data/ref/ruby/index.html +0 -24
- data/ref/ruby/rdoc-style.css +0 -208
data/doc/src/manual.xml
CHANGED
@@ -54,6 +54,10 @@
|
|
54
54
|
<!ENTITY rspec..ulink "<ulink url='&rspec.url;'>&rspec;</ulink>">
|
55
55
|
<!ENTITY rspec-tutorial.url "http://rspec.rubyforge.org/tutorials/index.html">
|
56
56
|
<!ENTITY rspec-tutorial..ulink "<ulink url='&rspec-tutorial.url;'>&rspec; tutorial</ulink>">
|
57
|
+
|
58
|
+
<!ENTITY kd "<application>kdiff3</application>">
|
59
|
+
|
60
|
+
<!ENTITY test-gen.link "<link linkend='usage.tools.generate-test'>automated test generator</link>">
|
57
61
|
]>
|
58
62
|
<book lang="en">
|
59
63
|
<bookinfo>
|
@@ -75,7 +79,7 @@
|
|
75
79
|
</copyright>
|
76
80
|
|
77
81
|
<abstract>
|
78
|
-
<para>This manual explains how to use &rv;.
|
82
|
+
<para>This manual explains how to use &rv;. A <ulink url="manual.txt">plain-text version of this manual</ulink> is also available. Finally, you can find the newest version of this manual at the <ulink url="&rv.url;">&rv; website</ulink>.</para>
|
79
83
|
</abstract>
|
80
84
|
|
81
85
|
<legalnotice>
|
@@ -323,7 +327,11 @@
|
|
323
327
|
|
324
328
|
<section id="organization.vpi.util">
|
325
329
|
<title>&vpi; utility layer</title>
|
326
|
-
<para>From a user's perspective, the &vpi; 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 &vpi; properties.</para>
|
330
|
+
<para>From a user's perspective, the &vpi; 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 either (1) its children or (2) its &vpi; properties.</para>
|
331
|
+
|
332
|
+
<para>The children of a handle are simply the handles that are immediately contained within it in. For example, suppose that you had a &v; module that contains some registers. The children, of a handle to the module, would be handles to the registers.</para>
|
333
|
+
|
334
|
+
<para>In the event that a child handle has the same name as a &vpi; property, the child is given priority. However, you can always access &vpi; properties explicitly via the <function>get_value</function> and <function>put_value</function> methods.</para>
|
327
335
|
|
328
336
|
<table id="table..handle-property-accessor-naming-format" frame='all'>
|
329
337
|
<title>Naming format for accessing a handle's &vpi; properties</title>
|
@@ -801,10 +809,10 @@
|
|
801
809
|
</section>
|
802
810
|
</chapter>
|
803
811
|
|
804
|
-
<chapter id="
|
805
|
-
<title>
|
812
|
+
<chapter id="setup">
|
813
|
+
<title>Setup</title>
|
806
814
|
|
807
|
-
<section id="
|
815
|
+
<section id="setup.reqs">
|
808
816
|
<title>Requirements</title>
|
809
817
|
<para>The following software is necessary in order to use &rv;.</para>
|
810
818
|
|
@@ -847,7 +855,7 @@
|
|
847
855
|
</varlistentry>
|
848
856
|
|
849
857
|
<varlistentry>
|
850
|
-
<term><
|
858
|
+
<term><application>make</application></term>
|
851
859
|
<listitem>
|
852
860
|
<para><ulink url="http://www.gnu.org/software/make/">&gnu; make</ulink> is preferred but any distribution of <command>make</command> should be acceptable.</para>
|
853
861
|
</listitem>
|
@@ -881,65 +889,65 @@
|
|
881
889
|
</listitem>
|
882
890
|
</varlistentry>
|
883
891
|
</variablelist>
|
884
|
-
</section>
|
885
|
-
|
886
|
-
<section id="usage.recommendations">
|
887
|
-
<title>Recommendations</title>
|
888
|
-
<para>The following software may make your interactions with &rv; more pleasant.</para>
|
889
|
-
|
890
|
-
<variablelist>
|
891
|
-
<varlistentry>
|
892
|
-
<term>Text merging tool</term>
|
893
|
-
<listitem>
|
894
|
-
<para>An <emphasis>interactive</emphasis> text merging tool can greatly simplify the process of transferring wanted changes from one file to another. In particular, such tools are especially beneficial when using the <link linkend="usage.tools.generate-test">automated test generator</link>. Below are a list of popular text merging tools.</para>
|
895
|
-
|
896
|
-
<variablelist>
|
897
|
-
|
898
|
-
<varlistentry>
|
899
|
-
<term><ulink url="http://elonen.iki.fi/code/imediff/">imediff2</ulink></term>
|
900
|
-
<listitem>
|
901
|
-
<para>A textual, fullscreen two-way merging tool, which works in a terminal. Useful when working remotely via SSH.</para>
|
902
|
-
</listitem>
|
903
|
-
</varlistentry>
|
904
892
|
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
<para>A graphical, three-way merging tool for KDE.</para>
|
909
|
-
</listitem>
|
910
|
-
</varlistentry>
|
893
|
+
<section id="setup.reqs.optional">
|
894
|
+
<title>Recommendations</title>
|
895
|
+
<para>The following software may make your interactions with &rv; more pleasant.</para>
|
911
896
|
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
<
|
921
|
-
|
922
|
-
<
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
<
|
928
|
-
|
929
|
-
<
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
897
|
+
<variablelist>
|
898
|
+
<varlistentry>
|
899
|
+
<term>Text merging tool</term>
|
900
|
+
<listitem>
|
901
|
+
<para>An <emphasis>interactive</emphasis> text merging tool can greatly simplify the process of transferring wanted changes from one file to another. In particular, such tools are especially beneficial when using the &test-gen.link;. A handful of the currently available open-source text merging tools are listed below.</para>
|
902
|
+
|
903
|
+
<variablelist>
|
904
|
+
|
905
|
+
<varlistentry>
|
906
|
+
<term><ulink url="http://kdiff3.sourceforge.net/">&kd;</ulink></term>
|
907
|
+
<listitem>
|
908
|
+
<para>A graphical, three-way merging tool for KDE.</para>
|
909
|
+
</listitem>
|
910
|
+
</varlistentry>
|
911
|
+
|
912
|
+
<varlistentry>
|
913
|
+
<term><ulink url="http://meld.sourceforge.net/"><application>meld</application></ulink></term>
|
914
|
+
<listitem>
|
915
|
+
<para>A graphical, three-way merging tool for GNOME.</para>
|
916
|
+
</listitem>
|
917
|
+
</varlistentry>
|
918
|
+
|
919
|
+
<varlistentry>
|
920
|
+
<term><ulink url="http://tkdiff.sourceforge.net/"><application>tkdiff</application></ulink></term>
|
921
|
+
<listitem>
|
922
|
+
<para>A graphical, two-way merging tool that uses the cross-platform Tk windowing toolkit.</para>
|
923
|
+
</listitem>
|
924
|
+
</varlistentry>
|
925
|
+
|
926
|
+
<varlistentry>
|
927
|
+
<term><ulink url="http://furius.ca/xxdiff/"><application>xxdiff</application></ulink></term>
|
928
|
+
<listitem>
|
929
|
+
<para>A graphical, three-way merging tool.</para>
|
930
|
+
</listitem>
|
931
|
+
</varlistentry>
|
932
|
+
|
933
|
+
<varlistentry>
|
934
|
+
<term><ulink url="http://elonen.iki.fi/code/imediff/"><application>imediff2</application></ulink></term>
|
935
|
+
<listitem>
|
936
|
+
<para>A textual, fullscreen two-way merging tool. This tool is useful when you are working remotely via SSH.</para>
|
937
|
+
</listitem>
|
938
|
+
</varlistentry>
|
939
|
+
|
940
|
+
</variablelist>
|
941
|
+
</listitem>
|
942
|
+
</varlistentry>
|
943
|
+
</variablelist>
|
944
|
+
</section>
|
937
945
|
</section>
|
938
946
|
|
939
|
-
<section id="
|
940
|
-
<title>Installation
|
947
|
+
<section id="setup.installation">
|
948
|
+
<title>Installation</title>
|
941
949
|
|
942
|
-
<para>Once you have satisfied the <link linkend="
|
950
|
+
<para>Once you have satisfied the <link linkend="setup.reqs">necessary requirements</link>, you can install &rv; by running the command <command>gem <action>install</action> <replaceable>ruby-vpi</replaceable></command>. RubyGems will install &rv; into the system gem directory, whose path can be determined by running the command <command>gem <action>env</action> <replaceable>gemdir</replaceable></command>. Within this directory, there is a "gems" subdirectory which contains the &rv; installation, as illustrated below.</para>
|
943
951
|
|
944
952
|
<screen>
|
945
953
|
<prompt>$</prompt> <userinput><command>gem <action>env</action> <replaceable>gemdir</replaceable></command></userinput>
|
@@ -949,10 +957,7 @@
|
|
949
957
|
<computeroutput>/usr/lib/ruby/gems/1.8/gems/ruby-vpi-7.0.0/</computeroutput>
|
950
958
|
</screen>
|
951
959
|
|
952
|
-
|
953
|
-
<para>You can uninstall &rv; by running the command <command>gem <action>uninstall</action> <replaceable>ruby-vpi</replaceable></command>. Furthermore, you can upgrade to the latest release of &rv; by running the command <command>gem <action>update</action> <replaceable>ruby-vpi</replaceable></command>. Finally, you can learn more about using and manipulating RubyGems in <ulink url="http://www.rubygems.org">the RubyGems user manual</ulink>.</para>
|
954
|
-
|
955
|
-
<section id="usage.installation.windows">
|
960
|
+
<section id="setup.installation.windows">
|
956
961
|
<title>Installing on Windows</title>
|
957
962
|
|
958
963
|
<procedure>
|
@@ -963,14 +968,18 @@
|
|
963
968
|
<para>Search for object files whose names end with <filename>.so</filename>, <filename>.o</filename>, or <filename>.dll</filename> in your &v; simulator's installation directory.</para>
|
964
969
|
</step>
|
965
970
|
<step>
|
966
|
-
<para>Determine which object files, among those found in the previous step, contain symbols whose names begin with <symbol>_vpi</symbol><footnote><para>Because &rv; makes use of the &
|
971
|
+
<para>Determine which object files, among those found in the previous step, contain symbols whose names begin with <symbol>_vpi</symbol><footnote><para>Because &rv; makes use of the &vpi; C-language interface, it links to symbols whose names begin with <symbol>_vpi</symbol>. It is possible for these symbols to be undefined when &rv; is compiled under GNU/Linux and similar operating systems. In contrast, one <ulink url="http://sourceware.org/ml/cygwin/2001-12/msg01293.html">cannot compile a shared object file with references to undefined symbols under Windows</ulink>. Thus, we must find a Verilog simulator's shared object file, which contains definitions of all &vpi; symbols, and give this file to the linker when compiling &rv;.</para></footnote> by running the command <command>for x in *.{o,so,dll}; do nm $x | grep -q '[Tt] _vpi' > /dev/null && echo $x; done</command> in Cygwin.</para>
|
967
972
|
|
968
|
-
<
|
973
|
+
<tip>
|
974
|
+
<para>If you are using Mentor Modelsim, the desired object file can be found at a path similar to <filename>C:\Modeltech\win32\libvsim.dll</filename>.</para>
|
975
|
+
</tip>
|
969
976
|
|
970
|
-
<
|
977
|
+
<tip>
|
978
|
+
<para>If you are using GPL Cver, the desired object file can be found at a path similar to <filename>C:\gplcver\objs\v_vpi.o</filename>.</para>
|
979
|
+
</tip>
|
971
980
|
</step>
|
972
981
|
<step>
|
973
|
-
<para>Assign the path of the object file (determined in the previous step) to the <varname>LDFLAGS</varname> environment variable. For example, if the object file's path is <replaceable>/
|
982
|
+
<para>Assign the path of the object file (determined in the previous step) to the <varname>LDFLAGS</varname> environment variable. For example, if the object file's path is <replaceable>/foo/bar/vpi.so</replaceable>, then you would run the command <command>export <varname>LDFLAGS</varname>=<replaceable>/foo/bar/vpi.so</replaceable></command> in Cygwin.</para>
|
974
983
|
</step>
|
975
984
|
<step>
|
976
985
|
<para>You may now install &rv; by running the command <command>gem <action>install</action> <replaceable>ruby-vpi</replaceable></command> in Cygwin.</para>
|
@@ -979,6 +988,16 @@
|
|
979
988
|
</section>
|
980
989
|
</section>
|
981
990
|
|
991
|
+
<section id="setup.maintenance">
|
992
|
+
<title>Maintenance</title>
|
993
|
+
|
994
|
+
<para>You can uninstall &rv; by running the command <command>gem <action>uninstall</action> <replaceable>ruby-vpi</replaceable></command>. Furthermore, you can upgrade to the latest release of &rv; by running the command <command>gem <action>update</action> <replaceable>ruby-vpi</replaceable></command>. Finally, you can learn more about using and manipulating RubyGems in <ulink url="http://www.rubygems.org">the RubyGems user manual</ulink>.</para>
|
995
|
+
</section>
|
996
|
+
</chapter>
|
997
|
+
|
998
|
+
<chapter id="usage">
|
999
|
+
<title>Usage</title>
|
1000
|
+
|
982
1001
|
<section id="usage.tools">
|
983
1002
|
<title>Tools</title>
|
984
1003
|
<para>The <filename>bin</filename> directory contains various utilities which ease the process of writing tests. Each tool provides help and usage information invoked with the <option>--help</option> option.</para>
|
@@ -986,7 +1005,55 @@
|
|
986
1005
|
<section id="usage.tools.generate-test">
|
987
1006
|
<title>Automated test generation</title>
|
988
1007
|
|
989
|
-
<para>The <command>generate_test.rb</command>
|
1008
|
+
<para>The automated test generator (<command>generate_test.rb</command>) generates tests from &v; 2001 module declarations, as demonstrated in <xref linkend="usage.tutorial.generate-test"/>. A generated test is composed of the following parts:
|
1009
|
+
<variablelist>
|
1010
|
+
<varlistentry>
|
1011
|
+
<term>Runner</term>
|
1012
|
+
<listitem>
|
1013
|
+
<para>Written in Rake, this file builds and runs the test.</para>
|
1014
|
+
</listitem>
|
1015
|
+
</varlistentry>
|
1016
|
+
<varlistentry>
|
1017
|
+
<term>Bench</term>
|
1018
|
+
<listitem>
|
1019
|
+
<para>Written in Verilog and Ruby, these files define the testing environment.</para>
|
1020
|
+
</listitem>
|
1021
|
+
</varlistentry>
|
1022
|
+
<varlistentry>
|
1023
|
+
<term>Design</term>
|
1024
|
+
<listitem>
|
1025
|
+
<para>Written in Ruby, this file provides an interface to the design being verified.</para>
|
1026
|
+
</listitem>
|
1027
|
+
</varlistentry>
|
1028
|
+
<varlistentry>
|
1029
|
+
<term>Prototype</term>
|
1030
|
+
<listitem>
|
1031
|
+
<para>Written in Ruby, this file defines a prototype of the design being verified.</para>
|
1032
|
+
</listitem>
|
1033
|
+
</varlistentry>
|
1034
|
+
<varlistentry>
|
1035
|
+
<term>Specification</term>
|
1036
|
+
<listitem>
|
1037
|
+
<para>Written in Ruby, this file verifies the design.</para>
|
1038
|
+
</listitem>
|
1039
|
+
</varlistentry>
|
1040
|
+
</variablelist>
|
1041
|
+
</para>
|
1042
|
+
|
1043
|
+
<para>The reason for dividing a single test into these parts is mainly to decouple the design from the specification. This allows you to focus on writing the specification while the remainder is automatically generated by the tool. For example, when the interface of a &v; module changes, you would simply re-run this tool and incorporate those changes (using a <link linkend="setup.reqs.optional">text merging tool</link>) into the test without diverting your focus from the specification.</para>
|
1044
|
+
|
1045
|
+
<tip>
|
1046
|
+
<title>Using &kd; with the automated test generator</title>
|
1047
|
+
<para>Create a file named <filename>merge2</filename> with the content below, make it executable, and put it somewhere accessible by your <varname>PATH</varname> environment variable. Next, update the <varname>MERGER</varname> environment variable by executing <command>export <varname>MERGER</varname>=<replaceable>merge2</replaceable></command>.</para>
|
1048
|
+
|
1049
|
+
<programlisting>
|
1050
|
+
#!/bin/sh
|
1051
|
+
# args: old file, new file
|
1052
|
+
kdiff3 --auto --merge --output "$2" "$@" 2>/dev/null
|
1053
|
+
</programlisting>
|
1054
|
+
|
1055
|
+
<para>From now on, &kd; will be invoked to help you transfer your changes between generated files. When you are finished transferring changes, simply issue the "save the file" command and terminate &kd;. Or, if you do not want to transfer any changes, simply terminate &kd;.</para>
|
1056
|
+
</tip>
|
990
1057
|
</section>
|
991
1058
|
|
992
1059
|
<section id="usage.tools.verilog-ruby-conv">
|
@@ -996,14 +1063,6 @@
|
|
996
1063
|
</section>
|
997
1064
|
</section>
|
998
1065
|
|
999
|
-
<section id="usage.examples">
|
1000
|
-
<title>Examples</title>
|
1001
|
-
|
1002
|
-
<para>The <filename>samp</filename> directory contains several example tests which illustrate how &rv; can be used. Each example has an associated <filename>Rakefile</filename> which simplifies the process of running it. Therefore, simply navigate into an example directory and run the command <command>rake</command> to get started.</para>
|
1003
|
-
|
1004
|
-
<para>Also, some example specifications make use of BDD through the <application>rSpec</application> library. See the <xref linkend="background.methodology"/> for a discussion of <application>rSpec</application>.</para>
|
1005
|
-
</section>
|
1006
|
-
|
1007
1066
|
<section id="usage.tutorial">
|
1008
1067
|
<title>Tutorial</title>
|
1009
1068
|
|
@@ -1015,7 +1074,7 @@
|
|
1015
1074
|
</step>
|
1016
1075
|
|
1017
1076
|
<step>
|
1018
|
-
<para><link linkend="usage.tutorial.generate-test">Generate a test</link> for the design using the
|
1077
|
+
<para><link linkend="usage.tutorial.generate-test">Generate a test</link> for the design using the &test-gen.link; tool.</para>
|
1019
1078
|
</step>
|
1020
1079
|
|
1021
1080
|
<step>
|
@@ -1063,11 +1122,6 @@
|
|
1063
1122
|
</variablelist>
|
1064
1123
|
</para>
|
1065
1124
|
|
1066
|
-
<important>
|
1067
|
-
<title>Before we continue…</title>
|
1068
|
-
<para>Save the source code shown in <xref linkend="fig..counter.v_decl"/> into a file named <filename>counter.v</filename>.</para>
|
1069
|
-
</important>
|
1070
|
-
|
1071
1125
|
<figure id="fig..counter.v_decl">
|
1072
1126
|
<title>Declaration of a simple up-counter with synchronous reset</title>
|
1073
1127
|
<programlisting>
|
@@ -1079,53 +1133,19 @@
|
|
1079
1133
|
<token>endmodule</token>
|
1080
1134
|
</programlisting>
|
1081
1135
|
</figure>
|
1136
|
+
|
1137
|
+
<important>
|
1138
|
+
<title>Before we continue…</title>
|
1139
|
+
<para>Save the source code shown in <xref linkend="fig..counter.v_decl"/> into a file named <filename>counter.v</filename>.</para>
|
1140
|
+
</important>
|
1082
1141
|
</section>
|
1083
1142
|
|
1084
1143
|
<section id="usage.tutorial.generate-test">
|
1085
1144
|
<title>Generate a test</title>
|
1086
1145
|
|
1087
|
-
<para>Now that we have a &design.gloss; to verify, let us generate a &test.gloss; for it using the
|
1088
|
-
|
1089
|
-
<note>
|
1090
|
-
<para>In this tutorial, you will see how specifications are implemented in <emphasis>both</emphasis> &rspec; and xUnit formats.</para>
|
1091
|
-
</note>
|
1092
|
-
|
1093
|
-
<para>Once we have decided how we want to implement our specification, we can proceed to generate a test for our design. <xref linkend="fig..generate-test.rspec"/> and <xref linkend="fig..generate-test.unit-test"/> illustrate this process. Here, the test generation tool produces a test composed of the following parts:
|
1094
|
-
<variablelist>
|
1095
|
-
<varlistentry>
|
1096
|
-
<term>Runner</term>
|
1097
|
-
<listitem>
|
1098
|
-
<para>Written in Rake, this file builds and runs the test.</para>
|
1099
|
-
</listitem>
|
1100
|
-
</varlistentry>
|
1101
|
-
<varlistentry>
|
1102
|
-
<term>Bench</term>
|
1103
|
-
<listitem>
|
1104
|
-
<para>Written in Verilog and Ruby, these files define the testing environment.</para>
|
1105
|
-
</listitem>
|
1106
|
-
</varlistentry>
|
1107
|
-
<varlistentry>
|
1108
|
-
<term>Design</term>
|
1109
|
-
<listitem>
|
1110
|
-
<para>Written in Ruby, this file provides an interface to the design being verified.</para>
|
1111
|
-
</listitem>
|
1112
|
-
</varlistentry>
|
1113
|
-
<varlistentry>
|
1114
|
-
<term>Prototype</term>
|
1115
|
-
<listitem>
|
1116
|
-
<para>Written in Ruby, this file defines a prototype of the design being verified.</para>
|
1117
|
-
</listitem>
|
1118
|
-
</varlistentry>
|
1119
|
-
<varlistentry>
|
1120
|
-
<term>Specification</term>
|
1121
|
-
<listitem>
|
1122
|
-
<para>Written in Ruby, this file verifies the design.</para>
|
1123
|
-
</listitem>
|
1124
|
-
</varlistentry>
|
1125
|
-
</variablelist>
|
1126
|
-
</para>
|
1146
|
+
<para>Now that we have a &design.gloss; to verify, let us generate a &test.gloss; for it using the &test-gen.link;. This tool allows us to implement our &specification.gloss; in either &rspec;, xUnit, or our very own format. Each format represents a different software development methodology: &rspec; represents &BDD.gloss;, xUnit represents &TDD.gloss;, and our own format can represent another methodology. Both &rspec; and xUnit are presented in this tutorial.</para>
|
1127
1147
|
|
1128
|
-
<para>
|
1148
|
+
<para>Once we have decided how we want to implement our specification, we can proceed to generate a test for our design. <xref linkend="fig..generate-test.rspec"/> and <xref linkend="fig..generate-test.unit-test"/> illustrate this process.</para>
|
1129
1149
|
|
1130
1150
|
<figure id="fig..generate-test.rspec">
|
1131
1151
|
<title>Generating a test with specification in &rspec; format</title>
|
@@ -1187,52 +1207,27 @@
|
|
1187
1207
|
|
1188
1208
|
<para>Now that we have identified a set of expectations for our design, we are ready to implement them in our specification. <xref linkend="fig..counter_rspec_spec.rb"/> and <xref linkend="fig..counter_xunit_spec.rb"/> illustrate this process. Note the striking similarities between our expectations and their implementation.</para>
|
1189
1209
|
|
1190
|
-
<important>
|
1191
|
-
<title>Before we continue…</title>
|
1192
|
-
<itemizedlist>
|
1193
|
-
<listitem>
|
1194
|
-
<para>Append the following code to the files named <filename>counter_rspec_design.rb</filename> and <filename>counter_xunit_design.rb</filename>.</para>
|
1195
|
-
|
1196
|
-
<programlisting>
|
1197
|
-
<token>class</token> <constant>Counter</constant>
|
1198
|
-
<token>def</token> <function>reset!</function>
|
1199
|
-
<varname>@reset</varname>.<function>intVal</function> = <literal>1</literal>
|
1200
|
-
<function>relay_verilog</function> <remark># advance the clock</remark>
|
1201
|
-
<varname>@reset</varname>.<function>intVal</function> = <literal>0</literal>
|
1202
|
-
<token>end</token>
|
1203
|
-
<token>end</token>
|
1204
|
-
</programlisting>
|
1205
|
-
</listitem>
|
1206
|
-
<listitem>
|
1207
|
-
<para>Replace the contents of the file named <filename>counter_rspec_spec.rb</filename> with the source code shown in <xref linkend="fig..counter_rspec_spec.rb"/>.</para>
|
1208
|
-
</listitem>
|
1209
|
-
<listitem>
|
1210
|
-
<para>Replace the contents of the file named <filename>counter_xunit_spec.rb</filename> with the source code shown in <xref linkend="fig..counter_xunit_spec.rb"/>.</para>
|
1211
|
-
</listitem>
|
1212
|
-
</itemizedlist>
|
1213
|
-
</important>
|
1214
|
-
|
1215
1210
|
<figure id="fig..counter_rspec_spec.rb">
|
1216
1211
|
<title>Specification implemented in &rspec; format</title>
|
1217
1212
|
<programlisting>
|
1218
|
-
<
|
1219
|
-
<constant>
|
1213
|
+
<remark># lowest upper bound of counter's value</remark>
|
1214
|
+
<constant>LIMIT</constant> = <literal>2</literal> ** <constant>Counter</constant>.<function>Size</function>.<function>intVal</function>
|
1220
1215
|
|
1221
|
-
<
|
1216
|
+
<remark># maximum allowed value for a counter</remark>
|
1217
|
+
<constant>MAX</constant> = <constant>LIMIT</constant> - <literal>1</literal>
|
1222
1218
|
|
1223
1219
|
<function>context</function> <literal>"A resetted counter's value"</literal> <token>do</token>
|
1224
1220
|
<function>setup</function> <token>do</token>
|
1225
|
-
<
|
1226
|
-
<varname>@design</varname>.<function>reset!</function>
|
1221
|
+
<constant>Counter</constant>.<function>reset!</function>
|
1227
1222
|
<token>end</token>
|
1228
1223
|
|
1229
1224
|
<function>specify</function> <literal>"should be zero"</literal> <token>do</token>
|
1230
|
-
<
|
1225
|
+
<constant>Counter</constant>.<function>count</function>.<function>intVal</function>.<function>should_equal</function> <literal>0</literal>
|
1231
1226
|
<token>end</token>
|
1232
1227
|
|
1233
1228
|
<function>specify</function> <literal>"should increment by one count upon each rising clock edge"</literal> <token>do</token>
|
1234
1229
|
<constant>LIMIT</constant>.<function>times</function> <token>do</token> |<varname>i</varname>|
|
1235
|
-
<
|
1230
|
+
<constant>Counter</constant>.<function>count</function>.<function>intVal</function>.<function>should_equal</function> <varname>i</varname>
|
1236
1231
|
<function>relay_verilog</function> <remark># advance the clock</remark>
|
1237
1232
|
<token>end</token>
|
1238
1233
|
<token>end</token>
|
@@ -1240,17 +1235,16 @@
|
|
1240
1235
|
|
1241
1236
|
<function>context</function> <literal>"A counter with the maximum value"</literal> <token>do</token>
|
1242
1237
|
<function>setup</function> <token>do</token>
|
1243
|
-
<
|
1244
|
-
<varname>@design</varname>.<function>reset!</function>
|
1238
|
+
<constant>Counter</constant>.<function>reset!</function>
|
1245
1239
|
|
1246
1240
|
<remark># increment the counter to maximum value</remark>
|
1247
1241
|
<constant>MAX</constant>.<function>times</function> <token>do</token> <function>relay_verilog</function> <token>end</token>
|
1248
|
-
<
|
1242
|
+
<constant>Counter</constant>.<function>count</function>.<function>intVal</function>.<function>should_equal</function> <constant>MAX</constant>
|
1249
1243
|
<token>end</token>
|
1250
1244
|
|
1251
1245
|
<function>specify</function> <literal>"should overflow upon increment"</literal> <token>do</token>
|
1252
1246
|
<function>relay_verilog</function> <remark># increment the counter</remark>
|
1253
|
-
<
|
1247
|
+
<constant>Counter</constant>.<function>count</function>.<function>intVal</function>.<function>should_equal</function> <literal>0</literal>
|
1254
1248
|
<token>end</token>
|
1255
1249
|
<token>end</token>
|
1256
1250
|
</programlisting>
|
@@ -1259,48 +1253,70 @@
|
|
1259
1253
|
<figure id="fig..counter_xunit_spec.rb">
|
1260
1254
|
<title>Specification implemented in xUnit format</title>
|
1261
1255
|
<programlisting>
|
1262
|
-
<
|
1263
|
-
<constant>
|
1256
|
+
<remark># lowest upper bound of counter's value</remark>
|
1257
|
+
<constant>LIMIT</constant> = <literal>2</literal> ** <constant>Counter</constant>.<function>Size</function>.<function>intVal</function>
|
1264
1258
|
|
1265
|
-
<
|
1266
|
-
|
1259
|
+
<remark># maximum allowed value for a counter</remark>
|
1260
|
+
<constant>MAX</constant> = <constant>LIMIT</constant> - <literal>1</literal>
|
1267
1261
|
|
1262
|
+
<token>class</token> <constant>ResettedCounterValue</constant> < <constant>Test</constant>::<constant>Unit</constant>::<constant>TestCase</constant>
|
1268
1263
|
<token>def</token> <function>setup</function>
|
1269
|
-
<
|
1270
|
-
<varname>@design</varname>.<function>reset!</function>
|
1264
|
+
<constant>Counter</constant>.<function>reset!</function>
|
1271
1265
|
<token>end</token>
|
1272
1266
|
|
1273
1267
|
<token>def</token> <function>test_zero</function>
|
1274
|
-
<function>assert_equal</function> <literal>0</literal>, <
|
1268
|
+
<function>assert_equal</function> <literal>0</literal>, <constant>Counter</constant>.<function>count</function>.<function>intVal</function>
|
1275
1269
|
<token>end</token>
|
1276
1270
|
|
1277
1271
|
<token>def</token> <function>test_increment</function>
|
1278
1272
|
<constant>LIMIT</constant>.<function>times</function> <token>do</token> |<varname>i</varname>|
|
1279
|
-
<function>assert_equal</function> <varname>i</varname>, <
|
1273
|
+
<function>assert_equal</function> <varname>i</varname>, <constant>Counter</constant>.<function>count</function>.<function>intVal</function>
|
1280
1274
|
<function>relay_verilog</function> <remark># advance the clock</remark>
|
1281
1275
|
<token>end</token>
|
1282
1276
|
<token>end</token>
|
1283
1277
|
<token>end</token>
|
1284
1278
|
|
1285
1279
|
<token>class</token> <constant>MaximumCounterValue</constant> < <constant>Test</constant>::<constant>Unit</constant>::<constant>TestCase</constant>
|
1286
|
-
<token>include</token> <constant>Vpi</constant>
|
1287
|
-
|
1288
1280
|
<token>def</token> <function>setup</function>
|
1289
|
-
<
|
1290
|
-
<varname>@design</varname>.<function>reset!</function>
|
1281
|
+
<constant>Counter</constant>.<function>reset!</function>
|
1291
1282
|
|
1292
1283
|
<remark># increment the counter to maximum value</remark>
|
1293
1284
|
<constant>MAX</constant>.<function>times</function> <token>do</token> <function>relay_verilog</function> <token>end</token>
|
1294
|
-
<function>assert_equal</function> <constant>MAX</constant>, <
|
1285
|
+
<function>assert_equal</function> <constant>MAX</constant>, <constant>Counter</constant>.<function>count</function>.<function>intVal</function>
|
1295
1286
|
<token>end</token>
|
1296
1287
|
|
1297
1288
|
<token>def</token> <function>test_overflow</function>
|
1298
1289
|
<function>relay_verilog</function> <remark># increment the counter</remark>
|
1299
|
-
<function>assert_equal</function> <literal>0</literal>, <
|
1290
|
+
<function>assert_equal</function> <literal>0</literal>, <constant>Counter</constant>.<function>count</function>.<function>intVal</function>
|
1300
1291
|
<token>end</token>
|
1301
1292
|
<token>end</token>
|
1302
1293
|
</programlisting>
|
1303
1294
|
</figure>
|
1295
|
+
|
1296
|
+
<important>
|
1297
|
+
<title>Before we continue…</title>
|
1298
|
+
<itemizedlist>
|
1299
|
+
<listitem>
|
1300
|
+
<para>Replace the contents of the file named <filename>counter_rspec_spec.rb</filename> with the source code shown in <xref linkend="fig..counter_rspec_spec.rb"/>.</para>
|
1301
|
+
</listitem>
|
1302
|
+
<listitem>
|
1303
|
+
<para>Replace the contents of the file named <filename>counter_xunit_spec.rb</filename> with the source code shown in <xref linkend="fig..counter_xunit_spec.rb"/>.</para>
|
1304
|
+
</listitem>
|
1305
|
+
<listitem>
|
1306
|
+
<para>Replace the contents of the files named <filename>counter_rspec_design.rb</filename> and <filename>counter_xunit_design.rb</filename> with the following code. This code defines the <function>reset!</function> method which resets our &v; design.</para>
|
1307
|
+
|
1308
|
+
<programlisting>
|
1309
|
+
<token>class</token> << <constant>Counter</constant>
|
1310
|
+
<token>def</token> <function>reset!</function>
|
1311
|
+
<function>reset</function>.<function>intVal</function> = <literal>1</literal>
|
1312
|
+
<function>relay_verilog</function> <remark># advance the clock</remark>
|
1313
|
+
<function>reset</function>.<function>intVal</function> = <literal>0</literal>
|
1314
|
+
<token>end</token>
|
1315
|
+
<token>end</token>
|
1316
|
+
</programlisting>
|
1317
|
+
</listitem>
|
1318
|
+
</itemizedlist>
|
1319
|
+
</important>
|
1304
1320
|
</section>
|
1305
1321
|
|
1306
1322
|
<section id="usage.tutorial.implement-proto">
|
@@ -1308,26 +1324,25 @@
|
|
1308
1324
|
|
1309
1325
|
<para>Now that we have a &specification.gloss; against which to verify our &design.gloss;, let us build a prototype of our design. By doing so, we exercise our specification, experience potential problems that may arise when we later implement our design in &v;, and gain confidence in our work. <xref linkend="fig..counter_proto.rb"/> shows the completed prototype for our design.</para>
|
1310
1326
|
|
1311
|
-
<important>
|
1312
|
-
<title>Before we continue…</title>
|
1313
|
-
<para>Replace the contents of the files named <filename>counter_rspec_proto.rb</filename> and <filename>counter_xunit_proto.rb</filename> with the source code shown in <xref linkend="fig..counter_proto.rb"/>.</para>
|
1314
|
-
</important>
|
1315
|
-
|
1316
1327
|
<figure id="fig..counter_proto.rb">
|
1317
1328
|
<title>Ruby prototype of our &v; design</title>
|
1318
1329
|
<programlisting>
|
1319
|
-
<token>class</token>
|
1330
|
+
<token>class</token> << <constant>Counter</constant>
|
1320
1331
|
<token>def</token> <function>simulate!</function>
|
1321
|
-
<token>if</token> <
|
1322
|
-
<
|
1332
|
+
<token>if</token> <function>reset</function>.<function>intVal</function> == <literal>1</literal>
|
1333
|
+
<function>count</function>.<function>intVal</function> = <literal>0</literal>
|
1323
1334
|
<token>else</token>
|
1324
|
-
<
|
1335
|
+
<function>count</function>.<function>intVal</function> += <literal>1</literal>
|
1325
1336
|
<token>end</token>
|
1326
1337
|
<token>end</token>
|
1327
1338
|
<token>end</token>
|
1328
1339
|
</programlisting>
|
1329
1340
|
</figure>
|
1330
1341
|
|
1342
|
+
<important>
|
1343
|
+
<title>Before we continue…</title>
|
1344
|
+
<para>Replace the contents of the files named <filename>counter_rspec_proto.rb</filename> and <filename>counter_xunit_proto.rb</filename> with the source code shown in <xref linkend="fig..counter_proto.rb"/>.</para>
|
1345
|
+
</important>
|
1331
1346
|
</section>
|
1332
1347
|
|
1333
1348
|
<section id="usage.tutorial.test-proto">
|
@@ -1335,15 +1350,21 @@
|
|
1335
1350
|
<para>Now that we have implemented our prototype, we are ready to verify it against our &specification.gloss; by running the &test.gloss;. <xref linkend="fig..test-proto.rspec"/> and <xref linkend="fig..test-proto.unit-test"/> illustrate this process.</para>
|
1336
1351
|
|
1337
1352
|
<tip>
|
1353
|
+
<title>Reuse your past efforts!</title>
|
1338
1354
|
<para>The <emphasis>same</emphasis> specification can be used to verify both prototype and design.</para>
|
1339
1355
|
</tip>
|
1340
1356
|
|
1341
|
-
<para>Here, the <varname>PROTOTYPE</varname> environment variable is assigned a non-empty value while running the test, so that, instead of our design, our prototype is verified against our specification. You can also assign a value to <varname>PROTOTYPE</varname> before running the test, by using your shell's <command>export</command> or <command>setenv</command> command. Finally, the Icarus &v; simulator, denoted by <replaceable>
|
1357
|
+
<para>Here, the <varname>PROTOTYPE</varname> environment variable is assigned a non-empty value while running the test, so that, instead of our design, our prototype is verified against our specification. You can also assign a value to <varname>PROTOTYPE</varname> before running the test, by using your shell's <command>export</command> or <command>setenv</command> command. Finally, the Icarus &v; simulator, denoted by <replaceable>cver</replaceable>, is used to run the simulation.</para>
|
1358
|
+
|
1359
|
+
<tip>
|
1360
|
+
<title>What can the test runner do?</title>
|
1361
|
+
<para>If you invoke the test runner (1) without any arguments or (2) with the <option>-T</option> option, it will show you a list of tasks that it can perform for you.</para>
|
1362
|
+
</tip>
|
1342
1363
|
|
1343
1364
|
<figure id="fig..test-proto.rspec">
|
1344
1365
|
<title>Running a test with specification in &rspec; format</title>
|
1345
1366
|
<screen>
|
1346
|
-
<prompt>$</prompt> <userinput><command>rake <option>-f</option> <replaceable>counter_rspec_runner.rake</replaceable> <replaceable>
|
1367
|
+
<prompt>$</prompt> <userinput><command>rake <option>-f</option> <replaceable>counter_rspec_runner.rake</replaceable> <replaceable>cver</replaceable> <varname>PROTOTYPE</varname>=<replaceable>1</replaceable></command></userinput>
|
1347
1368
|
<computeroutput>counter_rspec: verifying prototype instead of design
|
1348
1369
|
|
1349
1370
|
A resetted counter's value
|
@@ -1362,7 +1383,7 @@ Finished in 0.018199 seconds
|
|
1362
1383
|
<figure id="fig..test-proto.unit-test">
|
1363
1384
|
<title>Running a test with specification in xUnit format</title>
|
1364
1385
|
<screen>
|
1365
|
-
<prompt>$</prompt> <userinput><command>rake <option>-f</option> <replaceable>counter_xunit_runner.rake</replaceable> <replaceable>
|
1386
|
+
<prompt>$</prompt> <userinput><command>rake <option>-f</option> <replaceable>counter_xunit_runner.rake</replaceable> <replaceable>cver</replaceable> <varname>PROTOTYPE</varname>=<replaceable>1</replaceable></command></userinput>
|
1366
1387
|
<computeroutput>counter_xunit: verifying prototype instead of design
|
1367
1388
|
|
1368
1389
|
Loaded suite counter_xunit_bench
|
@@ -1380,11 +1401,6 @@ Finished in 0.040668 seconds.
|
|
1380
1401
|
|
1381
1402
|
<para>Now that we have implemented and verified our prototype, we are ready to implement our &design.gloss;. This is often quite simple because we translate <emphasis>existing</emphasis> code from &r; (our prototype) into &v; (our design). <xref linkend="fig..counter.v_impl"/> illustrates the result of this process. Once again, note the striking similarities between the implementation of our prototype and design.</para>
|
1382
1403
|
|
1383
|
-
<important>
|
1384
|
-
<title>Before we continue…</title>
|
1385
|
-
<para>Replace the contents of the file named <filename>counter.v</filename> with the source code shown in <xref linkend="fig..counter.v_impl"/>.</para>
|
1386
|
-
</important>
|
1387
|
-
|
1388
1404
|
<figure id="fig..counter.v_impl">
|
1389
1405
|
<title>Implementation of a simple up-counter with synchronous reset</title>
|
1390
1406
|
<programlisting>
|
@@ -1402,18 +1418,32 @@ Finished in 0.040668 seconds.
|
|
1402
1418
|
<token>endmodule</token>
|
1403
1419
|
</programlisting>
|
1404
1420
|
</figure>
|
1421
|
+
|
1422
|
+
<important>
|
1423
|
+
<title>Before we continue…</title>
|
1424
|
+
<para>Replace the contents of the file named <filename>counter.v</filename> with the source code shown in <xref linkend="fig..counter.v_impl"/>.</para>
|
1425
|
+
</important>
|
1405
1426
|
</section>
|
1406
1427
|
|
1407
1428
|
<section id="usage.tutorial.test-design">
|
1408
1429
|
<title>Verify the design</title>
|
1409
1430
|
<para>Now that we have implemented our &design.gloss;, we are ready to verify it against our &specification.gloss; by running the &test.gloss;. <xref linkend="fig..test-design.rspec"/> and <xref linkend="fig..test-design.unit-test"/> illustrate this process.</para>
|
1410
1431
|
|
1411
|
-
<para>Here, the <varname>PROTOTYPE</varname> environment variable is <emphasis>not</emphasis> specified while running the test, so that our design, instead of our prototype, is verified against our specification. You can also achieve this effect by assigning an empty value to <varname>PROTOTYPE</varname>, or by using your shell's <command>unset</command> command. Finally, the
|
1432
|
+
<para>Here, the <varname>PROTOTYPE</varname> environment variable is <emphasis>not</emphasis> specified while running the test, so that our design, instead of our prototype, is verified against our specification. You can also achieve this effect by assigning an empty value to <varname>PROTOTYPE</varname>, or by using your shell's <command>unset</command> command. Finally, the GPL Cver &v; simulator, denoted by <replaceable>cver</replaceable>, is used to run the simulation.</para>
|
1433
|
+
|
1434
|
+
<tip>
|
1435
|
+
<title>Running multiple tests</title>
|
1436
|
+
<para>Create a file named <filename>Rakefile</filename> containing the following line.</para>
|
1437
|
+
|
1438
|
+
<programlisting>require 'ruby-vpi/runner_proxy'</programlisting>
|
1439
|
+
|
1440
|
+
<para>Now you can invoke all test runners in the current directory simply by executing <command>rake <replaceable>cver</replaceable></command> (where <replaceable>cver</replaceable> denotes the GPL Cver simulator).</para>
|
1441
|
+
</tip>
|
1412
1442
|
|
1413
1443
|
<figure id="fig..test-design.rspec">
|
1414
1444
|
<title>Running a test with specification in &rspec; format</title>
|
1415
1445
|
<screen>
|
1416
|
-
<prompt>$</prompt> <userinput><command>rake <option>-f</option> <replaceable>counter_rspec_runner.rake</replaceable> <replaceable>
|
1446
|
+
<prompt>$</prompt> <userinput><command>rake <option>-f</option> <replaceable>counter_rspec_runner.rake</replaceable> <replaceable>cver</replaceable></command></userinput>
|
1417
1447
|
<computeroutput>A resetted counter's value
|
1418
1448
|
- should be zero
|
1419
1449
|
- should increment by one count upon each rising clock edge
|
@@ -1430,7 +1460,7 @@ Finished in 0.005628 seconds
|
|
1430
1460
|
<figure id="fig..test-design.unit-test">
|
1431
1461
|
<title>Running a test with specification in xUnit format</title>
|
1432
1462
|
<screen>
|
1433
|
-
<prompt>$</prompt> <userinput><command>rake <option>-f</option> <replaceable>counter_xunit_runner.rake</replaceable> <replaceable>
|
1463
|
+
<prompt>$</prompt> <userinput><command>rake <option>-f</option> <replaceable>counter_xunit_runner.rake</replaceable> <replaceable>cver</replaceable></command></userinput>
|
1434
1464
|
<computeroutput>Loaded suite counter_xunit_bench
|
1435
1465
|
Started
|
1436
1466
|
...
|
@@ -1440,7 +1470,14 @@ Finished in 0.006766 seconds.
|
|
1440
1470
|
</screen>
|
1441
1471
|
</figure>
|
1442
1472
|
</section>
|
1473
|
+
</section>
|
1474
|
+
|
1475
|
+
<section id="usage.examples">
|
1476
|
+
<title>Examples</title>
|
1443
1477
|
|
1478
|
+
<para>The <filename>samp</filename> directory contains several example tests which illustrate how &rv; can be used. Each example has an associated <filename>Rakefile</filename> which simplifies the process of running it. Therefore, simply navigate into an example directory and run the command <command>rake</command> to get started.</para>
|
1479
|
+
|
1480
|
+
<para>Also, some example specifications make use of BDD through the <application>rSpec</application> library. See the <xref linkend="background.methodology"/> for a discussion of <application>rSpec</application>.</para>
|
1444
1481
|
</section>
|
1445
1482
|
</chapter>
|
1446
1483
|
|
@@ -1478,7 +1515,7 @@ Finished in 0.006766 seconds.
|
|
1478
1515
|
<section id="problems.ivl.vpi_handle_by_name.absolute-paths">
|
1479
1516
|
<title>Give full paths to &v; objects</title>
|
1480
1517
|
|
1481
|
-
<para>In version 0.8 of Icarus &v;, the <function>vpi_handle_by_name</function> function requires an <emphasis>absolute</emphasis> path (including the name of the bench which instantiates the design) to a &v; object.</para>
|
1518
|
+
<para>In version 0.8 and snapshot 20061009 of Icarus &v;, the <function>vpi_handle_by_name</function> function requires an <emphasis>absolute</emphasis> path (including the name of the bench which instantiates the design) to a &v; object. In addition, <function>vpi_handle_by_name</function> is unable to retrieve the handle for a module parameter.</para>
|
1482
1519
|
|
1483
1520
|
<para>For example, consider <xref linkend="ex..TestFoo"/>. Here, one needs to specify <code>TestFoo.my_foo.clk</code> instead of <code>my_foo.clk</code> in order to access the <varname>clk</varname> input of the <varname>my_foo</varname> module instance.</para>
|
1484
1521
|
|