ruby-vpi 11.1.1 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/generate_test.rb +12 -11
- data/bin/generate_test_tpl/bench.rb +0 -4
- data/bin/generate_test_tpl/bench.v +3 -6
- data/bin/generate_test_tpl/runner.rake +20 -4
- data/bin/generate_test_tpl/spec.rb +5 -7
- data/doc/common.css +110 -95
- data/doc/common.tpl +16 -17
- data/doc/history.html +350 -330
- data/doc/history.yml +49 -0
- data/doc/intro.inc +18 -4
- data/doc/lib/doc_proxy.rb +22 -32
- data/doc/manual.erb +90 -83
- data/doc/manual.html +298 -266
- data/doc/memo.html +31 -10
- data/doc/readme.html +26 -6
- data/ext/relay.c +24 -28
- data/ext/vlog.c +4 -15
- data/lib/ruby-vpi/rspec.rb +1 -1
- data/lib/ruby-vpi/runner.rb +12 -10
- data/lib/ruby-vpi/runner_proxy.rb +17 -6
- data/lib/ruby-vpi/verilog_parser.rb +11 -7
- data/lib/ruby-vpi/vpi.rb +11 -1
- data/lib/ruby-vpi.rb +4 -0
- data/ref/c/annotated.html +2 -2
- data/ref/c/common_8h.html +1 -1
- data/ref/c/files.html +1 -1
- data/ref/c/functions.html +1 -1
- data/ref/c/functions_vars.html +1 -1
- data/ref/c/globals.html +1 -1
- data/ref/c/globals_0x63.html +1 -1
- data/ref/c/globals_0x65.html +1 -1
- data/ref/c/globals_0x66.html +1 -1
- data/ref/c/globals_0x70.html +1 -1
- data/ref/c/globals_0x72.html +1 -1
- data/ref/c/globals_0x73.html +1 -1
- data/ref/c/globals_0x74.html +1 -1
- data/ref/c/globals_0x76.html +2 -2
- data/ref/c/globals_0x78.html +1 -1
- data/ref/c/globals_defs.html +1 -1
- data/ref/c/globals_defs_0x65.html +1 -1
- data/ref/c/globals_defs_0x70.html +1 -1
- data/ref/c/globals_defs_0x76.html +2 -2
- data/ref/c/globals_defs_0x78.html +1 -1
- data/ref/c/globals_enum.html +1 -1
- data/ref/c/globals_eval.html +1 -1
- data/ref/c/globals_func.html +2 -2
- data/ref/c/globals_type.html +1 -1
- data/ref/c/globals_vars.html +1 -1
- data/ref/c/index.html +1 -1
- data/ref/c/relay_8c.html +2 -1
- data/ref/c/relay_8h.html +1 -1
- data/ref/c/structrelay____RubyOptions____def.html +8 -2
- data/ref/c/structt__cb__data.html +1 -1
- data/ref/c/structt__vpi__delay.html +1 -1
- data/ref/c/structt__vpi__error__info.html +1 -1
- data/ref/c/structt__vpi__strengthval.html +1 -1
- data/ref/c/structt__vpi__systf__data.html +1 -1
- data/ref/c/structt__vpi__time.html +1 -1
- data/ref/c/structt__vpi__value.html +1 -1
- data/ref/c/structt__vpi__vecval.html +1 -1
- data/ref/c/structt__vpi__vlog__info.html +1 -1
- data/ref/c/swig_8c.html +1 -1
- data/ref/c/swig_8h.html +1 -1
- data/ref/c/verilog_8h.html +1 -1
- data/ref/c/vlog_8c.html +15 -15
- data/ref/c/vlog_8h.html +1 -1
- data/ref/c/vpi__user_8h.html +1 -1
- data/ref/ruby/classes/OutputInfo.html +1 -1
- data/ref/ruby/classes/OutputInfo.src/M000030.html +30 -30
- data/ref/ruby/classes/RDoc.html +5 -5
- data/ref/ruby/classes/RDoc.src/{M000097.html → M000099.html} +0 -0
- data/ref/ruby/classes/RubyVpi.src/M000085.html +43 -39
- data/ref/ruby/classes/String.src/M000033.html +26 -26
- data/ref/ruby/classes/String.src/M000034.html +4 -4
- data/ref/ruby/classes/Template.src/M000032.html +4 -4
- data/ref/ruby/classes/VerilogParser/Module/Parameter.src/M000011.html +5 -5
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000007.html +7 -7
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000008.html +4 -4
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000009.html +4 -4
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000010.html +4 -4
- data/ref/ruby/classes/VerilogParser/Module.src/M000006.html +15 -11
- data/ref/ruby/classes/Vpi/Handle/Property.html +5 -5
- data/ref/ruby/classes/Vpi/Handle/Property.src/{M000096.html → M000098.html} +61 -61
- data/ref/ruby/classes/Vpi/Handle.html +78 -43
- data/ref/ruby/classes/Vpi/Handle.src/M000088.html +3 -3
- data/ref/ruby/classes/Vpi/Handle.src/M000089.html +4 -8
- data/ref/ruby/classes/Vpi/Handle.src/M000090.html +5 -31
- data/ref/ruby/classes/Vpi/Handle.src/M000091.html +9 -74
- data/ref/ruby/classes/Vpi/Handle.src/M000092.html +31 -17
- data/ref/ruby/classes/Vpi/Handle.src/M000093.html +74 -11
- data/ref/ruby/classes/Vpi/Handle.src/M000094.html +30 -0
- data/ref/ruby/classes/Vpi/Handle.src/M000095.html +11 -55
- data/ref/ruby/classes/Vpi/Handle.src/M000097.html +68 -0
- data/ref/ruby/created.rid +1 -1
- data/ref/ruby/files/bin/generate_test_rb.html +8 -11
- data/ref/ruby/files/bin/generate_test_rb.src/M000001.html +4 -4
- data/ref/ruby/files/bin/generate_test_rb.src/M000002.html +22 -24
- data/ref/ruby/files/bin/header_to_ruby_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/float_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/integer_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/rspec_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/runner_proxy_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/runner_rb.html +2 -2
- data/ref/ruby/files/lib/ruby-vpi/runner_rb.src/M000003.html +10 -10
- data/ref/ruby/files/lib/ruby-vpi/runner_rb.src/M000004.html +12 -12
- data/ref/ruby/files/lib/ruby-vpi/verilog_parser_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/vpi_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi_rb.html +2 -1
- data/ref/ruby/fr_method_index.html +20 -18
- data/samp/counter/counter_rspec_bench.v +3 -6
- data/samp/counter/counter_rspec_design.rb +2 -1
- data/samp/counter/counter_rspec_runner.rake +20 -4
- data/samp/counter/counter_rspec_spec.rb +4 -4
- data/samp/counter/counter_xunit_bench.v +3 -6
- data/samp/counter/counter_xunit_design.rb +2 -1
- data/samp/counter/counter_xunit_runner.rake +20 -4
- data/samp/pipelined_alu/hw5_unit_test_bench.v +3 -6
- data/samp/pipelined_alu/hw5_unit_test_runner.rake +20 -4
- metadata +21 -20
- data/doc/manual.rb +0 -5
|
@@ -33,46 +33,50 @@
|
|
|
33
33
|
48: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:rSpec</span>
|
|
34
34
|
49: <span class="ruby-constant">ARGV</span>.<span class="ruby-identifier">concat</span> <span class="ruby-node">%w[-f s]</span>
|
|
35
35
|
50: <span class="ruby-identifier">require</span> <span class="ruby-value str">'ruby-vpi/rspec'</span>
|
|
36
|
-
51:
|
|
37
|
-
52:
|
|
38
|
-
53:
|
|
39
|
-
54:
|
|
40
|
-
55:
|
|
41
|
-
56:
|
|
42
|
-
57:
|
|
43
|
-
58:
|
|
36
|
+
51:
|
|
37
|
+
52: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:tSpec</span>
|
|
38
|
+
53: <span class="ruby-constant">ARGV</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">'-rs'</span>
|
|
39
|
+
54: <span class="ruby-identifier">require</span> <span class="ruby-value str">'test/spec'</span>
|
|
40
|
+
55: <span class="ruby-keyword kw">end</span>
|
|
41
|
+
56:
|
|
42
|
+
57: <span class="ruby-comment cmt"># service the $ruby_init() task</span>
|
|
43
|
+
58: <span class="ruby-identifier">relay_verilog</span>
|
|
44
44
|
59:
|
|
45
|
-
60:
|
|
46
|
-
61:
|
|
47
|
-
62:
|
|
48
|
-
63:
|
|
49
|
-
64:
|
|
50
|
-
65:
|
|
51
|
-
66:
|
|
52
|
-
67:
|
|
53
|
-
68:
|
|
54
|
-
69:
|
|
55
|
-
70:
|
|
56
|
-
71:
|
|
57
|
-
72:
|
|
58
|
-
73: <span class="ruby-
|
|
59
|
-
74:
|
|
60
|
-
75:
|
|
61
|
-
76:
|
|
62
|
-
77: <span class="ruby-
|
|
63
|
-
78:
|
|
45
|
+
60: <span class="ruby-comment cmt"># set up code coverage analysis</span>
|
|
46
|
+
61: <span class="ruby-keyword kw">unless</span> (<span class="ruby-constant">ENV</span>[<span class="ruby-value str">'COVERAGE'</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">''</span>).<span class="ruby-identifier">empty?</span>
|
|
47
|
+
62: <span class="ruby-identifier">require</span> <span class="ruby-value str">'ruby-vpi/rcov'</span>
|
|
48
|
+
63:
|
|
49
|
+
64: <span class="ruby-constant">RubyVpi</span>.<span class="ruby-identifier">with_coverage_analysis</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
|
|
50
|
+
65: <span class="ruby-identifier">a</span>.<span class="ruby-identifier">dump_coverage_info</span> [
|
|
51
|
+
66: <span class="ruby-constant">Rcov</span><span class="ruby-operator">::</span><span class="ruby-constant">TextReport</span>.<span class="ruby-identifier">new</span>,
|
|
52
|
+
67: <span class="ruby-constant">Rcov</span><span class="ruby-operator">::</span><span class="ruby-constant">HTMLCoverage</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">:destdir</span> =<span class="ruby-operator">></span> <span class="ruby-node">"#{testName}_coverage"</span>)
|
|
53
|
+
68: ]
|
|
54
|
+
69: <span class="ruby-keyword kw">end</span>
|
|
55
|
+
70: <span class="ruby-keyword kw">end</span>
|
|
56
|
+
71:
|
|
57
|
+
72: <span class="ruby-comment cmt"># load the design under test</span>
|
|
58
|
+
73: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">design</span> = <span class="ruby-identifier">vpi_handle_by_name</span>(<span class="ruby-node">"#{testName}_bench"</span>, <span class="ruby-keyword kw">nil</span>)
|
|
59
|
+
74: <span class="ruby-identifier">raise</span> <span class="ruby-node">"Verilog bench for test #{testName.inspect} is inaccessible."</span>
|
|
60
|
+
75: <span class="ruby-keyword kw">end</span>
|
|
61
|
+
76:
|
|
62
|
+
77: <span class="ruby-constant">Kernel</span>.<span class="ruby-identifier">const_set</span>(<span class="ruby-identifier">aDesignId</span>, <span class="ruby-identifier">design</span>)
|
|
63
|
+
78: <span class="ruby-identifier">require</span> <span class="ruby-node">"#{testName}_design.rb"</span>
|
|
64
64
|
79:
|
|
65
|
-
80:
|
|
66
|
-
81:
|
|
67
|
-
82:
|
|
68
|
-
83:
|
|
69
|
-
84: <span class="ruby-keyword kw">
|
|
70
|
-
85:
|
|
71
|
-
86:
|
|
72
|
-
87:
|
|
73
|
-
88:
|
|
74
|
-
89:
|
|
75
|
-
90:
|
|
76
|
-
91:
|
|
65
|
+
80: <span class="ruby-comment cmt"># load the design's prototype</span>
|
|
66
|
+
81: <span class="ruby-keyword kw">unless</span> (<span class="ruby-constant">ENV</span>[<span class="ruby-value str">'PROTOTYPE'</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">''</span>).<span class="ruby-identifier">empty?</span>
|
|
67
|
+
82: <span class="ruby-identifier">require</span> <span class="ruby-node">"#{testName}_proto.rb"</span>
|
|
68
|
+
83:
|
|
69
|
+
84: <span class="ruby-constant">Vpi</span>.<span class="ruby-identifier">class_eval</span> <span class="ruby-keyword kw">do</span>
|
|
70
|
+
85: <span class="ruby-identifier">define_method</span> <span class="ruby-identifier">:relay_verilog</span> <span class="ruby-keyword kw">do</span>
|
|
71
|
+
86: <span class="ruby-identifier">design</span>.<span class="ruby-identifier">simulate!</span>
|
|
72
|
+
87: <span class="ruby-keyword kw">end</span>
|
|
73
|
+
88: <span class="ruby-keyword kw">end</span>
|
|
74
|
+
89:
|
|
75
|
+
90: <span class="ruby-identifier">puts</span> <span class="ruby-node">"#{Config::PROJECT_NAME}: prototype has been enabled for test #{testName.inspect}"</span>
|
|
76
|
+
91: <span class="ruby-keyword kw">end</span>
|
|
77
|
+
92:
|
|
78
|
+
93: <span class="ruby-comment cmt"># load the design's specification</span>
|
|
79
|
+
94: <span class="ruby-identifier">require</span> <span class="ruby-node">"#{testName}_spec.rb"</span>
|
|
80
|
+
95: <span class="ruby-keyword kw">end</span></pre>
|
|
77
81
|
</body>
|
|
78
82
|
</html>
|
|
@@ -10,32 +10,32 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/verilog_parser.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
115:
|
|
26
|
-
116: <span class="ruby-identifier">content</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{`define\s+(\w+)\s+(.+)}</span> <span class="ruby-keyword kw">do</span>
|
|
27
|
-
117: <span class="ruby-node">"#{$1.to_ruby_const_name} = #{$2}"</span>
|
|
28
|
-
118: <span class="ruby-keyword kw">end</span>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/verilog_parser.rb, line 108</span>
|
|
14
|
+
108: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">verilog_to_ruby</span>
|
|
15
|
+
109: <span class="ruby-identifier">content</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dup</span>
|
|
16
|
+
110:
|
|
17
|
+
111: <span class="ruby-comment cmt"># single-line comments</span>
|
|
18
|
+
112: <span class="ruby-identifier">content</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{//(.*)$}</span>, <span class="ruby-value str">'#\1'</span>
|
|
19
|
+
113:
|
|
20
|
+
114: <span class="ruby-comment cmt"># multi-line comments</span>
|
|
21
|
+
115: <span class="ruby-identifier">content</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{/\*.*?\*/}</span><span class="ruby-identifier">m</span>, <span class="ruby-value str">"\n=begin\n\\0\n=end\n"</span>
|
|
22
|
+
116:
|
|
23
|
+
117: <span class="ruby-comment cmt"># preprocessor directives</span>
|
|
24
|
+
118: <span class="ruby-identifier">content</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{`include}</span>, <span class="ruby-value str">'#\0'</span>
|
|
29
25
|
119:
|
|
30
|
-
120: <span class="ruby-identifier">content</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{
|
|
31
|
-
121:
|
|
32
|
-
122:
|
|
33
|
-
123:
|
|
34
|
-
124:
|
|
35
|
-
125:
|
|
36
|
-
126:
|
|
37
|
-
127:
|
|
38
|
-
128:
|
|
39
|
-
129:
|
|
26
|
+
120: <span class="ruby-identifier">content</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{`define\s+(\w+)\s+(.+)}</span> <span class="ruby-keyword kw">do</span>
|
|
27
|
+
121: <span class="ruby-node">"#{$1.to_ruby_const_name} = #{$2}"</span>
|
|
28
|
+
122: <span class="ruby-keyword kw">end</span>
|
|
29
|
+
123:
|
|
30
|
+
124: <span class="ruby-identifier">content</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{`+}</span>, <span class="ruby-value str">''</span>
|
|
31
|
+
125:
|
|
32
|
+
126: <span class="ruby-comment cmt"># numbers</span>
|
|
33
|
+
127: <span class="ruby-identifier">content</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{\d*\'([dohb]\w+)}</span>, <span class="ruby-value str">'0\1'</span>
|
|
34
|
+
128:
|
|
35
|
+
129: <span class="ruby-comment cmt"># ranges</span>
|
|
36
|
+
130: <span class="ruby-identifier">content</span>.<span class="ruby-identifier">gsub!</span> <span class="ruby-regexp re">%r{(\S)\s*:\s*(\S)}</span>, <span class="ruby-value str">'\1..\2'</span>
|
|
37
|
+
131:
|
|
38
|
+
132: <span class="ruby-identifier">content</span>
|
|
39
|
+
133: <span class="ruby-keyword kw">end</span></pre>
|
|
40
40
|
</body>
|
|
41
41
|
</html>
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/verilog_parser.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/verilog_parser.rb, line 136</span>
|
|
14
|
+
136: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_ruby_const_name</span>
|
|
15
|
+
137: <span class="ruby-keyword kw">self</span>[<span class="ruby-value">0</span>, <span class="ruby-value">1</span>].<span class="ruby-identifier">upcase</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
|
|
16
|
+
138: <span class="ruby-keyword kw">end</span></pre>
|
|
17
17
|
</body>
|
|
18
18
|
</html>
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File bin/generate_test.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File bin/generate_test.rb, line 78</span>
|
|
14
|
+
78: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">aName</span>
|
|
15
|
+
79: <span class="ruby-keyword kw">super</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">TEMPLATE_PATH</span>, <span class="ruby-identifier">aName</span>))
|
|
16
|
+
80: <span class="ruby-keyword kw">end</span></pre>
|
|
17
17
|
</body>
|
|
18
18
|
</html>
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/verilog_parser.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/verilog_parser.rb, line 75</span>
|
|
14
|
+
75: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">aDecl</span>
|
|
15
|
+
76: <span class="ruby-ivar">@decl</span> = <span class="ruby-identifier">aDecl</span>.<span class="ruby-identifier">strip</span>
|
|
16
|
+
77: <span class="ruby-ivar">@name</span>, <span class="ruby-ivar">@value</span> = <span class="ruby-ivar">@decl</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">'='</span>).<span class="ruby-identifier">map!</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">strip</span>}
|
|
17
|
+
78: <span class="ruby-keyword kw">end</span></pre>
|
|
18
18
|
</body>
|
|
19
19
|
</html>
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/verilog_parser.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/verilog_parser.rb, line 84</span>
|
|
14
|
+
84: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">aDecl</span>
|
|
15
|
+
85: <span class="ruby-ivar">@decl</span> = <span class="ruby-identifier">aDecl</span>.<span class="ruby-identifier">strip</span>
|
|
16
|
+
86:
|
|
17
|
+
87: <span class="ruby-ivar">@decl</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/(\[.*?\])?\s*(\w+)$/</span>
|
|
18
|
+
88: <span class="ruby-ivar">@size</span>, <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">$1</span>, <span class="ruby-identifier">$2</span>
|
|
19
|
+
89: <span class="ruby-keyword kw">end</span></pre>
|
|
20
20
|
</body>
|
|
21
21
|
</html>
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/verilog_parser.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/verilog_parser.rb, line 91</span>
|
|
14
|
+
91: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">input?</span>
|
|
15
|
+
92: <span class="ruby-ivar">@decl</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\binput\b/</span>
|
|
16
|
+
93: <span class="ruby-keyword kw">end</span></pre>
|
|
17
17
|
</body>
|
|
18
18
|
</html>
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/verilog_parser.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/verilog_parser.rb, line 95</span>
|
|
14
|
+
95: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">output?</span>
|
|
15
|
+
96: <span class="ruby-ivar">@decl</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\boutput\b/</span>
|
|
16
|
+
97: <span class="ruby-keyword kw">end</span></pre>
|
|
17
17
|
</body>
|
|
18
18
|
</html>
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/verilog_parser.rb, line 99</span>
|
|
14
|
+
99: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reg?</span>
|
|
15
|
+
100: <span class="ruby-ivar">@decl</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\breg\b/</span>
|
|
16
|
+
101: <span class="ruby-keyword kw">end</span></pre>
|
|
17
17
|
</body>
|
|
18
18
|
</html>
|
|
@@ -14,17 +14,21 @@
|
|
|
14
14
|
52: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">aDecl</span>
|
|
15
15
|
53: <span class="ruby-ivar">@decl</span> = <span class="ruby-identifier">aDecl</span>.<span class="ruby-identifier">strip</span>
|
|
16
16
|
54:
|
|
17
|
-
55: <span class="ruby-ivar">@decl</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">%r{module\s+(\w+)\s*(
|
|
18
|
-
56: <span class="ruby-ivar">@name</span>, <span class="ruby-identifier">paramDecls</span>, <span class="ruby-identifier">portDecls</span> = <span class="ruby-identifier">$1</span>, <span class="ruby-identifier">$
|
|
17
|
+
55: <span class="ruby-ivar">@decl</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">%r{module\s+(\w+)\s*(?:\#\((.*?)\))?\s*\((.*?)\)\s*;}</span><span class="ruby-identifier">m</span>
|
|
18
|
+
56: <span class="ruby-ivar">@name</span>, <span class="ruby-identifier">paramDecls</span>, <span class="ruby-identifier">portDecls</span> = <span class="ruby-identifier">$1</span>, <span class="ruby-identifier">$2</span>, <span class="ruby-identifier">$3</span>
|
|
19
19
|
57:
|
|
20
|
-
58: <span class="ruby-
|
|
21
|
-
59:
|
|
22
|
-
60:
|
|
23
|
-
61:
|
|
24
|
-
62:
|
|
25
|
-
63:
|
|
26
|
-
64:
|
|
27
|
-
65:
|
|
28
|
-
66:
|
|
20
|
+
58: <span class="ruby-ivar">@parameters</span> =
|
|
21
|
+
59: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">paramDecls</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">%r{\bparameter\b(.*)$}</span>
|
|
22
|
+
60: <span class="ruby-identifier">$1</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">','</span>).<span class="ruby-identifier">map!</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">decl</span><span class="ruby-operator">|</span>
|
|
23
|
+
61: <span class="ruby-constant">Parameter</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">decl</span>
|
|
24
|
+
62: <span class="ruby-keyword kw">end</span>
|
|
25
|
+
63: <span class="ruby-keyword kw">else</span>
|
|
26
|
+
64: []
|
|
27
|
+
65: <span class="ruby-keyword kw">end</span>
|
|
28
|
+
66:
|
|
29
|
+
67: <span class="ruby-ivar">@ports</span> = <span class="ruby-identifier">portDecls</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">','</span>).<span class="ruby-identifier">map!</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">decl</span><span class="ruby-operator">|</span>
|
|
30
|
+
68: <span class="ruby-constant">Port</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">decl</span>
|
|
31
|
+
69: <span class="ruby-keyword kw">end</span>
|
|
32
|
+
70: <span class="ruby-keyword kw">end</span></pre>
|
|
29
33
|
</body>
|
|
30
34
|
</html>
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
<h3 class="section-bar">Methods</h3>
|
|
77
77
|
|
|
78
78
|
<div class="name-list">
|
|
79
|
-
<a href="#
|
|
79
|
+
<a href="#M000098">resolve</a>
|
|
80
80
|
</div>
|
|
81
81
|
</div>
|
|
82
82
|
|
|
@@ -98,12 +98,12 @@
|
|
|
98
98
|
<div id="methods">
|
|
99
99
|
<h3 class="section-bar">Public Class methods</h3>
|
|
100
100
|
|
|
101
|
-
<div id="method-
|
|
102
|
-
<a name="
|
|
101
|
+
<div id="method-M000098" class="method-detail">
|
|
102
|
+
<a name="M000098"></a>
|
|
103
103
|
|
|
104
104
|
<div class="method-heading">
|
|
105
|
-
<a href="Property.src/
|
|
106
|
-
onclick="popupCode('Property.src/
|
|
105
|
+
<a href="Property.src/M000098.html" target="Code" class="method-signature"
|
|
106
|
+
onclick="popupCode('Property.src/M000098.html');return false;">
|
|
107
107
|
<span class="method-name">resolve</span><span class="method-args">(aName)</span>
|
|
108
108
|
</a>
|
|
109
109
|
</div>
|
|
@@ -10,71 +10,71 @@
|
|
|
10
10
|
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
11
|
</head>
|
|
12
12
|
<body class="standalone-code">
|
|
13
|
-
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
274:
|
|
19
|
-
275: <span class="ruby-identifier">tokens</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp re">/[\?!=]$/</span>, <span class="ruby-value str">''</span>)
|
|
20
|
-
276:
|
|
21
|
-
277: <span class="ruby-identifier">addendum</span> = <span class="ruby-identifier">$&</span>
|
|
22
|
-
278: <span class="ruby-identifier">isAssign</span> = <span class="ruby-identifier">$&</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'='</span>
|
|
23
|
-
279: <span class="ruby-identifier">isQuery</span> = <span class="ruby-identifier">$&</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'?'</span>
|
|
24
|
-
280:
|
|
25
|
-
281:
|
|
26
|
-
282: <span class="ruby-identifier">tokens</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^[a-z]$/</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">tokens</span>.<span class="ruby-identifier">pop</span>
|
|
27
|
-
283: <span class="ruby-identifier">accessor</span> = <span class="ruby-identifier">$&</span>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 280</span>
|
|
14
|
+
280: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Property</span>.<span class="ruby-identifier">resolve</span> <span class="ruby-identifier">aName</span>
|
|
15
|
+
281: <span class="ruby-comment cmt"># parse the given property name</span>
|
|
16
|
+
282: <span class="ruby-identifier">tokens</span> = <span class="ruby-identifier">aName</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">/_/</span>)
|
|
17
|
+
283:
|
|
28
18
|
284:
|
|
29
|
-
285: <span class="ruby-identifier">
|
|
19
|
+
285: <span class="ruby-identifier">tokens</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp re">/[\?!=]$/</span>, <span class="ruby-value str">''</span>)
|
|
30
20
|
286:
|
|
31
|
-
287: <span class="ruby-identifier">
|
|
32
|
-
288:
|
|
33
|
-
289:
|
|
34
|
-
290:
|
|
21
|
+
287: <span class="ruby-identifier">addendum</span> = <span class="ruby-identifier">$&</span>
|
|
22
|
+
288: <span class="ruby-identifier">isAssign</span> = <span class="ruby-identifier">$&</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'='</span>
|
|
23
|
+
289: <span class="ruby-identifier">isQuery</span> = <span class="ruby-identifier">$&</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'?'</span>
|
|
24
|
+
290:
|
|
35
25
|
291:
|
|
36
|
-
292:
|
|
37
|
-
293: <span class="ruby-identifier">
|
|
38
|
-
294:
|
|
39
|
-
295:
|
|
40
|
-
296:
|
|
41
|
-
297:
|
|
42
|
-
298:
|
|
43
|
-
299:
|
|
44
|
-
300:
|
|
26
|
+
292: <span class="ruby-identifier">tokens</span>.<span class="ruby-identifier">last</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^[a-z]$/</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">tokens</span>.<span class="ruby-identifier">pop</span>
|
|
27
|
+
293: <span class="ruby-identifier">accessor</span> = <span class="ruby-identifier">$&</span>
|
|
28
|
+
294:
|
|
29
|
+
295: <span class="ruby-identifier">name</span> = <span class="ruby-identifier">tokens</span>.<span class="ruby-identifier">pop</span>
|
|
30
|
+
296:
|
|
31
|
+
297: <span class="ruby-identifier">operation</span> =
|
|
32
|
+
298: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">tokens</span>.<span class="ruby-identifier">empty?</span>
|
|
33
|
+
299: <span class="ruby-identifier">tokens</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">'_'</span>) <span class="ruby-operator"><<</span> (<span class="ruby-identifier">addendum</span> <span class="ruby-operator">||</span> <span class="ruby-value str">''</span>)
|
|
34
|
+
300: <span class="ruby-keyword kw">end</span>
|
|
45
35
|
301:
|
|
46
|
-
302: <span class="ruby-
|
|
47
|
-
303: <span class="ruby-
|
|
48
|
-
304:
|
|
36
|
+
302: <span class="ruby-comment cmt"># determine the VPI integer type for the property</span>
|
|
37
|
+
303: <span class="ruby-identifier">name</span> = <span class="ruby-identifier">name</span>[<span class="ruby-value">0</span>, <span class="ruby-value">1</span>].<span class="ruby-identifier">upcase</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">name</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
|
|
38
|
+
304: <span class="ruby-identifier">name</span>.<span class="ruby-identifier">insert</span> <span class="ruby-value">0</span>, <span class="ruby-value str">'Vpi'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">name</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^[Vv]pi/</span>
|
|
49
39
|
305:
|
|
50
|
-
306: <span class="ruby-keyword kw">
|
|
51
|
-
307: <span class="ruby-
|
|
52
|
-
308:
|
|
53
|
-
309:
|
|
54
|
-
310:
|
|
55
|
-
311:
|
|
56
|
-
312:
|
|
57
|
-
313:
|
|
58
|
-
314:
|
|
59
|
-
315:
|
|
60
|
-
316:
|
|
61
|
-
317:
|
|
62
|
-
318:
|
|
63
|
-
319:
|
|
64
|
-
320:
|
|
65
|
-
321:
|
|
66
|
-
322:
|
|
67
|
-
323:
|
|
68
|
-
324:
|
|
69
|
-
325:
|
|
70
|
-
326:
|
|
71
|
-
327:
|
|
72
|
-
328:
|
|
73
|
-
329:
|
|
74
|
-
330:
|
|
75
|
-
331:
|
|
76
|
-
332:
|
|
77
|
-
333:
|
|
78
|
-
334:
|
|
40
|
+
306: <span class="ruby-keyword kw">begin</span>
|
|
41
|
+
307: <span class="ruby-identifier">type</span> = <span class="ruby-constant">Vpi</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">name</span>)
|
|
42
|
+
308: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">NameError</span>
|
|
43
|
+
309: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">"#{name.inspect} is not a valid VPI property"</span>
|
|
44
|
+
310: <span class="ruby-keyword kw">end</span>
|
|
45
|
+
311:
|
|
46
|
+
312: <span class="ruby-identifier">accessor</span> =
|
|
47
|
+
313: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">accessor</span>
|
|
48
|
+
314: <span class="ruby-identifier">accessor</span>.<span class="ruby-identifier">to_sym</span>
|
|
49
|
+
315:
|
|
50
|
+
316: <span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># infer accessor from VPI property name</span>
|
|
51
|
+
317: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">isQuery</span>
|
|
52
|
+
318: <span class="ruby-identifier">:b</span>
|
|
53
|
+
319:
|
|
54
|
+
320: <span class="ruby-keyword kw">else</span>
|
|
55
|
+
321: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">name</span>
|
|
56
|
+
322: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/Time$/</span>
|
|
57
|
+
323: <span class="ruby-identifier">:d</span>
|
|
58
|
+
324:
|
|
59
|
+
325: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/Val$/</span>
|
|
60
|
+
326: <span class="ruby-identifier">:l</span>
|
|
61
|
+
327:
|
|
62
|
+
328: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/Type$/</span>, <span class="ruby-regexp re">/Direction$/</span>, <span class="ruby-regexp re">/Index$/</span>, <span class="ruby-regexp re">/Size$/</span>, <span class="ruby-regexp re">/Strength\d?$/</span>, <span class="ruby-regexp re">/Polarity$/</span>, <span class="ruby-regexp re">/Edge$/</span>, <span class="ruby-regexp re">/Offset$/</span>, <span class="ruby-regexp re">/Mode$/</span>, <span class="ruby-regexp re">/LineNo$/</span>
|
|
63
|
+
329: <span class="ruby-identifier">:i</span>
|
|
64
|
+
330:
|
|
65
|
+
331: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/Is[A-Z]/</span>, <span class="ruby-regexp re">/ed$/</span>
|
|
66
|
+
332: <span class="ruby-identifier">:b</span>
|
|
67
|
+
333:
|
|
68
|
+
334: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/Name$/</span>, <span class="ruby-regexp re">/File$/</span>, <span class="ruby-regexp re">/Decompile$/</span>
|
|
69
|
+
335: <span class="ruby-identifier">:s</span>
|
|
70
|
+
336:
|
|
71
|
+
337: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/Parent$/</span>, <span class="ruby-regexp re">/Inst$/</span>, <span class="ruby-regexp re">/Range$/</span>, <span class="ruby-regexp re">/Driver$/</span>, <span class="ruby-regexp re">/Net$/</span>, <span class="ruby-regexp re">/Load$/</span>, <span class="ruby-regexp re">/Conn$/</span>, <span class="ruby-regexp re">/Bit$/</span>, <span class="ruby-regexp re">/Word$/</span>, <span class="ruby-regexp re">/[LR]hs$/</span>, <span class="ruby-regexp re">/(In|Out)$/</span>, <span class="ruby-regexp re">/Term$/</span>, <span class="ruby-regexp re">/Argument$/</span>, <span class="ruby-regexp re">/Condition$/</span>, <span class="ruby-regexp re">/Use$/</span>, <span class="ruby-regexp re">/Operand$/</span>, <span class="ruby-regexp re">/Stmt$/</span>, <span class="ruby-regexp re">/Expr$/</span>, <span class="ruby-regexp re">/Scope$/</span>, <span class="ruby-regexp re">/Memory$/</span>, <span class="ruby-regexp re">/Delay$/</span>
|
|
72
|
+
338: <span class="ruby-identifier">:h</span>
|
|
73
|
+
339: <span class="ruby-keyword kw">end</span>
|
|
74
|
+
340: <span class="ruby-keyword kw">end</span>
|
|
75
|
+
341: <span class="ruby-keyword kw">end</span>
|
|
76
|
+
342:
|
|
77
|
+
343: <span class="ruby-constant">Property</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">type</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">operation</span>, <span class="ruby-identifier">accessor</span>, <span class="ruby-identifier">isAssign</span>
|
|
78
|
+
344: <span class="ruby-keyword kw">end</span></pre>
|
|
79
79
|
</body>
|
|
80
80
|
</html>
|