ruby-vpi 15.0.2 → 16.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (208) hide show
  1. data/LICENSE +23 -340
  2. data/Rakefile +169 -192
  3. data/bin/generate_test.rb +26 -25
  4. data/bin/generate_test_tpl/runner.rake +4 -10
  5. data/bin/header_to_ruby.rb +3 -20
  6. data/doc/README +11 -0
  7. data/doc/Rakefile +8 -21
  8. data/doc/common.css +44 -10
  9. data/doc/common.tpl +5 -10
  10. data/doc/history.doc +8 -7
  11. data/doc/history.html +228 -560
  12. data/doc/history.rb +7 -11
  13. data/doc/{history.yml → history.yaml} +325 -128
  14. data/doc/images/{feed-icon.png → feed-icon-28x28.png} +0 -0
  15. data/doc/images/ruby/LICENSE +15 -0
  16. data/doc/images/ruby/logo-reflection.png +0 -0
  17. data/doc/images/ruby/logo-reflection.xcf +0 -0
  18. data/doc/images/ruby/logo.png +0 -0
  19. data/doc/images/{LICENSE → tango/LICENSE} +0 -0
  20. data/doc/images/{caution.png → tango/caution.png} +0 -0
  21. data/doc/images/{caution.svg → tango/caution.svg} +0 -0
  22. data/doc/images/{home.png → tango/home.png} +0 -0
  23. data/doc/images/{home.svg → tango/home.svg} +0 -0
  24. data/doc/images/{important.png → tango/important.png} +0 -0
  25. data/doc/images/{important.svg → tango/important.svg} +0 -0
  26. data/doc/images/{next.png → tango/next.png} +0 -0
  27. data/doc/images/{next.svg → tango/next.svg} +0 -0
  28. data/doc/images/{note.png → tango/note.png} +0 -0
  29. data/doc/images/{note.svg → tango/note.svg} +0 -0
  30. data/doc/images/{prev.png → tango/prev.png} +0 -0
  31. data/doc/images/{prev.svg → tango/prev.svg} +0 -0
  32. data/doc/images/{tip.png → tango/tip.png} +0 -0
  33. data/doc/images/{tip.svg → tango/tip.svg} +0 -0
  34. data/doc/images/{up.png → tango/up.png} +0 -0
  35. data/doc/images/{up.svg → tango/up.svg} +0 -0
  36. data/doc/images/{warning.png → tango/warning.png} +0 -0
  37. data/doc/images/{warning.svg → tango/warning.svg} +0 -0
  38. data/doc/intro.inc +105 -36
  39. data/doc/lib/doc_format.rb +151 -29
  40. data/doc/lib/doc_proxy.rb +28 -69
  41. data/doc/lib/erb_content.rb +10 -22
  42. data/doc/lib/erb_proxy.rb +13 -24
  43. data/doc/manual.doc +16 -60
  44. data/doc/manual.html +257 -340
  45. data/doc/memo.doc +2 -0
  46. data/doc/memo.html +11 -11
  47. data/doc/readme.doc +36 -2
  48. data/doc/readme.html +214 -51
  49. data/doc/rss.erb +3 -3
  50. data/doc/rss.xml +217 -269
  51. data/ext/Rakefile +7 -22
  52. data/ext/common.h +10 -21
  53. data/ext/extconf.rb +5 -0
  54. data/ext/main.c +2 -18
  55. data/ext/main.h +1 -16
  56. data/ext/relay.c +3 -17
  57. data/ext/relay.h +3 -17
  58. data/ext/verilog.h +6 -18
  59. data/ext/vlog.c +3 -21
  60. data/ext/vlog.h +3 -17
  61. data/lib/ruby-vpi/erb.rb +7 -20
  62. data/lib/ruby-vpi/float.rb +6 -20
  63. data/lib/ruby-vpi/integer.rb +27 -47
  64. data/lib/ruby-vpi/rake.rb +4 -19
  65. data/lib/ruby-vpi/rcov.rb +6 -21
  66. data/lib/ruby-vpi/rdoc.rb +3 -21
  67. data/lib/ruby-vpi/runner.rb +28 -29
  68. data/lib/ruby-vpi/runner_proxy.rb +5 -21
  69. data/lib/ruby-vpi/verilog_parser.rb +5 -20
  70. data/lib/ruby-vpi/vpi.rb +420 -376
  71. data/lib/ruby-vpi.rb +26 -32
  72. data/ref/c/annotated.html +1 -1
  73. data/ref/c/common_8h.html +1 -1
  74. data/ref/c/files.html +1 -1
  75. data/ref/c/functions.html +1 -1
  76. data/ref/c/functions_vars.html +1 -1
  77. data/ref/c/globals.html +1 -1
  78. data/ref/c/globals_0x63.html +1 -1
  79. data/ref/c/globals_0x65.html +1 -1
  80. data/ref/c/globals_0x66.html +1 -1
  81. data/ref/c/globals_0x6d.html +1 -1
  82. data/ref/c/globals_0x70.html +1 -1
  83. data/ref/c/globals_0x72.html +1 -1
  84. data/ref/c/globals_0x73.html +1 -1
  85. data/ref/c/globals_0x74.html +1 -1
  86. data/ref/c/globals_0x76.html +1 -1
  87. data/ref/c/globals_0x78.html +1 -1
  88. data/ref/c/globals_defs.html +1 -1
  89. data/ref/c/globals_defs_0x65.html +1 -1
  90. data/ref/c/globals_defs_0x70.html +1 -1
  91. data/ref/c/globals_defs_0x76.html +1 -1
  92. data/ref/c/globals_defs_0x78.html +1 -1
  93. data/ref/c/globals_enum.html +1 -1
  94. data/ref/c/globals_eval.html +1 -1
  95. data/ref/c/globals_func.html +1 -1
  96. data/ref/c/globals_type.html +1 -1
  97. data/ref/c/globals_vars.html +1 -1
  98. data/ref/c/index.html +1 -1
  99. data/ref/c/main_8c.html +1 -1
  100. data/ref/c/main_8h.html +1 -1
  101. data/ref/c/relay_8c.html +1 -1
  102. data/ref/c/relay_8h.html +1 -1
  103. data/ref/c/structt__cb__data.html +1 -1
  104. data/ref/c/structt__vpi__delay.html +1 -1
  105. data/ref/c/structt__vpi__error__info.html +1 -1
  106. data/ref/c/structt__vpi__strengthval.html +1 -1
  107. data/ref/c/structt__vpi__systf__data.html +1 -1
  108. data/ref/c/structt__vpi__time.html +1 -1
  109. data/ref/c/structt__vpi__value.html +1 -1
  110. data/ref/c/structt__vpi__vecval.html +1 -1
  111. data/ref/c/structt__vpi__vlog__info.html +1 -1
  112. data/ref/c/verilog_8h.html +1 -1
  113. data/ref/c/vlog_8c.html +1 -1
  114. data/ref/c/vlog_8h.html +1 -1
  115. data/ref/c/vpi__user_8h.html +1 -1
  116. data/ref/ruby/classes/ERB.html +5 -5
  117. data/ref/ruby/classes/ERB.src/{M000026.html → M000024.html} +15 -15
  118. data/ref/ruby/classes/FileUtils.html +10 -10
  119. data/ref/ruby/classes/FileUtils.src/{M000027.html → M000025.html} +4 -4
  120. data/ref/ruby/classes/FileUtils.src/{M000028.html → M000026.html} +4 -4
  121. data/ref/ruby/classes/Float.html +5 -5
  122. data/ref/ruby/classes/Float.src/{M000022.html → M000020.html} +5 -5
  123. data/ref/ruby/classes/Integer.html +20 -56
  124. data/ref/ruby/classes/Integer.src/M000008.html +11 -11
  125. data/ref/ruby/classes/Integer.src/M000009.html +4 -4
  126. data/ref/ruby/classes/Integer.src/M000010.html +4 -4
  127. data/ref/ruby/classes/Integer.src/M000011.html +4 -4
  128. data/ref/ruby/classes/Integer.src/M000012.html +4 -4
  129. data/ref/ruby/classes/Integer.src/M000013.html +4 -4
  130. data/ref/ruby/classes/Integer.src/M000016.html +12 -9
  131. data/ref/ruby/classes/Integer.src/M000017.html +18 -9
  132. data/ref/ruby/classes/Integer.src/M000018.html +12 -12
  133. data/ref/ruby/classes/Integer.src/M000019.html +17 -18
  134. data/ref/ruby/classes/RDoc.src/M000053.html +25 -25
  135. data/ref/ruby/classes/RubyVpi/Config.html +3 -3
  136. data/ref/ruby/classes/RubyVpi.html +11 -5
  137. data/ref/ruby/classes/RubyVpi.src/{M000029.html → M000027.html} +103 -101
  138. data/ref/ruby/classes/String.html +21 -15
  139. data/ref/ruby/classes/String.src/M000021.html +36 -0
  140. data/ref/ruby/classes/String.src/{M000024.html → M000022.html} +24 -24
  141. data/ref/ruby/classes/String.src/M000023.html +5 -23
  142. data/ref/ruby/classes/VerilogParser/Module/Parameter.src/M000007.html +5 -5
  143. data/ref/ruby/classes/VerilogParser/Module/Port.src/M000003.html +7 -7
  144. data/ref/ruby/classes/VerilogParser/Module/Port.src/M000004.html +4 -4
  145. data/ref/ruby/classes/VerilogParser/Module/Port.src/M000005.html +4 -4
  146. data/ref/ruby/classes/VerilogParser/Module/Port.src/M000006.html +4 -4
  147. data/ref/ruby/classes/VerilogParser/Module.src/M000002.html +20 -20
  148. data/ref/ruby/classes/VerilogParser.html +6 -0
  149. data/ref/ruby/classes/VerilogParser.src/M000001.html +20 -20
  150. data/ref/ruby/classes/Vpi/Handle.html +89 -88
  151. data/ref/ruby/classes/Vpi/Handle.src/M000036.html +18 -0
  152. data/ref/ruby/classes/Vpi/Handle.src/M000037.html +5 -5
  153. data/ref/ruby/classes/Vpi/Handle.src/M000038.html +5 -5
  154. data/ref/ruby/classes/Vpi/Handle.src/M000039.html +5 -5
  155. data/ref/ruby/classes/Vpi/Handle.src/M000040.html +8 -5
  156. data/ref/ruby/classes/Vpi/Handle.src/M000041.html +8 -8
  157. data/ref/ruby/classes/Vpi/Handle.src/M000042.html +7 -6
  158. data/ref/ruby/classes/Vpi/Handle.src/M000043.html +31 -9
  159. data/ref/ruby/classes/Vpi/Handle.src/M000044.html +74 -31
  160. data/ref/ruby/classes/Vpi/Handle.src/M000045.html +17 -74
  161. data/ref/ruby/classes/Vpi/Handle.src/M000046.html +11 -17
  162. data/ref/ruby/classes/Vpi/Handle.src/M000048.html +31 -0
  163. data/ref/ruby/classes/Vpi/Handle.src/M000049.html +53 -52
  164. data/ref/ruby/classes/Vpi/S_vpi_time.src/M000050.html +4 -4
  165. data/ref/ruby/classes/Vpi/S_vpi_time.src/M000051.html +5 -5
  166. data/ref/ruby/classes/Vpi/S_vpi_value.html +15 -15
  167. data/ref/ruby/classes/Vpi/S_vpi_value.src/{M000036.html → M000033.html} +5 -5
  168. data/ref/ruby/classes/Vpi/S_vpi_value.src/M000034.html +5 -5
  169. data/ref/ruby/classes/Vpi/S_vpi_value.src/M000035.html +5 -5
  170. data/ref/ruby/classes/Vpi.html +48 -19
  171. data/ref/ruby/classes/Vpi.src/M000028.html +28 -0
  172. data/ref/ruby/classes/Vpi.src/M000029.html +18 -0
  173. data/ref/ruby/classes/Vpi.src/M000030.html +25 -15
  174. data/ref/ruby/classes/Vpi.src/M000031.html +9 -5
  175. data/ref/ruby/classes/Vpi.src/M000032.html +9 -25
  176. data/ref/ruby/created.rid +1 -1
  177. data/ref/ruby/files/bin/generate_test_rb.html +2 -1
  178. data/ref/ruby/files/bin/header_to_ruby_rb.html +1 -1
  179. data/ref/ruby/files/lib/ruby-vpi/erb_rb.html +7 -1
  180. data/ref/ruby/files/lib/ruby-vpi/float_rb.html +7 -1
  181. data/ref/ruby/files/lib/ruby-vpi/integer_rb.html +7 -1
  182. data/ref/ruby/files/lib/ruby-vpi/rake_rb.html +7 -1
  183. data/ref/ruby/files/lib/ruby-vpi/rcov_rb.html +7 -1
  184. data/ref/ruby/files/lib/ruby-vpi/rdoc_rb.html +1 -1
  185. data/ref/ruby/files/lib/ruby-vpi/runner_proxy_rb.html +1 -1
  186. data/ref/ruby/files/lib/ruby-vpi/runner_rb.html +1 -1
  187. data/ref/ruby/files/lib/ruby-vpi/verilog_parser_rb.html +1 -1
  188. data/ref/ruby/files/lib/ruby-vpi/vpi_rb.html +1 -1
  189. data/ref/ruby/files/lib/ruby-vpi_rb.html +7 -1
  190. data/ref/ruby/fr_method_index.html +34 -34
  191. data/samp/counter/counter_rspec_runner.rake +4 -0
  192. data/samp/counter/counter_xunit_runner.rake +4 -0
  193. data/samp/pipelined_alu/Hw5UnitModel.rb +3 -19
  194. data/samp/pipelined_alu/README +38 -13
  195. data/samp/pipelined_alu/TestHw5UnitModel.rb +9 -20
  196. data/samp/pipelined_alu/hw5_unit.v +1 -16
  197. data/samp/pipelined_alu/hw5_unit_test_runner.rake +4 -0
  198. data/samp/pipelined_alu/hw5_unit_test_spec.rb +3 -20
  199. data/samp/pipelined_alu/int_gen.rb +6 -20
  200. metadata +47 -43
  201. data/doc/LICENSE +0 -397
  202. data/doc/images/feed-icon.LICENSE +0 -2
  203. data/doc/images/feed-icon.svg +0 -18
  204. data/ref/ruby/classes/Integer.src/M000020.html +0 -25
  205. data/ref/ruby/classes/Integer.src/M000021.html +0 -30
  206. data/ref/ruby/classes/String.src/M000025.html +0 -18
  207. data/ref/ruby/classes/Vpi/Handle.src/M000047.html +0 -24
  208. data/ref/ruby/classes/Vpi.src/M000033.html +0 -22
