ruby-vpi 13.0.0 → 14.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. data/Rakefile +6 -1
  2. data/bin/generate_test_tpl/bench.rb +84 -1
  3. data/bin/generate_test_tpl/bench.v +8 -17
  4. data/bin/generate_test_tpl/proto.rb +1 -1
  5. data/doc/common.css +14 -41
  6. data/doc/common.tpl +1 -1
  7. data/doc/figures/figures.dia +274 -753
  8. data/doc/figures/organization_detailed.png +0 -0
  9. data/doc/figures/ruby_relay.png +0 -0
  10. data/doc/history.html +363 -276
  11. data/doc/history.yml +40 -0
  12. data/doc/intro.inc +37 -15
  13. data/doc/lib/doc_proxy.rb +24 -4
  14. data/doc/manual.doc +345 -196
  15. data/doc/manual.html +741 -497
  16. data/doc/memo.doc +15 -15
  17. data/doc/memo.html +28 -27
  18. data/doc/readme.doc +2 -2
  19. data/doc/readme.html +51 -15
  20. data/doc/rss.erb +1 -1
  21. data/doc/rss.xml +1624 -31
  22. data/ext/Rakefile +1 -6
  23. data/ext/main.c +8 -3
  24. data/ext/main.h +5 -0
  25. data/ext/relay.c +12 -12
  26. data/ext/relay.h +1 -6
  27. data/ext/swig_vpi.i +2 -2
  28. data/ext/swig_wrap.cin +37 -20
  29. data/ext/verilog.h +2 -2
  30. data/ext/vlog.c +10 -3
  31. data/ext/vlog.h +4 -4
  32. data/lib/ruby-vpi/vpi.rb +114 -0
  33. data/lib/ruby-vpi.rb +21 -59
  34. data/ref/c/annotated.html +1 -1
  35. data/ref/c/common_8h.html +1 -1
  36. data/ref/c/files.html +1 -1
  37. data/ref/c/functions.html +1 -1
  38. data/ref/c/functions_vars.html +1 -1
  39. data/ref/c/globals.html +1 -1
  40. data/ref/c/globals_0x63.html +1 -1
  41. data/ref/c/globals_0x65.html +1 -1
  42. data/ref/c/globals_0x66.html +1 -1
  43. data/ref/c/globals_0x6d.html +3 -2
  44. data/ref/c/globals_0x70.html +1 -1
  45. data/ref/c/globals_0x72.html +4 -5
  46. data/ref/c/globals_0x73.html +1 -1
  47. data/ref/c/globals_0x74.html +1 -1
  48. data/ref/c/globals_0x76.html +4 -2
  49. data/ref/c/globals_0x78.html +1 -1
  50. data/ref/c/globals_defs.html +1 -1
  51. data/ref/c/globals_defs_0x65.html +1 -1
  52. data/ref/c/globals_defs_0x70.html +1 -1
  53. data/ref/c/globals_defs_0x76.html +1 -1
  54. data/ref/c/globals_defs_0x78.html +1 -1
  55. data/ref/c/globals_enum.html +1 -1
  56. data/ref/c/globals_eval.html +1 -1
  57. data/ref/c/globals_func.html +8 -7
  58. data/ref/c/globals_type.html +1 -1
  59. data/ref/c/globals_vars.html +3 -2
  60. data/ref/c/index.html +1 -1
  61. data/ref/c/main_8c.html +26 -1
  62. data/ref/c/main_8h.html +26 -1
  63. data/ref/c/relay_8c.html +11 -35
  64. data/ref/c/relay_8h.html +3 -27
  65. data/ref/c/structt__cb__data.html +1 -1
  66. data/ref/c/structt__vpi__delay.html +1 -1
  67. data/ref/c/structt__vpi__error__info.html +1 -1
  68. data/ref/c/structt__vpi__strengthval.html +1 -1
  69. data/ref/c/structt__vpi__systf__data.html +1 -1
  70. data/ref/c/structt__vpi__time.html +1 -1
  71. data/ref/c/structt__vpi__value.html +1 -1
  72. data/ref/c/structt__vpi__vecval.html +1 -1
  73. data/ref/c/structt__vpi__vlog__info.html +1 -1
  74. data/ref/c/verilog_8h.html +5 -5
  75. data/ref/c/vlog_8c.html +44 -6
  76. data/ref/c/vlog_8h.html +7 -8
  77. data/ref/c/vpi__user_8h.html +1 -1
  78. data/ref/ruby/classes/RDoc.html +5 -5
  79. data/ref/ruby/classes/RDoc.src/{M000041.html → M000045.html} +0 -0
  80. data/ref/ruby/classes/RubyVpi.html +10 -28
  81. data/ref/ruby/classes/RubyVpi.src/M000029.html +101 -124
  82. data/ref/ruby/classes/Vpi/Handle.html +56 -56
  83. data/ref/ruby/classes/Vpi/Handle.src/M000034.html +5 -9
  84. data/ref/ruby/classes/Vpi/Handle.src/M000035.html +5 -31
  85. data/ref/ruby/classes/Vpi/Handle.src/M000036.html +5 -74
  86. data/ref/ruby/classes/Vpi/Handle.src/M000037.html +5 -17
  87. data/ref/ruby/classes/Vpi/Handle.src/M000038.html +9 -11
  88. data/ref/ruby/classes/Vpi/Handle.src/M000039.html +44 -0
  89. data/ref/ruby/classes/Vpi/Handle.src/M000040.html +74 -55
  90. data/ref/ruby/classes/Vpi/Handle.src/M000041.html +30 -0
  91. data/ref/ruby/classes/Vpi/Handle.src/M000042.html +24 -0
  92. data/ref/ruby/classes/Vpi/Handle.src/M000044.html +68 -0
  93. data/ref/ruby/classes/Vpi.html +149 -0
  94. data/ref/ruby/classes/Vpi.src/M000030.html +28 -0
  95. data/ref/ruby/classes/Vpi.src/M000031.html +18 -0
  96. data/ref/ruby/classes/Vpi.src/M000032.html +39 -0
  97. data/ref/ruby/classes/Vpi.src/M000033.html +22 -0
  98. data/ref/ruby/created.rid +1 -1
  99. data/ref/ruby/files/lib/ruby-vpi/vpi_rb.html +1 -1
  100. data/ref/ruby/files/lib/ruby-vpi_rb.html +2 -2
  101. data/ref/ruby/fr_method_index.html +18 -14
  102. data/samp/counter/counter_rspec_bench.rb +81 -1
  103. data/samp/counter/counter_rspec_bench.v +5 -12
  104. data/samp/counter/counter_rspec_design.rb +1 -2
  105. data/samp/counter/counter_rspec_proto.rb +1 -1
  106. data/samp/counter/counter_rspec_spec.rb +3 -3
  107. data/samp/counter/counter_xunit_bench.rb +81 -1
  108. data/samp/counter/counter_xunit_bench.v +5 -12
  109. data/samp/counter/counter_xunit_design.rb +1 -2
  110. data/samp/counter/counter_xunit_proto.rb +1 -1
  111. data/samp/counter/counter_xunit_spec.rb +3 -3
  112. data/samp/pipelined_alu/hw5_unit_test_bench.rb +81 -1
  113. data/samp/pipelined_alu/hw5_unit_test_bench.v +11 -18
  114. data/samp/pipelined_alu/hw5_unit_test_design.rb +1 -1
  115. data/samp/pipelined_alu/hw5_unit_test_proto.rb +1 -1
  116. data/samp/pipelined_alu/hw5_unit_test_spec.rb +1 -1
  117. metadata +12 -9
  118. data/doc/figures/ruby_init.png +0 -0
  119. data/ext/swig_vpi.h +0 -924
  120. data/ref/ruby/classes/Vpi/Handle.src/M000030.html +0 -18
  121. data/ref/ruby/classes/Vpi/Handle.src/M000031.html +0 -18
  122. data/ref/ruby/classes/Vpi/Handle.src/M000032.html +0 -18
  123. data/ref/ruby/classes/Vpi/Handle.src/M000033.html +0 -18
