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
data/doc/history.yml CHANGED
@@ -1,3 +1,43 @@
1
+ -
2
+ Version: 14.0.0
3
+
4
+ Date: 2006-12-30
5
+
6
+ Summary: |
7
+ This release adds support for simulation callbacks, renders Verilog benches _fully simplified_, and revises the user manual to reflect major changes.
8
+
9
+ Notice: |
10
+ * The @Vpi::relay_verilog@ method has been replaced by @Vpi::simulate@.
11
+
12
+ Please update you tests accordingly, because invoking the @Vpi::relay_verilog@ method directly will cause your tests to freeze/hang.
13
+
14
+ * Verilog benches no longer contain any clock generation code. They are now mere skeletons, whose _only_ purpose is to instantiate the design under test.
15
+
16
+ The clock generation code is now contained in the Ruby bench.
17
+
18
+ h3. New features
19
+
20
+ * The @RubyVpi::init_bench@ method now gives you _complete control_ over performing a clock/operation/whatever cycle for your design. This feature allows you to work with multi-clocked designs.
21
+
22
+ * Callbacks are now supported through the @Vpi::vpi_register_cb@ method. See "the callbacks section in the user manual":manual.html#usage.vpi.callbacks for details.
23
+
24
+ * Added the @Vpi::advance_time@ method, which makes the Verilog simulator simulate a given number of time steps.
25
+
26
+ * Added the @Vpi::simulation_time@ method, which gives you the current simulation time as a 64-bit integer.
27
+
28
+ Details: |
29
+ * Removed the monkey patch for the SWIG @va_list@ problem -- it no longer occurs.
30
+
31
+ * Cleansed the appearance of the user documentation.
32
+ ** Added indices to section headings, just like LaTeX.
33
+ ** Admonition boxes no longer interfere with surrounding text, and they don't have big gap above them.
34
+ ** Navigation menu is now elastic (fluid layout).
35
+
36
+ * Revised the user manual and added new content.
37
+ ** Moved "VPI utility layer" section from background chapter into usage chapter in user manual.
38
+ ** Added a nice introduction to entire manual with links to reference documentation.
39
+
40
+
1
41
  -
2
42
  Version: 13.0.0
3
43
 
data/doc/intro.inc CHANGED
@@ -1,12 +1,16 @@
1
- bq. Ruby-VPI is a "Ruby":http://www.ruby-lang.org interface to "Verilog VPI":http://ieeexplore.ieee.org/xpl/standardstoc.jsp?isnumber=33945. It lets you create complex Verilog test benches easily and wholly in Ruby.
1
+ Ruby-VPI is a "Ruby":http://www.ruby-lang.org interface to "IEEE 1364-2005 Verilog VPI":http://ieeexplore.ieee.org/xpl/standardstoc.jsp?isnumber=33945. It lets you create complex Verilog test benches easily and wholly in Ruby.
2
2
 
3
3
 