data/Rakefile CHANGED
@@ -1,25 +1,9 @@
1
1
  # = Environment variables
2
2
  # CFLAGS:: Arguments to the compiler.
3
3
  # LDFLAGS:: Arguments to the linker.
4
- =begin
5
- Copyright 2006 Suraj N. Kurapati
6
-
7
- This file is part of Ruby-VPI.
8
-
9
- Ruby-VPI is free software; you can redistribute it and/or
10
- modify it under the terms of the GNU General Public License
11
- as published by the Free Software Foundation; either version 2
12
- of the License, or (at your option) any later version.
13
-
14
- Ruby-VPI is distributed in the hope that it will be useful,
15
- but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- GNU General Public License for more details.
18
-
19
- You should have received a copy of the GNU General Public License
20
- along with Ruby-VPI; if not, write to the Free Software Foundation,
21
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
- =end
4
+ #--
5
+ # Copyright 2006-2007 Suraj N. Kurapati
6
+ # See the file named LICENSE for details.
23
7
 
24
8
  CFLAGS, LDFLAGS = ENV['CFLAGS'], ENV['LDFLAGS']
25
9
 
@@ -36,245 +20,238 @@ $:.unshift PROJECT_LIBS
36
20
  require 'ruby-vpi'
37
21
  require 'ruby-vpi/rake'
