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
@@ -0,0 +1,258 @@
1
+ #!/usr/bin/ruby -w
2
+ #
3
+ # == Synopsis
4
+ # Generates Ruby-VPI tests from Verilog 2001 module declarations. A generated test is composed of the following parts.
5
+ #
6
+ # Runner:: Written in Rake, this file builds and runs the test bench.
7
+ #
8
+ # Bench:: Written in Verilog and Ruby, these files define the testing environment.
9
+ #
10
+ # Design:: Written in Ruby, this file provides an interface to the Verilog module under test.
11
+ #
12
+ # Prototype:: Written in Ruby, this file defines a prototype of the design under test.
13
+ #
14
+ # Specification:: Written in Ruby, this file verifies the design.
15
+ #
16
+ # The reason for dividing a single test into these parts is mainly to decouple the design from the specification. This allows humans to focus on writing the specification while the remainder is automatically generated by this tool.
17
+ #
18
+ # For example, when the interface of a Verilog module changes, you would simply re-run this tool to incorporate those changes into the test without diverting your focus from the specification.
19
+ #
20
+ # == Notes
21
+ # * If no input files are specified, then the standard input stream will be read instead.
22
+ # * The first signal parameter in a module's declaration is assumed to be the clocking signal.
23
+ # * Existing output files will be backed-up before being over-written. A backed-up file has a tilde (~) appended to its name.
24
+
25
+ =begin
26
+ Copyright 2006 Suraj N. Kurapati
27
+
28
+ This file is part of Ruby-VPI.
29
+
30
+ Ruby-VPI is free software; you can redistribute it and/or
31
+ modify it under the terms of the GNU General Public License
32
+ as published by the Free Software Foundation; either version 2
33
+ of the License, or (at your option) any later version.
34
+
35
+ Ruby-VPI is distributed in the hope that it will be useful,
36
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
37
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38
+ GNU General Public License for more details.
39
+
40
+ You should have received a copy of the GNU General Public License
41
+ along with Ruby-VPI; if not, write to the Free Software Foundation,
42
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
43
+ =end
44
+
45
+
46
+
47
+ require 'fileutils'
48
+
49
+ # Writes the given contents to the file at the given path. If the given path already exists, then a backup is created before proceeding.
50
+ def write_file aPath, aContent
51
+ # create a backup
52
+ if File.exist? aPath
53
+ backupPath = aPath.dup
54
+
55
+ while File.exist? backupPath
56
+ backupPath << '~'
57
+ end
58
+
59
+ FileUtils.cp aPath, backupPath, :preserve => true
60
+ end
61
+
62
+ File.open(aPath, 'w') {|f| f << aContent}
63
+ end
64
+
65
+
66
+
67
+ require 'ruby-vpi/erb'
68
+
69
+ # Template used for generating output.
70
+ class Template < ERB
71
+ TEMPLATE_PATH = __FILE__.sub %r{\.rb$}, '_tpl'
72
+
73
+ def initialize aName
74
+ super File.read(File.join(TEMPLATE_PATH, aName))
75
+ end
76
+ end
77
+
78
+
79
+
80
+ # Holds information about a parsed Verilog module.
81
+ class ModuleInfo
82
+ attr_reader :name, :portNames, :paramNames, :portDecls, :paramDecls, :inputPortNames
83
+
84
+ def initialize aDecl
85
+ aDecl =~ %r{module\s+(\w+)\s*(\#\((.*?)\))?\s*\((.*?)\)\s*;}m
86
+ @name, paramDecl, portDecl = $1, $3 || '', $4
87
+
88
+ # parse configuration parameters
89
+ paramDecl.gsub! %r{\bparameter\b}, ''
90
+ paramDecl.strip!
91
+
92
+ @paramDecls = paramDecl.split(/,/)
93
+
94
+ @paramNames = paramDecls.inject([]) do |acc, decl|
95
+ acc << decl.scan(%r{\w+}).first
96
+ end
97
+
98
+ # parse signal parameters
99
+ portDecl.gsub! %r{\breg\b}, ''
100
+ portDecl.strip!
101
+
102
+ @portDecls = portDecl.split(/,/)
103
+
104
+ @inputPortNames = []
105
+
106
+ @portNames = portDecls.inject([]) do |acc, decl|
107
+ name = decl.scan(%r{\w+}).last
108
+ @inputPortNames << name if decl =~ /\binput\b/
109
+
110
+ acc << name
111
+ end
112
+ end
113
+
114
+ # Parses and returns Verilog 2001 module declarations from the given input.
115
+ def self.parse_declarations aInput
116
+ input = aInput.dup
117
+
118
+ # remove single-line comments
119
+ input.gsub! %r{//.*$}, ''
120
+
121
+ # remove multi-line comments
122
+ input.gsub! %r{/\*.*?\*/}m, ''
123
+
124
+ input.scan %r{module.*?;}m
125
+ end
126
+ end
127
+
128
+
129
+
130
+ # Holds information about the output destinations of a parsed Verilog module.
131
+ class OutputInfo
132
+ RUBY_EXT = '.rb'
133
+ VERILOG_EXT = '.v'
134
+ RUNNER_EXT = '.rake'
135
+
136
+ RUNNER_TMPL_REL_PATH = 'tpl/runner.rake'
137
+
138
+ SPEC_FORMATS = [:RSpec, :UnitTest, :Generic]
139
+
140
+ attr_reader :verilogBenchName, :verilogBenchPath, :rubyBenchName, :rubyBenchPath, :designName, :designClassName, :designPath, :specName, :specClassName, :specFormat, :specPath, :rubyVpiPath, :runnerName, :runnerPath, :protoName, :protoPath, :protoClassName
141
+
142
+ attr_reader :testName, :suffix, :benchSuffix, :designSuffix, :specSuffix, :runnerSuffix, :protoSuffix
143
+
144
+ def initialize aModuleName, aSpecFormat, aTestName, aRubyVpiPath
145
+ raise ArgumentError unless SPEC_FORMATS.include? aSpecFormat
146
+ @specFormat = aSpecFormat
147
+ @testName = aTestName
148
+
149
+ @suffix = '_' + @testName
150
+ @benchSuffix = @suffix + '_bench'
151
+ @designSuffix = @suffix + '_design'
152
+ @specSuffix = @suffix + '_spec'
153
+ @runnerSuffix = @suffix + '_runner'
154
+ @protoSuffix = @suffix + '_proto'
155
+
156
+ @rubyVpiPath = aRubyVpiPath
157
+
158
+ @verilogBenchName = aModuleName + @benchSuffix
159
+ @verilogBenchPath = @verilogBenchName + VERILOG_EXT
160
+
161
+ @rubyBenchName = aModuleName + @benchSuffix
162
+ @rubyBenchPath = @rubyBenchName + RUBY_EXT
163
+
164
+ @designName = aModuleName + @designSuffix
165
+ @designPath = @designName + RUBY_EXT
166
+
167
+ @protoName = aModuleName + @protoSuffix
168
+ @protoPath = @protoName + RUBY_EXT
169
+
170
+ @specName = aModuleName + @specSuffix
171
+ @specPath = @specName + RUBY_EXT
172
+
173
+ @designClassName = aModuleName.capitalize
174
+ @protoClassName = @designClassName + 'Proto'
175
+ @specClassName = @specName.capitalize
176
+
177
+ @runnerName = aModuleName + @runnerSuffix
178
+ @runnerPath = @runnerName + RUNNER_EXT
179
+ end
180
+ end
181
+
182
+
183
+
184
+ if File.basename($0) == File.basename(__FILE__)
185
+ # obtain templates for output generation
186
+ VERILOG_BENCH_TEMPLATE = Template.new('bench.v')
187
+ RUBY_BENCH_TEMPLATE = Template.new('bench.rb')
188
+ DESIGN_TEMPLATE = Template.new('design.rb')
189
+ PROTO_TEMPLATE = Template.new('proto.rb')
190
+ SPEC_TEMPLATE = Template.new('spec.rb')
191
+ RUNNER_TEMPLATE = Template.new('runner.rake')
192
+
193
+
194
+ # parse command-line options
195
+ require 'optparse'
196
+
197
+ optSpecFmt = :Generic
198
+ optTestName = 'test'
199
+
200
+ opts = OptionParser.new
201
+ opts.banner = "Usage: #{File.basename __FILE__} [options] [files]"
202
+
203
+ opts.on '-h', '--help', 'show this help message' do
204
+ require 'ruby-vpi/rdoc'
205
+ RDoc.usage_from_file __FILE__
206
+
207
+ puts opts
208
+ exit
209
+ end
210
+
211
+ opts.on '-u', '--unit', 'use Test::Unit specification format' do |val|
212
+ optSpecFmt = :UnitTest if val
213
+ end
214
+
215
+ opts.on '-r', '--rspec', 'use RSpec specification format' do |val|
216
+ optSpecFmt = :RSpec if val
217
+ end
218
+
219
+ opts.on '-n', '--name NAME', 'attach NAME indentifier to generated test' do |val|
220
+ optTestName = val
221
+ end
222
+
223
+ opts.parse! ARGV
224
+
225
+ puts "Using name `#{optTestName}' for generated test."
226
+ puts "Using #{optSpecFmt} specification format."
227
+
228
+
229
+ ModuleInfo.parse_declarations(ARGF.read).each do |moduleDecl|
230
+ puts
231
+
232
+ m = ModuleInfo.new(moduleDecl).freeze
233
+ puts "Parsed module: #{m.name}"
234
+
235
+ o = OutputInfo.new(m.name, optSpecFmt, optTestName, File.dirname(File.dirname(__FILE__))).freeze
236
+
237
+ # generate output
238
+ aModuleInfo, aOutputInfo = m, o
239
+
240
+ write_file o.runnerPath, RUNNER_TEMPLATE.result(binding)
241
+ puts "- Generated runner: #{o.runnerPath}"
242
+
243
+ write_file o.verilogBenchPath, VERILOG_BENCH_TEMPLATE.result(binding)
244
+ puts "- Generated bench: #{o.verilogBenchPath}"
245
+
246
+ write_file o.rubyBenchPath, RUBY_BENCH_TEMPLATE.result(binding)
247
+ puts "- Generated bench: #{o.rubyBenchPath}"
248
+
249
+ write_file o.designPath, DESIGN_TEMPLATE.result(binding)
250
+ puts "- Generated design: #{o.designPath}"
251
+
252
+ write_file o.protoPath, PROTO_TEMPLATE.result(binding)
253
+ puts "- Generated prototype: #{o.protoPath}"
254
+
255
+ write_file o.specPath, SPEC_TEMPLATE.result(binding)
256
+ puts "- Generated specification: #{o.specPath}"
257
+ end
258
+ end
@@ -0,0 +1,31 @@
1
+ ## This is the Ruby side of the bench.
2
+
3
+ require 'ruby-vpi'
4
+ <%
5
+ case aOutputInfo.specFormat
6
+ when :UnitTest
7
+ %>
8
+ require 'test/unit'
9
+ <%
10
+ when :RSpec
11
+ %>
12
+ require 'ruby-vpi/rspec'
13
+ <%
14
+ end
15
+ %>
16
+
17
+ RubyVPI.init_bench '<%= aModuleInfo.name + aOutputInfo.suffix %>', :<%= aOutputInfo.protoClassName %>
18
+
19
+ # service the $ruby_relay callback
20
+ <%
21
+ case aOutputInfo.specFormat
22
+ when :UnitTest, :RSpec
23
+ %>
24
+ # The <%= aOutputInfo.specFormat %> library will take control henceforth.
25
+ <%
26
+ else
27
+ %>
28
+ <%= aOutputInfo.specClassName + '.new' %>
29
+ <%
30
+ end
31
+ %>
@@ -0,0 +1,54 @@
1
+ <%
2
+ # Returns a comma-separated string of parameter declarations in Verilog module instantiation format.
3
+ def make_inst_param_decl(paramNames)
4
+ paramNames.inject([]) {|acc, param| acc << ".#{param}(#{param})"}.join(', ')
5
+ end
6
+
7
+ clockSignal = aModuleInfo.portNames.first
8
+ %>
9
+ /* This is the Verilog side of the bench. */
10
+
11
+ module <%= aOutputInfo.verilogBenchName %>;
12
+
13
+ // instantiate the design under test
14
+ <% aModuleInfo.paramDecls.each do |decl| %>
15
+ parameter <%= decl %>;
16
+ <% end %>
17
+
18
+ <%
19
+ aModuleInfo.portDecls.each do |decl|
20
+ { 'input' => 'reg', 'output' => 'wire' }.each_pair do |key, val|
21
+ decl.sub! %r{\b#{key}\b(.*?)$}, "#{val}\\1;"
22
+ end
23
+ %>
24
+ <%= decl.strip %>
25
+ <%
26
+ end
27
+ %>
28
+
29
+ <%= aModuleInfo.name %><%
30
+ instConfigDecl = make_inst_param_decl(aModuleInfo.paramNames)
31
+
32
+ unless instConfigDecl.empty?
33
+ %>#(<%= instConfigDecl %>)<%
34
+ end
35
+
36
+ %><%= aOutputInfo.verilogBenchName + aOutputInfo.designSuffix %>(<%= make_inst_param_decl(aModuleInfo.portNames) %>);
37
+
38
+ // connect to the Ruby side of this bench
39
+ initial begin
40
+ <%= clockSignal %> = 0;
41
+ $ruby_init("ruby", "-w", "-rubygems", "<%= aOutputInfo.rubyBenchPath %>"<%=
42
+ %{, "-f", "s"} if aOutputInfo.specFormat == :RSpec
43
+ %>);
44
+ end
45
+
46
+ always begin
47
+ #5 <%= clockSignal %> = ~<%= clockSignal %>;
48
+ end
49
+
50
+ always @(posedge <%= clockSignal %>) begin
51
+ #1 $ruby_relay;
52
+ end
53
+
54
+ endmodule
@@ -0,0 +1,26 @@
1
+ # An interface to the design under test.
2
+ class <%= aOutputInfo.designClassName %>
3
+ include Vpi
4
+
5
+ <% aModuleInfo.paramDecls.each do |decl| %>
6
+ <%= decl.strip.capitalize %>
7
+ <% end %>
8
+
9
+ attr_reader <%=
10
+ aModuleInfo.portNames.inject([]) do |acc, port|
11
+ acc << ":#{port}"
12
+ end.join(', ')
13
+ %>
14
+
15
+ def initialize
16
+ <% aModuleInfo.portNames.each do |port| %>
17
+ @<%= port %> = vpi_handle_by_name("<%= aOutputInfo.verilogBenchName %>.<%= port %>", nil)
18
+ <% end %>
19
+ end
20
+
21
+ def reset!
22
+ <% aModuleInfo.inputPortNames[1..-1].each do |port| %>
23
+ @<%= port %>.hexStrVal = 'x'
24
+ <% end %>
25
+ end
26
+ end
@@ -0,0 +1,8 @@
1
+ # A prototype of the design under test.
2
+ class <%= aOutputInfo.protoClassName %> < <%= aOutputInfo.designClassName %>
3
+ def simulate!
4
+ # read inputs
5
+ # simulate design's behavior
6
+ # produce outputs
7
+ end
8
+ end
@@ -0,0 +1,28 @@
1
+ ## This file builds and runs the test.
2
+
3
+ # These are source files that are to be simulated.
4
+ SIMULATOR_SOURCES = [
5
+ '<%= aOutputInfo.verilogBenchPath %>',
6
+ '<%= aModuleInfo.name %>.v',
7
+ ]
8
+
9
+ # This specifies the "top module" that is to be simulated.
10
+ SIMULATOR_TARGET = '<%= aOutputInfo.verilogBenchName %>'
11
+
12
+ # These are command-line arguments for the simulator.
13
+ # They can be specified as a string or an array of strings.
14
+ SIMULATOR_ARGS = {
15
+ # GPL Cver
16
+ :cver => '',
17
+
18
+ # Icarus Verilog
19
+ :ivl => '',
20
+
21
+ # Synopsys VCS
22
+ :vcs => '',
23
+
24
+ # Mentor Modelsim
25
+ :vsim => '',
26
+ }
27
+
28
+ require 'ruby-vpi/runner'
@@ -0,0 +1,46 @@
1
+ ## This specification verifies the design under test.
2
+
3
+ <%
4
+ case aOutputInfo.specFormat
5
+ when :UnitTest
6
+ %>
7
+ class <%= aOutputInfo.specClassName %> < Test::Unit::TestCase
8
+ include Vpi
9
+
10
+ def setup
11
+ @design = <%= aOutputInfo.designClassName %>.new
12
+ end
13
+ <% aModuleInfo.portNames.each do |param| %>
14
+
15
+ def test_<%= param %>
16
+ end
17
+ <% end %>
18
+ end
19
+ <%
20
+ when :RSpec
21
+ %>
22
+ include Vpi
23
+
24
+ context "A new <%= aOutputInfo.designClassName %>" do
25
+ setup do
26
+ @design = <%= aOutputInfo.designClassName %>.new
27
+ @design.reset!
28
+ end
29
+
30
+ specify "should ..." do
31
+ # @design.should ...
32
+ end
33
+ end
34
+ <%
35
+ else
36
+ %>
37
+ class <%= aOutputInfo.specClassName %>
38
+ include Vpi
39
+
40
+ def initialize
41
+ @design = <%= aOutputInfo.designClassName %>.new
42
+ end
43
+ end
44
+ <%
45
+ end
46
+ %>
@@ -0,0 +1,70 @@
1
+ #!/usr/bin/ruby -w
2
+ #
3
+ # == Synopsis
4
+ # Transforms Verilog header files into Ruby syntax.
5
+
6
+ =begin
7
+ Copyright 2006 Suraj N. Kurapati
8
+
9
+ This file is part of Ruby-VPI.
10
+
11
+ Ruby-VPI is free software; you can redistribute it and/or
12
+ modify it under the terms of the GNU General Public License
13
+ as published by the Free Software Foundation; either version 2
14
+ of the License, or (at your option) any later version.
15
+
16
+ Ruby-VPI is distributed in the hope that it will be useful,
17
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ GNU General Public License for more details.
20
+
21
+ You should have received a copy of the GNU General Public License
22
+ along with Ruby-VPI; if not, write to the Free Software Foundation,
23
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24
+ =end
25
+
26
+ class String
27
+ # Converts this Verilog header content into Ruby syntax.
28
+ def to_ruby
29
+ content = self.dup
30
+
31
+ # remove single-line comments
32
+ content.gsub! %r{//(.*)$}, '#\1'
33
+
34
+ # remove multi-line comments
35
+ content.gsub! %r{/\*.*?\*/}m, "\n=begin\n\\0\n=end\n"
36
+
37
+ # remove preprocessor directives
38
+ content.gsub! %r{`include}, '#\0'
39
+ content.gsub! %r{`define\s+(\w+)\s+(.+)}, '\1 = \2'
40
+ content.gsub! %r{`+}, ''
41
+
42
+ # change numbers
43
+ content.gsub! %r{\d*\'([dohb]\w+)}, '0\1'
44
+
45
+ # change ranges
46
+ content.gsub! %r{(\S)\s*:\s*(\S)}, '\1..\2'
47
+
48
+ content
49
+ end
50
+ end
51
+
52
+ if File.basename($0) == File.basename(__FILE__)
53
+ # parse command-line options
54
+ require 'optparse'
55
+
56
+ opts = OptionParser.new
57
+ opts.banner = "Usage: #{File.basename __FILE__} [options] [files]"
58
+
59
+ opts.on '-h', '--help', 'show this help message' do
60
+ require 'ruby-vpi/rdoc'
61
+ RDoc.usage_from_file __FILE__
62
+
63
+ puts opts
64
+ exit
65
+ end
66
+
67
+ opts.parse! ARGV
68
+
69
+ puts ARGF.read.to_ruby
70
+ end
data/doc/Rakefile ADDED
@@ -0,0 +1,55 @@
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
+ require 'rake/clean'
22
+
23
+ FORMATS = {
24
+ # task name => [xsltproc flag, needs resources?]
25
+ 'html' => ['xhtml', true],
26
+ 'text' => ['txt', false],
27
+ }
28
+
29
+ task :default => FORMATS.keys
30
+
31
+ FORMATS.each_pair do |fmtName, (fmtFlag, needsResources)|
32
+ desc "Generate documentation in #{fmtName} format."
33
+ file fmtFlag => ['src/manual.xml', 'src/manual.xsl'] do |t|
34
+ sh %{xmlto #{fmtFlag} -o #{fmtFlag} -m #{t.prerequisites[1]} #{t.prerequisites[0]}}
35
+ end
36
+
37
+ CLOBBER.include fmtFlag
38
+
39
+ task fmtName => fmtFlag
40
+
41
+ # copy additional resources to output directory
42
+ if needsResources
43
+ FileList['src/*/'].each do |path|
44
+ dst = File.join(fmtFlag, File.basename(path))
45
+
46
+ file dst => [path, fmtFlag] do
47
+ cp_r path, dst
48
+ end
49
+
50
+ CLEAN.include dst
51
+
52
+ task fmtName => dst
53
+ end
54
+ end
55
+ end