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.
Files changed (120) hide show
  1. data/bin/generate_test.rb +12 -11
  2. data/bin/generate_test_tpl/bench.rb +0 -4
  3. data/bin/generate_test_tpl/bench.v +3 -6
  4. data/bin/generate_test_tpl/runner.rake +20 -4
  5. data/bin/generate_test_tpl/spec.rb +5 -7
  6. data/doc/common.css +110 -95
  7. data/doc/common.tpl +16 -17
  8. data/doc/history.html +350 -330
  9. data/doc/history.yml +49 -0
  10. data/doc/intro.inc +18 -4
  11. data/doc/lib/doc_proxy.rb +22 -32
  12. data/doc/manual.erb +90 -83
  13. data/doc/manual.html +298 -266
  14. data/doc/memo.html +31 -10
  15. data/doc/readme.html +26 -6
  16. data/ext/relay.c +24 -28
  17. data/ext/vlog.c +4 -15
  18. data/lib/ruby-vpi/rspec.rb +1 -1
  19. data/lib/ruby-vpi/runner.rb +12 -10
  20. data/lib/ruby-vpi/runner_proxy.rb +17 -6
  21. data/lib/ruby-vpi/verilog_parser.rb +11 -7
  22. data/lib/ruby-vpi/vpi.rb +11 -1
  23. data/lib/ruby-vpi.rb +4 -0
  24. data/ref/c/annotated.html +2 -2
  25. data/ref/c/common_8h.html +1 -1
  26. data/ref/c/files.html +1 -1
  27. data/ref/c/functions.html +1 -1
  28. data/ref/c/functions_vars.html +1 -1
  29. data/ref/c/globals.html +1 -1
  30. data/ref/c/globals_0x63.html +1 -1
  31. data/ref/c/globals_0x65.html +1 -1
  32. data/ref/c/globals_0x66.html +1 -1
  33. data/ref/c/globals_0x70.html +1 -1
  34. data/ref/c/globals_0x72.html +1 -1
  35. data/ref/c/globals_0x73.html +1 -1
  36. data/ref/c/globals_0x74.html +1 -1
  37. data/ref/c/globals_0x76.html +2 -2
  38. data/ref/c/globals_0x78.html +1 -1
  39. data/ref/c/globals_defs.html +1 -1
  40. data/ref/c/globals_defs_0x65.html +1 -1
  41. data/ref/c/globals_defs_0x70.html +1 -1
  42. data/ref/c/globals_defs_0x76.html +2 -2
  43. data/ref/c/globals_defs_0x78.html +1 -1
  44. data/ref/c/globals_enum.html +1 -1
  45. data/ref/c/globals_eval.html +1 -1
  46. data/ref/c/globals_func.html +2 -2
  47. data/ref/c/globals_type.html +1 -1
  48. data/ref/c/globals_vars.html +1 -1
  49. data/ref/c/index.html +1 -1
  50. data/ref/c/relay_8c.html +2 -1
  51. data/ref/c/relay_8h.html +1 -1
  52. data/ref/c/structrelay____RubyOptions____def.html +8 -2
  53. data/ref/c/structt__cb__data.html +1 -1
  54. data/ref/c/structt__vpi__delay.html +1 -1
  55. data/ref/c/structt__vpi__error__info.html +1 -1
  56. data/ref/c/structt__vpi__strengthval.html +1 -1
  57. data/ref/c/structt__vpi__systf__data.html +1 -1
  58. data/ref/c/structt__vpi__time.html +1 -1
  59. data/ref/c/structt__vpi__value.html +1 -1
  60. data/ref/c/structt__vpi__vecval.html +1 -1
  61. data/ref/c/structt__vpi__vlog__info.html +1 -1
  62. data/ref/c/swig_8c.html +1 -1
  63. data/ref/c/swig_8h.html +1 -1
  64. data/ref/c/verilog_8h.html +1 -1
  65. data/ref/c/vlog_8c.html +15 -15
  66. data/ref/c/vlog_8h.html +1 -1
  67. data/ref/c/vpi__user_8h.html +1 -1
  68. data/ref/ruby/classes/OutputInfo.html +1 -1
  69. data/ref/ruby/classes/OutputInfo.src/M000030.html +30 -30
  70. data/ref/ruby/classes/RDoc.html +5 -5
  71. data/ref/ruby/classes/RDoc.src/{M000097.html → M000099.html} +0 -0
  72. data/ref/ruby/classes/RubyVpi.src/M000085.html +43 -39
  73. data/ref/ruby/classes/String.src/M000033.html +26 -26
  74. data/ref/ruby/classes/String.src/M000034.html +4 -4
  75. data/ref/ruby/classes/Template.src/M000032.html +4 -4
  76. data/ref/ruby/classes/VerilogParser/Module/Parameter.src/M000011.html +5 -5
  77. data/ref/ruby/classes/VerilogParser/Module/Port.src/M000007.html +7 -7
  78. data/ref/ruby/classes/VerilogParser/Module/Port.src/M000008.html +4 -4
  79. data/ref/ruby/classes/VerilogParser/Module/Port.src/M000009.html +4 -4
  80. data/ref/ruby/classes/VerilogParser/Module/Port.src/M000010.html +4 -4
  81. data/ref/ruby/classes/VerilogParser/Module.src/M000006.html +15 -11
  82. data/ref/ruby/classes/Vpi/Handle/Property.html +5 -5
  83. data/ref/ruby/classes/Vpi/Handle/Property.src/{M000096.html → M000098.html} +61 -61
  84. data/ref/ruby/classes/Vpi/Handle.html +78 -43
  85. data/ref/ruby/classes/Vpi/Handle.src/M000088.html +3 -3
  86. data/ref/ruby/classes/Vpi/Handle.src/M000089.html +4 -8
  87. data/ref/ruby/classes/Vpi/Handle.src/M000090.html +5 -31
  88. data/ref/ruby/classes/Vpi/Handle.src/M000091.html +9 -74
  89. data/ref/ruby/classes/Vpi/Handle.src/M000092.html +31 -17
  90. data/ref/ruby/classes/Vpi/Handle.src/M000093.html +74 -11
  91. data/ref/ruby/classes/Vpi/Handle.src/M000094.html +30 -0
  92. data/ref/ruby/classes/Vpi/Handle.src/M000095.html +11 -55
  93. data/ref/ruby/classes/Vpi/Handle.src/M000097.html +68 -0
  94. data/ref/ruby/created.rid +1 -1
  95. data/ref/ruby/files/bin/generate_test_rb.html +8 -11
  96. data/ref/ruby/files/bin/generate_test_rb.src/M000001.html +4 -4
  97. data/ref/ruby/files/bin/generate_test_rb.src/M000002.html +22 -24
  98. data/ref/ruby/files/bin/header_to_ruby_rb.html +1 -1
  99. data/ref/ruby/files/lib/ruby-vpi/float_rb.html +1 -1
  100. data/ref/ruby/files/lib/ruby-vpi/integer_rb.html +1 -1
  101. data/ref/ruby/files/lib/ruby-vpi/rspec_rb.html +1 -1
  102. data/ref/ruby/files/lib/ruby-vpi/runner_proxy_rb.html +1 -1
  103. data/ref/ruby/files/lib/ruby-vpi/runner_rb.html +2 -2
  104. data/ref/ruby/files/lib/ruby-vpi/runner_rb.src/M000003.html +10 -10
  105. data/ref/ruby/files/lib/ruby-vpi/runner_rb.src/M000004.html +12 -12
  106. data/ref/ruby/files/lib/ruby-vpi/verilog_parser_rb.html +1 -1
  107. data/ref/ruby/files/lib/ruby-vpi/vpi_rb.html +1 -1
  108. data/ref/ruby/files/lib/ruby-vpi_rb.html +2 -1
  109. data/ref/ruby/fr_method_index.html +20 -18
  110. data/samp/counter/counter_rspec_bench.v +3 -6
  111. data/samp/counter/counter_rspec_design.rb +2 -1
  112. data/samp/counter/counter_rspec_runner.rake +20 -4
  113. data/samp/counter/counter_rspec_spec.rb +4 -4
  114. data/samp/counter/counter_xunit_bench.v +3 -6
  115. data/samp/counter/counter_xunit_design.rb +2 -1
  116. data/samp/counter/counter_xunit_runner.rake +20 -4
  117. data/samp/pipelined_alu/hw5_unit_test_bench.v +3 -6
  118. data/samp/pipelined_alu/hw5_unit_test_runner.rake +20 -4
  119. metadata +21 -20
  120. data/doc/manual.rb +0 -5