38
22
 
23
+ task :default => :build
39
24
 
40
- include RubyVpi::Config
41
- PROJECT_SSH_URL = "snk@rubyforge.org:/var/www/gforge-projects/#{PROJECT_ID}"
42
-
43
- load 'doc/history.rb'
44
- head = @history.first
45
- PROJECT_VERSION = head['Version']
46
- PROJECT_BIRTHDAY = head['Date']
47
25
 
26
+ # load project information
27
+ include RubyVpi::Config
28
+ PROJECT_SSH_URL = "snk@rubyforge.org:/var/www/gforge-projects/#{PROJECT_ID}"
48
29
 
49
- # Returns a temporary, unique path ready for use. No file exists at the returned path.
50
- def generate_temp_path
51
- rm_f path = Tempfile.new($$).path
52
- path
53
- end
30
+ load 'doc/history.rb'
31
+ head = @history.first
32
+ PROJECT_VERSION = head['Version']
33
+ PROJECT_BIRTHDAY = head['Date']
54
34
 
55
- # uploads the given sources to the given destination URL
56
- def upload aDestUrl, *aSources
57
- sh 'rsync', '-avz', '--delete', aSources, aDestUrl
58
- end
59
35
 
36
+ # utility
60
37
 
38
+ # Returns a temporary, unique path ready for use. No file exists at the
39
+ # returned path.
40
+ def generate_temp_path
41
+ rm_f path = Tempfile.new($$).path
42
+ path
43
+ end
61
44
 
