ruby-vpi 16.0.1 → 17.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/LICENSE +19 -19
- data/README +1 -1
- data/Rakefile +35 -32
- data/bin/convert.rb +28 -0
- data/bin/generate/design.rb +16 -0
- data/bin/generate/proto.rb +13 -0
- data/bin/generate/runner.rake +33 -0
- data/bin/generate/spec.rb +45 -0
- data/bin/generate.rb +177 -0
- data/bin/ruby-vpi +56 -0
- data/doc/Rakefile +20 -4
- data/doc/common.css +92 -33
- data/doc/common.inc +13 -0
- data/doc/common.tpl +42 -28
- data/doc/history.doc +11 -11
- data/doc/history.html +769 -248
- data/doc/history.inc +909 -0
- data/doc/history.rb +9 -0
- data/doc/history.yaml +69 -0
- data/doc/intro.inc +170 -178
- data/doc/lib/doc_format.rb +57 -144
- data/doc/lib/doc_proxy.rb +504 -88
- data/doc/lib/erb_content.rb +8 -8
- data/doc/lib/erb_proxy.rb +17 -17
- data/doc/manual.doc +626 -777
- data/doc/manual.html +1541 -1031
- data/doc/memo.doc +38 -36
- data/doc/memo.html +64 -28
- data/doc/readme.doc +4 -31
- data/doc/readme.html +221 -163
- data/doc/rss.erb +1 -1
- data/doc/rss.xml +73 -1761
- data/ext/Rakefile +6 -5
- data/ext/main.c +17 -15
- data/ext/relay.c +4 -7
- data/ext/relay.h +2 -2
- data/ext/swig_vpi.h +2 -2
- data/ext/swig_vpi.i +1 -2
- data/ext/swig_wrap.cin +12 -16
- data/ext/vlog.c +5 -5
- data/ext/vlog.h +2 -2
- data/lib/ruby-vpi/erb.rb +3 -3
- data/lib/ruby-vpi/float.rb +2 -2
- data/lib/ruby-vpi/rcov.rb +5 -7
- data/lib/ruby-vpi/runner.rb +43 -41
- data/lib/ruby-vpi/runner_boot_loader.rb +117 -0
- data/lib/ruby-vpi/runner_proxy.rb +6 -8
- data/lib/ruby-vpi/util.rb +10 -0
- data/lib/ruby-vpi/verilog_parser.rb +28 -56
- data/lib/ruby-vpi/vpi.rb +168 -123
- data/lib/ruby-vpi.rb +22 -143
- data/ref/c/annotated.html +1 -1
- 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_0x6d.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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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/main_8c.html +1 -1
- data/ref/c/main_8h.html +1 -1
- data/ref/c/relay_8c.html +1 -1
- data/ref/c/relay_8h.html +1 -1
- 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/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 +1 -1
- data/ref/ruby/classes/ERB.html +5 -5
- data/ref/ruby/classes/ERB.src/{M000024.html → M000026.html} +0 -0
- data/ref/ruby/classes/FileUtils.html +11 -11
- data/ref/ruby/classes/FileUtils.src/{M000025.html → M000027.html} +0 -0
- data/ref/ruby/classes/FileUtils.src/{M000026.html → M000028.html} +0 -0
- data/ref/ruby/classes/Float.html +6 -6
- data/ref/ruby/classes/Float.src/{M000020.html → M000021.html} +0 -0
- data/ref/ruby/classes/Integer.html +65 -65
- data/ref/ruby/classes/Integer.src/M000009.html +12 -5
- data/ref/ruby/classes/Integer.src/M000010.html +5 -5
- data/ref/ruby/classes/Integer.src/M000011.html +5 -5
- data/ref/ruby/classes/Integer.src/M000012.html +5 -5
- data/ref/ruby/classes/Integer.src/M000013.html +5 -5
- data/ref/ruby/classes/Integer.src/M000014.html +18 -0
- data/ref/ruby/classes/Integer.src/M000017.html +12 -18
- data/ref/ruby/classes/Integer.src/M000018.html +18 -12
- data/ref/ruby/classes/Integer.src/M000019.html +12 -17
- data/ref/ruby/classes/Integer.src/M000020.html +30 -0
- data/ref/ruby/classes/RDoc.html +5 -5
- data/ref/ruby/classes/RDoc.src/{M000053.html → M000058.html} +0 -0
- data/ref/ruby/classes/{RubyVpi/Config.html → RubyVPI.html} +20 -6
- data/ref/ruby/classes/String.html +34 -15
- data/ref/ruby/classes/String.src/M000022.html +5 -28
- data/ref/ruby/classes/String.src/M000023.html +5 -5
- data/ref/ruby/classes/String.src/{M000021.html → M000024.html} +0 -0
- data/ref/ruby/classes/String.src/M000025.html +41 -0
- data/ref/ruby/classes/VerilogParser/Module/Port.html +16 -36
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000006.html +10 -5
- data/ref/ruby/classes/VerilogParser/Module/Port.src/{M000004.html → M000007.html} +4 -4
- data/ref/ruby/classes/VerilogParser/Module/Port.src/{M000005.html → M000008.html} +4 -4
- data/ref/ruby/classes/VerilogParser/Module.html +28 -9
- data/ref/ruby/classes/VerilogParser/Module.src/M000005.html +29 -0
- data/ref/ruby/classes/VerilogParser.html +5 -39
- data/ref/ruby/classes/VerilogParser.src/M000004.html +26 -0
- data/ref/ruby/classes/Vpi/Handle.html +179 -77
- data/ref/ruby/classes/Vpi/Handle.src/M000035.html +18 -0
- data/ref/ruby/classes/Vpi/Handle.src/M000036.html +5 -5
- data/ref/ruby/classes/Vpi/Handle.src/M000037.html +5 -5
- data/ref/ruby/classes/Vpi/Handle.src/M000038.html +5 -5
- data/ref/ruby/classes/Vpi/Handle.src/M000039.html +5 -5
- data/ref/ruby/classes/Vpi/Handle.src/M000040.html +5 -8
- data/ref/ruby/classes/Vpi/Handle.src/M000041.html +5 -8
- data/ref/ruby/classes/Vpi/Handle.src/M000042.html +5 -9
- data/ref/ruby/classes/Vpi/Handle.src/M000043.html +8 -31
- data/ref/ruby/classes/Vpi/Handle.src/M000044.html +8 -74
- data/ref/ruby/classes/Vpi/Handle.src/M000045.html +9 -17
- data/ref/ruby/classes/Vpi/Handle.src/M000046.html +31 -11
- data/ref/ruby/classes/Vpi/Handle.src/M000047.html +86 -0
- data/ref/ruby/classes/Vpi/Handle.src/M000048.html +17 -18
- data/ref/ruby/classes/Vpi/Handle.src/M000050.html +18 -0
- data/ref/ruby/classes/Vpi/Handle.src/M000051.html +24 -0
- data/ref/ruby/classes/Vpi/Handle.src/M000053.html +31 -0
- data/ref/ruby/classes/Vpi/Handle.src/M000054.html +89 -0
- data/ref/ruby/classes/Vpi/S_vpi_time.html +16 -16
- data/ref/ruby/classes/Vpi/S_vpi_time.src/{M000050.html → M000055.html} +4 -4
- data/ref/ruby/classes/Vpi/S_vpi_time.src/{M000051.html → M000056.html} +5 -5
- data/ref/ruby/classes/Vpi/S_vpi_value.html +15 -15
- data/ref/ruby/classes/Vpi/S_vpi_value.src/{M000035.html → M000032.html} +5 -5
- data/ref/ruby/classes/Vpi/S_vpi_value.src/M000033.html +5 -5
- data/ref/ruby/classes/Vpi/S_vpi_value.src/M000034.html +5 -5
- data/ref/ruby/classes/Vpi.html +6 -42
- data/ref/ruby/classes/Vpi.src/M000029.html +15 -5
- data/ref/ruby/classes/Vpi.src/M000030.html +24 -24
- data/ref/ruby/classes/Vpi.src/M000031.html +6 -8
- data/ref/ruby/created.rid +1 -1
- data/ref/ruby/files/bin/{header_to_ruby_rb.html → convert_rb.html} +5 -5
- data/ref/ruby/files/bin/{generate_test_rb.html → generate_rb.html} +8 -21
- 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/runner_boot_loader_rb.html +197 -0
- data/ref/ruby/files/lib/ruby-vpi/runner_boot_loader_rb.src/M000001.html +17 -0
- data/ref/ruby/files/lib/ruby-vpi/runner_boot_loader_rb.src/M000002.html +18 -0
- data/ref/ruby/files/lib/ruby-vpi/runner_proxy_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi/runner_rb.html +6 -19
- data/ref/ruby/files/lib/ruby-vpi/util_rb.html +101 -0
- data/ref/ruby/files/lib/ruby-vpi/verilog_parser_rb.html +8 -1
- data/ref/ruby/files/lib/ruby-vpi/vpi_rb.html +1 -1
- data/ref/ruby/files/lib/ruby-vpi_rb.html +2 -14
- data/ref/ruby/fr_class_index.html +1 -3
- data/ref/ruby/fr_file_index.html +4 -2
- data/ref/ruby/fr_method_index.html +56 -51
- data/ref/ruby/index.html +1 -1
- data/samp/counter/RSpec/Rakefile +1 -0
- data/samp/counter/RSpec/counter_design.rb +15 -0
- data/samp/counter/RSpec/counter_proto.rb +10 -0
- data/samp/counter/RSpec/counter_runner.rake +44 -0
- data/samp/counter/RSpec/counter_spec.rb +39 -0
- data/samp/counter/Rakefile +1 -1
- data/samp/counter/counter.v +7 -7
- data/samp/counter/xUnit/Rakefile +1 -0
- data/samp/counter/xUnit/counter_bench.rb +95 -0
- data/samp/counter/{counter_xunit_bench.v → xUnit/counter_bench.v} +0 -0
- data/samp/counter/xUnit/counter_design.rb +15 -0
- data/samp/counter/xUnit/counter_proto.rb +10 -0
- data/samp/counter/xUnit/counter_runner.rake +44 -0
- data/samp/counter/{counter_xunit_spec.rb → xUnit/counter_spec.rb} +9 -9
- data/samp/pipelined_alu/Rakefile +1 -1
- data/samp/pipelined_alu/TestHw5UnitModel.rb +4 -5
- data/samp/pipelined_alu/hw5_unit.v +55 -85
- data/samp/pipelined_alu/hw5_unit_design.rb +51 -0
- data/samp/pipelined_alu/hw5_unit_proto.rb +4 -0
- data/samp/pipelined_alu/hw5_unit_runner.rake +43 -0
- data/samp/pipelined_alu/hw5_unit_spec.rb +64 -0
- data/samp/register_file/LICENSE +20 -0
- data/samp/register_file/README +4 -0
- data/samp/register_file/Rakefile +1 -0
- data/samp/register_file/register_file.v +18 -0
- data/samp/register_file/register_file_design.rb +11 -0
- data/samp/register_file/register_file_proto.rb +11 -0
- data/samp/register_file/register_file_runner.rake +43 -0
- data/samp/register_file/register_file_spec.rb +58 -0
- metadata +78 -66
- data/bin/generate_test.rb +0 -200
- data/bin/generate_test_tpl/bench.rb +0 -89
- data/bin/generate_test_tpl/bench.v +0 -26
- data/bin/generate_test_tpl/design.rb +0 -11
- data/bin/generate_test_tpl/proto.rb +0 -16
- data/bin/generate_test_tpl/runner.rake +0 -42
- data/bin/generate_test_tpl/spec.rb +0 -37
- data/bin/header_to_ruby.rb +0 -27
- data/ref/ruby/classes/Integer.src/M000008.html +0 -25
- data/ref/ruby/classes/Integer.src/M000016.html +0 -25
- data/ref/ruby/classes/RubyVpi.html +0 -199
- data/ref/ruby/classes/RubyVpi.src/M000027.html +0 -121
- data/ref/ruby/classes/VerilogParser/Module/Parameter.html +0 -160
- data/ref/ruby/classes/VerilogParser/Module/Parameter.src/M000007.html +0 -19
- data/ref/ruby/classes/VerilogParser/Module/Port.src/M000003.html +0 -21
- data/ref/ruby/classes/VerilogParser/Module.src/M000002.html +0 -34
- data/ref/ruby/classes/VerilogParser.src/M000001.html +0 -34
- data/ref/ruby/classes/Vpi/Handle.src/M000049.html +0 -69
- data/ref/ruby/classes/Vpi.src/M000028.html +0 -28
- data/ref/ruby/classes/Vpi.src/M000032.html +0 -22
- data/samp/counter/counter_rspec_bench.rb +0 -86
- data/samp/counter/counter_rspec_bench.v +0 -9
- data/samp/counter/counter_rspec_design.rb +0 -8
- data/samp/counter/counter_rspec_proto.rb +0 -13
- data/samp/counter/counter_rspec_runner.rake +0 -52
- data/samp/counter/counter_rspec_spec.rb +0 -39
- data/samp/counter/counter_xunit_bench.rb +0 -86
- data/samp/counter/counter_xunit_design.rb +0 -8
- data/samp/counter/counter_xunit_proto.rb +0 -13
- data/samp/counter/counter_xunit_runner.rake +0 -52
- data/samp/pipelined_alu/hw5_unit_test_bench.rb +0 -86
- data/samp/pipelined_alu/hw5_unit_test_bench.v +0 -14
- data/samp/pipelined_alu/hw5_unit_test_design.rb +0 -61
- data/samp/pipelined_alu/hw5_unit_test_proto.rb +0 -7
- data/samp/pipelined_alu/hw5_unit_test_runner.rake +0 -52
- data/samp/pipelined_alu/hw5_unit_test_spec.rb +0 -68
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html>
|
|
7
|
+
<head>
|
|
8
|
+
<title>x? (Vpi::Handle)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 43</span>
|
|
14
|
+
43: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">x?</span>
|
|
15
|
+
44: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">hexStrVal</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/x/i</span>
|
|
16
|
+
45: <span class="ruby-keyword kw">end</span></pre>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>x
|
|
8
|
+
<title>x! (Vpi::Handle)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
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
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 48</span>
|
|
14
|
+
48: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">x!</span>
|
|
15
|
+
49: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">hexStrVal</span> = <span class="ruby-value str">'x'</span>
|
|
16
|
+
50: <span class="ruby-keyword kw">end</span></pre>
|
|
17
17
|
</body>
|
|
18
18
|
</html>
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>z? (Vpi::Handle)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
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
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 53</span>
|
|
14
|
+
53: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">z?</span>
|
|
15
|
+
54: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">hexStrVal</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/z/i</span>
|
|
16
|
+
55: <span class="ruby-keyword kw">end</span></pre>
|
|
17
17
|
</body>
|
|
18
18
|
</html>
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>z
|
|
8
|
+
<title>z! (Vpi::Handle)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
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
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 58</span>
|
|
14
|
+
58: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">z!</span>
|
|
15
|
+
59: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">hexStrVal</span> = <span class="ruby-value str">'z'</span>
|
|
16
|
+
60: <span class="ruby-keyword kw">end</span></pre>
|
|
17
17
|
</body>
|
|
18
18
|
</html>
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>high? (Vpi::Handle)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
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
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 63</span>
|
|
14
|
+
63: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">high?</span>
|
|
15
|
+
64: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">intVal</span> <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>
|
|
16
|
+
65: <span class="ruby-keyword kw">end</span></pre>
|
|
17
17
|
</body>
|
|
18
18
|
</html>
|
|
@@ -5,17 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>high! (Vpi::Handle)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
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
|
-
79:
|
|
18
|
-
80: <span class="ruby-identifier">old</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">new</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
|
|
19
|
-
81: <span class="ruby-keyword kw">end</span></pre>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 68</span>
|
|
14
|
+
68: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">high!</span>
|
|
15
|
+
69: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">intVal</span> = <span class="ruby-value">1</span>
|
|
16
|
+
70: <span class="ruby-keyword kw">end</span></pre>
|
|
20
17
|
</body>
|
|
21
18
|
</html>
|
|
@@ -5,17 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>low? (Vpi::Handle)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
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
|
-
87:
|
|
18
|
-
88: <span class="ruby-identifier">old</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">new</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
|
19
|
-
89: <span class="ruby-keyword kw">end</span></pre>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 73</span>
|
|
14
|
+
73: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">low?</span>
|
|
15
|
+
74: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">hexStrVal</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^0+$/</span>
|
|
16
|
+
75: <span class="ruby-keyword kw">end</span></pre>
|
|
20
17
|
</body>
|
|
21
18
|
</html>
|
|
@@ -5,18 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>low! (Vpi::Handle)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
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
|
-
96:
|
|
18
|
-
97: <span class="ruby-identifier">vpi_get_value</span> <span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">val</span>
|
|
19
|
-
98: <span class="ruby-identifier">val</span>
|
|
20
|
-
99: <span class="ruby-keyword kw">end</span></pre>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 78</span>
|
|
14
|
+
78: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">low!</span>
|
|
15
|
+
79: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">intVal</span> = <span class="ruby-value">0</span>
|
|
16
|
+
80: <span class="ruby-keyword kw">end</span></pre>
|
|
21
17
|
</body>
|
|
22
18
|
</html>
|
|
@@ -5,40 +5,17 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>posedge? (Vpi::Handle)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
110:
|
|
21
|
-
111: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiScalarVal</span>
|
|
22
|
-
112: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">scalar</span>
|
|
23
|
-
113:
|
|
24
|
-
114: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiIntVal</span>
|
|
25
|
-
115: <span class="ruby-identifier">get_value_wrapper</span>(<span class="ruby-constant">VpiHexStrVal</span>).<span class="ruby-identifier">value</span>.<span class="ruby-identifier">str</span>.<span class="ruby-identifier">to_i</span>(<span class="ruby-value">16</span>)
|
|
26
|
-
116:
|
|
27
|
-
117: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiRealVal</span>
|
|
28
|
-
118: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">real</span>
|
|
29
|
-
119:
|
|
30
|
-
120: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiTimeVal</span>
|
|
31
|
-
121: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">time</span>
|
|
32
|
-
122:
|
|
33
|
-
123: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiVectorVal</span>
|
|
34
|
-
124: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">vector</span>
|
|
35
|
-
125:
|
|
36
|
-
126: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiStrengthVal</span>
|
|
37
|
-
127: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">strength</span>
|
|
38
|
-
128:
|
|
39
|
-
129: <span class="ruby-keyword kw">else</span>
|
|
40
|
-
130: <span class="ruby-identifier">raise</span> <span class="ruby-node">"unknown S_vpi_value.format: #{val.format}"</span>
|
|
41
|
-
131: <span class="ruby-keyword kw">end</span>
|
|
42
|
-
132: <span class="ruby-keyword kw">end</span></pre>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 83</span>
|
|
14
|
+
83: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">posedge?</span>
|
|
15
|
+
84: <span class="ruby-identifier">old</span> = <span class="ruby-ivar">@lastVal</span>
|
|
16
|
+
85: <span class="ruby-identifier">new</span> = <span class="ruby-ivar">@lastVal</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">intVal</span>
|
|
17
|
+
86:
|
|
18
|
+
87: <span class="ruby-identifier">old</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">new</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
|
|
19
|
+
88: <span class="ruby-keyword kw">end</span></pre>
|
|
43
20
|
</body>
|
|
44
21
|
</html>
|
|
@@ -5,83 +5,17 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>negedge? (Vpi::Handle)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
144: <span class="ruby-keyword kw">end</span>
|
|
21
|
-
145:
|
|
22
|
-
146: <span class="ruby-identifier">newVal</span> = <span class="ruby-constant">S_vpi_value</span>.<span class="ruby-identifier">new</span>
|
|
23
|
-
147: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">format</span> = <span class="ruby-identifier">aFormat</span>
|
|
24
|
-
148:
|
|
25
|
-
149: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">aFormat</span>
|
|
26
|
-
150: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiBinStrVal</span>, <span class="ruby-constant">VpiOctStrVal</span>, <span class="ruby-constant">VpiDecStrVal</span>, <span class="ruby-constant">VpiHexStrVal</span>, <span class="ruby-constant">VpiStringVal</span>
|
|
27
|
-
151: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">str</span> = <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_s</span>
|
|
28
|
-
152:
|
|
29
|
-
153: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiScalarVal</span>
|
|
30
|
-
154: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">scalar</span> = <span class="ruby-identifier">aValue</span>
|
|
31
|
-
155:
|
|
32
|
-
156: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiIntVal</span>
|
|
33
|
-
157: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">format</span> = <span class="ruby-constant">VpiHexStrVal</span>
|
|
34
|
-
158: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">str</span> = <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_i</span>.<span class="ruby-identifier">to_s</span>(<span class="ruby-value">16</span>)
|
|
35
|
-
159:
|
|
36
|
-
160: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiRealVal</span>
|
|
37
|
-
161: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">real</span> = <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_f</span>
|
|
38
|
-
162:
|
|
39
|
-
163: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiTimeVal</span>
|
|
40
|
-
164: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">time</span> = <span class="ruby-identifier">aValue</span>
|
|
41
|
-
165:
|
|
42
|
-
166: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiVectorVal</span>
|
|
43
|
-
167: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">vector</span> = <span class="ruby-identifier">aValue</span>
|
|
44
|
-
168:
|
|
45
|
-
169: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiStrengthVal</span>
|
|
46
|
-
170: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">strength</span> = <span class="ruby-identifier">aValue</span>
|
|
47
|
-
171:
|
|
48
|
-
172: <span class="ruby-keyword kw">else</span>
|
|
49
|
-
173: <span class="ruby-identifier">raise</span> <span class="ruby-node">"unknown S_vpi_value.format: #{newVal.format}"</span>
|
|
50
|
-
174: <span class="ruby-keyword kw">end</span>
|
|
51
|
-
175:
|
|
52
|
-
176: <span class="ruby-identifier">vpi_put_value</span> <span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">newVal</span>, <span class="ruby-identifier">aTime</span>, <span class="ruby-identifier">aDelay</span>
|
|
53
|
-
177:
|
|
54
|
-
178: <span class="ruby-comment cmt"># ensure that value was written correctly</span>
|
|
55
|
-
179: <span class="ruby-identifier">readenVal</span> = <span class="ruby-identifier">get_value</span>(<span class="ruby-identifier">aFormat</span>)
|
|
56
|
-
180:
|
|
57
|
-
181: <span class="ruby-identifier">writtenCorrectly</span> =
|
|
58
|
-
182: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">aFormat</span>
|
|
59
|
-
183: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiBinStrVal</span>, <span class="ruby-constant">VpiOctStrVal</span>, <span class="ruby-constant">VpiDecStrVal</span>, <span class="ruby-constant">VpiHexStrVal</span>
|
|
60
|
-
184: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">aValue</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/[xz]/i</span> <span class="ruby-comment cmt"># TODO: verify 'z' behavior</span>
|
|
61
|
-
185: <span class="ruby-identifier">readenVal</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/[xz]/i</span>
|
|
62
|
-
186: <span class="ruby-keyword kw">else</span>
|
|
63
|
-
187: <span class="ruby-identifier">readenVal</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_s</span>
|
|
64
|
-
188: <span class="ruby-keyword kw">end</span>
|
|
65
|
-
189:
|
|
66
|
-
190: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiStringVal</span>
|
|
67
|
-
191: <span class="ruby-identifier">readenVal</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_s</span>
|
|
68
|
-
192:
|
|
69
|
-
193: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiIntVal</span>
|
|
70
|
-
194: <span class="ruby-comment cmt"># allow for register overflow when limit reached</span>
|
|
71
|
-
195: <span class="ruby-identifier">readenVal</span> <span class="ruby-operator">==</span> (<span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">%</span> (<span class="ruby-value">2</span> <span class="ruby-operator">**</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">vpiSize</span>))
|
|
72
|
-
196:
|
|
73
|
-
197: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiRealVal</span>
|
|
74
|
-
198: <span class="ruby-identifier">readenVal</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_f</span>
|
|
75
|
-
199:
|
|
76
|
-
200: <span class="ruby-keyword kw">else</span>
|
|
77
|
-
201: <span class="ruby-keyword kw">true</span>
|
|
78
|
-
202: <span class="ruby-keyword kw">end</span>
|
|
79
|
-
203:
|
|
80
|
-
204: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">writtenCorrectly</span>
|
|
81
|
-
205: <span class="ruby-identifier">raise</span> <span class="ruby-node">"value written (#{aValue.inspect}) does not match value read (#{readenVal.inspect}) from handle #{self}"</span>
|
|
82
|
-
206: <span class="ruby-keyword kw">end</span>
|
|
83
|
-
207:
|
|
84
|
-
208: <span class="ruby-identifier">aValue</span>
|
|
85
|
-
209: <span class="ruby-keyword kw">end</span></pre>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 91</span>
|
|
14
|
+
91: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">negedge?</span>
|
|
15
|
+
92: <span class="ruby-identifier">old</span> = <span class="ruby-ivar">@lastVal</span>
|
|
16
|
+
93: <span class="ruby-identifier">new</span> = <span class="ruby-ivar">@lastVal</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">intVal</span>
|
|
17
|
+
94:
|
|
18
|
+
95: <span class="ruby-identifier">old</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">new</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
|
|
19
|
+
96: <span class="ruby-keyword kw">end</span></pre>
|
|
86
20
|
</body>
|
|
87
21
|
</html>
|
|
@@ -5,26 +5,18 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>get_value_wrapper (Vpi::Handle)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
220: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">h</span> = <span class="ruby-identifier">vpi_scan</span>(<span class="ruby-identifier">itr</span>)
|
|
22
|
-
221: <span class="ruby-identifier">handles</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">h</span>
|
|
23
|
-
222: <span class="ruby-keyword kw">end</span>
|
|
24
|
-
223: <span class="ruby-keyword kw">end</span>
|
|
25
|
-
224: <span class="ruby-keyword kw">end</span>
|
|
26
|
-
225:
|
|
27
|
-
226: <span class="ruby-identifier">handles</span>
|
|
28
|
-
227: <span class="ruby-keyword kw">end</span></pre>
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 101</span>
|
|
14
|
+
101: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_value_wrapper</span> <span class="ruby-identifier">aFormat</span>
|
|
15
|
+
102: <span class="ruby-identifier">val</span> = <span class="ruby-constant">S_vpi_value</span>.<span class="ruby-identifier">new</span>
|
|
16
|
+
103: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">format</span> = <span class="ruby-identifier">aFormat</span>
|
|
17
|
+
104:
|
|
18
|
+
105: <span class="ruby-identifier">vpi_get_value</span> <span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">val</span>
|
|
19
|
+
106: <span class="ruby-identifier">val</span>
|
|
20
|
+
107: <span class="ruby-keyword kw">end</span></pre>
|
|
29
21
|
</body>
|
|
30
22
|
</html>
|
|
@@ -5,20 +5,40 @@
|
|
|
5
5
|
|
|
6
6
|
<html>
|
|
7
7
|
<head>
|
|
8
|
-
<title>
|
|
8
|
+
<title>get_value (Vpi::Handle)</title>
|
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 113</span>
|
|
14
|
+
113: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_value</span> <span class="ruby-identifier">aFormat</span> = <span class="ruby-constant">VpiObjTypeVal</span>
|
|
15
|
+
114: <span class="ruby-identifier">val</span> = <span class="ruby-identifier">get_value_wrapper</span>(<span class="ruby-identifier">resolve_prop_type</span>(<span class="ruby-identifier">aFormat</span>))
|
|
16
|
+
115:
|
|
17
|
+
116: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">format</span>
|
|
18
|
+
117: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiBinStrVal</span>, <span class="ruby-constant">VpiOctStrVal</span>, <span class="ruby-constant">VpiDecStrVal</span>, <span class="ruby-constant">VpiHexStrVal</span>, <span class="ruby-constant">VpiStringVal</span>
|
|
19
|
+
118: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">str</span>
|
|
20
|
+
119:
|
|
21
|
+
120: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiScalarVal</span>
|
|
22
|
+
121: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">scalar</span>
|
|
23
|
+
122:
|
|
24
|
+
123: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiIntVal</span>
|
|
25
|
+
124: <span class="ruby-identifier">get_value_wrapper</span>(<span class="ruby-constant">VpiBinStrVal</span>).<span class="ruby-identifier">value</span>.<span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/[^01]/</span>, <span class="ruby-value str">'0'</span>).<span class="ruby-identifier">to_i</span>(<span class="ruby-value">2</span>)
|
|
26
|
+
125:
|
|
27
|
+
126: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiRealVal</span>
|
|
28
|
+
127: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">real</span>
|
|
29
|
+
128:
|
|
30
|
+
129: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiTimeVal</span>
|
|
31
|
+
130: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">time</span>
|
|
32
|
+
131:
|
|
33
|
+
132: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiVectorVal</span>
|
|
34
|
+
133: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">vector</span>
|
|
35
|
+
134:
|
|
36
|
+
135: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiStrengthVal</span>
|
|
37
|
+
136: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">strength</span>
|
|
38
|
+
137:
|
|
39
|
+
138: <span class="ruby-keyword kw">else</span>
|
|
40
|
+
139: <span class="ruby-identifier">raise</span> <span class="ruby-node">"unknown S_vpi_value.format: #{val.format}"</span>
|
|
41
|
+
140: <span class="ruby-keyword kw">end</span>
|
|
42
|
+
141: <span class="ruby-keyword kw">end</span></pre>
|
|
23
43
|
</body>
|
|
24
44
|
</html>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html>
|
|
7
|
+
<head>
|
|
8
|
+
<title>put_value (Vpi::Handle)</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
11
|
+
</head>
|
|
12
|
+
<body class="standalone-code">
|
|
13
|
+
<pre> <span class="ruby-comment cmt"># File lib/ruby-vpi/vpi.rb, line 147</span>
|
|
14
|
+
147: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">put_value</span> <span class="ruby-identifier">aValue</span>, <span class="ruby-identifier">aFormat</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">aTime</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">aDelay</span> = <span class="ruby-constant">VpiNoDelay</span>
|
|
15
|
+
148: <span class="ruby-identifier">aFormat</span> =
|
|
16
|
+
149: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">aFormat</span>
|
|
17
|
+
150: <span class="ruby-identifier">resolve_prop_type</span>(<span class="ruby-identifier">aFormat</span>)
|
|
18
|
+
151: <span class="ruby-keyword kw">else</span>
|
|
19
|
+
152: <span class="ruby-identifier">get_value_wrapper</span>(<span class="ruby-constant">VpiObjTypeVal</span>).<span class="ruby-identifier">format</span>
|
|
20
|
+
153: <span class="ruby-keyword kw">end</span>
|
|
21
|
+
154:
|
|
22
|
+
155: <span class="ruby-identifier">newVal</span> = <span class="ruby-constant">S_vpi_value</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">:format</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">aFormat</span>)
|
|
23
|
+
156:
|
|
24
|
+
157: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">aFormat</span>
|
|
25
|
+
158: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiBinStrVal</span>, <span class="ruby-constant">VpiOctStrVal</span>, <span class="ruby-constant">VpiDecStrVal</span>, <span class="ruby-constant">VpiHexStrVal</span>, <span class="ruby-constant">VpiStringVal</span>
|
|
26
|
+
159: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">str</span> = <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_s</span>
|
|
27
|
+
160:
|
|
28
|
+
161: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiScalarVal</span>
|
|
29
|
+
162: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">scalar</span> = <span class="ruby-identifier">aValue</span>
|
|
30
|
+
163:
|
|
31
|
+
164: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiIntVal</span>
|
|
32
|
+
165: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">format</span> = <span class="ruby-constant">VpiHexStrVal</span>
|
|
33
|
+
166: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">str</span> = <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_i</span>.<span class="ruby-identifier">to_s</span>(<span class="ruby-value">16</span>)
|
|
34
|
+
167:
|
|
35
|
+
168: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiRealVal</span>
|
|
36
|
+
169: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">real</span> = <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_f</span>
|
|
37
|
+
170:
|
|
38
|
+
171: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiTimeVal</span>
|
|
39
|
+
172: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">time</span> = <span class="ruby-identifier">aValue</span>
|
|
40
|
+
173:
|
|
41
|
+
174: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiVectorVal</span>
|
|
42
|
+
175: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">vector</span> = <span class="ruby-identifier">aValue</span>
|
|
43
|
+
176:
|
|
44
|
+
177: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiStrengthVal</span>
|
|
45
|
+
178: <span class="ruby-identifier">newVal</span>.<span class="ruby-identifier">value</span>.<span class="ruby-identifier">strength</span> = <span class="ruby-identifier">aValue</span>
|
|
46
|
+
179:
|
|
47
|
+
180: <span class="ruby-keyword kw">else</span>
|
|
48
|
+
181: <span class="ruby-identifier">raise</span> <span class="ruby-node">"unknown S_vpi_value.format: #{newVal.format}"</span>
|
|
49
|
+
182: <span class="ruby-keyword kw">end</span>
|
|
50
|
+
183:
|
|
51
|
+
184: <span class="ruby-identifier">vpi_put_value</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">newVal</span>, <span class="ruby-identifier">aTime</span>, <span class="ruby-identifier">aDelay</span>)
|
|
52
|
+
185:
|
|
53
|
+
186: <span class="ruby-comment cmt"># ensure that value was written correctly</span>
|
|
54
|
+
187: <span class="ruby-identifier">readenVal</span> = <span class="ruby-identifier">get_value</span>(<span class="ruby-identifier">aFormat</span>)
|
|
55
|
+
188:
|
|
56
|
+
189: <span class="ruby-identifier">writtenCorrectly</span> =
|
|
57
|
+
190: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">aFormat</span>
|
|
58
|
+
191: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiBinStrVal</span>, <span class="ruby-constant">VpiOctStrVal</span>, <span class="ruby-constant">VpiDecStrVal</span>, <span class="ruby-constant">VpiHexStrVal</span>
|
|
59
|
+
192: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">aValue</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/[xz]/i</span> <span class="ruby-comment cmt"># TODO: verify 'z' behavior</span>
|
|
60
|
+
193: <span class="ruby-identifier">readenVal</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/[xz]/i</span>
|
|
61
|
+
194: <span class="ruby-keyword kw">else</span>
|
|
62
|
+
195: <span class="ruby-identifier">readenVal</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_s</span>
|
|
63
|
+
196: <span class="ruby-keyword kw">end</span>
|
|
64
|
+
197:
|
|
65
|
+
198: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiStringVal</span>
|
|
66
|
+
199: <span class="ruby-identifier">readenVal</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_s</span>
|
|
67
|
+
200:
|
|
68
|
+
201: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiIntVal</span>
|
|
69
|
+
202: <span class="ruby-comment cmt"># allow for register overflow when limit reached</span>
|
|
70
|
+
203: <span class="ruby-identifier">readenVal</span> <span class="ruby-operator">==</span> (<span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">%</span> (<span class="ruby-value">2</span> <span class="ruby-operator">**</span> <span class="ruby-identifier">vpi_get</span>(<span class="ruby-constant">VpiSize</span>, <span class="ruby-keyword kw">self</span>)))
|
|
71
|
+
204:
|
|
72
|
+
205: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">VpiRealVal</span>
|
|
73
|
+
206: <span class="ruby-identifier">readenVal</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">aValue</span>.<span class="ruby-identifier">to_f</span>
|
|
74
|
+
207:
|
|
75
|
+
208: <span class="ruby-keyword kw">else</span>
|
|
76
|
+
209: <span class="ruby-keyword kw">true</span>
|
|
77
|
+
210: <span class="ruby-keyword kw">end</span>
|
|
78
|
+
211:
|
|
79
|
+
212: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">writtenCorrectly</span>
|
|
80
|
+
213: <span class="ruby-identifier">raise</span> <span class="ruby-node">"value written (#{aValue.inspect}) does not match value read (#{readenVal.inspect}) on handle #{self}"</span>
|
|
81
|
+
214: <span class="ruby-keyword kw">end</span>
|
|
82
|
+
215:
|
|
83
|
+
216: <span class="ruby-identifier">aValue</span>
|
|
84
|
+
217: <span class="ruby-keyword kw">end</span></pre>
|
|
85
|
+
</body>
|
|
86
|
+
</html>
|