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/ext/Rakefile CHANGED
@@ -3,26 +3,9 @@
3
3
  # = Environment variables
4
4
  # CFLAGS:: Arguments to the compiler.
5
5
  # LDFLAGS:: Arguments to the linker.
6
-
7
- =begin
8
- Copyright 2006 Suraj N. Kurapati
9
-
10
- This file is part of Ruby-VPI.
11
-
12
- Ruby-VPI is free software; you can redistribute it and/or
13
- modify it under the terms of the GNU General Public License
14
- as published by the Free Software Foundation; either version 2
15
- of the License, or (at your option) any later version.
16
-
17
- Ruby-VPI is distributed in the hope that it will be useful,
18
- but WITHOUT ANY WARRANTY; without even the implied warranty of
19
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
- GNU General Public License for more details.
21
-
22
- You should have received a copy of the GNU General Public License
23
- along with Ruby-VPI; if not, write to the Free Software Foundation,
24
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25
- =end
6
+ #--
7
+ # Copyright 2006 Suraj N. Kurapati
8
+ # See the file named LICENSE for details.
26
9
 
27
10
  require 'rake/clean'
28
11
  require 'rbconfig'
@@ -52,7 +35,8 @@ end
52
35
 
53
36
  file 'swig_vpi.i' => 'swig_vpi.h'
54
37
 
55
- # avoid compilation problems due to va_list, which is used in the SWIG-generated wrapper for VPI vprintf functions
38
+ # avoid compilation problems due to va_list, which is used in the SWIG-generated
39
+ # wrapper for VPI vprintf functions
56
40
  file 'swig_vpi.h' => 'vpi_user.h' do |t|
57
41
  src, dst = t.prerequisites[0], t.name
58
42
 
@@ -61,5 +45,6 @@ file 'swig_vpi.h' => 'vpi_user.h' do |t|
61
45
  end
62
46
  end
63
47
 
64
- # NOTE: since SWIG is not a requirement for users, we should not clobber these generated files
48
+ # NOTE: since SWIG is not a requirement for users, we should not clobber these
49
+ # generated files
65
50
  #CLOBBER.include 'swig_wrap.cin', 'swig_vpi.h'
data/ext/common.h CHANGED
@@ -1,21 +1,6 @@
1
1
  /*
2
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.
3
+ See the file named LICENSE for details.
19
4
  */
20
5
  /**\file
21
6
  Things common to all Ruby-VPI code.
@@ -29,14 +14,16 @@
29
14
 
30
15
 
31
16
  /**
32
- A wrapper for vpi_printf() which marks the given message as being emitted from Ruby-VPI and ends the message with a new line.
17
+ A wrapper for vpi_printf() which marks the given message as being emitted
18
+ from Ruby-VPI and ends the message with a new line.
33
19
 
34
20
  @param ... Arguments to vpi_printf()
35
21
  */
36
- #define common_printf(...) vpi_printf("Ruby-VPI: "); vpi_printf(__VA_ARGS__); vpi_printf("\n");
22
+ #define common_printf(...) vpi_printf("Ruby-VPI: "); vpi_printf(__VA_ARGS__); vpi_printf("\n");
37
23
 
38
24
  /**
39
- A wrapper for common_printf() which marks the given message as being debugging output.
25
+ A wrapper for common_printf() which marks the given message as being
26
+ debugging output.
40
27
  */
41
28
  #ifdef DEBUG
42
29
  #define common_debug(...) vpi_printf("(%s:%d) ", __FILE__, __LINE__); common_printf(__VA_ARGS__);
@@ -45,12 +32,14 @@
45
32
  #endif
46
33
 
47
34
  /**
48
- A boolean variable with two possible values: true and false. Pass aroung this value instead of zero and non-zero integers.
35
+ A boolean variable with two possible values: true and false. Pass aroung
36
+ this value instead of zero and non-zero integers.
49
37
  */
50
38
  typedef enum { false = 0, true = 1 } bool;
51
39
 
52
40
  /**
53
- Returns the string "true" if the given boolean expression is true. Otherwise returns the string "false".
41
+ Returns the string "true" if the given boolean expression is true. Otherwise
42
+ returns the string "false".
54
43
  */
55
44
  #define common_boolToStr(aBoolExpr) ( (aBoolExpr) ? "true" : "false" )