62
- task :default => :build
45
+ # uploads the given sources to the given destination URL
46
+ def upload aDestUrl, *aSources
47
+ sh 'rsync', '-avz', '--delete', aSources, aDestUrl
48
+ end
63
49
 
64
- [:clean, :clobber].each do |t|
65
- task t do
66
- files = FileList['**/Rakefile'].exclude('_darcs')
67
- files.shift # avoid infinite loop on _this_ file
50
+ # propogate cleaning tasks recursively to lower levels
51
+ [:clean, :clobber].each do |t|
52
+ task t do
53
+ files = FileList['**/Rakefile'].exclude('_darcs')
54
+ files.shift # avoid infinite loop on _this_ file
68
55
 
69
- # allows propogation to lower levels when gem not installed
70
- ENV['RUBYLIB'] = PROJECT_LIBS
56
+ # allows propogation to lower levels when gem not installed
57
+ ENV['RUBYLIB'] = PROJECT_LIBS
71
58
 
72
- files.each do |f|
73
- cd File.dirname(f) do
74
- sh 'rake', t.to_s
59
+ files.each do |f|
60
+ cd File.dirname(f) do
61
+ sh 'rake', t.to_s
62
+ end
75
63
  end
76
64
  end
77
65
  end
78
- end
79
66
 
80
67
 
68
+ # extension
81
69
 
82
- ## extension
70
+ desc "Builds object files for all simulators."
71
+ task :build
83
72
 
84
- desc "Builds object files for all simulators."
85
- task :build
73
+ directory 'obj'
74
+ CLOBBER.include 'obj'
86
75
 
87
- directory 'obj'
88
- CLOBBER.include 'obj'
76
+ SIMULATORS.each_pair do |id, sim|
77
+ taskName = "build_#{id}"
89
78
 
