ruby-vpi 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (364) hide show
  1. data/HISTORY +398 -0
  2. data/LICENSE +340 -0
  3. data/MEMO +38 -0
  4. data/README +9 -0
  5. data/Rakefile +271 -0
  6. data/bin/generate_test.rb +258 -0
  7. data/bin/generate_test_tpl/bench.rb +31 -0
  8. data/bin/generate_test_tpl/bench.v +54 -0
  9. data/bin/generate_test_tpl/design.rb +26 -0
  10. data/bin/generate_test_tpl/proto.rb +8 -0
  11. data/bin/generate_test_tpl/runner.rake +28 -0
  12. data/bin/generate_test_tpl/spec.rb +46 -0
  13. data/bin/header_to_ruby.rb +70 -0
  14. data/doc/Rakefile +55 -0
  15. data/doc/src/LICENSE +397 -0
  16. data/doc/src/figures/organization.png +0 -0
  17. data/doc/src/figures/organization_detailed.png +0 -0
  18. data/doc/src/figures/ruby_init.png +0 -0
  19. data/doc/src/figures/ruby_relay.png +0 -0
  20. data/doc/src/figures.dia +0 -0
  21. data/doc/src/images/COPYING +67 -0
  22. data/doc/src/images/ChangeLog +27 -0
  23. data/doc/src/images/blank.png +0 -0
  24. data/doc/src/images/callouts/1.png +0 -0
  25. data/doc/src/images/callouts/10.png +0 -0
  26. data/doc/src/images/callouts/11.png +0 -0
  27. data/doc/src/images/callouts/12.png +0 -0
  28. data/doc/src/images/callouts/13.png +0 -0
  29. data/doc/src/images/callouts/14.png +0 -0
  30. data/doc/src/images/callouts/15.png +0 -0
  31. data/doc/src/images/callouts/2.png +0 -0
  32. data/doc/src/images/callouts/3.png +0 -0
  33. data/doc/src/images/callouts/4.png +0 -0
  34. data/doc/src/images/callouts/5.png +0 -0
  35. data/doc/src/images/callouts/6.png +0 -0
  36. data/doc/src/images/callouts/7.png +0 -0
  37. data/doc/src/images/callouts/8.png +0 -0
  38. data/doc/src/images/callouts/9.png +0 -0
  39. data/doc/src/images/callouts/ChangeLog +15 -0
  40. data/doc/src/images/caution.png +0 -0
  41. data/doc/src/images/caution.svg +290 -0
  42. data/doc/src/images/copyright +55 -0
  43. data/doc/src/images/draft.png +0 -0
  44. data/doc/src/images/home.png +0 -0
  45. data/doc/src/images/home.svg +386 -0
  46. data/doc/src/images/important.png +0 -0
  47. data/doc/src/images/important.svg +163 -0
  48. data/doc/src/images/next.png +0 -0
  49. data/doc/src/images/next.svg +191 -0
  50. data/doc/src/images/note.png +0 -0
  51. data/doc/src/images/note.svg +483 -0
  52. data/doc/src/images/prev.png +0 -0
  53. data/doc/src/images/prev.svg +852 -0
  54. data/doc/src/images/tip.png +0 -0
  55. data/doc/src/images/tip.svg +1145 -0
  56. data/doc/src/images/toc-blank.png +0 -0
  57. data/doc/src/images/toc-minus.png +0 -0
  58. data/doc/src/images/toc-plus.png +0 -0
  59. data/doc/src/images/up.png +0 -0
  60. data/doc/src/images/up.svg +195 -0
  61. data/doc/src/images/warning.png +0 -0
  62. data/doc/src/images/warning.svg +334 -0
  63. data/doc/src/license.xml +446 -0
  64. data/doc/src/manual.xml +1582 -0
  65. data/doc/src/manual.xsl +23 -0
  66. data/doc/src/shared.dtd +63 -0
  67. data/doc/src/styles/manual.css +87 -0
  68. data/doc/txt/manual.txt +1657 -0
  69. data/doc/xhtml/background.html +3 -0
  70. data/doc/xhtml/background.methodology.html +3 -0
  71. data/doc/xhtml/background.organization.html +10 -0
  72. data/doc/xhtml/background.running-tests.html +3 -0
  73. data/doc/xhtml/background.terminology.html +3 -0
  74. data/doc/xhtml/figures/organization.png +0 -0
  75. data/doc/xhtml/figures/organization_detailed.png +0 -0
  76. data/doc/xhtml/figures/ruby_init.png +0 -0
  77. data/doc/xhtml/figures/ruby_relay.png +0 -0
  78. data/doc/xhtml/gfdl-0.html +18 -0
  79. data/doc/xhtml/gfdl-1.html +70 -0
  80. data/doc/xhtml/gfdl-10.html +15 -0
  81. data/doc/xhtml/gfdl-2.html +13 -0
  82. data/doc/xhtml/gfdl-3.html +31 -0
  83. data/doc/xhtml/gfdl-4.html +75 -0
  84. data/doc/xhtml/gfdl-5.html +20 -0
  85. data/doc/xhtml/gfdl-6.html +12 -0
  86. data/doc/xhtml/gfdl-7.html +16 -0
  87. data/doc/xhtml/gfdl-8.html +17 -0
  88. data/doc/xhtml/gfdl-9.html +9 -0
  89. data/doc/xhtml/gfdl-addendum.html +25 -0
  90. data/doc/xhtml/gfdl.html +11 -0
  91. data/doc/xhtml/glossary.html +3 -0
  92. data/doc/xhtml/images/COPYING +67 -0
  93. data/doc/xhtml/images/ChangeLog +27 -0
  94. data/doc/xhtml/images/blank.png +0 -0
  95. data/doc/xhtml/images/callouts/1.png +0 -0
  96. data/doc/xhtml/images/callouts/10.png +0 -0
  97. data/doc/xhtml/images/callouts/11.png +0 -0
  98. data/doc/xhtml/images/callouts/12.png +0 -0
  99. data/doc/xhtml/images/callouts/13.png +0 -0
  100. data/doc/xhtml/images/callouts/14.png +0 -0
  101. data/doc/xhtml/images/callouts/15.png +0 -0
  102. data/doc/xhtml/images/callouts/2.png +0 -0
  103. data/doc/xhtml/images/callouts/3.png +0 -0
  104. data/doc/xhtml/images/callouts/4.png +0 -0
  105. data/doc/xhtml/images/callouts/5.png +0 -0
  106. data/doc/xhtml/images/callouts/6.png +0 -0
  107. data/doc/xhtml/images/callouts/7.png +0 -0
  108. data/doc/xhtml/images/callouts/8.png +0 -0
  109. data/doc/xhtml/images/callouts/9.png +0 -0
  110. data/doc/xhtml/images/callouts/ChangeLog +15 -0
  111. data/doc/xhtml/images/caution.png +0 -0
  112. data/doc/xhtml/images/caution.svg +290 -0
  113. data/doc/xhtml/images/copyright +55 -0
  114. data/doc/xhtml/images/draft.png +0 -0
  115. data/doc/xhtml/images/home.png +0 -0
  116. data/doc/xhtml/images/home.svg +386 -0
  117. data/doc/xhtml/images/important.png +0 -0
  118. data/doc/xhtml/images/important.svg +163 -0
  119. data/doc/xhtml/images/next.png +0 -0
  120. data/doc/xhtml/images/next.svg +191 -0
  121. data/doc/xhtml/images/note.png +0 -0
  122. data/doc/xhtml/images/note.svg +483 -0
  123. data/doc/xhtml/images/prev.png +0 -0
  124. data/doc/xhtml/images/prev.svg +852 -0
  125. data/doc/xhtml/images/tip.png +0 -0
  126. data/doc/xhtml/images/tip.svg +1145 -0
  127. data/doc/xhtml/images/toc-blank.png +0 -0
  128. data/doc/xhtml/images/toc-minus.png +0 -0
  129. data/doc/xhtml/images/toc-plus.png +0 -0
  130. data/doc/xhtml/images/up.png +0 -0
  131. data/doc/xhtml/images/up.svg +195 -0
  132. data/doc/xhtml/images/warning.png +0 -0
  133. data/doc/xhtml/images/warning.svg +334 -0
  134. data/doc/xhtml/index.html +4 -0
  135. data/doc/xhtml/introduction.html +3 -0
  136. data/doc/xhtml/introduction.license.html +3 -0
  137. data/doc/xhtml/introduction.manifest.html +3 -0
  138. data/doc/xhtml/introduction.related-works.html +3 -0
  139. data/doc/xhtml/introduction.resources.html +3 -0
  140. data/doc/xhtml/problem.ivl.html +18 -0
  141. data/doc/xhtml/problems.html +3 -0
  142. data/doc/xhtml/problems.ruby.html +3 -0
  143. data/doc/xhtml/problems.vsim.html +3 -0
  144. data/doc/xhtml/styles/manual.css +87 -0
  145. data/doc/xhtml/usage.examples.html +3 -0
  146. data/doc/xhtml/usage.html +3 -0
  147. data/doc/xhtml/usage.installation.html +3 -0
  148. data/doc/xhtml/usage.requirements.html +3 -0
  149. data/doc/xhtml/usage.tools.html +3 -0
  150. data/doc/xhtml/usage.tutorial.html +199 -0
  151. data/ext/Doxyfile +272 -0
  152. data/ext/README +124 -0
  153. data/ext/Rakefile +65 -0
  154. data/ext/common.h +56 -0
  155. data/ext/extconf.rb +4 -0
  156. data/ext/relay.cin +146 -0
  157. data/ext/relay.hin +48 -0
  158. data/ext/ruby-vpi.c +36 -0
  159. data/ext/swig.cin +38 -0
  160. data/ext/swig.hin +39 -0
  161. data/ext/swig_vpi.h +924 -0
  162. data/ext/swig_vpi.i +8 -0
  163. data/ext/swig_wrap.cin +4613 -0
  164. data/ext/verilog.h +59 -0
  165. data/ext/vlog.cin +92 -0
  166. data/ext/vlog.hin +57 -0
  167. data/ext/vpi_user.h +924 -0
  168. data/gem_extconf.rb +8 -0
  169. data/history.html +809 -0
  170. data/lib/ruby-vpi/erb.rb +41 -0
  171. data/lib/ruby-vpi/rake.rb +35 -0
  172. data/lib/ruby-vpi/rdoc.rb +51 -0
  173. data/lib/ruby-vpi/rspec.rb +32 -0
  174. data/lib/ruby-vpi/runner.rb +22 -0
  175. data/lib/ruby-vpi/vpi_util.rb +310 -0
  176. data/lib/ruby-vpi.rb +58 -0
  177. data/memo.html +86 -0
  178. data/readme.html +19 -0
  179. data/ref/c/annotated.html +36 -0
  180. data/ref/c/common_8h.html +178 -0
  181. data/ref/c/doxygen.css +310 -0
  182. data/ref/c/doxygen.png +0 -0
  183. data/ref/c/files.html +35 -0
  184. data/ref/c/functions.html +135 -0
  185. data/ref/c/functions_vars.html +135 -0
  186. data/ref/c/globals.html +55 -0
  187. data/ref/c/globals_0x63.html +86 -0
  188. data/ref/c/globals_0x65.html +55 -0
  189. data/ref/c/globals_0x66.html +55 -0
  190. data/ref/c/globals_0x70.html +71 -0
  191. data/ref/c/globals_0x72.html +62 -0
  192. data/ref/c/globals_0x73.html +65 -0
  193. data/ref/c/globals_0x74.html +55 -0
  194. data/ref/c/globals_0x76.html +472 -0
  195. data/ref/c/globals_0x78.html +55 -0
  196. data/ref/c/globals_defs.html +81 -0
  197. data/ref/c/globals_defs_0x65.html +50 -0
  198. data/ref/c/globals_defs_0x70.html +51 -0
  199. data/ref/c/globals_defs_0x76.html +463 -0
  200. data/ref/c/globals_defs_0x78.html +50 -0
  201. data/ref/c/globals_enum.html +39 -0
  202. data/ref/c/globals_eval.html +40 -0
  203. data/ref/c/globals_func.html +49 -0
  204. data/ref/c/globals_type.html +63 -0
  205. data/ref/c/globals_vars.html +42 -0
  206. data/ref/c/hierarchy.html +36 -0
  207. data/ref/c/index.html +20 -0
  208. data/ref/c/relay_8cin.html +268 -0
  209. data/ref/c/relay_8hin.html +161 -0
  210. data/ref/c/ruby-vpi_8c.html +34 -0
  211. data/ref/c/structrelay____RubyOptions____def.html +84 -0
  212. data/ref/c/structt__cb__data.html +208 -0
  213. data/ref/c/structt__vpi__delay.html +183 -0
  214. data/ref/c/structt__vpi__error__info.html +208 -0
  215. data/ref/c/structt__vpi__strengthval.html +108 -0
  216. data/ref/c/structt__vpi__systf__data.html +208 -0
  217. data/ref/c/structt__vpi__time.html +133 -0
  218. data/ref/c/structt__vpi__value.html +285 -0
  219. data/ref/c/structt__vpi__vecval.html +83 -0
  220. data/ref/c/structt__vpi__vlog__info.html +133 -0
  221. data/ref/c/swig_8cin.html +91 -0
  222. data/ref/c/swig_8hin.html +99 -0
  223. data/ref/c/tab_b.gif +0 -0
  224. data/ref/c/tab_l.gif +0 -0
  225. data/ref/c/tab_r.gif +0 -0
  226. data/ref/c/tabs.css +102 -0
  227. data/ref/c/verilog_8h.html +149 -0
  228. data/ref/c/vlog_8cin.html +199 -0
  229. data/ref/c/vlog_8hin.html +152 -0
  230. data/ref/c/vpi__user_8h.html +12747 -0
  231. data/ref/ruby/classes/Counter.html +258 -0
  232. data/ref/ruby/classes/Counter.src/M000037.html +20 -0
  233. data/ref/ruby/classes/Counter.src/M000038.html +22 -0
  234. data/ref/ruby/classes/Counter.src/M000039.html +20 -0
  235. data/ref/ruby/classes/Counter.src/M000040.html +22 -0
  236. data/ref/ruby/classes/CounterProto.html +164 -0
  237. data/ref/ruby/classes/CounterProto.src/M000004.html +22 -0
  238. data/ref/ruby/classes/CounterProto.src/M000005.html +22 -0
  239. data/ref/ruby/classes/ERB.html +158 -0
  240. data/ref/ruby/classes/ERB.src/M000034.html +29 -0
  241. data/ref/ruby/classes/FileUtils.html +165 -0
  242. data/ref/ruby/classes/FileUtils.src/M000047.html +18 -0
  243. data/ref/ruby/classes/FileUtils.src/M000048.html +18 -0
  244. data/ref/ruby/classes/Hw5UnitModel/Operation.html +216 -0
  245. data/ref/ruby/classes/Hw5UnitModel/Operation.src/M000011.html +25 -0
  246. data/ref/ruby/classes/Hw5UnitModel/Operation.src/M000012.html +33 -0
  247. data/ref/ruby/classes/Hw5UnitModel/Operation.src/M000013.html +18 -0
  248. data/ref/ruby/classes/Hw5UnitModel.html +256 -0
  249. data/ref/ruby/classes/Hw5UnitModel.src/M000006.html +24 -0
  250. data/ref/ruby/classes/Hw5UnitModel.src/M000008.html +20 -0
  251. data/ref/ruby/classes/Hw5UnitModel.src/M000009.html +38 -0
  252. data/ref/ruby/classes/Hw5UnitModel.src/M000010.html +22 -0
  253. data/ref/ruby/classes/Hw5_unit.html +196 -0
  254. data/ref/ruby/classes/Hw5_unit.src/M000003.html +27 -0
  255. data/ref/ruby/classes/Hw5_unit_spec.html +237 -0
  256. data/ref/ruby/classes/Hw5_unit_spec.src/M000023.html +21 -0
  257. data/ref/ruby/classes/Hw5_unit_spec.src/M000024.html +21 -0
  258. data/ref/ruby/classes/Hw5_unit_spec.src/M000025.html +67 -0
  259. data/ref/ruby/classes/InputGenerator.html +260 -0
  260. data/ref/ruby/classes/InputGenerator.src/M000027.html +18 -0
  261. data/ref/ruby/classes/InputGenerator.src/M000028.html +18 -0
  262. data/ref/ruby/classes/InputGenerator.src/M000029.html +19 -0
  263. data/ref/ruby/classes/InputGenerator.src/M000030.html +38 -0
  264. data/ref/ruby/classes/InputGenerator.src/M000031.html +19 -0
  265. data/ref/ruby/classes/InputGenerator.src/M000032.html +19 -0
  266. data/ref/ruby/classes/MaximumCounterValue.html +159 -0
  267. data/ref/ruby/classes/MaximumCounterValue.src/M000035.html +23 -0
  268. data/ref/ruby/classes/MaximumCounterValue.src/M000036.html +21 -0
  269. data/ref/ruby/classes/ModuleInfo.html +199 -0
  270. data/ref/ruby/classes/ModuleInfo.src/M000018.html +44 -0
  271. data/ref/ruby/classes/ModuleInfo.src/M000019.html +26 -0
  272. data/ref/ruby/classes/OutputInfo.html +304 -0
  273. data/ref/ruby/classes/OutputInfo.src/M000017.html +51 -0
  274. data/ref/ruby/classes/RDoc.html +135 -0
  275. data/ref/ruby/classes/RDoc.src/M000051.html +40 -0
  276. data/ref/ruby/classes/ResettedCounterValue.html +174 -0
  277. data/ref/ruby/classes/ResettedCounterValue.src/M000014.html +19 -0
  278. data/ref/ruby/classes/ResettedCounterValue.src/M000015.html +18 -0
  279. data/ref/ruby/classes/ResettedCounterValue.src/M000016.html +23 -0
  280. data/ref/ruby/classes/RubyVPI.html +186 -0
  281. data/ref/ruby/classes/RubyVPI.src/M000049.html +18 -0
  282. data/ref/ruby/classes/RubyVPI.src/M000050.html +39 -0
  283. data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.html +370 -0
  284. data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000041.html +22 -0
  285. data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000042.html +44 -0
  286. data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000043.html +82 -0
  287. data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000044.html +127 -0
  288. data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000045.html +26 -0
  289. data/ref/ruby/classes/SWIG/TYPE_p_unsigned_int.src/M000046.html +18 -0
  290. data/ref/ruby/classes/SWIG.html +111 -0
  291. data/ref/ruby/classes/String.html +140 -0
  292. data/ref/ruby/classes/String.src/M000033.html +37 -0
  293. data/ref/ruby/classes/Template.html +158 -0
  294. data/ref/ruby/classes/Template.src/M000026.html +18 -0
  295. data/ref/ruby/classes/TestHw5UnitModel.html +180 -0
  296. data/ref/ruby/classes/TestHw5UnitModel.src/M000020.html +19 -0
  297. data/ref/ruby/classes/TestHw5UnitModel.src/M000021.html +19 -0
  298. data/ref/ruby/classes/TestHw5UnitModel.src/M000022.html +64 -0
  299. data/ref/ruby/created.rid +1 -0
  300. data/ref/ruby/files/bin/generate_test_rb.html +236 -0
  301. data/ref/ruby/files/bin/generate_test_rb.src/M000001.html +29 -0
  302. data/ref/ruby/files/bin/generate_test_tpl/bench_rb.html +115 -0
  303. data/ref/ruby/files/bin/generate_test_tpl/design_rb.html +107 -0
  304. data/ref/ruby/files/bin/generate_test_tpl/proto_rb.html +107 -0
  305. data/ref/ruby/files/bin/generate_test_tpl/spec_rb.html +140 -0
  306. data/ref/ruby/files/bin/generate_test_tpl/spec_rb.src/M000002.html +22 -0
  307. data/ref/ruby/files/bin/header_to_ruby_rb.html +116 -0
  308. data/ref/ruby/files/ext/extconf_rb.html +108 -0
  309. data/ref/ruby/files/gem_extconf_rb.html +114 -0
  310. data/ref/ruby/files/lib/ruby-vpi/erb_rb.html +108 -0
  311. data/ref/ruby/files/lib/ruby-vpi/rake_rb.html +108 -0
  312. data/ref/ruby/files/lib/ruby-vpi/rdoc_rb.html +108 -0
  313. data/ref/ruby/files/lib/ruby-vpi/rspec_rb.html +115 -0
  314. data/ref/ruby/files/lib/ruby-vpi/runner_rb.html +108 -0
  315. data/ref/ruby/files/lib/ruby-vpi/vpi_util_rb.html +108 -0
  316. data/ref/ruby/files/lib/ruby-vpi_rb.html +108 -0
  317. data/ref/ruby/files/samp/counter/counter_rspecTest_bench_rb.html +115 -0
  318. data/ref/ruby/files/samp/counter/counter_rspecTest_design_rb.html +107 -0
  319. data/ref/ruby/files/samp/counter/counter_rspecTest_proto_rb.html +107 -0
  320. data/ref/ruby/files/samp/counter/counter_rspecTest_spec_rb.html +142 -0
  321. data/ref/ruby/files/samp/counter/counter_unitTest_bench_rb.html +115 -0
  322. data/ref/ruby/files/samp/counter/counter_unitTest_design_rb.html +107 -0
  323. data/ref/ruby/files/samp/counter/counter_unitTest_proto_rb.html +107 -0
  324. data/ref/ruby/files/samp/counter/counter_unitTest_spec_rb.html +135 -0
  325. data/ref/ruby/files/samp/pipelined_alu/Hw5UnitModel_rb.html +101 -0
  326. data/ref/ruby/files/samp/pipelined_alu/InputGenerator_rb.html +101 -0
  327. data/ref/ruby/files/samp/pipelined_alu/TestHw5UnitModel_rb.html +111 -0
  328. data/ref/ruby/files/samp/pipelined_alu/hw5_unit_bench_rb.html +108 -0
  329. data/ref/ruby/files/samp/pipelined_alu/hw5_unit_design_rb.html +107 -0
  330. data/ref/ruby/files/samp/pipelined_alu/hw5_unit_spec_rb.html +112 -0
  331. data/ref/ruby/fr_class_index.html +46 -0
  332. data/ref/ruby/fr_file_index.html +55 -0
  333. data/ref/ruby/fr_method_index.html +77 -0
  334. data/ref/ruby/index.html +24 -0
  335. data/ref/ruby/rdoc-style.css +208 -0
  336. data/samp/counter/Rakefile +1 -0
  337. data/samp/counter/counter.v +20 -0
  338. data/samp/counter/counter_rspecTest_bench.rb +9 -0
  339. data/samp/counter/counter_rspecTest_bench.v +28 -0
  340. data/samp/counter/counter_rspecTest_design.rb +22 -0
  341. data/samp/counter/counter_rspecTest_proto.rb +10 -0
  342. data/samp/counter/counter_rspecTest_runner.rake +28 -0
  343. data/samp/counter/counter_rspecTest_spec.rb +47 -0
  344. data/samp/counter/counter_unitTest_bench.rb +9 -0
  345. data/samp/counter/counter_unitTest_bench.v +28 -0
  346. data/samp/counter/counter_unitTest_design.rb +22 -0
  347. data/samp/counter/counter_unitTest_proto.rb +10 -0
  348. data/samp/counter/counter_unitTest_runner.rake +28 -0
  349. data/samp/counter/counter_unitTest_spec.rb +49 -0
  350. data/samp/pipelined_alu/Hw5UnitModel.rb +134 -0
  351. data/samp/pipelined_alu/InputGenerator.rb +94 -0
  352. data/samp/pipelined_alu/README +127 -0
  353. data/samp/pipelined_alu/Rakefile +1 -0
  354. data/samp/pipelined_alu/TestHw5UnitModel.rb +88 -0
  355. data/samp/pipelined_alu/hw5_unit.v +186 -0
  356. data/samp/pipelined_alu/hw5_unit_bench.rb +8 -0
  357. data/samp/pipelined_alu/hw5_unit_bench.v +45 -0
  358. data/samp/pipelined_alu/hw5_unit_design.rb +18 -0
  359. data/samp/pipelined_alu/hw5_unit_runner.rake +10 -0
  360. data/samp/pipelined_alu/hw5_unit_spec.rb +123 -0
  361. data/tpl/launcher.rake +30 -0
  362. data/tpl/runner.rake +96 -0
  363. data/tpl/synopsys_vcs.tab +2 -0
  364. metadata +484 -0