56
45
 
data/ext/extconf.rb CHANGED
@@ -1,3 +1,8 @@
1
+ # Generates a makefile for buiding the extension.
2
+ #--
3
+ # Copyright 2006-2007 Suraj N. Kurapati
4
+ # See the file named LICENSE for details.
5
+
1
6
  require 'mkmf'
2
7
 
3
8
  # check for POSIX threads library
data/ext/main.c CHANGED
@@ -1,22 +1,7 @@
1
1
  /*
2
2
  Copyright 1999 Kazuhiro HIWADA
3
3
  Copyright 2006 Suraj N. Kurapati
4
-
5
- This file is part of Ruby-VPI.
6
-
7
- Ruby-VPI is free software; you can redistribute it and/or
8
- modify it under the terms of the GNU General Public License
9
- as published by the Free Software Foundation; either version 2
10
- of the License, or (at your option) any later version.
11
-
12
- Ruby-VPI is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with Ruby-VPI; if not, write to the Free Software Foundation,
19
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
4
+ See the file named LICENSE for details.
20
5
  */
21
6
 
22
7
  #include "main.h"
@@ -38,9 +23,8 @@ void main_init() {
38
23
  rb_define_module_function(mVpi, "relay_verilog", main_relay_verilog, 0);
39
24
  rb_define_module_function(mVpi, "relay_ruby_reason", main_relay_ruby_reason, 0);
40
25
 
41
-
42
26
  // initialize the Ruby bench
43
- char* benchFile = getenv("RUBY_VPI__RUBY_BENCH_FILE");
27
+ char* benchFile = getenv("RUBYVPI_BOOTSTRAP");
44
28
 
45
29
  if (benchFile != NULL) {
46
30
  ruby_script(benchFile);
data/ext/main.h CHANGED
@@ -1,21 +1,6 @@
1
1
  /*
2
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.
3
+ See the file named LICENSE for details.
19
4
  */
20
5
  /**\file
21
6
  The C extension for Ruby-VPI.
data/ext/relay.c CHANGED
@@ -1,22 +1,7 @@
1
1
  /*
2
2
  Copyright 1999 Kazuhiro HIWADA
3
3
  Copyright 2006 Suraj N. Kurapati
4
-
5
- This file is part of Ruby-VPI.
6
-
7
- Ruby-VPI is free software; you can redistribute it and/or
8
- modify it under the terms of the GNU General Public License
9
- as published by the Free Software Foundation; either version 2
10
- of the License, or (at your option) any later version.
11
-
12
- Ruby-VPI is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with Ruby-VPI; if not, write to the Free Software Foundation,
19
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
4
+ See the file named LICENSE for details.
20
5
  */
21
6
 
22
7
  #include "relay.h"
@@ -43,7 +28,8 @@ void relay_init() {
43
28
  // start the ruby thread
44
29
  pthread_create(&relay__rubyThread, NULL, relay_ruby_thread, NULL);
45
30
 
46
- // XXX: freezee verilog because RubyVpi.init_bench will call relay_verilog (which assumes that verilog is frozen)
31
+ // XXX: freezee verilog because RubyVpi.init_bench will call relay_verilog
32
+ // (which assumes that verilog is frozen)
47
33
  pthread_mutex_lock(&relay__verilogLock);
48
34
  }
49
35
 
data/ext/relay.h CHANGED
@@ -1,22 +1,7 @@
1
1
  /*
2
2
  Copyright 1999 Kazuhiro HIWADA
3
3
  Copyright 2006 Suraj N. Kurapati
4
-
5
- This file is part of Ruby-VPI.
6
-
7
- Ruby-VPI is free software; you can redistribute it and/or
8
- modify it under the terms of the GNU General Public License
9
- as published by the Free Software Foundation; either version 2
10
- of the License, or (at your option) any later version.
11
-
12
- Ruby-VPI is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with Ruby-VPI; if not, write to the Free Software Foundation,
19
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
4
+ See the file named LICENSE for details.
20
5
  */
21
6
  /**\file
22
7
  Logic for transferring control between Ruby and Verilog.
@@ -28,7 +13,8 @@
28
13
  #include "common.h"
29
14
 
30
15
  /**
31
- Initialize the relay mechanism, which enables Verilog to transfer control to Ruby and vice versa, and start Ruby.
16
+ Initialize the relay mechanism, which enables Verilog to transfer control to
17
+ Ruby and vice versa, and start Ruby.
32
18
  */
33
19
  void relay_init();
34
20
 
data/ext/verilog.h CHANGED
@@ -1,21 +1,6 @@
1
1
  /*
2
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.
3
+ See the file named LICENSE for details.
19
4
  */
20
5
  /**\file
21
6
  A proxy for all Verilog headers of interest to us.
@@ -25,7 +10,9 @@
25
10
  #define VERILOG_H
26
11
 
27
12
  /*
28
- Use our verbatim copy of the official IEEE Std. 1364-2005 header file, which was obtained from this URL: <http://www.boydtechinc.com/ptf/archive/ptf_2005/0737.html>
13
+ Use our verbatim copy of the official IEEE Std. 1364-2005 header file, which
14
+ was obtained from this URL:
15
+ <http://www.boydtechinc.com/ptf/archive/ptf_2005/0737.html>
29
16
  */
30
17
  #include "vpi_user.h"
31
18
 
@@ -37,7 +24,8 @@
37
24
  #endif
38
25
 
39
26
  /*
40
- Do we want to enforce strict compliance with IEEE Std. 1364-2001? If so, Ruby-VPI might not work with Synopsys VCS, but that's not our fault. ;-)
27
+ Do we want to enforce strict compliance with IEEE Std. 1364-2001? If so,
28
+ Ruby-VPI might not work with Synopsys VCS, but that's not our fault. ;-)
41
29
  */
42
30
  #define verilog_tf_funcPtr_strict(aPtrName) \
43
31
  PLI_INT32 (*aPtrName)(PLI_BYTE8*)
data/ext/vlog.c CHANGED
@@ -1,22 +1,7 @@
1
1
  /*
2
2
  Copyright 1999 Kazuhiro HIWADA
3
3
  Copyright 2006 Suraj N. Kurapati
4
-
5
- This file is part of Ruby-VPI.
6
-
7
- Ruby-VPI is free software; you can redistribute it and/or
8
- modify it under the terms of the GNU General Public License
9
- as published by the Free Software Foundation; either version 2
10
- of the License, or (at your option) any later version.
11
-
12
- Ruby-VPI is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with Ruby-VPI; if not, write to the Free Software Foundation,
19
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
4
+ See the file named LICENSE for details.
20
5
  */
21
6
 
22
7
  #include "vlog.h"
@@ -60,15 +45,12 @@ void vlog_startup() {
60
45
 
61
46
  void (*vlog_startup_routines[])() = { vlog_startup, NULL };
62
47
 
63
- #if defined(PRAGMATIC_CVER) || defined(SYNOPSYS_VCS)
48
+ #if defined(PRAGMATIC_CVER) || defined(SYNOPSYS_VCS) || defined(CADENCE_NCSIM)
64
49
  /**
65
50
  Invokes each routine specified in the vlog_startup_routines array.
66
-
67
- This code is originally from GPL Cver 2.11a:
68
- Copyright (c) 1991-2005 Pragmatic C Software Corp.
69
51
  */
70
52
  void vlog_startup_routines_bootstrap() {
71
- unsigned int i;
53
+ unsigned i;
72
54
  for (i = 0; vlog_startup_routines[i] != NULL; i++)
73
55
  vlog_startup_routines[i]();
74
56
  }
data/ext/vlog.h CHANGED
@@ -1,21 +1,6 @@
1
1
  /*
2
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.
3
+ See the file named LICENSE for details.
19
4
  */
20
5
  /**\file
21
6
  Interface between C and Verilog code.
@@ -33,7 +18,8 @@
33
18
  verilog_cb_funcSig(vlog_relay_ruby);
34
19
 
35
20
  /**
36
- Returns the data corresponding to the callback that caused the relay from Verilog to Ruby.
21
+ Returns the data corresponding to the callback that caused the relay from
22
+ Verilog to Ruby.
37
23
  */
38
24
  s_cb_data* vlog_relay_ruby_reason();
39
25
 
data/lib/ruby-vpi/erb.rb CHANGED
@@ -1,26 +1,13 @@
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
+ # ERB templating.
2
+ #--
3
+ # Copyright 2006-2007 Suraj N. Kurapati
4
+ # See the file named LICENSE for details.
20
5
 
21
6
  require 'erb'
22
7
 
23
- # A version of ERB whose embedding tags behave like those of PHP. That is, only <%= ... %> tags produce output, whereas <% ... %> tags do *not* produce any output.
8
+ # A version of ERB whose embedding tags behave like those of PHP. That is, only
9
+ # <%= ... %> tags produce output, whereas <% ... %> tags do *not* produce any
10
+ # output.
24
11
  class ERB
25
12
  alias original_initialize initialize
26
13
 
@@ -1,25 +1,11 @@
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
+ # Library for hardware-related floating point operations.
2
+ #--
3
+ # Copyright 2006-2007 Suraj N. Kurapati
4
+ # See the file named LICENSE for details.
20
5
 
21
6
  class String
22
- # Converts this string into a floating point number using the given radix. The default radix is 10.
7
+ # Converts this string into a floating point number using the given radix.
8
+ # The default radix is 10.
23
9
  def to_f aRadix = 10
24
10
  whole, frac = split('.', 2)
25
11
  whole = whole.to_i(aRadix).to_f
@@ -1,24 +1,11 @@
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
20
-
21
- # NOTE: Because integers are _immediate_ values in Ruby, these methods *cannot* modify the value of the integer upon which they are invoked. Instead, they return the new value as their result.
1
+ # Library for hardware-related integer operations.
2
+ #--
3
+ # Copyright 2006-2007 Suraj N. Kurapati
4
+ # See the file named LICENSE for details.
5
+
6
+ # NOTE: Because integers are _immediate_ values in Ruby, these methods *cannot*
7
+ # modify the value of the integer upon which they are invoked. Instead, they
8
+ # return the new value as their result.
22
9
  class Integer
23
10
  # Returns the ceiling of the logarithm (base 2) of this positive integer.
24
11
  def log2
@@ -37,7 +24,8 @@ class Integer
37
24
  to_s(2).length
38
25
  end
39
26
 
40
- # Returns the lowest upper-bound of this integer. This integer cannot reach the limit without occupying more bits in its binary representation.
27
+ # Returns the lowest upper-bound of this integer. This integer cannot reach
28
+ # the limit without occupying more bits in its binary representation.
41
29
  def limit
42
30
  length.to_limit
43
31
  end
@@ -59,33 +47,18 @@ class Integer
59
47
  end
60
48
 
61
49
 
62
- # Returns the maximum value representable by this integer without occupying more bits in its binary representation.
50
+ # Returns the maximum value representable by this integer without occupying
51
+ # more bits in its binary representation.
63
52
  alias max mask
64
53
 
65
- # Returns the maximum value representable by an integer with *this* number of bits.
54
+ # Returns the maximum value representable by an integer with *this* number of
55
+ # bits.
66
56
  alias to_max to_mask
67
57
 
68
58
 
69
- # Ensures that this integer is no less than the given limit.
70
- def ensure_min aLimit
71
- if self < aLimit
72
- aLimit
73
- else
74
- self
75
- end
76
- end
77
-
78
- # Ensures that this integer is no greater than the given limit.
79
- def ensure_max aLimit
80
- if self > aLimit
81
- aLimit
82
- else
83
- self
84
- end
85
- end
86
-
87
-
88
- # Transforms this infinite-length Ruby integer into a fixed-length integer (represented in two's complement form) that has the given width (number of bits).
59
+ # Transforms this infinite-length Ruby integer into a fixed-length integer
60
+ # (represented in two's complement form) that has the given width (number of
61
+ # bits).
89
62
  def pack aPackedWidth
90
63
  bits = length
91
64
  bits += 1 if self > 0 # positive integers also have a sign bit (zero)
@@ -97,7 +70,9 @@ class Integer
97
70
  extend_sign(bits, aPackedWidth)
98
71
  end
99
72
 
100
- # Transforms this fixed-length integer (represented in two's complement form) that has the given width (number of bits) into an infinite-length Ruby integer.
73
+ # Transforms this fixed-length integer (represented in two's complement form)
74
+ # that has the given width (number of bits) into an infinite-length Ruby
75
+ # integer.
101
76
  def unpack aPackedWidth
102
77
  bits = length
103
78
 
@@ -116,7 +91,9 @@ class Integer
116
91
  end
117
92
 
118
93
 
119
- # Performs sign extension on this integer, which has the given width (number of bits), so that the result will have the given extended width (number of bits).
94
+ # Performs sign extension on this integer, which has the given width (number
95
+ # of bits), so that the result will have the given extended width (number of
96
+ # bits).
120
97
  def extend_sign aOrigWidth, aExtWidth
121
98
  result = self
122
99
  maskWidth = aExtWidth - aOrigWidth
@@ -128,7 +105,10 @@ class Integer
128
105
  result & aExtWidth.to_mask
129
106
  end
130
107
 
131
- # Splits this integer into an array of smaller integers, each of which have the given positive, non-zero width (number of bits). These smaller integers are ordered from left to right, in the same way that humans write unsigned binary numbers; for example:
108
+ # Splits this integer into an array of smaller integers, each of which have
109
+ # the given positive, non-zero width (number of bits). These smaller integers
110
+ # are ordered from left to right, in the same way that humans write unsigned
111
+ # binary numbers; for example:
132
112
  #
133
113
  ## >> 6.split 1
134
114
  ## => [1, 1, 0]
data/lib/ruby-vpi/rake.rb 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
+ # Utilities for Rakefiles.
2
+ #--
3
+ # Copyright 2006-2007 Suraj N. Kurapati
4
+ # See the file named LICENSE for details.
20
5
 
21
6
  require 'fileutils'
22
7
 
data/lib/ruby-vpi/rcov.rb CHANGED
@@ -1,23 +1,7 @@
1
- =begin
2
- Copyright (c) 2004-2006 Mauricio Fernandez <mfp@acm.org>
3
- Copyright 2006 Suraj N. Kurapati
4
-
5
- This file is part of Ruby-VPI.
6
-
7
- Ruby-VPI is free software; you can redistribute it and/or
8
- modify it under the terms of the GNU General Public License
9
- as published by the Free Software Foundation; either version 2
10
- of the License, or (at your option) any later version.
11
-
12
- Ruby-VPI is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with Ruby-VPI; if not, write to the Free Software Foundation,
19
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
- =end
1
+ # Code coverage analysis.
2
+ #--
3
+ # Copyright 2006-2007 Suraj N. Kurapati
4
+ # See the file named LICENSE for details.
21
5
 
22
6
  require 'rcov'
23
7
 
@@ -53,7 +37,8 @@ module RubyVpi
53
37
  end
54
38
  end
55
39
 
56
- # Invokes the given block, which yields COVERAGE_ANALYSIS, after code coverage analysis has completed.
40
+ # Invokes the given block, which yields COVERAGE_ANALYSIS, after code coverage
41
+ # analysis has completed.
57
42
  def RubyVpi.with_coverage_analysis &aBlock # :nodoc:
58
43
  if aBlock
59
44
  COVERAGE_ANALYSIS_HANDLERS << aBlock
data/lib/ruby-vpi/rdoc.rb CHANGED
@@ -1,28 +1,10 @@
1
- =begin
2
- Copyright 2004 Dave Thomas
3
- Copyright 2006 Suraj N. Kurapati
4
-
5
- This file is part of Ruby-VPI.
6
-
7
- Ruby-VPI is free software; you can redistribute it and/or
8
- modify it under the terms of the GNU General Public License
9
- as published by the Free Software Foundation; either version 2
10
- of the License, or (at your option) any later version.
11
-
12
- Ruby-VPI is distributed in the hope that it will be useful,
13
- but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- GNU General Public License for more details.
16
-
17
- You should have received a copy of the GNU General Public License
18
- along with Ruby-VPI; if not, write to the Free Software Foundation,
19
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
- =end
21
-
22
1
  require 'rdoc/usage'
23
2
 
24
3
  module RDoc
25
4
  # Display usage information from RDoc comments in the given file.
5
+ #--
6
+ # Copyright (c) 2001-2003 Dave Thomas.
7
+ # Released under the same license as Ruby.
26
8
  def RDoc.usage_from_file input_file, *args
27
9
  comment = File.open(input_file) do |file|
28
10
  find_comment(file)