ruby-vpi 12.0.0 → 12.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +16 -0
- data/doc/Rakefile +34 -8
- data/doc/common.css +8 -3
- data/doc/common.tpl +1 -0
- data/doc/{history.erb → history.doc} +0 -0
- data/doc/history.html +281 -277
- data/doc/history.rb +4 -1
- data/doc/history.yml +18 -1
- data/doc/images/feed-icon.LICENSE +2 -0
- data/doc/images/feed-icon.png +0 -0
- data/doc/images/feed-icon.svg +18 -0
- data/doc/intro.inc +1 -1
- data/doc/lib/doc_format.rb +44 -10
- data/doc/lib/doc_proxy.rb +18 -17
- data/doc/{manual.erb → manual.doc} +3 -3
- data/doc/manual.html +35 -105
- data/doc/{memo.erb → memo.doc} +2 -2
- data/doc/memo.html +22 -49
- data/doc/{readme.erb → readme.doc} +2 -0
- data/doc/readme.html +5 -5
- data/doc/rss.erb +30 -0
- data/doc/rss.xml +209 -0
- data/lib/ruby-vpi.rb +16 -15
- data/ref/c/annotated.html +6 -1
- data/ref/c/common_8h.html +1 -1
- data/ref/c/files.html +3 -1
- data/ref/c/functions.html +44 -24
- data/ref/c/functions_vars.html +44 -24
- data/ref/c/globals.html +211 -5
- data/ref/c/globals_0x62.html +62 -0
- data/ref/c/globals_0x63.html +49 -32
- data/ref/c/globals_0x65.html +10 -3
- data/ref/c/globals_0x66.html +20 -3
- data/ref/c/globals_0x67.html +64 -0
- data/ref/c/globals_0x69.html +62 -0
- data/ref/c/globals_0x6c.html +64 -0
- data/ref/c/globals_0x6d.html +62 -0
- data/ref/c/globals_0x6e.html +63 -0
- data/ref/c/globals_0x70.html +26 -19
- data/ref/c/globals_0x72.html +15 -4
- data/ref/c/globals_0x73.html +199 -13
- data/ref/c/globals_0x74.html +9 -2
- data/ref/c/globals_0x75.html +63 -0
- data/ref/c/globals_0x76.html +426 -415
- data/ref/c/globals_0x78.html +10 -3
- data/ref/c/globals_defs.html +35 -30
- data/ref/c/globals_defs_0x65.html +7 -2
- data/ref/c/globals_defs_0x6c.html +57 -0
- data/ref/c/globals_defs_0x6e.html +56 -0
- data/ref/c/globals_defs_0x70.html +8 -3
- data/ref/c/globals_defs_0x72.html +57 -0
- data/ref/c/globals_defs_0x73.html +164 -0
- data/ref/c/globals_defs_0x75.html +56 -0
- data/ref/c/globals_defs_0x76.html +420 -413
- data/ref/c/globals_defs_0x78.html +7 -2
- data/ref/c/globals_enum.html +1 -1
- data/ref/c/globals_eval.html +1 -1
- data/ref/c/globals_func.html +173 -14
- data/ref/c/globals_func_0x66.html +62 -0
- data/ref/c/globals_func_0x67.html +55 -0
- data/ref/c/globals_func_0x69.html +53 -0
- data/ref/c/globals_func_0x70.html +53 -0
- data/ref/c/globals_func_0x72.html +57 -0
- data/ref/c/globals_func_0x73.html +114 -0
- data/ref/c/globals_func_0x76.html +57 -0
- data/ref/c/globals_type.html +29 -26
- data/ref/c/globals_vars.html +88 -4
- data/ref/c/index.html +1 -1
- data/ref/c/relay_8c.html +1 -1
- data/ref/c/relay_8h.html +1 -1
- data/ref/c/structrelay____RubyOptions____def.html +1 -1
- data/ref/c/structswig__cast__info.html +98 -0
- data/ref/c/structswig__class.html +115 -0
- data/ref/c/structswig__module__info.html +132 -0
- data/ref/c/structswig__type__info.html +132 -0
- data/ref/c/structt__cb__data.html +23 -6
- data/ref/c/structt__vpi__delay.html +20 -3
- data/ref/c/structt__vpi__error__info.html +71 -3
- data/ref/c/structt__vpi__strengthval.html +3 -3
- data/ref/c/structt__vpi__systf__data.html +46 -12
- data/ref/c/structt__vpi__time.html +3 -3
- data/ref/c/structt__vpi__value.html +113 -3
- data/ref/c/structt__vpi__vecval.html +3 -3
- data/ref/c/structt__vpi__vlog__info.html +54 -3
- data/ref/c/swig_8c.html +2 -2
- data/ref/c/swig_8h.html +1 -1
- data/ref/c/swig__vpi_8h.html +8739 -0
- data/ref/c/swig__wrap_8cin.html +11556 -0
- data/ref/c/unions__vpi__value__value.html +166 -0
- data/ref/c/verilog_8h.html +1 -1
- data/ref/c/vlog_8c.html +1 -1
- data/ref/c/vlog_8h.html +1 -1
- data/ref/c/vpi__user_8h.html +16 -16
- data/ref/ruby/classes/RubyVpi.src/M000085.html +27 -27
- data/ref/ruby/classes/RubyVpi/Config.html +6 -1
- data/ref/ruby/classes/String.html +19 -19
- data/ref/ruby/classes/String.src/M000033.html +23 -28
- data/ref/ruby/classes/String.src/M000034.html +28 -5
- data/ref/ruby/classes/String.src/M000035.html +5 -23
- data/ref/ruby/created.rid +1 -1
- data/ref/ruby/files/bin/generate_test_rb.html +1 -1
- 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/float_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 +1 -1
- data/ref/ruby/files/lib/ruby-vpi/verilog_parser_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/vpi_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/xx_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi_rb.html +2 -2
- data/ref/ruby/fr_method_index.html +3 -3
- data/ref/ruby/index.html +2 -2
- metadata +116 -86
data/doc/history.rb
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
require 'yaml'
|
2
2
|
@history = YAML.load_file(File.join(File.dirname(__FILE__), 'history.yml'))
|
3
3
|
|
4
|
+
# note: @history is an array of hashes
|
5
|
+
|
6
|
+
|
4
7
|
def format_history_entry aEntry
|
5
|
-
output = "h1. Version #{aEntry['Version']} (#{aEntry['Date']})\n\n"
|
8
|
+
output = "h1(##{aEntry['Version']}). Version #{aEntry['Version']} (#{aEntry['Date']})\n\n"
|
6
9
|
|
7
10
|
%w[Summary Acknowledgment Notice Detail].each do |key|
|
8
11
|
if content = aEntry[key]
|
data/doc/history.yml
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
-
|
2
|
+
Version: 12.0.1
|
3
|
+
|
4
|
+
Date: 2006-12-18
|
5
|
+
|
6
|
+
Summary: |
|
7
|
+
This release fixes a problem in code coverage analysis.
|
8
|
+
|
9
|
+
Acknowledgment: |
|
10
|
+
Thanks to Mauricio Fernandez for helping me solve the problem.
|
11
|
+
|
12
|
+
Detail: |
|
13
|
+
Previously, code coverage reports were not providing any useful information because they were being generated _before_ the test had a chance to run. This problem has been fixed -- code coverage reports are now generated _after_ the test has finished running.
|
14
|
+
|
15
|
+
This problem was wholly due to programmer error (i.e. my mistake @;-)@) because I had forgotten that @Kernel.at_exit@ invokes the blocks passed to it in _reverse_ order. So, the coverage report was being generated before Test::Unit had a chance to run (it also uses @Kernel.at_exit@).
|
16
|
+
|
17
|
+
|
1
18
|
-
|
2
19
|
Version: 12.0.0
|
3
20
|
|
@@ -298,7 +315,7 @@
|
|
298
315
|
Date: 2006-09-15
|
299
316
|
|
300
317
|
Summary: |
|
301
|
-
This release adds initial
|
318
|
+
This release adds initial support for code coverage analysis via the "rcov library":http://eigenclass.org/hiki.rb?rcov.
|
302
319
|
|
303
320
|
Acknowledgment: |
|
304
321
|
Thanks to Mauricio Fernandez for helping me use rcov without its runner.
|
Binary file
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="128px" height="128px" id="RSSicon" viewBox="0 0 256 256">
|
4
|
+
<defs>
|
5
|
+
<linearGradient x1="0.085" y1="0.085" x2="0.915" y2="0.915" id="RSSg">
|
6
|
+
<stop offset="0.0" stop-color="#E3702D"/><stop offset="0.1071" stop-color="#EA7D31"/>
|
7
|
+
<stop offset="0.3503" stop-color="#F69537"/><stop offset="0.5" stop-color="#FB9E3A"/>
|
8
|
+
<stop offset="0.7016" stop-color="#EA7C31"/><stop offset="0.8866" stop-color="#DE642B"/>
|
9
|
+
<stop offset="1.0" stop-color="#D95B29"/>
|
10
|
+
</linearGradient>
|
11
|
+
</defs>
|
12
|
+
<rect width="256" height="256" rx="55" ry="55" x="0" y="0" fill="#CC5D15"/>
|
13
|
+
<rect width="246" height="246" rx="50" ry="50" x="5" y="5" fill="#F49C52"/>
|
14
|
+
<rect width="236" height="236" rx="47" ry="47" x="10" y="10" fill="url(#RSSg)"/>
|
15
|
+
<circle cx="68" cy="189" r="24" fill="#FFF"/>
|
16
|
+
<path d="M160 213h-34a82 82 0 0 0 -82 -82v-34a116 116 0 0 1 116 116z" fill="#FFF"/>
|
17
|
+
<path d="M184 213A140 140 0 0 0 44 73 V 38a175 175 0 0 1 175 175z" fill="#FFF"/>
|
18
|
+
</svg>
|
data/doc/intro.inc
CHANGED
@@ -3,7 +3,7 @@ bq. Ruby-VPI is a "Ruby":http://www.ruby-lang.org interface to "Verilog VPI":htt
|
|
3
3
|
|
4
4
|
h2(#intro.features). Features
|
5
5
|
|
6
|
-
* Supports the _entire_ IEEE Std 1364-2005 VPI standard.
|
6
|
+
* Supports the _entire_ "IEEE Std 1364-2005"::http://ieeexplore.ieee.org/xpl/standardstoc.jsp?isnumber=33945 VPI standard.
|
7
7
|
|
8
8
|
* Works with all "major Verilog simulators":manual.html#setup.reqs available today.
|
9
9
|
** Compile _once_ (during "installation":manual.html#setup.installation) and use forever!
|
data/doc/lib/doc_format.rb
CHANGED
@@ -24,16 +24,56 @@ require 'coderay'
|
|
24
24
|
require 'redcloth'
|
25
25
|
|
26
26
|
class String
|
27
|
+
# The content of these HTML tags will be preserved verbatim when they are processed by Textile.
|
28
|
+
PRESERVED_TAGS = [:code, :tt]
|
29
|
+
|
30
|
+
# Transforms this string into HTML.
|
31
|
+
def to_html
|
32
|
+
text = dup
|
33
|
+
|
34
|
+
# prevent the content of these tags from being transformed by Textile
|
35
|
+
# for example, Textile transforms quotation marks in code into curly ones ( ) -- this ruins any source code in the content of the tags!
|
36
|
+
PRESERVED_TAGS.each do |tag|
|
37
|
+
text.gsub! %r{<#{tag}(.*?)>(.*?)</#{tag}>}m, %{<pre tag=#{tag.inspect}\\1>\\2</pre>}
|
38
|
+
end
|
39
|
+
|
40
|
+
html = text.redcloth
|
41
|
+
|
42
|
+
# restore the original tags for the preserved tags
|
43
|
+
# unescape content of <pre> tags because they may contain nested preserved tags (redcloth escapes the content of <pre> tags)
|
44
|
+
html.gsub! %r{(<pre>)(.*?)(</pre>)}m do
|
45
|
+
$1 + CGI.unescapeHTML($2) + $3
|
46
|
+
end
|
47
|
+
|
48
|
+
PRESERVED_TAGS.each do |tag|
|
49
|
+
html.gsub! %r{<pre tag=#{tag.inspect}(.*?)>(.*?)</pre>}m, %{<#{tag}\\1>\\2</#{tag}>}
|
50
|
+
end
|
51
|
+
|
52
|
+
# assume that indented text in Textile is NOT source code
|
53
|
+
html.gsub! %r{(<pre>)\s*<code>(.*?)\s*</code>\s*(</pre>)}m, '\1\2\3'
|
54
|
+
|
55
|
+
# escape content of <pre> tags, because we un-escaped it above
|
56
|
+
html.gsub! %r{(<pre>)(.*?)(</pre>)}m do
|
57
|
+
$1 + CGI.escapeHTML($2) + $3
|
58
|
+
end
|
59
|
+
|
60
|
+
html.coderay
|
61
|
+
end
|
62
|
+
|
27
63
|
# Returns the result of running this string through RedCloth.
|
28
64
|
def redcloth
|
29
65
|
RedCloth.new(self).to_html
|
30
66
|
end
|
31
67
|
|
32
|
-
# Adds syntax coloring to <code
|
68
|
+
# Adds syntax coloring to <code> elements in the given text. If
|
69
|
+
# the <code> tag has an attribute lang="...", then that is considered the
|
70
|
+
# programming language for which appropriate syntax coloring should be
|
71
|
+
# applied. Otherwise, the programming language is assumed to be ruby.
|
33
72
|
def coderay
|
34
73
|
gsub %r{<(code)(.*?)>(.*?)</\1>}m do
|
35
|
-
code = CGI.unescapeHTML
|
74
|
+
code = CGI.unescapeHTML $3
|
36
75
|
atts = $2
|
76
|
+
|
37
77
|
lang =
|
38
78
|
if $2 =~ /lang=('|")(.*?)\1/i
|
39
79
|
$2
|
@@ -41,8 +81,7 @@ class String
|
|
41
81
|
:ruby
|
42
82
|
end
|
43
83
|
|
44
|
-
|
45
|
-
type =
|
84
|
+
tag =
|
46
85
|
if code =~ /\n/
|
47
86
|
:pre
|
48
87
|
else
|
@@ -51,12 +90,7 @@ class String
|
|
51
90
|
|
52
91
|
html = CodeRay.scan(code, lang).html(:css => :style)
|
53
92
|
|
54
|
-
%{<#{
|
93
|
+
%{<#{tag} class="code"#{atts}>#{html}</#{tag}>}
|
55
94
|
end
|
56
95
|
end
|
57
|
-
|
58
|
-
def to_html
|
59
|
-
redcloth.coderay
|
60
|
-
end
|
61
96
|
end
|
62
|
-
|
data/doc/lib/doc_proxy.rb
CHANGED
@@ -24,6 +24,7 @@ require 'erb_proxy'
|
|
24
24
|
class DocProxy < ErbProxy
|
25
25
|
Block = Struct.new :anchor, :title, :type
|
26
26
|
Heading = Struct.new :anchor, :title, :depth
|
27
|
+
@@anchorNum = 0
|
27
28
|
|
28
29
|
CATEGORIES = {
|
29
30
|
:admonition => [:tip, :note, :important, :caution, :warning],
|
@@ -65,25 +66,25 @@ class DocProxy < ErbProxy
|
|
65
66
|
buffer = aResult
|
66
67
|
|
67
68
|
# parse document structure and insert anchors (so that the table of contents can link directly to these headings) where necessary
|
68
|
-
buffer.gsub! %r{^(\s*h(\d))(
|
69
|
-
|
70
|
-
|
71
|
-
title
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
69
|
+
buffer.gsub! %r{^(\s*h(\d))(.*)$} do
|
70
|
+
head, depth, rest = $1, $2, $3
|
71
|
+
|
72
|
+
# parse title and class attributes
|
73
|
+
rest =~ /^([\{\(\[].*?[\]\)\}])?\.(.*)$/
|
74
|
+
atts, title = $1, $2.strip
|
75
|
+
|
76
|
+
# parse and insert anchor if necessary
|
77
|
+
if atts =~ /#(.*?)\)/
|
78
|
+
anchor = $1
|
79
|
+
else
|
80
|
+
anchor = "anchor#{@@anchorNum += 1}"
|
81
|
+
rest.insert 0, "(##{anchor})"
|
82
|
+
end
|
83
|
+
|
84
|
+
@headings << Heading.new(anchor, title, depth.to_i)
|
79
85
|
@blocks[:section] << Block.new(anchor, title, :section)
|
80
86
|
|
81
|
-
|
82
|
-
if hasAnchor
|
83
|
-
target.to_s
|
84
|
-
else
|
85
|
-
"#{target[1]}(##{anchor})#{target[3]}#{target[4]}"
|
86
|
-
end
|
87
|
+
head + rest
|
87
88
|
end
|
88
89
|
|
89
90
|
# expand cross-references into links to their targets
|
@@ -118,7 +118,7 @@ In the event that a child handle has the same name as a VPI property, the child
|
|
118
118
|
|_. Operation |_. _ |_. Property |_. _ |_. Accessor |_. Addendum |
|
119
119
|
|\2. optional | required |\3. optional |
|
120
120
|
|
121
|
-
* *Operation* suggests a method that should be invoked in the context of the Property parameter.
|
121
|
+
* *Operation* suggests a method that should be invoked in the context of the Property parameter. All "methods in the Enumerable module":http://www.ruby-doc.org/core/classes/Enumerable.html are available as operations.
|
122
122
|
|
123
123
|
* *Property* suggests a VPI property that should be accessed. The "vpi" prefix, which is common to all VPI properties, can be omitted if you wish. For example, the VPI property "vpiFullName" is considered equivalent to "fullName" and "FullName", but not equivalent "full_name".
|
124
124
|
|
@@ -321,7 +321,7 @@ h1(#usage). Usage
|
|
321
321
|
|
322
322
|
h2(#usage.tools). Tools
|
323
323
|
|
324
|
-
The <tt>bin</tt> directory contains various utilities which ease the process of writing tests. Each tool provides help and usage information invoked with the <tt
|
324
|
+
The <tt>bin</tt> directory contains various utilities which ease the process of writing tests. Each tool provides help and usage information invoked with the <tt>--help</tt> option.
|
325
325
|
|
326
326
|
|
327
327
|
h3(#usage.tools.generate-test). Automated test generation
|
@@ -530,7 +530,7 @@ Finished in 0.040668 seconds.
|
|
530
530
|
In these examples, the @PROTOTYPE@ 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 @PROTOTYPE@ before running the test, by using your shell's *export* or *setenv* command. Finally, the "GPL Cver simulator":#setup.reqs, denoted by _cver_, is used to run the simulation.
|
531
531
|
|
532
532
|
<% tip "What can the test runner do?" do %>
|
533
|
-
If you invoke the test runner (1) without any arguments or (2) with the <tt
|
533
|
+
If you invoke the test runner (1) without any arguments or (2) with the <tt>--tasks</tt> option, it will show you a list of tasks that it can perform for you.
|
534
534
|
<% end %>
|
535
535
|
|
536
536
|
|
data/doc/manual.html
CHANGED
@@ -1,19 +1,18 @@
|
|
1
|
-
|
2
1
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
2
|
<html>
|
4
3
|
<head>
|
5
4
|
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
|
6
5
|
<link rel="stylesheet" type="text/css" href="common.css" />
|
6
|
+
<link rel="alternate" type="application/rss+xml" href="http://ruby-vpi.rubyforge.org/doc/rss.xml" title="RSS feed for this project." />
|
7
7
|
<title>Ruby-VPI user manual</title>
|
8
8
|
</head>
|
9
9
|
<body>
|
10
|
-
|
11
|
-
<div id="navigation">
|
10
|
+
<div id="navigation">
|
12
11
|
<p><a href="readme.html"><img src="images/home.png" title="project home" alt="project home" /></a></p>
|
13
12
|
|
14
13
|
<h1>Contents</h1>
|
15
14
|
<ul>
|
16
|
-
<li><a href="#
|
15
|
+
<li><a href="#anchor5">Ruby-VPI user manual</a>
|
17
16
|
<ul>
|
18
17
|
<li><a href="#terms">Terms</a></li>
|
19
18
|
</ul>
|
@@ -141,22 +140,16 @@
|
|
141
140
|
</ul></li>
|
142
141
|
</ul>
|
143
142
|
|
144
|
-
|
145
|
-
<h1>Admonitions</h1>
|
143
|
+
<h1>Admonitions</h1>
|
146
144
|
|
147
|
-
|
148
|
-
|
149
|
-
<h2>Tips</h2>
|
145
|
+
<h2>Tips</h2>
|
150
146
|
<ol>
|
151
147
|
<li><a href="#tip1">Add support for your Verilog simulator</a></li>
|
152
148
|
<li><a href="#tip2">Using <strong>kdiff3</strong> with the automated test generator.</a></li>
|
153
149
|
<li><a href="#tip3">What can the test runner do?</a></li>
|
154
150
|
<li><a href="#tip4">Running multiple tests at once.</a></li>
|
155
151
|
</ol>
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
<h2>Notes</h2>
|
152
|
+
<h2>Notes</h2>
|
160
153
|
<ol>
|
161
154
|
<li><a href="#note1">note1</a></li>
|
162
155
|
<li><a href="#note2">Undefined symbols in Windows</a></li>
|
@@ -166,28 +159,16 @@
|
|
166
159
|
<li><a href="#note6">Fixed in 2.0.0.</a></li>
|
167
160
|
<li><a href="#note7">Fixed in 2.0.0.</a></li>
|
168
161
|
</ol>
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
<h2>Importants</h2>
|
162
|
+
<h2>Importants</h2>
|
173
163
|
<ol>
|
174
164
|
<li><a href="#important1">Before we continue…</a></li>
|
175
165
|
<li><a href="#important2">Before we continue…</a></li>
|
176
166
|
<li><a href="#important3">Before we continue…</a></li>
|
177
167
|
<li><a href="#important4">Before we continue…</a></li>
|
178
168
|
</ol>
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
<h1>Formals</h1>
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
<h2>Figures</h2>
|
169
|
+
<h1>Formals</h1>
|
170
|
+
|
171
|
+
<h2>Figures</h2>
|
191
172
|
<ol>
|
192
173
|
<li><a href="#fig..organization">Overall organization of a test</a></li>
|
193
174
|
<li><a href="#fig..organization.detail">Detailed organization of a test</a></li>
|
@@ -195,17 +176,11 @@
|
|
195
176
|
<li><a href="#fig..ruby_init">Initialization of a test</a></li>
|
196
177
|
<li><a href="#fig..ruby_relay">Execution of a test</a></li>
|
197
178
|
</ol>
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
<h2>Tables</h2>
|
179
|
+
<h2>Tables</h2>
|
202
180
|
<ol>
|
203
181
|
<li><a href="#table1">Possible accessors and their implications</a></li>
|
204
182
|
</ol>
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
<h2>Examples</h2>
|
183
|
+
<h2>Examples</h2>
|
209
184
|
<ol>
|
210
185
|
<li><a href="#example1">Examples of accessing a handle’s <span class="caps">VPI</span> properties</a></li>
|
211
186
|
<li><a href="#fig..counter.v_decl">Declaration of a simple up-counter with synchronous reset</a></li>
|
@@ -223,24 +198,16 @@
|
|
223
198
|
<li><a href="#ex..TestFoo_bad">Bad design with unconnected registers</a></li>
|
224
199
|
<li><a href="#ex..TestFoo_fix">Fixed design with wired registers</a></li>
|
225
200
|
</ol>
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
</div>
|
234
|
-
|
235
|
-
<div class="cover-page">
|
201
|
+
</div>
|
202
|
+
<div class="cover-page">
|
236
203
|
|
237
|
-
<h1 id="
|
204
|
+
<h1 id="anchor5">Ruby-VPI user manual</h1>
|
238
205
|
|
239
206
|
|
240
207
|
<p>Suraj N. Kurapati</p>
|
241
208
|
|
242
209
|
|
243
|
-
<p>
|
210
|
+
<p>Mon Dec 18 12:07:24 <span class="caps">PST 2006</span></p>
|
244
211
|
|
245
212
|
|
246
213
|
</div>
|
@@ -266,7 +233,7 @@
|
|
266
233
|
|
267
234
|
|
268
235
|
<ul>
|
269
|
-
<li>Supports the <em>entire</em>
|
236
|
+
<li>Supports the <em>entire</em> <a href=":http://ieeexplore.ieee.org/xpl/standardstoc.jsp?isnumber=33945"><span class="caps">IEEE</span> Std 1364-2005</a> VPI standard.</li>
|
270
237
|
</ul>
|
271
238
|
|
272
239
|
|
@@ -439,9 +406,7 @@
|
|
439
406
|
</div>
|
440
407
|
|
441
408
|
</div>
|
442
|
-
|
443
|
-
<p>As a newcomer into the world of Verilog, I often heard the term <strong>test bench</strong>: “I ran the test bench, but it didn’t work!” or “Are you crazy?!! You <em>still</em> haven’t written the test bench?”, for example. I poured through my textbook for a definition of the term, but it was to no avail. Instead, it nonchalantly employed the term <em>throughout</em> its being, as if mocking my ignorance of what seems to be universal knowledge.</p>
|
444
|
-
|
409
|
+
As a newcomer into the world of Verilog, I often heard the term <strong>test bench</strong>: “I ran the test bench, but it didn’t work!” or “Are you crazy?!! You <em>still</em> haven’t written the test bench?”, for example. I poured through my textbook for a definition of the term, but it was to no avail. Instead, it nonchalantly employed the term <em>throughout</em> its being, as if mocking my ignorance of what seems to be universal knowledge.
|
445
410
|
|
446
411
|
<p>Defeated, I turned to my inner faculties to determine the answer. Let’s see, the term <em>test bench</em> has the word <em>test</em>—so it has something to do with testing—and it has the word <em>bench</em>—so maybe it’s referring to a table where the testing should occur. This reasoning grew increasingly familiar as my mind rummaged through towering stores of obsolescence and ultimately revealed dreaded memories of sleepless anguish: debugging electronics in the robotics laboratory.</p>
|
447
412
|
|
@@ -468,9 +433,7 @@
|
|
468
433
|
</div>
|
469
434
|
|
470
435
|
</div>
|
471
|
-
|
472
|
-
<p>As <a href="#fig..organization">the figure named “Overall organization of a test”</a> shows, a <a href="#glossary.test">test</a> is composed of a <a href="#glossary.bench">bench</a>, a <a href="#glossary.design">design</a>, and a <a href="#glossary.specification">specification</a>.</p>
|
473
|
-
|
436
|
+
As <a href="#fig..organization">the figure named “Overall organization of a test”</a> shows, a <a href="#glossary.test">test</a> is composed of a <a href="#glossary.bench">bench</a>, a <a href="#glossary.design">design</a>, and a <a href="#glossary.specification">specification</a>.
|
474
437
|
|
475
438
|
<p>To extend the <a href="#background.vocab">analogy of an electronics laboratory</a>, the <em>bench</em> acts as the laboratory bench which provides measurement and manipulation tools. The <em>design</em> acts as the electronic component being verified by the engineer. And the <em>specification</em> acts as the engineer who measures, manipulates, and verifies the electronic component.</p>
|
476
439
|
|
@@ -491,9 +454,7 @@
|
|
491
454
|
</div>
|
492
455
|
|
493
456
|
</div>
|
494
|
-
|
495
|
-
<p>In <a href="#fig..organization.detail">the figure named “Detailed organization of a test”</a>, Ruby-VPI acts as the <em>bench</em>, a Verilog simulator encapsulates the <em>design</em>, and a Ruby interpreter encapsulates the <em>specification</em>.</p>
|
496
|
-
|
457
|
+
In <a href="#fig..organization.detail">the figure named “Detailed organization of a test”</a>, Ruby-VPI acts as the <em>bench</em>, a Verilog simulator encapsulates the <em>design</em>, and a Ruby interpreter encapsulates the <em>specification</em>.
|
497
458
|
|
498
459
|
<p>Notice that Ruby-VPI encapsulates all communication between the Ruby interpreter and <span class="caps">VPI</span>. This allows the specification, or any Ruby program in general, to access <span class="caps">VPI</span> using nothing more than the Ruby language! Thus, Ruby-VPI removes the burden of having to write C programs in order to access <span class="caps">VPI</span>.</p>
|
499
460
|
|
@@ -561,7 +522,7 @@
|
|
561
522
|
|
562
523
|
|
563
524
|
<ul>
|
564
|
-
<li><strong>Operation</strong> suggests a method that should be invoked in the context of the Property parameter.</li>
|
525
|
+
<li><strong>Operation</strong> suggests a method that should be invoked in the context of the Property parameter. All <a href="http://www.ruby-doc.org/core/classes/Enumerable.html">methods in the Enumerable module</a> are available as operations.</li>
|
565
526
|
</ul>
|
566
527
|
|
567
528
|
|
@@ -583,7 +544,6 @@
|
|
583
544
|
</div>
|
584
545
|
|
585
546
|
</div>
|
586
|
-
|
587
547
|
<div class="formal">
|
588
548
|
|
589
549
|
<div class="table" id="table1">
|
@@ -635,7 +595,6 @@
|
|
635
595
|
</div>
|
636
596
|
|
637
597
|
</div>
|
638
|
-
|
639
598
|
<div class="formal">
|
640
599
|
|
641
600
|
<div class="example" id="example1">
|
@@ -1083,12 +1042,8 @@
|
|
1083
1042
|
</div>
|
1084
1043
|
|
1085
1044
|
</div>
|
1086
|
-
|
1087
|
-
|
1088
|
-
<li><strong>make</strong>
|
1089
|
-
– any distribution should be acceptable.</li>
|
1090
|
-
</ul>
|
1091
|
-
|
1045
|
+
* <strong>make</strong>
|
1046
|
+
– any distribution should be acceptable.
|
1092
1047
|
|
1093
1048
|
<ul>
|
1094
1049
|
<li>C compiler
|
@@ -1174,14 +1129,10 @@ $ ls -d /usr/lib/ruby/gems/1.8/gems/ruby-vpi*
|
|
1174
1129
|
</div>
|
1175
1130
|
|
1176
1131
|
</div>
|
1132
|
+
* Search for object files whose names end with <tt>.so</tt>, <tt>.o</tt>, or <tt>.dll</tt> in your Verilog simulator’s installation directory.
|
1177
1133
|
|
1178
1134
|
<ul>
|
1179
|
-
<li>
|
1180
|
-
</ul>
|
1181
|
-
|
1182
|
-
|
1183
|
-
<ul>
|
1184
|
-
<li>Determine which object files, among those found in the previous step, contain symbols whose names begin with “_vpi” by running the <pre>for x in *.{o,so,dll}; do nm $x | grep -q '[Tt] _vpi' && echo $x; done</pre> command in Cygwin.
|
1135
|
+
<li>Determine which object files, among those found in the previous step, contain symbols whose names begin with “_vpi” by running the <pre>for x in *.{o,so,dll}; do nm $x | grep -q '[Tt] _vpi' && echo $x; done</pre> command in Cygwin.
|
1185
1136
|
<ul>
|
1186
1137
|
<li>If you are using Mentor Modelsim, the desired object file can be found at a path similar to <tt>C:\Modeltech\win32\libvsim.dll</tt>.</li>
|
1187
1138
|
<li>If you are using <span class="caps">GPL</span> Cver, the desired object file can be found at a path similar to <tt>C:\gplcver\objs\v_vpi.o</tt>.</li>
|
@@ -1231,7 +1182,7 @@ $ ls -d /usr/lib/ruby/gems/1.8/gems/ruby-vpi*
|
|
1231
1182
|
<h2 id="usage.tools">Tools</h2>
|
1232
1183
|
|
1233
1184
|
|
1234
|
-
<p>The <tt>bin</tt> directory contains various utilities which ease the process of writing tests. Each tool provides help and usage information invoked with the <tt
|
1185
|
+
<p>The <tt>bin</tt> directory contains various utilities which ease the process of writing tests. Each tool provides help and usage information invoked with the <tt>--help</tt> option.</p>
|
1235
1186
|
|
1236
1187
|
|
1237
1188
|
<h3 id="usage.tools.generate-test">Automated test generation</h3>
|
@@ -1342,7 +1293,6 @@ endmodule
|
|
1342
1293
|
</div>
|
1343
1294
|
|
1344
1295
|
</div>
|
1345
|
-
|
1346
1296
|
<div class="admonition">
|
1347
1297
|
|
1348
1298
|
<div class="important" id="important1">
|
@@ -1390,9 +1340,7 @@ Each format represents a different software development methodology:
|
|
1390
1340
|
</div>
|
1391
1341
|
|
1392
1342
|
</div>
|
1393
|
-
|
1394
|
-
<p>Once we have decided how we want to implement our specification, we can proceed to generate a test for our design. This process is illustrated by <a href="#fig..generate-test.rspec">the example named “Generating a test with specification in rSpec format”</a> and <a href="#fig..generate-test.unit-test">the example named “Generating a test with specification in xUnit format”</a>.</p>
|
1395
|
-
|
1343
|
+
Once we have decided how we want to implement our specification, we can proceed to generate a test for our design. This process is illustrated by <a href="#fig..generate-test.rspec">the example named “Generating a test with specification in rSpec format”</a> and <a href="#fig..generate-test.unit-test">the example named “Generating a test with specification in xUnit format”</a>.
|
1396
1344
|
|
1397
1345
|
<div class="formal">
|
1398
1346
|
|
@@ -1416,7 +1364,6 @@ $ generate_test.rb counter.v --rspec --name rspec
|
|
1416
1364
|
</div>
|
1417
1365
|
|
1418
1366
|
</div>
|
1419
|
-
|
1420
1367
|
<div class="formal">
|
1421
1368
|
|
1422
1369
|
<div class="example" id="fig..generate-test.unit-test">
|
@@ -1508,7 +1455,6 @@ context <span style="background-color:#fff0f0"><span style="color:#710">"</
|
|
1508
1455
|
</div>
|
1509
1456
|
|
1510
1457
|
</div>
|
1511
|
-
|
1512
1458
|
<div class="formal">
|
1513
1459
|
|
1514
1460
|
<div class="example" id="fig..counter_xunit_spec.rb">
|
@@ -1560,7 +1506,6 @@ context <span style="background-color:#fff0f0"><span style="color:#710">"</
|
|
1560
1506
|
</div>
|
1561
1507
|
|
1562
1508
|
</div>
|
1563
|
-
|
1564
1509
|
<div class="admonition">
|
1565
1510
|
|
1566
1511
|
<div class="important" id="important2">
|
@@ -1617,7 +1562,6 @@ context <span style="background-color:#fff0f0"><span style="color:#710">"</
|
|
1617
1562
|
</div>
|
1618
1563
|
|
1619
1564
|
</div>
|
1620
|
-
|
1621
1565
|
<div class="admonition">
|
1622
1566
|
|
1623
1567
|
<div class="important" id="important3">
|
@@ -1651,7 +1595,7 @@ context <span style="background-color:#fff0f0"><span style="color:#710">"</
|
|
1651
1595
|
<pre>
|
1652
1596
|
$ rake -f counter_rspec_runner.rake cver PROTOTYPE=1
|
1653
1597
|
|
1654
|
-
Ruby-VPI: prototype has been enabled for test
|
1598
|
+
Ruby-VPI: prototype has been enabled for test "counter_rspec"
|
1655
1599
|
|
1656
1600
|
A resetted counter's value
|
1657
1601
|
- should be zero
|
@@ -1668,7 +1612,6 @@ Finished in 0.018199 seconds
|
|
1668
1612
|
</div>
|
1669
1613
|
|
1670
1614
|
</div>
|
1671
|
-
|
1672
1615
|
<div class="formal">
|
1673
1616
|
|
1674
1617
|
<div class="example" id="fig..test-proto.unit-test">
|
@@ -1679,7 +1622,7 @@ Finished in 0.018199 seconds
|
|
1679
1622
|
<pre>
|
1680
1623
|
$ rake -f counter_xunit_runner.rake cver PROTOTYPE=1
|
1681
1624
|
|
1682
|
-
Ruby-VPI: prototype has been enabled for test
|
1625
|
+
Ruby-VPI: prototype has been enabled for test "counter_xunit"
|
1683
1626
|
|
1684
1627
|
Loaded suite counter_xunit_bench
|
1685
1628
|
Started
|
@@ -1692,9 +1635,7 @@ Finished in 0.040668 seconds.
|
|
1692
1635
|
</div>
|
1693
1636
|
|
1694
1637
|
</div>
|
1695
|
-
|
1696
|
-
<p>In these examples, the <code class="code"><span style="color:#036; font-weight:bold">PROTOTYPE</span></code> 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 <code class="code"><span style="color:#036; font-weight:bold">PROTOTYPE</span></code> before running the test, by using your shell’s <strong>export</strong> or <strong>setenv</strong> command. Finally, the <a href="#setup.reqs"><span class="caps">GPL</span> Cver simulator</a>, denoted by <em>cver</em>, is used to run the simulation.</p>
|
1697
|
-
|
1638
|
+
In these examples, the <code class="code"><span style="color:#036; font-weight:bold">PROTOTYPE</span></code> 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 <code class="code"><span style="color:#036; font-weight:bold">PROTOTYPE</span></code> before running the test, by using your shell’s <strong>export</strong> or <strong>setenv</strong> command. Finally, the <a href="#setup.reqs"><span class="caps">GPL</span> Cver simulator</a>, denoted by <em>cver</em>, is used to run the simulation.
|
1698
1639
|
|
1699
1640
|
<div class="admonition">
|
1700
1641
|
|
@@ -1706,7 +1647,7 @@ Finished in 0.040668 seconds.
|
|
1706
1647
|
<p class="title">Tip: What can the test runner do?</p>
|
1707
1648
|
|
1708
1649
|
|
1709
|
-
<p>If you invoke the test runner (1) without any arguments or (2) with the <tt
|
1650
|
+
<p>If you invoke the test runner (1) without any arguments or (2) with the <tt>--tasks</tt> option, it will show you a list of tasks that it can perform for you.</p>
|
1710
1651
|
|
1711
1652
|
|
1712
1653
|
</div>
|
@@ -1751,7 +1692,6 @@ endmodule
|
|
1751
1692
|
</div>
|
1752
1693
|
|
1753
1694
|
</div>
|
1754
|
-
|
1755
1695
|
<div class="admonition">
|
1756
1696
|
|
1757
1697
|
<div class="important" id="important4">
|
@@ -1800,7 +1740,6 @@ Finished in 0.005628 seconds
|
|
1800
1740
|
</div>
|
1801
1741
|
|
1802
1742
|
</div>
|
1803
|
-
|
1804
1743
|
<div class="formal">
|
1805
1744
|
|
1806
1745
|
<div class="example" id="fig..test-design.unit-test">
|
@@ -1822,9 +1761,7 @@ Finished in 0.006766 seconds.
|
|
1822
1761
|
</div>
|
1823
1762
|
|
1824
1763
|
</div>
|
1825
|
-
|
1826
|
-
<p>In these examples, the <code class="code"><span style="color:#036; font-weight:bold">PROTOTYPE</span></code> environment variable is <em>not</em> 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 <code class="code"><span style="color:#036; font-weight:bold">PROTOTYPE</span></code>, or by using your shell’s <strong>unset</strong> command. Finally, the <a href="#setup.reqs"><span class="caps">GPL</span> Cver simulator</a>, denoted by <em>cver</em>, is used to run the simulation.</p>
|
1827
|
-
|
1764
|
+
In these examples, the <code class="code"><span style="color:#036; font-weight:bold">PROTOTYPE</span></code> environment variable is <em>not</em> 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 <code class="code"><span style="color:#036; font-weight:bold">PROTOTYPE</span></code>, or by using your shell’s <strong>unset</strong> command. Finally, the <a href="#setup.reqs"><span class="caps">GPL</span> Cver simulator</a>, denoted by <em>cver</em>, is used to run the simulation.
|
1828
1765
|
|
1829
1766
|
<div class="admonition">
|
1830
1767
|
|
@@ -1904,9 +1841,7 @@ Finished in 0.006766 seconds.
|
|
1904
1841
|
</div>
|
1905
1842
|
|
1906
1843
|
</div>
|
1907
|
-
|
1908
|
-
<p>If a “stack level too deep (SystemStackError)” error occurs during the simulation, then increase the system-resource limit for stack-size by running the <pre>ulimit -s unlimited</pre> command before starting the simulation.</p>
|
1909
|
-
|
1844
|
+
If a “stack level too deep (SystemStackError)” error occurs during the simulation, then increase the system-resource limit for stack-size by running the <pre>ulimit -s unlimited</pre> command before starting the simulation.
|
1910
1845
|
|
1911
1846
|
<h3 id="problems.ruby.xUnit">test/unit</h3>
|
1912
1847
|
|
@@ -1927,9 +1862,7 @@ Finished in 0.006766 seconds.
|
|
1927
1862
|
</div>
|
1928
1863
|
|
1929
1864
|
</div>
|
1930
|
-
|
1931
|
-
<p>If your specification employs Ruby’s unit testing framework, then you will encounter an error saying “[BUG] cross-thread violation on rb_gc()”.</p>
|
1932
|
-
|
1865
|
+
If your specification employs Ruby’s unit testing framework, then you will encounter an error saying “[BUG] cross-thread violation on rb_gc()”.
|
1933
1866
|
|
1934
1867
|
<h2 id="problem.ivl">Icarus Verilog</h2>
|
1935
1868
|
|
@@ -1995,7 +1928,6 @@ endmodule
|
|
1995
1928
|
</div>
|
1996
1929
|
|
1997
1930
|
</div>
|
1998
|
-
|
1999
1931
|
<div class="formal">
|
2000
1932
|
|
2001
1933
|
<div class="example" id="ex..TestFoo_fix">
|
@@ -2048,9 +1980,7 @@ endmodule
|
|
2048
1980
|
</div>
|
2049
1981
|
|
2050
1982
|
</div>
|
2051
|
-
|
2052
|
-
<p>Version 6.1b of Mentor Modelsim doesn’t play nicely with either an embedded Ruby interpreter or <span class="caps">POSIX</span> threads in a <span class="caps">PLI</span> application. When Ruby-VPI invokes the ruby_run function (which starts the Ruby interpreter), the simulator terminates immediately with an exit status of 0.</p>
|
2053
|
-
|
1983
|
+
Version 6.1b of Mentor Modelsim doesn’t play nicely with either an embedded Ruby interpreter or <span class="caps">POSIX</span> threads in a <span class="caps">PLI</span> application. When Ruby-VPI invokes the ruby_run function (which starts the Ruby interpreter), the simulator terminates immediately with an exit status of 0.
|
2054
1984
|
|
2055
1985
|
<h1 id="glossary">Glossary</h1>
|
2056
1986
|
|