79
+ desc "Builds object files for #{sim.name}."
80
+ task taskName => ['obj', 'ext'] do
81
+ src = "#{PROJECT_ID}.so"
82
+ dst = "#{PROJECT_ID}.#{id}.so"
90
83
 
91
- SIMULATORS.each do |sim|
92
- taskName = "build_#{sim.id}"
84
+ dst = File.expand_path(File.join('obj', dst))
93
85
 
94
- desc "Builds object files for #{sim.name} simulator."
95
- task taskName => ['obj', 'ext'] do
96
- src = "#{PROJECT_ID}.so"
97
- dst = "#{PROJECT_ID}.#{sim.id}.so"
86
+ unless File.exist? dst
87
+ cd 'ext' do
88
+ ENV['CFLAGS'] = "#{CFLAGS} #{sim.compiler_args}"
89
+ ENV['LDFLAGS'] = "#{LDFLAGS} #{sim.linker_args}"
98
90
 
99
- dst = File.expand_path(File.join('obj', dst))
100
-
101
- unless File.exist? dst
102
- cd 'ext' do
103
- ENV['CFLAGS'] = "#{CFLAGS} #{sim.compiler_args}"
104
- ENV['LDFLAGS'] = "#{LDFLAGS} #{sim.linker_args}"
105
-
106
- sh 'rake'
107
- mv src, dst
108
- sh 'rake clean'
91
+ sh 'rake'
92
+ mv src, dst
93
+ sh 'rake clean'
94
+ end
109
95
  end
110
96
  end
111
- end
112
-
113
- task :build => taskName
114
- end
115
-
116
97
 
117
-
118
- ## documentation
119
-
120
- desc 'Generate user documentation.'
121
- task :doc do |t|
122
- cd t.name do
123
- sh 'rake'
98
+ task :build => taskName
124
99
  end
125
- end
126
100
 
127
101
 
128
- directory 'ref'
129
- CLOBBER.include 'ref'
130
-
131
- desc 'Generate reference documentation.'
132
- file 'ref' => ['ref/c', 'ref/ruby']
102
+ # documentation
133
103
 
104
+ desc 'Generate user documentation.'
105
+ task :doc do |t|
106
+ cd t.name do
107
+ sh 'rake'
108
+ end
109
+ end
134
110
 
135
- directory 'ref/ruby'
136
- CLOBBER.include 'ref/ruby'
137
111
 
138
- desc 'Generate reference for Ruby.'
139
- Rake::RDocTask.new 'ref/ruby' do |t|
140
- t.rdoc_dir = t.name
141
- t.title = "#{PROJECT_NAME}: #{PROJECT_SUMMARY}"
142
- t.options.concat %w(--charset utf-8 --line-numbers)
143
- t.rdoc_files.include '{bin,lib/**}/*.rb'
144
- end
112
+ directory 'ref'
113
+ CLOBBER.include 'ref'
145
114
 
115
+ desc 'Generate reference documentation.'
116
+ file 'ref' => ['ref/c', 'ref/ruby']
146
117
 
147
- directory 'ref/c'
148
- CLOBBER.include 'ref/c'
149
118
 
150
- desc 'Generate reference for C.'
151
- file 'ref/c' do |t|
152
- # doxygen outputs to this temporary destination
153
- tempDest = 'ext/html'
119
+ directory 'ref/ruby'
120
+ CLOBBER.include 'ref/ruby'
154
121
 
155
- cd File.dirname(tempDest) do
156
- sh "doxygen"
122
+ desc 'Generate reference for Ruby.'
123
+ Rake::RDocTask.new 'ref/ruby' do |t|
124
+ t.rdoc_dir = t.name
125
+ t.title = "#{PROJECT_NAME}: #{PROJECT_SUMMARY}"
126
+ t.options.concat %w(--charset utf-8 --line-numbers)
127
+ t.rdoc_files.include '{bin,lib/**}/*.rb'
157
128
  end
158
129
 
159
- mv FileList[tempDest + '/*'].to_a, t.name
160
- rmdir tempDest
161
- end
162
130
 
131
+ directory 'ref/c'
132
+ CLOBBER.include 'ref/c'
163
133
 
164
- desc 'Generate release announcement.'
165
- task :ann => 'doc/history.rb' do |t|
166
- require t.prerequisites[0]
167
- text = [
168
- PROJECT_DETAIL,
169
- "* " + PROJECT_URL,
170
- "---",
171
- format_history_entry(@history.first)
172
- ].join "\n\n"
134
+ desc 'Generate reference for C.'
135
+ file 'ref/c' do |t|
136
+ # doxygen outputs to this temporary destination
137
+ tempDest = 'ext/html'
173
138
 
174
- require 'doc/lib/doc_format'
175
- html = text.redcloth
139
+ cd File.dirname(tempDest) do
140
+ sh "doxygen"
141
+ end
176
142
 