data/doc/memo.html CHANGED
@@ -7,7 +7,7 @@
7
7
  <title>Pending tasks</title>
8
8
  </head>
9
9
  <body>
10
-
10
+
11
11
  <div id="navigation">
12
12
  <p><a href="readme.html"><img src="images/home.png" title="project home" alt="project home" /></a></p>
13
13
 
@@ -19,16 +19,37 @@
19
19
  <li><a href="#anchor3">Notes</a></li>
20
20
  </ul>
21
21
 
22
- <h2>Sections</h2>
23
- <ol>
24
- <li><a href="#anchor0">Pending tasks</a></li>
25
- <li><a href="#anchor1">Finished tasks</a></li>
26
- <li><a href="#anchor2">Obsolete tasks</a></li>
27
- <li><a href="#anchor3">Notes</a></li>
28
- </ol>
29
-
22
+
23
+ <h1>Admonitions</h1>
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+ <h1>Formals</h1>
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
30
51
  </div>
31
-
52
+
32
53
  <h1 id="anchor0">Pending tasks</h1>
33
54
 
34
55
 
data/doc/readme.html CHANGED
@@ -7,7 +7,7 @@
7
7
  <title>Welcome to Ruby-VPI</title>
8
8
  </head>
9
9
  <body>
10
-
10
+
11
11
  <div id="navigation">
12
12
 
13
13
  <ul>
@@ -83,12 +83,15 @@
83
83
 
84
84
 
85
85
  <ul>
86
- <li>Works with all <a href="manual.html#setup.reqs">major Verilog simulators</a> available today.</li>
86
+ <li>Works with all <a href="manual.html#setup.reqs">major Verilog simulators</a> available today.
87
+ <ul>
88
+ <li>Compile <em>once</em> (during <a href="manual.html#setup.installation">installation</a>) and use forever!</li>
89
+ </ul></li>
87
90
  </ul>
88
91
 
89
92
 
90
93
  <ul>
91
- <li>Enables <a href="http://www.agilealliance.org/intro">agile practices</a> such as
94
+ <li>Enables <a href="http://agilemanifesto.org/">agile practices</a> such as
92
95
  <ul>
93
96
  <li><a href="http://www.testdriven.com">test-driven</a> development</li>
94
97
  <li><a href="http://behaviour-driven.org">behavior-driven</a> development</li>
@@ -113,7 +116,7 @@
113
116
  <li>Regular expressions</li>
114
117
  <li>Multi-threading</li>
115
118
  <li>System calls and I/O</li>