@@ -1,16 +1,9 @@
1
1
  // This file is the Verilog side of the bench.
2
2
  module counter_xunit_bench;
3
+ parameter Size = 5;
4
+ reg clock;
5
+ reg reset;
6
+ wire [Size - 1 : 0] count;
3
7
 
4
- // instantiate the design under test
5
- parameter Size = 5;
6
- reg clock;
7
- reg reset;
8
- wire [Size - 1 : 0] count;
9
-
10
- counter #(.Size(Size)) counter_xunit_bench_design(.clock(clock), .reset(reset), .count(count));
11
-
12
- // generate clock for the design under test
13
- initial clock = 0;
14
- always #5 clock = !clock;
15
-
8
+ counter #(.Size(Size)) counter_xunit_bench_design(.clock(clock), .reset(reset), .count(count));
16
9
  endmodule
@@ -2,8 +2,7 @@
2
2
 
3
3
  # This method resets the design under test.
4
4
  def Counter.reset!
5
- # assert the reset signal for two clock cycles
6
5
  reset.intVal = 1
7
- 2.times {relay_verilog}
6
+ simulate
8
7
  reset.intVal = 0
9
8
  end
@@ -1,6 +1,6 @@
1
1
  # This is a prototype of the design under test.
2
2
 
3
- # When prototyping is enabled, relay_verilog invokes this method
3
+ # When prototyping is enabled, Vpi::simulate invokes this method
4
4
  # instead of transferring control to the Verilog simulator.