177
- IO.popen('w3m -T text/html -dump -cols 60', 'w+') do |pipe|
178
- pipe.write html
179
- pipe.close_write
180
- puts pipe.read
143
+ mv FileList[tempDest + '/*'].to_a, t.name
144
+ rmdir tempDest
181
145
  end
182
- end
183
-
184
146
 
185
147
 
186
- ## distribution
148
+ # distribution
187
149
 
188
- desc "Prepare for distribution."
189
- task :dist => ['ext', 'ref', :doc] do |t|
190
- cd 'ext' do
191
- sh 'rake swig'
150
+ desc "Prepare for distribution."
151
+ task :dist => ['ext', 'ref', :doc] do |t|
152
+ cd 'ext' do
153
+ sh 'rake swig'
154
+ end
192
155
  end
193
- end
194
-
195
156
 
196
- desc 'Publish documentation to website.'
197
- task :web => [:web_ref, :web_doc]
157
+ desc 'Publish documentation to website.'
158
+ task :web => [:web_ref, :web_doc]
198
159
 
199
- desc "Publish reference documentation."
200
- task :web_ref => 'ref' do |t|
201
- upload PROJECT_SSH_URL, *t.prerequisites
202
- end
203
-
204
- desc "Publish user documentation."
205
- task :web_doc => 'doc' do |t|
206
- upload PROJECT_SSH_URL, *t.prerequisites
207
- end
160
+ desc "Publish reference documentation."
161
+ task :web_ref => 'ref' do |t|
162
+ upload PROJECT_SSH_URL, *t.prerequisites
163
+ end
208
164
 
209
- desc 'Connect to website FTP.'
210
- task :ftp do
211
- sh 'lftp', "sftp://#{PROJECT_SSH_URL}"
212
- end
165
+ desc "Publish user documentation."
166
+ task :web_doc => 'doc' do |t|
167
+ upload PROJECT_SSH_URL, *t.prerequisites
168
+ end
213
169
 
170
+ desc 'Connect to website FTP.'
171
+ task :ftp do
172
+ sh 'lftp', "sftp://#{PROJECT_SSH_URL}"
173
+ end
214
174
 
215
- desc "Generate release packages."
216
- task :release => [:clobber, :dist] do
217
- sh 'rake package'
218
- end
175
+ desc 'Generate release announcement.'
176
+ task :ann => 'doc/history.rb' do |t|
177
+ require t.prerequisites[0]
219
178
 
220
- spec = Gem::Specification.new do |s|
221
- s.name = s.rubyforge_project = PROJECT_ID
222
- s.summary = PROJECT_SUMMARY
223
- s.description = PROJECT_DETAIL
224
- s.homepage = PROJECT_URL
225
- s.version = PROJECT_VERSION
179
+ $: << File.join(File.dirname(__FILE__), 'doc', 'lib')
180
+ require 'doc_proxy'
226
181
 
227
- s.add_dependency 'rake', '>= 0.7.0'
228
- s.add_dependency 'rspec', '>= 0.7.0'
229
- s.add_dependency 'rcov', '>= 0.7.0'
230
- s.add_dependency 'xx' # needed by rcov
231
- s.add_dependency 'ruby-debug', '>= 0.5.2'
182
+ text = [
183
+ PROJECT_DETAIL,
184
+ "* See #{PROJECT_URL} for details.",
185
+ "---",
186
+ @history.first
187
+ ].join "\n\n"
232
188
 
233
- s.requirements << "POSIX threads library"
234
- s.requirements << "C language compiler"
189
+ IO.popen('w3m -T text/html -dump -cols 60', 'w+') do |pipe|
190
+ pipe.write text.to_html
191
+ pipe.close_write
192
+ puts pipe.read
193
+ end
194
+ end
235
195
 
236
- s.files = FileList['**/*'].exclude('_darcs')
237
- s.autorequire = PROJECT_ID
238
- s.extensions << 'gem_extconf.rb'
239
196
 
240
- # make tools executable
241
- tools = FileList['bin/*.rb']
197
+ # packaging
242
198
 
243
- tools.each do |f|
244
- chmod 0755, f
245
- end
199
+ desc "Generate release packages."
200
+ task :release => [:clobber, :dist] do
201
+ sh 'rake package'
202
+ end
246
203
 
247
- s.executables = tools.map {|f| File.basename f}
248
- end
204
+ spec = Gem::Specification.new do |s|
205
+ s.name = s.rubyforge_project = PROJECT_ID
206
+ s.summary = PROJECT_SUMMARY
207
+ s.description = PROJECT_DETAIL
208
+ s.homepage = PROJECT_URL
209
+ s.version = PROJECT_VERSION
210
+
211
+ s.add_dependency 'rake', '>= 0.7.0'
212
+ s.add_dependency 'rspec', '>= 0.7.0'
213
+ s.add_dependency 'rcov', '>= 0.7.0'
214
+ s.add_dependency 'xx' # needed by rcov
215
+ s.add_dependency 'ruby-debug', '>= 0.5.2'
216
+
217
+ s.requirements << "POSIX threads library"
218
+ s.requirements << "C language compiler"
219
+
220
+ s.files = FileList['**/*'].exclude('_darcs')
221
+ s.autorequire = PROJECT_ID
222
+ s.extensions << 'gem_extconf.rb'
223
+ s.executables = FileList['bin/*.rb'].map {|f| File.basename f}
224
+ end
249
225
 