4
4
  h2(#intro.features). Features
5
5
 
6
+ h3. Portable
7
+
6
8
  * Supports the _entire_ "IEEE Std 1364-2005"::http://ieeexplore.ieee.org/xpl/standardstoc.jsp?isnumber=33945 VPI standard.
7
9
 
8
10
  * Works with all "major Verilog simulators":manual.html#setup.reqs available today.
9
- ** Compile _once_ (during "installation":manual.html#setup.installation) and use forever!
11
+ ** Compiled _just once_ during "installation":manual.html#setup.installation and used forever!
12
+
13
+ h3. Agile
10
14
 
11
15
  * Enables "agile practices":http://agilemanifesto.org/ such as
12
16
  ** "test-driven":http://www.testdriven.com development
@@ -14,33 +18,51 @@ h2(#intro.features). Features
14
18
  ** "rapid prototyping":manual.html#usage.tutorial.implement-proto for design exploration
15
19
 
16
20
  * Eliminates unneccesary work:
17
- ** "Specifications":manual.html#usage.tutorial.specification are _readable_, portable, and executable.
21
+ ** "Specifications":manual.html#usage.tutorial.specification are readable, portable, and _executable_.
18
22
  ** The "automated test generator":manual.html#usage.tools.generate-test helps you accomodate design changes with _minimal_ effort.
23
+ ** There is absolutely _no compiling_!
24
+
25
+ h3. Powerful
19
26
 
20
- * Utilizes the "power and elegance":http://www.ruby-lang.org/en/about/ of Ruby:
27
+ * Inherits the "power and elegance":http://www.ruby-lang.org/en/about/ of Ruby:
21
28
  ** Unlimited length integers
22
29
  ** Regular expressions
23
30
  ** Multi-threading
24
31
  ** System calls and I/O
25
32
  ** "_ad infinitum_":http://rubyforge.org
26
33
 
34
+ * Uses "ruby-debug":http://rubyforge.org/projects/ruby-debug/ for "interactive debugging":manual.html#usage.debugger.
35
+ * Uses "rcov":http://eigenclass.org/hiki.rb?rcov for test "coverage analysis and report generation":manual.html#usage.test-runner.env-vars.
36
+
37
+ h3. Free
38
+
27
39
  * Gives you the _freedom_ to study, modify, and distribute this software, in accordance with the "GNU General Public License":http://www.gnu.org/copyleft/gpl.html.
28
40
 
29
41
 
30
- h3(#intro.applications). Applications
42
+ h2(#intro.applications). Applications
43
+
44
+ Here is a modest sampling of tasks that Ruby-VPI can be used to perform.
31
45
 
32
- Here is a modest sampling of tasks, paraphrased from "Pin Hong":http://embedded.eecs.berkeley.edu/Alumni/pinhong/scriptEDA/, that Ruby-VPI can be used to perform.
46
+ * From the second edition of "_The Verilog PLI Handbook_":http://www.sutherland-hdl.com/publications.html:
47
+ ** C language bus-functional models
48
+ ** Reading test vector files
49
+ ** Delay calculation
50
+ ** Custom output displays
51
+ ** Co-simulation
52
+ ** Design debug utilities
53
+ ** Simulation analysis
33
54
 
34
- * Writing hardware models in Ruby
35
- * Dumping/processing netlist data from Verilog database
36
- * Dumping/processing simulation data
37
- * Feeding dynamic simulation stimuli
38
- * Back-annotating delay information
39
- * Interactive logic simulation
40
- * Building a distributed simulation
55
+ * Adapted from "Pin Hong's":http://embedded.eecs.berkeley.edu/Alumni/pinhong/scriptEDA/ observations:
56
+ ** Writing hardware models in Ruby
57
+ ** Dumping or processing netlist data from Verilog database
58
+ ** Dumping or processing simulation data
59
+ ** Feeding dynamic simulation stimuli
60
+ ** Back-annotating delay information
61
+ ** Interactive logic simulation
62
+ ** Building a distributed simulation
41
63
 
42
64
 
43
- h3(#intro.appetizers). Appetizers
65
+ h2(#intro.appetizers). Appetizers
44
66
 
45
67
  Here is a modest sampling of code to whet your appetite.
46
68
 
@@ -58,5 +80,5 @@ bq. @puts some_register@
58
80
 
59
81
  * Simulate fifteen clock cycles:
60
82
 
61
- bq. @15.times { relay_verilog }@
83
+ bq. @15.times { simulate }@
62
84
 
data/doc/lib/doc_proxy.rb CHANGED
@@ -23,7 +23,7 @@ require 'erb_proxy'
23
23
  # Processes ERB templates to produce documentation. Templates may contain "<xref...>" tags where the ... represents the target anchor of the cross-reference.
24
24
  class DocProxy < ErbProxy
25
25
  Block = Struct.new :anchor, :title, :type
26
- Heading = Struct.new :anchor, :title, :depth
26
+ Heading = Struct.new :anchor, :title, :depth, :index
27
27
  @@anchorNum = 0
28
28
 
29
29
  CATEGORIES = {
@@ -67,12 +67,32 @@ class DocProxy < ErbProxy
67
67
 
68
68
  # parse document structure and insert anchors (so that the table of contents can link directly to these headings) where necessary
69
69
  buffer.gsub! %r{^(\s*h(\d))(.*)$} do
70
- head, depth, rest = $1, $2, $3
70
+ head, depth, rest = $1, $2.to_i, $3
71
71
 
72
72
  # parse title and class attributes
73
73
  rest =~ /^([\{\(\[].*?[\]\)\}])?\.(.*)$/
74
74
  atts, title = $1, $2.strip
75
75
 
76
+ # put heading index in title
77
+ prevDepth = @headings.last.depth rescue 0
78
+ prevIndex = @headings.last.index rescue ""
79
+ depthDiff = (depth - prevDepth).abs
80
+
81
+ index =
82
+ if depth > prevDepth
83
+ s = prevIndex + ('.1' * depthDiff)
84
+ s.sub /^\./, ''
85
+
86
+ elsif depth < prevDepth
87
+ s = prevIndex.sub /(\.\d+){#{depthDiff}}$/, ''
88
+ s.next
89
+
90
+ else
91
+ prevIndex.next
92
+ end
93
+
94
+ rest = "#{atts}. #{index} &nbsp; #{title}"
95
+
76
96
  # parse and insert anchor if necessary
77
97
  if atts =~ /#(.*?)\)/
78
98
  anchor = $1
@@ -81,7 +101,7 @@ class DocProxy < ErbProxy
81
101
  rest.insert 0, "(##{anchor})"
82
102
  end
83
103
 
84
- @headings << Heading.new(anchor, title, depth.to_i)
104
+ @headings << Heading.new(anchor, title, depth, index)
85
105
  @blocks[:section] << Block.new(anchor, title, :section)
86
106
 
87
107
  head + rest
@@ -141,7 +161,7 @@ class DocProxy < ErbProxy
141
161
 
142
162
  # Joins the given elements by putting enough white-space between them so that RedCloth knows they're different elements.
143
163
  def join_redcloth_elements *args
144
- args.join "\n\n\n"
164
+ args.join("\n\n\n") << "\n\n\n"
145
165
  end
146
166
 
147
167
  # Removes the # from a HTML anchor so that only its name is preserved.