5
5
  def Counter.simulate!
6
6
  if reset.intVal == 1
@@ -18,7 +18,7 @@ class ResettedCounterValue < Test::Unit::TestCase
18
18
  def test_increment
19
19
  LIMIT.times do |i|
20
20
  assert_equal i, Counter.count.intVal
21
- relay_verilog # increment the counter
21
+ simulate # increment the counter
22
22
  end
23
23
  end
24
24
  end
@@ -28,12 +28,12 @@ class MaximumCounterValue < Test::Unit::TestCase
28
28
  Counter.reset!
29
29
 
30
30
  # increment the counter to maximum value
31
- MAX.times {relay_verilog}
31
+ MAX.times {simulate}
32
32
  assert_equal MAX, Counter.count.intVal
33
33
  end
34
34
 
35
35
  def test_overflow
36
- relay_verilog # increment the counter
36
+ simulate # increment the counter
37
37
  assert_equal 0, Counter.count.intVal
38
38
  end
39
39
  end
@@ -3,4 +3,84 @@
3
3
  require 'rubygems'
4
4
  require 'ruby-vpi'
5
5
 
6
- RubyVpi.init_bench :Hw5_unit, :xUnit
6
+ RubyVpi.init_bench :Hw5_unit, :xUnit do
7
+ ##
8
+ # This block is executed whenever Vpi::simulate is invoked.
9
+ #
10
+ # It simulates the design under test by (typically) toggling
11
+ # the clock signal, as demonstrated below.
12
+ ##
13
+
14
+ ##
15
+ # We are currently here (marked by the ! signs):
16
+ #
17
+ # !
18
+ # !
19
+ # ! ____ ____ ____ ____
20
+ # ___!/ \____/ \____/ \____/ \
21
+ # !
22
+ # !
23
+ #
24
+ ##
25
+
26
+ Hw5_unit.clk.intVal = 1
27
+
28
+ ##
29
+ # After setting the clock signal to high, we are here:
30
+ #
31
+ # !
32
+ # !
33
+ # !____ ____ ____ ____
34
+ # ____/! \____/ \____/ \____/ \
35
+ # !
36
+ # !
37
+ #
38
+ ##
39
+
40
+ advance_time
41
+
42
+ ##
43
+ # After advancing the time, we are here:
44
+ #
45
+ # !
46
+ # !
47
+ # ____! ____ ____ ____
48
+ # ____/ !\____/ \____/ \____/ \
49
+ # !
50
+ # !
51
+ #
52
+ ##
53
+
54
+ Hw5_unit.clk.intVal = 0
55
+
56
+ ##
57
+ # After setting the clock signal to low, we are here:
58
+ #
59
+ # !
60
+ # !
61
+ # ____ ! ____ ____ ____
62
+ # ____/ \!____/ \____/ \____/ \
63
+ # !
64
+ # !
65
+ #
66
+ ##
67
+
68
+ advance_time
69
+
70
+ ##
71
+ # After advancing the time, we are here:
72
+ #
73
+ #
74
+ # !
75
+ # !
76
+ # ____ ! ____ ____ ____
77
+ # ____/ \____!/ \____/ \____/ \
78
+ # !
79
+ # !
80
+ #
81
+ ##
82
+
83
+ ##
84
+ # This process repeats when Vpi::simulate is invoked again.
85
+ ##
86
+ end
@@ -1,21 +1,14 @@
1
1
  // This file is the Verilog side of the bench.
2
2
  module hw5_unit_test_bench;
3
-
4
- // instantiate the design under test
5
- reg clk;
6
- reg reset;
7
- reg [`DATABITS-1:0] in_databits;
8
- reg [`WIDTH-1:0] a;
9
- reg [`WIDTH-1:0] b;
10
- reg [1:0] in_op;
11
- wire [`WIDTH-1:0] res;
12
- wire [`DATABITS-1:0] out_databits;
13
- wire [1:0] out_op;
14
-
15
- hw5_unit hw5_unit_test_bench_design(.clk(clk), .reset(reset), .in_databits(in_databits), .a(a), .b(b), .in_op(in_op), .res(res), .out_databits(out_databits), .out_op(out_op));
16
-
17
- // generate clock for the design under test
18
- initial clk = 0;
19
- always #5 clk = !clk;
20
-
3
+ reg clk;
4
+ reg reset;
5
+ reg [`DATABITS-1:0] in_databits;
6
+ reg [`WIDTH-1:0] a;
7
+ reg [`WIDTH-1:0] b;
8
+ reg [1:0] in_op;
9
+ wire [`WIDTH-1:0] res;
10
+ wire [`DATABITS-1:0] out_databits;
11
+ wire [1:0] out_op;
12
+
13
+ hw5_unit hw5_unit_test_bench_design(.clk(clk), .reset(reset), .in_databits(in_databits), .a(a), .b(b), .in_op(in_op), .res(res), .out_databits(out_databits), .out_op(out_op));
21
14
  endmodule