250
- Rake::GemPackageTask.new(spec) do |pkg|
251
- pkg.need_tar = true
252
- end
226
+ Rake::GemPackageTask.new(spec) do |pkg|
227
+ pkg.need_tar = true
228
+ end
253
229
 
254
230
 
255
- desc "Configures the gem during installation."
256
- task :gem_config_inst do |t|
257
- # make documentation available to gem_server
258
- gemDir = File.dirname(__FILE__)
259
- gemName = File.basename(gemDir)
260
- docDir = File.join('..', '..', 'doc', gemName)
231
+ # installation
261
232
 
262
- mkdir_p docDir
263
- ln_s gemDir, File.join(docDir, 'rdoc')
264
- end
233
+ desc "Configures the gem during installation."
234
+ task :gem_config_inst do |t|
235
+ # make documentation available to gem_server
236
+ gemDir = File.dirname(__FILE__)
237
+ gemName = File.basename(gemDir)
238
+ docDir = File.join('..', '..', 'doc', gemName)
265
239
 
240
+ mkdir_p docDir
241
+ ln_s gemDir, File.join(docDir, 'rdoc')
242
+ end
266
243
 
267
244
 
268
- ## testing
245
+ # testing
269
246
 
270
- desc "Ensure that examples work with $SIMULATOR"
271
- task :test => :build do
272
- # ensures that current sources are tested instead of the installed gem
273
- ENV['RUBYLIB'] = PROJECT_LIBS
247
+ desc "Ensure that examples work with $SIMULATOR"
248
+ task :test => :build do
249
+ # ensures that current sources are tested instead of the installed gem
250
+ ENV['RUBYLIB'] = PROJECT_LIBS
274
251
 
275
- FileList['samp/*/'].each do |s|
276
- cd s do
277
- sh 'rake', ENV['SIMULATOR'] || 'cver'
252
+ FileList['samp/*/'].each do |s|
253
+ cd s do
254
+ sh 'rake', ENV['SIMULATOR'] || 'cver'
255
+ end
278
256
  end
279
257
  end
280
- end
data/bin/generate_test.rb CHANGED
@@ -1,37 +1,37 @@
1
1
  # Generates Ruby-VPI tests from Verilog 2001 module declarations.
2
+ #
2
3
  # * The standard input stream is read if no input files are specified.
3
- # * The first input signal in a module's declaration is assumed to be the clocking signal.
4
+ #
5
+ # * The first input signal in a module's declaration is assumed to be the
6
+ # clocking signal.
7
+ #
4
8
  #
5
9
  # = Progress indicators
10
+ #
6
11
  # module:: A Verilog module has been identified.
12
+ #
7
13
  # create:: A file is being created because it does not exist.
14
+ #
8
15
  # skip:: A file is being skipped because it is already up to date.
9
- # update:: A file will be updated because it is out of date. A text merging tool (see MERGER) will be launched to transfer content from the old file (*.old) and the new file (*.new) to the out of date file. If a text merging tool is not specified, then you will have to do the merging by hand.
16
+ #
17
+ # update:: A file will be updated because it is out of date. A text merging
18
+ # tool (see MERGER) will be launched to transfer content from the old
19
+ # file (*.old) and the new file (*.new) to the out of date file. If a
20
+ # text merging tool is not specified, then you will have to do the
21
+ # merging by hand.
22
+ #
10
23
  #
11
24
  # = Environment variables
12
- # MERGER:: A command that invokes a text merging tool with three arguments: (1) old file, (2) new file, (3) output file. The tool's output should be written to the output file.
13
-
14
-
15
- =begin
16
- Copyright 2006 Suraj N. Kurapati
17
-
18
- This file is part of Ruby-VPI.
19
-
20
- Ruby-VPI is free software; you can redistribute it and/or
21
- modify it under the terms of the GNU General Public License
22
- as published by the Free Software Foundation; either version 2
23
- of the License, or (at your option) any later version.
24
-
25
- Ruby-VPI is distributed in the hope that it will be useful,
26
- but WITHOUT ANY WARRANTY; without even the implied warranty of
27
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
- GNU General Public License for more details.
29
-
30
- You should have received a copy of the GNU General Public License
31
- along with Ruby-VPI; if not, write to the Free Software Foundation,
32
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
33
- =end
25
+ #
26
+ # MERGER:: A command that invokes a text merging tool with three arguments: (1)
27
+ # old file, (2) new file, (3) output file. The tool's output should be
28
+ # written to the output file.
29
+ #
30
+ #--
31
+ # Copyright 2006 Suraj N. Kurapati
32
+ # See the file named LICENSE for details.
34
33
 