data/ext/Doxyfile ADDED
@@ -0,0 +1,272 @@
1
+ # Doxyfile 1.4.4
2
+
3
+ #---------------------------------------------------------------------------
4
+ # Project related configuration options
5
+ #---------------------------------------------------------------------------
6
+ PROJECT_NAME = Ruby-VPI
7
+ PROJECT_NUMBER =
8
+ OUTPUT_DIRECTORY =
9
+ CREATE_SUBDIRS = NO
10
+ OUTPUT_LANGUAGE = English
11
+ USE_WINDOWS_ENCODING = NO
12
+ BRIEF_MEMBER_DESC = YES
13
+ REPEAT_BRIEF = YES
14
+ ABBREVIATE_BRIEF = "The $name class" \
15
+ "The $name widget" \
16
+ "The $name file" \
17
+ is \
18
+ provides \
19
+ specifies \
20
+ contains \
21
+ represents \
22
+ a \
23
+ an \
24
+ the
25
+ ALWAYS_DETAILED_SEC = NO
26
+ INLINE_INHERITED_MEMB = NO
27
+ FULL_PATH_NAMES = YES
28
+ STRIP_FROM_PATH =
29
+ STRIP_FROM_INC_PATH =
30
+ SHORT_NAMES = NO
31
+ JAVADOC_AUTOBRIEF = YES
32
+ MULTILINE_CPP_IS_BRIEF = NO
33
+ DETAILS_AT_TOP = NO
34
+ INHERIT_DOCS = YES
35
+ DISTRIBUTE_GROUP_DOC = NO
36
+ SEPARATE_MEMBER_PAGES = NO
37
+ TAB_SIZE = 8
38
+ ALIASES =
39
+ OPTIMIZE_OUTPUT_FOR_C = YES
40
+ OPTIMIZE_OUTPUT_JAVA = NO
41
+ SUBGROUPING = YES
42
+ #---------------------------------------------------------------------------
43
+ # Build related configuration options
44
+ #---------------------------------------------------------------------------
45
+ EXTRACT_ALL = YES
46
+ EXTRACT_PRIVATE = YES
47
+ EXTRACT_STATIC = YES
48
+ EXTRACT_LOCAL_CLASSES = YES
49
+ EXTRACT_LOCAL_METHODS = NO
50
+ HIDE_UNDOC_MEMBERS = NO
51
+ HIDE_UNDOC_CLASSES = NO
52
+ HIDE_FRIEND_COMPOUNDS = NO
53
+ HIDE_IN_BODY_DOCS = NO
54
+ INTERNAL_DOCS = NO
55
+ CASE_SENSE_NAMES = YES
56
+ HIDE_SCOPE_NAMES = NO
57
+ SHOW_INCLUDE_FILES = YES
58
+ INLINE_INFO = YES
59
+ SORT_MEMBER_DOCS = YES
60
+ SORT_BRIEF_DOCS = NO
61
+ SORT_BY_SCOPE_NAME = NO
62
+ GENERATE_TODOLIST = YES
63
+ GENERATE_TESTLIST = YES
64
+ GENERATE_BUGLIST = YES
65
+ GENERATE_DEPRECATEDLIST= YES
66
+ ENABLED_SECTIONS =
67
+ MAX_INITIALIZER_LINES = 30
68
+ SHOW_USED_FILES = YES
69
+ SHOW_DIRECTORIES = YES
70
+ FILE_VERSION_FILTER =
71
+ #---------------------------------------------------------------------------
72
+ # configuration options related to warning and progress messages
73
+ #---------------------------------------------------------------------------
74
+ QUIET = NO
75
+ WARNINGS = YES
76
+ WARN_IF_UNDOCUMENTED = YES
77
+ WARN_IF_DOC_ERROR = YES
78
+ WARN_NO_PARAMDOC = NO
79
+ WARN_FORMAT = "$file:$line: $text"
80
+ WARN_LOGFILE =
81
+ #---------------------------------------------------------------------------
82
+ # configuration options related to the input files
83
+ #---------------------------------------------------------------------------
84
+ INPUT =
85
+ FILE_PATTERNS = *.c \
86
+ *.cin \
87
+ *.cc \
88
+ *.cxx \
89
+ *.cpp \
90
+ *.c++ \
91
+ *.d \
92
+ *.java \
93
+ *.ii \
94
+ *.ixx \
95
+ *.ipp \
96
+ *.i++ \
97
+ *.inl \
98
+ *.h \
99
+ *.hin \
100
+ *.hh \
101
+ *.hxx \
102
+ *.hpp \
103
+ *.h++ \
104
+ *.idl \
105
+ *.odl \
106
+ *.cs \
107
+ *.php \
108
+ *.php3 \
109
+ *.inc \
110
+ *.m \
111
+ *.mm \
112
+ *.dox \
113
+ *.C \
114
+ *.CC \
115
+ *.C++ \
116
+ *.II \
117
+ *.I++ \
118
+ *.H \
119
+ *.HH \
120
+ *.H++ \
121
+ *.CS \
122
+ *.PHP \
123
+ *.PHP3 \
124
+ *.M \
125
+ *.MM
126
+ RECURSIVE = YES
127
+ EXCLUDE =
128
+ EXCLUDE_SYMLINKS = NO
129
+ EXCLUDE_PATTERNS =
130
+ EXAMPLE_PATH =
131
+ EXAMPLE_PATTERNS = *
132
+ EXAMPLE_RECURSIVE = NO
133
+ IMAGE_PATH =
134
+ INPUT_FILTER =
135
+ FILTER_PATTERNS =
136
+ FILTER_SOURCE_FILES = NO
137
+ #---------------------------------------------------------------------------
138
+ # configuration options related to source browsing
139
+ #---------------------------------------------------------------------------
140
+ SOURCE_BROWSER = NO
141
+ INLINE_SOURCES = NO
142
+ STRIP_CODE_COMMENTS = YES
143
+ REFERENCED_BY_RELATION = NO
144
+ REFERENCES_RELATION = NO
145
+ USE_HTAGS = NO
146
+ VERBATIM_HEADERS = NO
147
+ #---------------------------------------------------------------------------
148
+ # configuration options related to the alphabetical class index
149
+ #---------------------------------------------------------------------------
150
+ ALPHABETICAL_INDEX = NO
151
+ COLS_IN_ALPHA_INDEX = 5
152
+ IGNORE_PREFIX =
153
+ #---------------------------------------------------------------------------
154
+ # configuration options related to the HTML output
155
+ #---------------------------------------------------------------------------
156
+ GENERATE_HTML = YES
157
+ HTML_OUTPUT = html
158
+ HTML_FILE_EXTENSION = .html
159
+ HTML_HEADER =
160
+ HTML_FOOTER =
161
+ HTML_STYLESHEET =
162
+ HTML_ALIGN_MEMBERS = YES
163
+ GENERATE_HTMLHELP = NO
164
+ CHM_FILE =
165
+ HHC_LOCATION =
166
+ GENERATE_CHI = NO
167
+ BINARY_TOC = NO
168
+ TOC_EXPAND = NO
169
+ DISABLE_INDEX = NO
170
+ ENUM_VALUES_PER_LINE = 4
171
+ GENERATE_TREEVIEW = NO
172
+ TREEVIEW_WIDTH = 250
173
+ #---------------------------------------------------------------------------
174
+ # configuration options related to the LaTeX output
175
+ #---------------------------------------------------------------------------
176
+ GENERATE_LATEX = NO
177
+ LATEX_OUTPUT = latex
178
+ LATEX_CMD_NAME = latex
179
+ MAKEINDEX_CMD_NAME = makeindex
180
+ COMPACT_LATEX = NO
181
+ PAPER_TYPE = a4wide
182
+ EXTRA_PACKAGES =
183
+ LATEX_HEADER =
184
+ PDF_HYPERLINKS = NO
185
+ USE_PDFLATEX = NO
186
+ LATEX_BATCHMODE = NO
187
+ LATEX_HIDE_INDICES = NO
188
+ #---------------------------------------------------------------------------
189
+ # configuration options related to the RTF output
190
+ #---------------------------------------------------------------------------
191
+ GENERATE_RTF = NO
192
+ RTF_OUTPUT = rtf
193
+ COMPACT_RTF = NO
194
+ RTF_HYPERLINKS = NO
195
+ RTF_STYLESHEET_FILE =
196
+ RTF_EXTENSIONS_FILE =
197
+ #---------------------------------------------------------------------------
198
+ # configuration options related to the man page output
199
+ #---------------------------------------------------------------------------
200
+ GENERATE_MAN = NO
201
+ MAN_OUTPUT = man
202
+ MAN_EXTENSION = .3
203
+ MAN_LINKS = NO
204
+ #---------------------------------------------------------------------------
205
+ # configuration options related to the XML output
206
+ #---------------------------------------------------------------------------
207
+ GENERATE_XML = NO
208
+ XML_OUTPUT = xml
209
+ XML_SCHEMA =
210
+ XML_DTD =
211
+ XML_PROGRAMLISTING = YES
212
+ #---------------------------------------------------------------------------
213
+ # configuration options for the AutoGen Definitions output
214
+ #---------------------------------------------------------------------------
215
+ GENERATE_AUTOGEN_DEF = NO
216
+ #---------------------------------------------------------------------------
217
+ # configuration options related to the Perl module output
218
+ #---------------------------------------------------------------------------
219
+ GENERATE_PERLMOD = NO
220
+ PERLMOD_LATEX = NO
221
+ PERLMOD_PRETTY = YES
222
+ PERLMOD_MAKEVAR_PREFIX =
223
+ #---------------------------------------------------------------------------
224
+ # Configuration options related to the preprocessor
225
+ #---------------------------------------------------------------------------
226
+ ENABLE_PREPROCESSING = YES
227
+ MACRO_EXPANSION = NO
228
+ EXPAND_ONLY_PREDEF = NO
229
+ SEARCH_INCLUDES = YES
230
+ INCLUDE_PATH =
231
+ INCLUDE_FILE_PATTERNS =
232
+ PREDEFINED =
233
+ EXPAND_AS_DEFINED =
234
+ SKIP_FUNCTION_MACROS = YES
235
+ #---------------------------------------------------------------------------
236
+ # Configuration::additions related to external references
237
+ #---------------------------------------------------------------------------
238
+ TAGFILES =
239
+ GENERATE_TAGFILE =
240
+ ALLEXTERNALS = NO
241
+ EXTERNAL_GROUPS = YES
242
+ PERL_PATH = /usr/bin/perl
243
+ #---------------------------------------------------------------------------
244
+ # Configuration options related to the dot tool
245
+ #---------------------------------------------------------------------------
246
+ CLASS_DIAGRAMS = YES
247
+ HIDE_UNDOC_RELATIONS = YES
248
+ HAVE_DOT = NO
249
+ CLASS_GRAPH = YES
250
+ COLLABORATION_GRAPH = YES
251
+ GROUP_GRAPHS = YES
252
+ UML_LOOK = NO
253
+ TEMPLATE_RELATIONS = NO
254
+ INCLUDE_GRAPH = YES
255
+ INCLUDED_BY_GRAPH = YES
256
+ CALL_GRAPH = NO
257
+ GRAPHICAL_HIERARCHY = YES
258
+ DIRECTORY_GRAPH = YES
259
+ DOT_IMAGE_FORMAT = png
260
+ DOT_PATH =
261
+ DOTFILE_DIRS =
262
+ MAX_DOT_GRAPH_WIDTH = 1024
263
+ MAX_DOT_GRAPH_HEIGHT = 1024
264
+ MAX_DOT_GRAPH_DEPTH = 1000
265
+ DOT_TRANSPARENT = NO
266
+ DOT_MULTI_TARGETS = NO
267
+ GENERATE_LEGEND = YES
268
+ DOT_CLEANUP = YES
269
+ #---------------------------------------------------------------------------
270
+ # Configuration::additions related to the search engine
271
+ #---------------------------------------------------------------------------
272
+ SEARCHENGINE = NO
data/ext/README ADDED
@@ -0,0 +1,124 @@
1
+ Class|Module Naming Convention
2
+ ------------------------------
3
+
4
+ FooBar
5
+ C module named "FooBar".
6
+
7
+ RFooBar
8
+ Ruby class or module named "FooBar".
9
+
10
+ RFooBar_rb_do_stuff
11
+ Ruby function named "do_stuff" which is callable from Ruby like this: "FooBar.new.do_stuff" or "FooBar::do_stuff" or ...
12
+
13
+ RFooBar_doStuff
14
+ Service function named "doStuff" which is callable from C only.
15
+
16
+ RFooBar__someStuff
17
+ Something named "someStuff", which is neither a Ruby function nor a service function, that belongs to "FooBar". Think of the two underscores "__" as being two colons "::" in Ruby.
18
+
19
+
20
+ Variable Naming Convention
21
+ --------------------------
22
+
23
+ fooBar
24
+ Ordinary variable named "fooBar".
25
+
26
+ a?p?(r|v)?FooBar
27
+ Variable named "FooBar" which has additional properties denoted by the optional prefixes.
28
+
29
+ aFooBar
30
+ Function argument named named "FooBar". For example: "int divide(int aDividend, aDivisor);".
31
+
32
+ pFooBar
33
+ Pointer named "FooBar".
34
+
35
+ rFooBar
36
+ Ruby object (instance of a Ruby class) named "FooBar".
37
+
38
+ vFooBar
39
+ Verilog object named "FooBar".
40
+
41
+
42
+ Code Formatting Convention
43
+ --------------------------
44
+
45
+ Indenting
46
+ Use a single tab character to indent by one level. If you feel that tab characters occupy too much space or indent too deeply, then configure your text editor to *visually* display tab characters using less space. This is similar to the output produced by the filter "expand -t 2" in UNIX.
47
+
48
+ level 1
49
+ level 2
50
+ level 3
51
+ ... and so on ...
52
+ level 2
53
+ level 1
54
+
55
+ Line breaking
56
+ Do not break a long line into multiple lines. Let it be as long as it wants and configure your text editor to *visually* wrap long lines and indent them so they are easy to read. This is similar to the output produced by the filter "fmt -cs" in UNIX.
57
+
58
+ For example:
59
+
60
+ /**
61
+ Foo is a fantastic bar which can be seen from atop the majestic peaks of baz. However, let us not forget the beauty of sparkling rubies beneath its rugged, earthy exterior. Yes, this line is very long, and that is the point.
62
+ */
63
+
64
+ Vertical spacing
65
+ Use 1 line comment before the start of a group of related statements if necessary.
66
+
67
+ Use 1 line within a group of related statements.
68
+
69
+ Use 2 lines to mark the boundary between groups of related statements.
70
+
71
+ Use 3 lines to mark the boundary of a completely disjoint block of code, which has its own groups of related statements.
72
+
73
+ Braces alignment
74
+ Put an open brace on same line as the start of the block statement. For example:
75
+
76
+ if(foo) {
77
+ doFoo();
78
+
79
+ if(bar) {
80
+ doBar();
81
+ }
82
+ }
83
+ else {
84
+ doRuby();
85
+ }
86
+
87
+ Delimiting operators
88
+ When there are many operators in a single statement, indent the first element beneath the block-starter and put the operator at the start of subsequent elements. For example:
89
+
90
+ static unsigned long int
91
+ foo
92
+ , bar
93
+ , baz
94
+ ;
95
+
96
+ doStuff(
97
+ foo
98
+ , bar
99
+ , baz
100
+ );
101
+
102
+ if(
103
+ foo
104
+ && bar
105
+ || baz
106
+ ) {
107
+ doStuff();
108
+ }
109
+
110
+
111
+ Code Documenting Convention
112
+ ---------------------------
113
+
114
+ Doxygen
115
+ Use Javadoc style (at "@" to start a documenting command) instead of LaTeX style (backslash "\" to start a documenting command) whenever possible. All public functions, variables, etc. must have such comments. For example:
116
+
117
+ /**
118
+ Writes out a foo and returns a bar.
119
+
120
+ @param aFoo The foo to write out.
121
+ @return A bar.
122
+ */
123
+ bar doStuff(foo aFoo);
124
+
data/ext/Rakefile ADDED
@@ -0,0 +1,65 @@
1
+ # Build file for the native C extension.
2
+ #
3
+ # = Environment variables
4
+ # CFLAGS:: Arguments to the compiler.
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
26
+
27
+ require 'rake/clean'
28
+ require 'rbconfig'
29
+
30
+ $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
31
+ require 'ruby-vpi/rake'
32
+
33
+
34
+ CFLAGS = [Config::CONFIG['CFLAGS'], ENV['CFLAGS'], '-g', '-DDEBUG']
35
+ LDFLAGS = [Config::CONFIG['LDFLAGS'], ENV['LDFLAGS']]
36
+
37
+
38
+ desc "Builds the extension."
39
+ task :default => 'Makefile' do |t|
40
+ sh 'make', '-f', t.prerequisites[0]
41
+ end
42
+
43
+ file 'Makefile' => [:swig, 'extconf.rb'] do |t|
44
+ ruby t.prerequisites[1], "--with-cflags=#{CFLAGS.join(' ')}", "--with-ldflags=#{LDFLAGS.join(' ')}"
45
+ end
46
+
47
+ CLEAN.include 'Makefile', 'mkmf.log', '*.o', '*.so'
48
+
49
+
50
+ desc 'Generate Ruby wrapper for VPI.'
51
+ task :swig => 'swig_wrap.cin'
52
+
53
+ file 'swig_wrap.cin' => 'swig_vpi.i' do |t|
54
+ sh %w{swig -ruby -o}, t.name, t.prerequisites[0]
55
+ end
56
+
57
+ file 'swig_vpi.i' => 'swig_vpi.h'
58
+
59
+ file 'swig_vpi.h' => 'vpi_user.h' do |t|
60
+ # avoid problems with SWIG-generated wrapper for VPI vprintf functions which use va_list
61
+ ruby %{-pe 'gsub /\\bva_list\\b/, "int"' #{t.prerequisites[0]} > #{t.name}}
62
+ end
63
+
64
+ # NOTE: since SWIG is not a requirement for users, we should not clobber these generated files
65
+ #CLOBBER.include 'swig_wrap.cin', 'swig_vpi.h'
data/ext/common.h ADDED
@@ -0,0 +1,56 @@
1
+ /*
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
+ */
20
+ /**\file
21
+ Things common to all Ruby-VPI code.
22
+ */
23
+
24
+ #ifndef COMMON_H
25
+ #define COMMON_H
26
+
27
+ #include "verilog.h"
28
+
29
+
30
+ /**
31
+ A wrapper for vpi_printf() which marks the given message as being emitted from Ruby-VPI and ends the message with a new line.
32
+
33
+ @param ... Arguments to vpi_printf()
34
+ */
35
+ #define common_printf(...) vpi_printf("Ruby-VPI: "); vpi_printf(__VA_ARGS__); vpi_printf("\n");
36
+
37
+ /**
38
+ A wrapper for common_printf() which marks the given message as being debugging output.
39
+ */
40
+ #ifdef DEBUG
41
+ #define common_debug(...) vpi_printf("(%s:%d) ", __FILE__, __LINE__); common_printf(__VA_ARGS__);
42
+ #else
43
+ #define common_debug(...)
44
+ #endif
45
+
46
+ /**
47
+ A boolean variable with two possible values: true and false. Pass aroung this value instead of zero and non-zero integers.
48
+ */
49
+ typedef enum { false = 0, true = 1 } bool;
50
+
51
+ /**
52
+ Returns the string "true" if the given boolean expression is true. Otherwise returns the string "false".
53
+ */
54
+ #define common_boolToStr(aBoolExpr) ( (aBoolExpr) ? "true" : "false" )
55
+
56
+ #endif
data/ext/extconf.rb ADDED
@@ -0,0 +1,4 @@
1
+ require 'mkmf'
2
+
3
+ have_library 'pthread', 'pthread_create'
4
+ create_makefile 'ruby-vpi'
data/ext/relay.cin ADDED
@@ -0,0 +1,146 @@
1
+ /*
2
+ Copyright 2006 Suraj N. Kurapati
3
+ Copyright 1999 Kazuhiro HIWADA
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
+ */
21
+
22
+ #ifndef RELAY_CIN
23
+ #define RELAY_CIN
24
+
25
+ #include <stdlib.h>
26
+ #include <pthread.h>
27
+ #include <ruby.h>
28
+ #include <assert.h>
29
+
30
+ #include "verilog.h"
31
+ #include "common.h"
32
+
33
+ #include "relay.hin"
34
+ #include "swig.hin"
35
+
36
+
37
+ static pthread_t relay__rubyThread;
38
+ static pthread_mutex_t relay__rubyLock;
39
+ static pthread_mutex_t relay__verilogLock;
40
+
41
+ static void relay_init() {
42
+ pthread_mutex_init(&relay__rubyLock, NULL);
43
+ pthread_mutex_lock(&relay__rubyLock);
44
+ pthread_mutex_init(&relay__verilogLock, NULL);
45
+ pthread_mutex_lock(&relay__verilogLock);
46
+ }
47
+
48
+ static void relay_ruby() {
49
+ pthread_mutex_unlock(&relay__rubyLock);
50
+ pthread_mutex_lock(&relay__verilogLock);
51
+ }
52
+
53
+ static void relay_verilog() {
54
+ pthread_mutex_unlock(&relay__verilogLock);
55
+ pthread_mutex_lock(&relay__rubyLock);
56
+ }
57
+
58
+ typedef struct {
59
+ PLI_BYTE8** mArgs; /// Array of command-line arguments.
60
+ uint mCount; /// Number of command-line arguments.
61
+ } relay__RubyOptions__def;
62
+
63
+ /**
64
+ @param apRubyOptions relay__RubyOptions__def structure which contains command-line options passsed to the Ruby interpreter.
65
+ @note The structure will be freed *deeply* after use.
66
+ */
67
+ static void* ruby_run_handshake(void* apRubyOptions) {
68
+ // initialize Ruby interpreter
69
+ ruby_init();
70
+ ruby_init_loadpath();
71
+
72
+ swig_init();
73
+
74
+ // pass command-line arguments to the interpreter
75
+ relay__RubyOptions__def* pRubyOptions = (relay__RubyOptions__def*) apRubyOptions;
76
+
77
+ PLI_BYTE8** argv = pRubyOptions->mArgs;
78
+ uint argc = pRubyOptions->mCount;
79
+
80
+ ruby_options(argc, argv);
81
+
82
+ // free the memory used by command-line options
83
+ uint i;
84
+ for (i = 0; i < argc; i++) {
85
+ free(argv[i]);
86
+ }
87
+
88
+ free(argv);
89
+ free(pRubyOptions);
90
+
91
+
92
+ // start Ruby interpreter
93
+ ruby_run();
94
+
95
+
96
+ // Ruby interpreter is now finished, so clean it up before terminating this thread
97
+ ruby_finalize();
98
+ return NULL;
99
+ }
100
+
101
+ static void relay_ruby_run() {
102
+ relay__RubyOptions__def* pRubyOptions = malloc(sizeof(relay__RubyOptions__def));
103
+
104
+ if (pRubyOptions) {
105
+ pRubyOptions->mArgs = NULL;
106
+ pRubyOptions->mCount = 0;
107
+
108
+ // transform the arguments passed to this function by Verilog into command-line arguments for Ruby interpeter
109
+ vpiHandle vCall = vpi_handle(vpiSysTfCall, NULL);
110
+
111
+ if (vCall) {
112
+ vpiHandle vCallArgs = vpi_iterate(vpiArgument, vCall);
113
+
114
+ if (vCallArgs) {
115
+ vpiHandle vArg;
116
+ s_vpi_value argVal;
117
+ argVal.format = vpiStringVal;
118
+
119
+ while ((vArg = vpi_scan(vCallArgs)) != NULL) {
120
+ vpi_get_value(vArg, &argVal);
121
+
122
+ pRubyOptions->mCount++;
123
+
124
+
125
+ if (pRubyOptions->mArgs == NULL)
126
+ pRubyOptions->mArgs = malloc(sizeof(PLI_BYTE8*) * pRubyOptions->mCount);
127
+ else
128
+ pRubyOptions->mArgs = realloc(pRubyOptions->mArgs, sizeof(PLI_BYTE8*) * pRubyOptions->mCount);
129
+
130
+ assert(pRubyOptions->mArgs != NULL);
131
+
132
+
133
+ pRubyOptions->mArgs[pRubyOptions->mCount-1] = strdup(argVal.value.str);
134
+ }
135
+ }
136
+ }
137
+
138
+ pthread_create(&relay__rubyThread, 0, ruby_run_handshake, pRubyOptions);
139
+ return;
140
+ }
141
+
142
+ common_printf("error: unable to allocate memory for Ruby's command-line arguments.");
143
+ exit(EXIT_FAILURE);
144
+ }
145
+
146
+ #endif