@@ -23,7 +23,7 @@ def Hw5_unit.reset!
23
23
  reset.intVal = 1
24
24
 
25
25
  RESET_DELAY.times do
26
- relay_verilog
26
+ simulate
27
27
  end
28
28
 
29
29
  reset.intVal = 0
@@ -1,6 +1,6 @@
1
1
  # This is a prototype of the design under test.
2
2
 
3
- # When prototyping is enabled, relay_verilog invokes this method
3
+ # When prototyping is enabled, Vpi::simulate invokes this method
4
4
  # instead of transferring control to the Verilog simulator.
5
5
  def Hw5_unit.simulate!
6
6
  raise NotImplementedError, "Prototype is not yet implemented."
@@ -60,7 +60,7 @@ class Hw5_unit_test_spec < Test::Unit::TestCase
60
60
  numIssued += 1
61
61
  end
62
62
 
63
- relay_verilog
63
+ simulate
64
64
 
65
65
  # verify result of finished operation
66
66
  unless Hw5_unit.out_databits.x?
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: ruby-vpi
5
5
  version: !ruby/object:Gem::Version
6
- version: 13.0.0
7
- date: 2006-12-27 00:00:00 -08:00
6
+ version: 14.0.0
7
+ date: 2006-12-30 00:00:00 -08:00
8
8
  summary: Ruby interface to IEEE 1364-2005 Verilog VPI
9
9
  require_paths:
10
10
  - lib
@@ -53,7 +53,6 @@ files:
53
53
  - ext/relay.c
54
54
  - ext/Doxyfile
55
55
  - ext/vpi_user.h
56
- - ext/swig_vpi.h
57
56
  - ext/swig_wrap.cin
58
57
  - bin/generate_test.rb
59
58
  - bin/generate_test_tpl
@@ -97,7 +96,6 @@ files:
97
96
  - doc/readme.html
98
97
  - doc/rss.xml
99
98
  - doc/figures/figures.dia
100
- - doc/figures/ruby_init.png
101
99
  - doc/figures/ruby_relay.png
102
100
  - doc/figures/organization.png
103
101
  - doc/figures/organization_detailed.png
@@ -239,6 +237,7 @@ files:
239
237
  - ref/ruby/classes/ERB.src
240
238
  - ref/ruby/classes/FileUtils.src
241
239
  - ref/ruby/classes/RubyVpi.src
240
+ - ref/ruby/classes/Vpi.src
242
241
  - ref/ruby/classes/Vpi
243
242
  - ref/ruby/classes/RDoc.src
244
243
  - ref/ruby/classes/VerilogParser.html
@@ -285,19 +284,23 @@ files:
285
284
  - ref/ruby/classes/FileUtils.src/M000027.html
286
285
  - ref/ruby/classes/FileUtils.src/M000028.html
287
286
  - ref/ruby/classes/RubyVpi.src/M000029.html
287
+ - ref/ruby/classes/Vpi.src/M000030.html
288
+ - ref/ruby/classes/Vpi.src/M000031.html
289
+ - ref/ruby/classes/Vpi.src/M000032.html
290
+ - ref/ruby/classes/Vpi.src/M000033.html
288
291
  - ref/ruby/classes/Vpi/Handle.src
289
292
  - ref/ruby/classes/Vpi/Handle.html
290
- - ref/ruby/classes/Vpi/Handle.src/M000030.html
291
- - ref/ruby/classes/Vpi/Handle.src/M000031.html
292
- - ref/ruby/classes/Vpi/Handle.src/M000032.html
293
- - ref/ruby/classes/Vpi/Handle.src/M000033.html
294
293
  - ref/ruby/classes/Vpi/Handle.src/M000034.html
295
294
  - ref/ruby/classes/Vpi/Handle.src/M000035.html
296
295
  - ref/ruby/classes/Vpi/Handle.src/M000036.html
297
296
  - ref/ruby/classes/Vpi/Handle.src/M000037.html
298
297
  - ref/ruby/classes/Vpi/Handle.src/M000038.html
298
+ - ref/ruby/classes/Vpi/Handle.src/M000039.html
299
299
  - ref/ruby/classes/Vpi/Handle.src/M000040.html
300
- - ref/ruby/classes/RDoc.src/M000041.html
300
+ - ref/ruby/classes/Vpi/Handle.src/M000041.html
301
+ - ref/ruby/classes/Vpi/Handle.src/M000042.html
302
+ - ref/ruby/classes/Vpi/Handle.src/M000044.html
303
+ - ref/ruby/classes/RDoc.src/M000045.html
301
304
  - ref/ruby/classes/RubyVpi/Config.html
302
305
  test_files: []
303
306
 
Binary file