116
- <li><a href="http://rubyforge.org"><em>ad infinium</em></a></li>
119
+ <li><a href="http://rubyforge.org"><em>ad infinitum</em></a></li>
117
120
  </ul></li>
118
121
  </ul>
119
122
 
@@ -123,10 +126,27 @@
123
126
  </ul>
124
127
 
125
128
 
126
- <h2 id="intro.appetizers">Appetizers</h2>
129
+ <h3 id="intro.applications">Applications</h3>
130
+
131
+
132
+ <p>Here is a modest sampling of tasks, paraphrased from <a href="http://embedded.eecs.berkeley.edu/Alumni/pinhong/scriptEDA/">Pin Hong</a>, that Ruby-VPI can be used to perform.</p>
133
+
134
+
135
+ <ul>
136
+ <li>Writing hardware models in Ruby</li>
137
+ <li>Dumping/processing netlist data from Verilog database</li>
138
+ <li>Dumping/processing simulation data</li>
139
+ <li>Feeding dynamic simulation stimuli</li>
140
+ <li>Back-annotating delay information</li>
141
+ <li>Interactive logic simulation</li>
142
+ <li>Building a distributed simulation</li>
143
+ </ul>
144
+
145
+
146
+ <h3 id="intro.appetizers">Appetizers</h3>
127
147
 
128
148
 
129
- <p>Here is a modest sampling to whet your appetite.</p>
149
+ <p>Here is a modest sampling of code to whet your appetite.</p>
130
150
 
131
151
 
132
152
  <ul>
data/ext/relay.c CHANGED
@@ -49,6 +49,9 @@ void relay_verilog() {
49
49
  pthread_mutex_lock(&relay__rubyLock);
50
50
  }
51
51
 