34
+ require 'ruby-vpi' # for project info
35
35
  require 'ruby-vpi/verilog_parser'
36
36
  require 'fileutils'
37
37
  require 'digest/md5'
@@ -42,7 +42,8 @@ def notify *args # :nodoc:
42
42
  printf "%8s %s\n", *args
43
43
  end
44
44
 
45
- # Writes the given contents to the file at the given path. If the given path already exists, then a backup is created before invoking the merging tool.
45
+ # Writes the given contents to the file at the given path. If the given path
46
+ # already exists, then a backup is created before invoking the merging tool.
46
47
  def write_file aPath, aContent # :nodoc:
47
48
  if File.exist? aPath
48
49
  oldDigest = Digest::MD5.digest(File.read(aPath))
@@ -22,17 +22,11 @@ SIMULATOR_TARGET = '<%= aOutputInfo.verilogBenchName %>'
22
22
  # :cver => %w[these are also separate arguments],
23
23
  #
24
24
  SIMULATOR_ARGUMENTS = {
25
- # GPL Cver
26
- :cver => '',
25
+ <% RubyVpi::Config::SIMULATORS.each_pair do |id, sim| %>
26
+ # <%= sim.name %>
27
+ :<%= id %> => '',
27
28
 
28
- # Icarus Verilog
29
- :ivl => '',
30
-
31
- # Synopsys VCS
32
- :vcs => '',
33
-
34
- # Mentor Modelsim
35
- :vsim => '',
29
+ <% end %>
36
30
  }
37
31
 
38
32
  # This task is invoked _before_ the simulator runs.
@@ -1,26 +1,9 @@
1
1
  # Transforms Verilog header files into Ruby.
2
2
  # * The standard input stream is read if no input files are specified.
3
3
  # * Output is written to the standard output stream.
4
-
5
- =begin
6
- Copyright 2006 Suraj N. Kurapati
7
-
8
- This file is part of Ruby-VPI.
9
-
10
- Ruby-VPI is free software; you can redistribute it and/or
11
- modify it under the terms of the GNU General Public License
12
- as published by the Free Software Foundation; either version 2
13
- of the License, or (at your option) any later version.
14
-
15
- Ruby-VPI is distributed in the hope that it will be useful,
16
- but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- GNU General Public License for more details.
19
-
20
- You should have received a copy of the GNU General Public License
21
- along with Ruby-VPI; if not, write to the Free Software Foundation,
22
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23
- =end
4
+ #--
5
+ # Copyright 2006 Suraj N. Kurapati
6
+ # See the file named LICENSE for details.
24
7
 
25
8
  if File.basename($0) == File.basename(__FILE__)
26
9
  # parse command-line options
data/doc/README ADDED
@@ -0,0 +1,11 @@
1
+ The *.doc files in this directory are plain-text files!
2
+
3
+ To transform them into XHTML, you need the following software:
4
+
5
+ Rake: http://docs.rubyrake.org/
6
+
7
+ RedCloth: http://whytheluckystiff.net/ruby/redcloth/
8
+
9
+ Coderay: http://coderay.rubychan.de/
10
+
11
+ Once you have the above software, simply run the "rake" command.
data/doc/Rakefile CHANGED
@@ -1,22 +1,7 @@
1
- =begin
2
- Copyright 2006 Suraj N. Kurapati
3
-
4
- This file is part of Ruby-VPI.
5
-
6
- Ruby-VPI is free software; you can redistribute it and/or
7
- modify it under the terms of the GNU General Public License
8
- as published by the Free Software Foundation; either version 2
9
- of the License, or (at your option) any later version.
10
-
11
- Ruby-VPI is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License
17
- along with Ruby-VPI; if not, write to the Free Software Foundation,
18
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
- =end
1
+ # Generates the documentation in HTML format.
2
+ #--
3
+ # Copyright 2006 Suraj N. Kurapati
4
+ # See the file named LICENSE for details.
20
5
 
21
6
  require 'rake/clean'
22
7
 
@@ -43,9 +28,11 @@ FileList['*.doc'].each do |src|
43
28
 
44
29
  desc "Process file #{src.inspect}."
45
30
  file dst => [src, 'common.tpl', *deps] do |t|
31
+ String.reset_anchors
32
+
46
33
  content = DocProxy.new.instance_eval do
47
34
  # default output configuration
48
- table_of_contents = true
35
+ insert_toc = true
49
36
  page_title = nil
50
37
 
51
38
  # load the documentation's helper
@@ -56,7 +43,7 @@ FileList['*.doc'].each do |src|
56
43
  # evaluate the documentation file
57
44
  template = ERB.new(File.read(src))
58
45
  content = template.result(binding)
59
- post_process! content
46
+ toc, content = post_process(content)
60
47
 
61
48
  # fit result into common HTML format
62
49
  template = ERB.new(File.read(t.prerequisites[1]))