52
+ /**
53
+ Stores command-line options for the Ruby interpreter.
54
+ */
52
55
  typedef struct {
53
56
  PLI_BYTE8** mArgs; /// Array of command-line arguments.
54
57
  unsigned int mCount; /// Number of command-line arguments.
@@ -59,13 +62,12 @@ typedef struct {
59
62
  @note The structure will be freed *deeply* after use.
60
63
  */
61
64
  void* ruby_run_handshake(void* apRubyOptions) {
62
- // initialize Ruby interpreter
63
65
  ruby_init();
64
66
  ruby_init_loadpath();
65
67
 
66
68
  swig_init();
67
69
 
68
- // pass command-line arguments to the interpreter
70
+ // pass command-line arguments to the interpreter
69
71
  relay__RubyOptions__def* pRubyOptions = (relay__RubyOptions__def*) apRubyOptions;
70
72
 
71
73
  PLI_BYTE8** argv = pRubyOptions->mArgs;
@@ -73,7 +75,7 @@ void* ruby_run_handshake(void* apRubyOptions) {
73
75
 
74
76
  ruby_options(argc, argv);
75
77
 
76
- // free the memory used by command-line options
78
+ // free the memory used by command-line options
77
79
  unsigned int i;
78
80
  for (i = 0; i < argc; i++) {
79
81
  free(argv[i]);
@@ -82,13 +84,9 @@ void* ruby_run_handshake(void* apRubyOptions) {
82
84
  free(argv);
83
85
  free(pRubyOptions);
84
86
 
85
-
86
- // start Ruby interpreter
87
87
  ruby_run();
88
-
89
-
90
- // Ruby interpreter is now finished, so clean it up before terminating this thread
91
88
  ruby_finalize();
89
+
92
90
  return NULL;
93
91
  }
94
92
 
@@ -100,34 +98,32 @@ void relay_ruby_run() {
100
98
  pRubyOptions->mCount = 0;
101
99
 
102
100
  // transform the arguments passed to this function by Verilog into command-line arguments for Ruby interpeter
103
- vpiHandle vCall = vpi_handle(vpiSysTfCall, NULL);
104
-
105
- if (vCall) {
106
- vpiHandle vCallArgs = vpi_iterate(vpiArgument, vCall);
107
-
108
- if (vCallArgs) {
109
- vpiHandle vArg;
110
- s_vpi_value argVal;
111
- argVal.format = vpiStringVal;
101
+ vpiHandle vCall = vpi_handle(vpiSysTfCall, NULL);
112
102
 
113
- while ((vArg = vpi_scan(vCallArgs)) != NULL) {
114
- vpi_get_value(vArg, &argVal);
103
+ if (vCall) {
104
+ vpiHandle vCallArgs = vpi_iterate(vpiArgument, vCall);
115
105
 
116
- pRubyOptions->mCount++;
106
+ if (vCallArgs) {
107
+ vpiHandle vArg;
108
+ s_vpi_value argVal;
109
+ argVal.format = vpiStringVal;
117
110
 
111
+ while (vArg = vpi_scan(vCallArgs)) {
112
+ pRubyOptions->mCount++;
118
113
 
119
- if (pRubyOptions->mArgs == NULL)
120
- pRubyOptions->mArgs = malloc(sizeof(PLI_BYTE8*) * pRubyOptions->mCount);
121
- else
122
- pRubyOptions->mArgs = realloc(pRubyOptions->mArgs, sizeof(PLI_BYTE8*) * pRubyOptions->mCount);
114
+ // grow the options struct to hold more options
115
+ if (pRubyOptions->mArgs == NULL)
116
+ pRubyOptions->mArgs = malloc(sizeof(PLI_BYTE8*) * pRubyOptions->mCount);
117
+ else
118
+ pRubyOptions->mArgs = realloc(pRubyOptions->mArgs, sizeof(PLI_BYTE8*) * pRubyOptions->mCount);
123
119
 
124
- assert(pRubyOptions->mArgs != NULL);
120
+ assert(pRubyOptions->mArgs != NULL);
125
121
 
126
-
127
- pRubyOptions->mArgs[pRubyOptions->mCount-1] = strdup(argVal.value.str);
122
+ vpi_get_value(vArg, &argVal);
123
+ pRubyOptions->mArgs[pRubyOptions->mCount - 1] = strdup(argVal.value.str);
124
+ }
128
125
  }
129
126
  }
130
- }
131
127
 
132
128
  pthread_create(&relay__rubyThread, 0, ruby_run_handshake, pRubyOptions);
133
129
  return;
data/ext/vlog.c CHANGED
@@ -25,25 +25,14 @@
25
25
  #include <stdlib.h>
26
26
 
27
27
 
28
- verilog_tf_funcSig(vlog_ruby_relay) {
29
- // transfer control to ruby
30
- relay_ruby();
31
-
32
-
33
- // transfer control to verilog
34
- verilog_tf_funcReturn(0);
35
- }
36
-
37
28
  verilog_tf_funcSig(vlog_ruby_init) {
38
- // setup control transfer mechanism
39
29
  relay_init();
40
-
41
-
42
- // start ruby interpreter and transfer control to it
43
30
  relay_ruby_run();
31
+ verilog_tf_funcReturn(0);
32
+ }
44
33
 
45
-
46
- // transfer control to verilog
34
+ verilog_tf_funcSig(vlog_ruby_relay) {
35
+ relay_ruby();
47
36
  verilog_tf_funcReturn(0);
48
37
  }
49
38
 
@@ -1,8 +1,8 @@
1
1
  # Bootstraps the RSpec library from within Ruby.
2
2
 
3
3
  =begin
4
+ Copyright 2006 rSpec project <http://rspec.rubyforge.org>
4
5
  Copyright 2006 Suraj N. Kurapati
5
- Copyright 2006 RSpec project
6
6
 
7
7
  This file is part of Ruby-VPI.
8
8
 
@@ -3,7 +3,7 @@
3
3
  # = Required variables
4
4
  # SIMULATOR_SOURCES:: Array of paths to source files needed by the simulator.
5
5
  # SIMULATOR_TARGET:: Name of the Verilog module to be simulated.
6
- # SIMULATOR_ARGS:: A hash containing keys for each simulator task (same as Rakefile task names) and values containing command-line arguments for each simulator.
6
+ # SIMULATOR_ARGUMENTS:: A hash containing keys for each simulator task (same as Rakefile task names) and values containing command-line arguments for each simulator.
7
7
 
8
8
  =begin
9
9
  Copyright 2006 Suraj N. Kurapati
@@ -29,10 +29,12 @@
29
29
  raise ArgumentError, "All required variables must be defined." unless
30
30
  defined?(SIMULATOR_SOURCES) &&
31
31
  defined?(SIMULATOR_TARGET) &&
32
- defined?(SIMULATOR_ARGS)
32
+ defined?(SIMULATOR_ARGUMENTS)
33
33
 
34
34
  SIMULATOR_INCLUDES = [] unless defined? SIMULATOR_INCLUDES
35
35
 
36
+ task :setup
37
+
36
38
  # resolve paths to sources by searching include directories
37
39
  SIMULATOR_SOURCES.map! do |src|
38
40
  unless File.exist? src
@@ -93,17 +95,17 @@ end
93
95
 
94
96
 
95
97
  desc "Simulate with GPL Cver."
96
- task :cver do
97
- sh 'cver', SIMULATOR_ARGS[:cver], "+loadvpi=#{object_file_path(:cver)}:#{BOOTSTAP_FUNC}", expand_include_dir_options(:cver), SIMULATOR_SOURCES
98
+ task :cver => :setup do
99
+ sh 'cver', SIMULATOR_ARGUMENTS[:cver], "+loadvpi=#{object_file_path(:cver)}:#{BOOTSTAP_FUNC}", expand_include_dir_options(:cver), SIMULATOR_SOURCES
98
100
  end
99
101
 
100
102
  CLOBBER.include 'verilog.log'
101
103
 
102
104
 
103
105
  desc "Simulate with Icarus Verilog."
104
- task :ivl do
106
+ task :ivl => :setup do
105
107
  cp object_file_path(:ivl), 'ruby-vpi.vpi'
106
- sh 'iverilog', SIMULATOR_ARGS[:ivl], '-mruby-vpi', expand_include_dir_options(:ivl), SIMULATOR_SOURCES
108
+ sh 'iverilog', SIMULATOR_ARGUMENTS[:ivl], '-mruby-vpi', expand_include_dir_options(:ivl), SIMULATOR_SOURCES
107
109
  sh 'vvp -M. a.out'
108
110
  end
109
111
 
@@ -111,18 +113,18 @@ CLEAN.include 'ruby-vpi.vpi', 'a.out'
111
113
 
112
114
 
113
115
  desc "Simulate with Synopsys VCS."
114
- task :vcs do
115
- sh %w(vcs -R +v2k +vpi), SIMULATOR_ARGS[:vcs], '-load', "#{object_file_path(:vcs)}:#{BOOTSTAP_FUNC}", expand_include_dir_options(:vcs), SIMULATOR_SOURCES
116
+ task :vcs => :setup do
117
+ sh %w(vcs -R +v2k +vpi), SIMULATOR_ARGUMENTS[:vcs], '-load', "#{object_file_path(:vcs)}:#{BOOTSTAP_FUNC}", expand_include_dir_options(:vcs), SIMULATOR_SOURCES
116
118
  end
117
119
 
118
120
  CLEAN.include 'csrc', 'simv*'
119
121
 
120
122
 
121
123
  desc "Simulate with Mentor Modelsim."
122
- task :vsim do
124
+ task :vsim => :setup do
123
125
  sh 'vlib work'
124
126
  sh 'vlog', expand_include_dir_options(:vsim), SIMULATOR_SOURCES
125
- sh 'vsim', SIMULATOR_ARGS[:vsim], '-c', SIMULATOR_TARGET, '-pli', object_file_path(:vsim), '-do', 'run -all'
127
+ sh 'vsim', SIMULATOR_ARGUMENTS[:vsim], '-c', SIMULATOR_TARGET, '-pli', object_file_path(:vsim), '-do', 'run -all'
126
128
  end
127
129
 
128
130
  CLEAN.include 'work'
@@ -20,11 +20,22 @@
20
20
  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
21
  =end
22
22
 
23
- # invoke each test runner with the command-line args
24
- FileList['*.rake', '*.rk'].each do |runner|
25
- sh 'rake', '-f', runner, *ARGV
23
+ # supress errors about nonexistent tasks
24
+ task :default
25
+
26
+ ARGV.each do |t|
27
+ task t
26
28
  end
27
29
 
28
- # supress errors about non-existant tasks
29
- ARGV.each do |t| task t end
30
- task :default
30
+ # invoke each test runner with the command-line args
31
+ at_exit do
32
+ unless ARGV.empty?
33
+ FileList['**/*.rake'].each do |path|
34
+ parent, runner = File.dirname(path), File.basename(path)
35
+
36
+ cd parent do
37
+ sh 'rake', '-f', runner, *ARGV
38
+ end
39
+ end
40
+ end
41
+ end
@@ -52,13 +52,17 @@ class VerilogParser
52
52
  def initialize aDecl
53
53
  @decl = aDecl.strip
54
54
 
55
- @decl =~ %r{module\s+(\w+)\s*(\#\((.*?)\))?\s*\((.*?)\)\s*;}m
56
- @name, paramDecls, portDecls = $1, $3 || '', $4
57
-
58
- paramDecls =~ %r{\bparameter\b(.*)$}
59
- @parameters = $1.split(',').map! do |decl|
60
- Parameter.new decl
61
- end
55
+ @decl =~ %r{module\s+(\w+)\s*(?:\#\((.*?)\))?\s*\((.*?)\)\s*;}m
56
+ @name, paramDecls, portDecls = $1, $2, $3
57
+
58
+ @parameters =
59
+ if paramDecls =~ %r{\bparameter\b(.*)$}
60
+ $1.split(',').map! do |decl|
61
+ Parameter.new decl
62
+ end
63
+ else
64
+ []
65
+ end
62
66
 
63
67
  @ports = portDecls.split(',').map! do |decl|
64
68
  Port.new decl
data/lib/ruby-vpi/vpi.rb CHANGED
@@ -49,16 +49,26 @@ module Vpi
49
49
  }
50
50
  end
51
51
 
52
- # Tests if the logic value of this handle is "don't care" (x).
52
+ # Tests if the logic value of this handle is unknown (x).
53
53
  def x?
54
54
  self.hexStrVal =~ /x/i
55
55
  end
56
56
 
57
+ # Sets the logic value of this handle to unknown (x).
58
+ def x!
59
+ self.hexStrVal = 'x'
60
+ end
61
+
57
62
  # Tests if the logic value of this handle is high impedance (z).
58
63
  def z?
59
64
  self.hexStrVal =~ /z/i
60
65
  end
61
66
 
67
+ # Sets the logic value of this handle to high impedance (z).
68
+ def z!
69
+ self.hexStrVal = 'z'
70
+ end
71
+
62
72
  # Reads the value using the given format (integer constant) and returns a +S_vpi_value+ object.
63
73
  def get_value_wrapper aFormat
64
74
  val = S_vpi_value.new
data/lib/ruby-vpi.rb CHANGED
@@ -48,6 +48,10 @@ module RubyVpi
48
48
  when :rSpec
49
49
  ARGV.concat %w[-f s]
50
50
  require 'ruby-vpi/rspec'
51
+
52
+ when :tSpec
53
+ ARGV << '-rs'
54
+ require 'test/spec'
51
55
  end
52
56
 
53
57
  # service the $ruby_init() task
data/ref/c/annotated.html CHANGED
@@ -17,7 +17,7 @@
17
17
  <li><a href="functions.html"><span>Data&nbsp;Fields</span></a></li>
18
18
  </ul></div>
19
19
  <h1>Ruby-VPI Data Structures</h1>Here are the data structures with brief descriptions:<table>
20
- <tr><td class="indexkey"><a class="el" href="structrelay____RubyOptions____def.html">relay__RubyOptions__def</a></td><td class="indexvalue"></td></tr>
20
+ <tr><td class="indexkey"><a class="el" href="structrelay____RubyOptions____def.html">relay__RubyOptions__def</a></td><td class="indexvalue">Stores command-line options for the Ruby interpreter </td></tr>
21
21
  <tr><td class="indexkey"><a class="el" href="structt__cb__data.html">t_cb_data</a></td><td class="indexvalue"></td></tr>
22
22
  <tr><td class="indexkey"><a class="el" href="structt__vpi__delay.html">t_vpi_delay</a></td><td class="indexvalue"></td></tr>
23
23
  <tr><td class="indexkey"><a class="el" href="structt__vpi__error__info.html">t_vpi_error_info</a></td><td class="indexvalue"></td></tr>
@@ -28,7 +28,7 @@
28
28
  <tr><td class="indexkey"><a class="el" href="structt__vpi__vecval.html">t_vpi_vecval</a></td><td class="indexvalue"></td></tr>
29
29
  <tr><td class="indexkey"><a class="el" href="structt__vpi__vlog__info.html">t_vpi_vlog_info</a></td><td class="indexvalue"></td></tr>
30
30
  </table>
31
- <hr size="1"><address style="align: right;"><small>Generated on Wed Nov 15 19:34:18 2006 for Ruby-VPI by&nbsp;
31
+ <hr size="1"><address style="align: right;"><small>Generated on Thu Dec 7 15:09:45 2006 for Ruby-VPI by&nbsp;
32
32
  <a href="http://www.doxygen.org/index.html">
33
33
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
34
34
  </body>
data/ref/c/common_8h.html CHANGED
@@ -139,7 +139,7 @@ Pass aroung this value instead of zero and non-zero integers. <dl compact><dt><b
139
139
 
140
140
  </div>
141
141
  </div><p>
142
- <hr size="1"><address style="align: right;"><small>Generated on Wed Nov 15 19:34:18 2006 for Ruby-VPI by&nbsp;
142
+ <hr size="1"><address style="align: right;"><small>Generated on Thu Dec 7 15:09:44 2006 for Ruby-VPI by&nbsp;
143
143
  <a href="http://www.doxygen.org/index.html">
144
144
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
145
145
  </body>
data/ref/c/files.html CHANGED
@@ -27,7 +27,7 @@
27
27
  <tr><td class="indexkey"><a class="el" href="vlog_8h.html">vlog.h</a></td><td class="indexvalue">Interface between C and Verilog code </td></tr>
28
28
  <tr><td class="indexkey"><a class="el" href="vpi__user_8h.html">vpi_user.h</a></td><td class="indexvalue"></td></tr>
29
29
  </table>
30
- <hr size="1"><address style="align: right;"><small>Generated on Wed Nov 15 19:34:18 2006 for Ruby-VPI by&nbsp;
30
+ <hr size="1"><address style="align: right;"><small>Generated on Thu Dec 7 15:09:45 2006 for Ruby-VPI by&nbsp;
31
31
  <a href="http://www.doxygen.org/index.html">
32
32
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
33
33
  </body>
data/ref/c/functions.html CHANGED
@@ -127,7 +127,7 @@ Here is a list of all struct and union fields with links to the structures/union
127
127
  : <a class="el" href="structt__cb__data.html#5039bb34ac75410ff93cbe44515b3543">t_cb_data</a>, <a class="el" href="structt__vpi__value.html#73c4197b95dc5a8f4e8f0754e776d796">t_vpi_value</a><li>vector
128
128
  : <a class="el" href="structt__vpi__value.html#b363de5e581f84f9da4610dade8136df">t_vpi_value</a><li>version
129
129
  : <a class="el" href="structt__vpi__vlog__info.html#3ff076199159904aa9869e0fb1476bad">t_vpi_vlog_info</a></ul>
130
- <hr size="1"><address style="align: right;"><small>Generated on Wed Nov 15 19:34:18 2006 for Ruby-VPI by&nbsp;
130
+ <hr size="1"><address style="align: right;"><small>Generated on Thu Dec 7 15:09:45 2006 for Ruby-VPI by&nbsp;
131
131
  <a href="http://www.doxygen.org/index.html">
132
132
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
133
133
  </body>
@@ -127,7 +127,7 @@
127
127
  : <a class="el" href="structt__cb__data.html#5039bb34ac75410ff93cbe44515b3543">t_cb_data</a>, <a class="el" href="structt__vpi__value.html#73c4197b95dc5a8f4e8f0754e776d796">t_vpi_value</a><li>vector
128
128
  : <a class="el" href="structt__vpi__value.html#b363de5e581f84f9da4610dade8136df">t_vpi_value</a><li>version
129
129
  : <a class="el" href="structt__vpi__vlog__info.html#3ff076199159904aa9869e0fb1476bad">t_vpi_vlog_info</a></ul>
130
- <hr size="1"><address style="align: right;"><small>Generated on Wed Nov 15 19:34:18 2006 for Ruby-VPI by&nbsp;
130
+ <hr size="1"><address style="align: right;"><small>Generated on Thu Dec 7 15:09:45 2006 for Ruby-VPI by&nbsp;
131
131
  <a href="http://www.doxygen.org/index.html">
132
132
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
133
133
  </body>
data/ref/c/globals.html CHANGED
@@ -48,7 +48,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li
48
48
  <h3><a class="anchor" name="index_b">- b -</a></h3><ul>
49
49
  <li>bool
50
50
  : <a class="el" href="common_8h.html#f6a258d8f3ee5206d682d799316314b1">common.h</a></ul>
51
- <hr size="1"><address style="align: right;"><small>Generated on Wed Nov 15 19:34:18 2006 for Ruby-VPI by&nbsp;
51
+ <hr size="1"><address style="align: right;"><small>Generated on Thu Dec 7 15:09:45 2006 for Ruby-VPI by&nbsp;
52
52
  <a href="http://www.doxygen.org/index.html">
53
53
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
54
54
  </body>
@@ -79,7 +79,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li
79
79
  : <a class="el" href="common_8h.html#f30d3fc89fbb3ed2aab2f5904ab76815">common.h</a><li>common_debug
80
80
  : <a class="el" href="common_8h.html#fcdad79cb06a5c61737b2f434218dc95">common.h</a><li>common_printf
81
81
  : <a class="el" href="common_8h.html#88235e5f8aab82571d68045e9f73fe81">common.h</a></ul>
82
- <hr size="1"><address style="align: right;"><small>Generated on Wed Nov 15 19:34:18 2006 for Ruby-VPI by&nbsp;
82
+ <hr size="1"><address style="align: right;"><small>Generated on Thu Dec 7 15:09:45 2006 for Ruby-VPI by&nbsp;
83
83
  <a href="http://www.doxygen.org/index.html">
84
84
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
85
85
  </body>
@@ -48,7 +48,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li
48
48
  <h3><a class="anchor" name="index_e">- e -</a></h3><ul>
49
49
  <li>EETERN
50
50
  : <a class="el" href="vpi__user_8h.html#17207c0c9000e05cf0c7bcde1c10293d">vpi_user.h</a></ul>
51
- <hr size="1"><address style="align: right;"><small>Generated on Wed Nov 15 19:34:18 2006 for Ruby-VPI by&nbsp;
51
+ <hr size="1"><address style="align: right;"><small>Generated on Thu Dec 7 15:09:45 2006 for Ruby-VPI by&nbsp;
52
52
  <a href="http://www.doxygen.org/index.html">
53
53
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
54
54
  </body>
@@ -48,7 +48,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li
48
48
  <h3><a class="anchor" name="index_f">- f -</a></h3><ul>
49
49
  <li>false
50
50
  : <a class="el" href="common_8h.html#f6a258d8f3ee5206d682d799316314b1e9de385ef6fe9bf3360d1038396b884c">common.h</a></ul>
51
- <hr size="1"><address style="align: right;"><small>Generated on Wed Nov 15 19:34:18 2006 for Ruby-VPI by&nbsp;
51
+ <hr size="1"><address style="align: right;"><small>Generated on Thu Dec 7 15:09:45 2006 for Ruby-VPI by&nbsp;
52
52
  <a href="http://www.doxygen.org/index.html">
53
53
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
54
54
  </body>
@@ -64,7 +64,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li
64
64
  : <a class="el" href="vpi__user_8h.html#b4fa10713b8dd2588754f7172f9be4e0">vpi_user.h</a><li>PLI_VEXTERN
65
65
  : <a class="el" href="vpi__user_8h.html#ad181db3eb3faa5de4d589896dbcb662">vpi_user.h</a><li>PROTO_PARAMS
66
66
  : <a class="el" href="vpi__user_8h.html#240fc866a11eedf2a49b6b5afd5d2972">vpi_user.h</a></ul>
67
- <hr size="1"><address style="align: right;"><small>Generated on Wed Nov 15 19:34:18 2006 for Ruby-VPI by&nbsp;
67
+ <hr size="1"><address style="align: right;"><small>Generated on Thu Dec 7 15:09:45 2006 for Ruby-VPI by&nbsp;
68
68
  <a href="http://www.doxygen.org/index.html">
69
69
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
70
70
  </body>
@@ -55,7 +55,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li
55
55
  : <a class="el" href="relay_8h.html#746b991056f045f975634a6dad38cae7">relay.h</a>, <a class="el" href="relay_8c.html#746b991056f045f975634a6dad38cae7">relay.c</a><li>relay_verilog()
56
56
  : <a class="el" href="relay_8h.html#c1a02ebdb76a321bac689ac9b30f0422">relay.h</a>, <a class="el" href="relay_8c.html#c1a02ebdb76a321bac689ac9b30f0422">relay.c</a><li>ruby_run_handshake()
57
57
  : <a class="el" href="relay_8c.html#48de991a596f3c94a9bf19b3bf5a8dfd">relay.c</a></ul>
58
- <hr size="1"><address style="align: right;"><small>Generated on Wed Nov 15 19:34:18 2006 for Ruby-VPI by&nbsp;
58
+ <hr size="1"><address style="align: right;"><small>Generated on Thu Dec 7 15:09:45 2006 for Ruby-VPI by&nbsp;
59
59
  <a href="http://www.doxygen.org/index.html">
60
60
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
61
61
  </body>
@@ -58,7 +58,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li
58
58
  : <a class="el" href="vpi__user_8h.html#4d989aa964a0d69d3e1da525725573c8">vpi_user.h</a><li>swig_init()
59
59
  : <a class="el" href="swig_8h.html#fb31a3a8e1674c2ca6f32a9772bfb491">swig.h</a>, <a class="el" href="swig_8c.html#fb31a3a8e1674c2ca6f32a9772bfb491">swig.c</a><li>swig_rb_relay_verilog()
60
60
  : <a class="el" href="swig_8h.html#8ddc9ef9bf799f418bfe09959e695b0f">swig.h</a>, <a class="el" href="swig_8c.html#8ddc9ef9bf799f418bfe09959e695b0f">swig.c</a></ul>
61
- <hr size="1"><address style="align: right;"><small>Generated on Wed Nov 15 19:34:18 2006 for Ruby-VPI by&nbsp;
61
+ <hr size="1"><address style="align: right;"><small>Generated on Thu Dec 7 15:09:45 2006 for Ruby-VPI by&nbsp;
62
62
  <a href="http://www.doxygen.org/index.html">
63
63
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
64
64
  </body>
@@ -48,7 +48,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li
48
48
  <h3><a class="anchor" name="index_t">- t -</a></h3><ul>
49
49
  <li>true
50
50
  : <a class="el" href="common_8h.html#f6a258d8f3ee5206d682d799316314b108f175a5505a10b9ed657defeb050e4b">common.h</a></ul>
51
- <hr size="1"><address style="align: right;"><small>Generated on Wed Nov 15 19:34:18 2006 for Ruby-VPI by&nbsp;
51
+ <hr size="1"><address style="align: right;"><small>Generated on Thu Dec 7 15:09:45 2006 for Ruby-VPI by&nbsp;
52
52
  <a href="http://www.doxygen.org/index.html">
53
53
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
54
54
  </body>
@@ -50,7 +50,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li
50
50
  : <a class="el" href="verilog_8h.html#6e8374d012a82e20b7e93415b95cf33d">verilog.h</a><li>verilog_tf_funcPtr_strict
51
51
  : <a class="el" href="verilog_8h.html#858d173d13926845fc1c1248519d7fdc">verilog.h</a><li>verilog_tf_funcReturn
52
52
  : <a class="el" href="verilog_8h.html#0895cc43ee6708ed1a7fa8b9829665ba">verilog.h</a><li>verilog_tf_funcSig
53
- : <a class="el" href="vlog_8h.html#1b39935aef93f96d0dfb959639b00754">vlog.h</a>, <a class="el" href="vlog_8c.html#1b39935aef93f96d0dfb959639b00754">vlog.c</a>, <a class="el" href="verilog_8h.html#d3ce96438bf5e9101337a49bac4507f7">verilog.h</a><li>vlog_bind_task()
53
+ : <a class="el" href="vlog_8h.html#1b39935aef93f96d0dfb959639b00754">vlog.h</a>, <a class="el" href="vlog_8c.html#2e0274a583a8e9f28e0a99003053a354">vlog.c</a>, <a class="el" href="verilog_8h.html#d3ce96438bf5e9101337a49bac4507f7">verilog.h</a><li>vlog_bind_task()
54
54
  : <a class="el" href="vlog_8h.html#152829ae9d28417665d4d15a059e096c">vlog.h</a>, <a class="el" href="vlog_8c.html#152829ae9d28417665d4d15a059e096c">vlog.c</a><li>vlog_startup()
55
55
  : <a class="el" href="vlog_8c.html#dc9eaadf567421f239b8b647a3ea0eb2">vlog.c</a><li>vlog_startup_routines
56
56
  : <a class="el" href="vpi__user_8h.html#c633eb05d7e314a57629aa32ca3a9076">vpi_user.h</a>, <a class="el" href="vlog_8c.html#c1228ec9528d9c9be4de1c8e42cd3835">vlog.c</a><li>vpi0
@@ -465,7 +465,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li
465
465
  : <a class="el" href="vpi__user_8h.html#0a97a6fa4c5f82c05fc5909aded783e2">vpi_user.h</a><li>vpiXorPrim
466
466
  : <a class="el" href="vpi__user_8h.html#803026dd4484367c4b3cb871d28249df">vpi_user.h</a><li>vpiZ
467
467
  : <a class="el" href="vpi__user_8h.html#926969d440ea7547404cbac67367fe5f">vpi_user.h</a></ul>
468
- <hr size="1"><address style="align: right;"><small>Generated on Wed Nov 15 19:34:18 2006 for Ruby-VPI by&nbsp;
468
+ <hr size="1"><address style="align: right;"><small>Generated on Thu Dec 7 15:09:45 2006 for Ruby-VPI by&nbsp;
469
469
  <a href="http://www.doxygen.org/index.html">
470
470
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
471
471
  </body>
@@ -48,7 +48,7 @@ Here is a list of all functions, variables, defines, enums, and typedefs with li
48
48
  <h3><a class="anchor" name="index_x">- x -</a></h3><ul>
49
49
  <li>XXTERN
50
50
  : <a class="el" href="vpi__user_8h.html#d3973263496fbe347baaf726dac775c5">vpi_user.h</a></ul>
51
- <hr size="1"><address style="align: right;"><small>Generated on Wed Nov 15 19:34:18 2006 for Ruby-VPI by&nbsp;
51
+ <hr size="1"><address style="align: right;"><small>Generated on Thu Dec 7 15:09:45 2006 for Ruby-VPI by&nbsp;
52
52
  <a href="http://www.doxygen.org/index.html">
53
53
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
54
54
  </body>
@@ -74,7 +74,7 @@
74
74
  : <a class="el" href="common_8h.html#f30d3fc89fbb3ed2aab2f5904ab76815">common.h</a><li>common_debug
75
75
  : <a class="el" href="common_8h.html#fcdad79cb06a5c61737b2f434218dc95">common.h</a><li>common_printf
76
76
  : <a class="el" href="common_8h.html#88235e5f8aab82571d68045e9f73fe81">common.h</a></ul>
77
- <hr size="1"><address style="align: right;"><small>Generated on Wed Nov 15 19:34:18 2006 for Ruby-VPI by&nbsp;
77
+ <hr size="1"><address style="align: right;"><small>Generated on Thu Dec 7 15:09:45 2006 for Ruby-VPI by&nbsp;
78
78
  <a href="http://www.doxygen.org/index.html">
79
79
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
80
80
  </body>
@@ -43,7 +43,7 @@
43
43
  <h3><a class="anchor" name="index_e">- e -</a></h3><ul>
44
44
  <li>EETERN
45
45
  : <a class="el" href="vpi__user_8h.html#17207c0c9000e05cf0c7bcde1c10293d">vpi_user.h</a></ul>
46
- <hr size="1"><address style="align: right;"><small>Generated on Wed Nov 15 19:34:18 2006 for Ruby-VPI by&nbsp;
46
+ <hr size="1"><address style="align: right;"><small>Generated on Thu Dec 7 15:09:45 2006 for Ruby-VPI by&nbsp;
47
47
  <a href="http://www.doxygen.org/index.html">
48
48
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
49
49
  </body>