ruby-vpi 19.0.0 → 20.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (776) hide show
  1. data/LICENSE +12 -13
  2. data/README +1 -1
  3. data/Rakefile +104 -118
  4. data/TODO +77 -0
  5. data/bin/convert.rb +1 -1
  6. data/bin/generate/design.rb +3 -2
  7. data/bin/generate/loader.rb +1 -0
  8. data/bin/generate/proto.rb +16 -14
  9. data/bin/generate/runner.rake +8 -3
  10. data/bin/generate/spec.rb +11 -13
  11. data/bin/generate.rb +23 -18
  12. data/bin/ruby-vpi +36 -27
  13. data/doc/api/c/annotated.html +36 -0
  14. data/{ref → doc/api}/c/common_8h.html +9 -13
  15. data/{ref → doc/api}/c/doxygen.css +0 -0
  16. data/{ref → doc/api}/c/doxygen.png +0 -0
  17. data/{ref → doc/api}/c/files.html +10 -8
  18. data/doc/api/c/functions.html +184 -0
  19. data/doc/api/c/functions_vars.html +184 -0
  20. data/{ref → doc/api}/c/globals.html +12 -11
  21. data/{ref → doc/api}/c/globals_0x63.html +12 -11
  22. data/{ref → doc/api}/c/globals_0x65.html +12 -11
  23. data/{ref → doc/api}/c/globals_0x66.html +12 -11
  24. data/{ref → doc/api}/c/globals_0x6d.html +14 -13
  25. data/{ref → doc/api}/c/globals_0x70.html +21 -20
  26. data/{ref → doc/api}/c/globals_0x72.html +14 -13
  27. data/{ref → doc/api}/c/globals_0x74.html +12 -11
  28. data/{ref → doc/api}/c/globals_0x76.html +17 -16
  29. data/{ref → doc/api}/c/globals_0x78.html +12 -11
  30. data/{ref → doc/api}/c/globals_defs.html +12 -10
  31. data/{ref → doc/api}/c/globals_defs_0x65.html +12 -10
  32. data/{ref → doc/api}/c/globals_defs_0x70.html +12 -10
  33. data/{ref → doc/api}/c/globals_defs_0x76.html +14 -12
  34. data/{ref → doc/api}/c/globals_defs_0x78.html +12 -10
  35. data/{ref → doc/api}/c/globals_enum.html +11 -9
  36. data/{ref → doc/api}/c/globals_eval.html +11 -9
  37. data/{ref → doc/api}/c/globals_func.html +17 -15
  38. data/doc/api/c/globals_type.html +72 -0
  39. data/{ref → doc/api}/c/globals_vars.html +13 -11
  40. data/{ref → doc/api}/c/index.html +7 -6
  41. data/{ref → doc/api}/c/main_8c.html +7 -11
  42. data/{ref → doc/api}/c/main_8h.html +7 -11
  43. data/{ref → doc/api}/c/relay_8c.html +7 -11
  44. data/{ref → doc/api}/c/relay_8h.html +7 -11
  45. data/{ref/c/structt__cb__data.html → doc/api/c/structs__cb__data.html} +32 -30
  46. data/{ref/c/structt__vpi__delay.html → doc/api/c/structs__vpi__delay.html} +29 -27
  47. data/{ref/c/structt__vpi__error__info.html → doc/api/c/structs__vpi__error__info.html} +32 -30
  48. data/{ref/c/structt__vpi__strengthval.html → doc/api/c/structs__vpi__strengthval.html} +20 -18
  49. data/{ref/c/structt__vpi__systf__data.html → doc/api/c/structs__vpi__systf__data.html} +32 -30
  50. data/{ref/c/structt__vpi__time.html → doc/api/c/structs__vpi__time.html} +23 -21
  51. data/doc/api/c/structs__vpi__value.html +207 -0
  52. data/{ref/c/structt__vpi__vecval.html → doc/api/c/structs__vpi__vecval.html} +17 -15
  53. data/{ref/c/structt__vpi__vlog__info.html → doc/api/c/structs__vpi__vlog__info.html} +23 -21
  54. data/{ref → doc/api}/c/tab_b.gif +0 -0
  55. data/{ref → doc/api}/c/tab_l.gif +0 -0
  56. data/{ref → doc/api}/c/tab_r.gif +0 -0
  57. data/{ref → doc/api}/c/tabs.css +2 -2
  58. data/{ref → doc/api}/c/verilog_8h.html +11 -15
  59. data/{ref → doc/api}/c/vlog_8c.html +14 -18
  60. data/{ref → doc/api}/c/vlog_8h.html +9 -13
  61. data/{ref → doc/api}/c/vpi__user_8h.html +120 -239
  62. data/{ref → doc/api}/ruby/classes/ERB.html +7 -7
  63. data/doc/api/ruby/classes/ERB.src/M000025.html +29 -0
  64. data/{ref → doc/api}/ruby/classes/FileUtils.html +6 -23
  65. data/doc/api/ruby/classes/FileUtils.src/M000026.html +20 -0
  66. data/{ref → doc/api}/ruby/classes/Float.html +8 -8
  67. data/doc/api/ruby/classes/Float.src/M000020.html +19 -0
  68. data/{ref → doc/api}/ruby/classes/Integer.html +67 -67
  69. data/doc/api/ruby/classes/Integer.src/M000008.html +25 -0
  70. data/doc/api/ruby/classes/Integer.src/M000009.html +18 -0
  71. data/doc/api/ruby/classes/Integer.src/M000010.html +18 -0
  72. data/doc/api/ruby/classes/Integer.src/M000011.html +18 -0
  73. data/doc/api/ruby/classes/Integer.src/M000012.html +18 -0
  74. data/doc/api/ruby/classes/Integer.src/M000013.html +18 -0
  75. data/doc/api/ruby/classes/Integer.src/M000016.html +25 -0
  76. data/doc/api/ruby/classes/Integer.src/M000017.html +31 -0
  77. data/doc/api/ruby/classes/Integer.src/M000018.html +25 -0
  78. data/doc/api/ruby/classes/Integer.src/M000019.html +30 -0
  79. data/{ref → doc/api}/ruby/classes/Object.html +3 -3
  80. data/{ref → doc/api}/ruby/classes/RDoc.html +7 -7
  81. data/doc/api/ruby/classes/RDoc.src/M000541.html +40 -0
  82. data/doc/api/ruby/classes/RubyVPI/SIMULATORS.html +130 -0
  83. data/doc/api/ruby/classes/RubyVPI/SIMULATORS.src/M000028.html +19 -0
  84. data/{ref → doc/api}/ruby/classes/RubyVPI.html +96 -55
  85. data/doc/api/ruby/classes/RubyVPI.src/M000027.html +34 -0
  86. data/{ref → doc/api}/ruby/classes/String.html +16 -16
  87. data/doc/api/ruby/classes/String.src/M000021.html +36 -0
  88. data/doc/api/ruby/classes/String.src/M000022.html +18 -0
  89. data/doc/api/ruby/classes/String.src/M000023.html +18 -0
  90. data/doc/api/ruby/classes/String.src/M000024.html +41 -0
  91. data/doc/api/ruby/classes/VPI/Handle.html +2098 -0
  92. data/doc/api/ruby/classes/VPI/Handle.src/M000434.html +31 -0
  93. data/doc/api/ruby/classes/VPI/Handle.src/M000435.html +18 -0
  94. data/doc/api/ruby/classes/VPI/Handle.src/M000436.html +18 -0
  95. data/doc/api/ruby/classes/VPI/Handle.src/M000439.html +18 -0
  96. data/doc/api/ruby/classes/VPI/Handle.src/M000440.html +18 -0
  97. data/doc/api/ruby/classes/VPI/Handle.src/M000443.html +18 -0
  98. data/doc/api/ruby/classes/VPI/Handle.src/M000444.html +18 -0
  99. data/doc/api/ruby/classes/VPI/Handle.src/M000447.html +18 -0
  100. data/doc/api/ruby/classes/VPI/Handle.src/M000448.html +18 -0
  101. data/doc/api/ruby/classes/VPI/Handle.src/M000451.html +18 -0
  102. data/doc/api/ruby/classes/VPI/Handle.src/M000452.html +18 -0
  103. data/doc/api/ruby/classes/VPI/Handle.src/M000455.html +18 -0
  104. data/doc/api/ruby/classes/VPI/Handle.src/M000456.html +18 -0
  105. data/doc/api/ruby/classes/VPI/Handle.src/M000459.html +24 -0
  106. data/doc/api/ruby/classes/VPI/Handle.src/M000461.html +21 -0
  107. data/doc/api/ruby/classes/VPI/Handle.src/M000462.html +28 -0
  108. data/doc/api/ruby/classes/VPI/Handle.src/M000463.html +50 -0
  109. data/doc/api/ruby/classes/VPI/Handle.src/M000464.html +19 -0
  110. data/doc/api/ruby/classes/VPI/Handle.src/M000465.html +19 -0
  111. data/doc/api/ruby/classes/VPI/Handle.src/M000466.html +18 -0
  112. data/doc/api/ruby/classes/VPI/Handle.src/M000467.html +18 -0
  113. data/doc/api/ruby/classes/VPI/Handle.src/M000468.html +30 -0
  114. data/doc/api/ruby/classes/VPI/Handle.src/M000469.html +18 -0
  115. data/doc/api/ruby/classes/VPI/Handle.src/M000470.html +18 -0
  116. data/doc/api/ruby/classes/VPI/Handle.src/M000471.html +40 -0
  117. data/doc/api/ruby/classes/VPI/Handle.src/M000472.html +18 -0
  118. data/doc/api/ruby/classes/VPI/Handle.src/M000473.html +21 -0
  119. data/doc/api/ruby/classes/VPI/Handle.src/M000474.html +16 -0
  120. data/doc/api/ruby/classes/VPI/Handle.src/M000475.html +16 -0
  121. data/doc/api/ruby/classes/VPI/Handle.src/M000476.html +16 -0
  122. data/doc/api/ruby/classes/VPI/Handle.src/M000477.html +16 -0
  123. data/doc/api/ruby/classes/VPI/Handle.src/M000478.html +16 -0
  124. data/doc/api/ruby/classes/VPI/Handle.src/M000479.html +16 -0
  125. data/doc/api/ruby/classes/VPI/Handle.src/M000480.html +16 -0
  126. data/doc/api/ruby/classes/VPI/Handle.src/M000481.html +16 -0
  127. data/doc/api/ruby/classes/VPI/Handle.src/M000482.html +16 -0
  128. data/doc/api/ruby/classes/VPI/Handle.src/M000483.html +16 -0
  129. data/doc/api/ruby/classes/VPI/Handle.src/M000484.html +16 -0
  130. data/doc/api/ruby/classes/VPI/Handle.src/M000485.html +16 -0
  131. data/doc/api/ruby/classes/VPI/Handle.src/M000486.html +16 -0
  132. data/doc/api/ruby/classes/VPI/Handle.src/M000487.html +16 -0
  133. data/doc/api/ruby/classes/VPI/Handle.src/M000488.html +16 -0
  134. data/doc/api/ruby/classes/VPI/Handle.src/M000489.html +16 -0
  135. data/doc/api/ruby/classes/VPI/Handle.src/M000490.html +16 -0
  136. data/doc/api/ruby/classes/VPI/Handle.src/M000491.html +16 -0
  137. data/doc/api/ruby/classes/VPI/Handle.src/M000492.html +16 -0
  138. data/doc/api/ruby/classes/VPI/Handle.src/M000493.html +16 -0
  139. data/doc/api/ruby/classes/VPI/Handle.src/M000494.html +16 -0
  140. data/doc/api/ruby/classes/VPI/Handle.src/M000495.html +16 -0
  141. data/doc/api/ruby/classes/VPI/Handle.src/M000496.html +16 -0
  142. data/doc/api/ruby/classes/VPI/Handle.src/M000497.html +16 -0
  143. data/doc/api/ruby/classes/VPI/Handle.src/M000498.html +16 -0
  144. data/doc/api/ruby/classes/VPI/Handle.src/M000499.html +16 -0
  145. data/doc/api/ruby/classes/VPI/Handle.src/M000500.html +16 -0
  146. data/doc/api/ruby/classes/VPI/Handle.src/M000501.html +16 -0
  147. data/doc/api/ruby/classes/VPI/Handle.src/M000502.html +16 -0
  148. data/doc/api/ruby/classes/VPI/Handle.src/M000503.html +16 -0
  149. data/doc/api/ruby/classes/VPI/Handle.src/M000504.html +16 -0
  150. data/doc/api/ruby/classes/VPI/Handle.src/M000505.html +16 -0
  151. data/doc/api/ruby/classes/VPI/Handle.src/M000506.html +16 -0
  152. data/doc/api/ruby/classes/VPI/Handle.src/M000507.html +16 -0
  153. data/doc/api/ruby/classes/VPI/Handle.src/M000508.html +16 -0
  154. data/doc/api/ruby/classes/VPI/Handle.src/M000509.html +16 -0
  155. data/doc/api/ruby/classes/VPI/Handle.src/M000510.html +16 -0
  156. data/doc/api/ruby/classes/VPI/Handle.src/M000511.html +16 -0
  157. data/doc/api/ruby/classes/VPI/Handle.src/M000512.html +16 -0
  158. data/doc/api/ruby/classes/VPI/Handle.src/M000513.html +16 -0
  159. data/doc/api/ruby/classes/VPI/Handle.src/M000514.html +16 -0
  160. data/doc/api/ruby/classes/VPI/Handle.src/M000515.html +16 -0
  161. data/doc/api/ruby/classes/VPI/Handle.src/M000516.html +16 -0
  162. data/doc/api/ruby/classes/VPI/Handle.src/M000517.html +16 -0
  163. data/doc/api/ruby/classes/VPI/Handle.src/M000518.html +16 -0
  164. data/doc/api/ruby/classes/VPI/Handle.src/M000519.html +16 -0
  165. data/doc/api/ruby/classes/VPI/Handle.src/M000520.html +16 -0
  166. data/doc/api/ruby/classes/VPI/Handle.src/M000521.html +16 -0
  167. data/doc/api/ruby/classes/VPI/Handle.src/M000522.html +16 -0
  168. data/doc/api/ruby/classes/VPI/Handle.src/M000523.html +16 -0
  169. data/doc/api/ruby/classes/VPI/Handle.src/M000524.html +16 -0
  170. data/doc/api/ruby/classes/VPI/Handle.src/M000525.html +16 -0
  171. data/doc/api/ruby/classes/VPI/Handle.src/M000526.html +16 -0
  172. data/doc/api/ruby/classes/VPI/Handle.src/M000527.html +16 -0
  173. data/doc/api/ruby/classes/VPI/Handle.src/M000528.html +16 -0
  174. data/doc/api/ruby/classes/VPI/Handle.src/M000529.html +16 -0
  175. data/doc/api/ruby/classes/VPI/Handle.src/M000530.html +16 -0
  176. data/doc/api/ruby/classes/VPI/Handle.src/M000531.html +16 -0
  177. data/doc/api/ruby/classes/VPI/Handle.src/M000532.html +16 -0
  178. data/doc/api/ruby/classes/VPI/Handle.src/M000533.html +16 -0
  179. data/doc/api/ruby/classes/VPI/Handle.src/M000534.html +16 -0
  180. data/doc/api/ruby/classes/VPI/Handle.src/M000535.html +16 -0
  181. data/doc/api/ruby/classes/VPI/Handle.src/M000536.html +16 -0
  182. data/doc/api/ruby/classes/VPI/Handle.src/M000537.html +16 -0
  183. data/{ref → doc/api}/ruby/classes/VPI/S_vpi_time.html +18 -18
  184. data/doc/api/ruby/classes/VPI/S_vpi_time.src/M000538.html +18 -0
  185. data/doc/api/ruby/classes/VPI/S_vpi_time.src/M000539.html +19 -0
  186. data/{ref → doc/api}/ruby/classes/VPI/S_vpi_value.html +17 -17
  187. data/doc/api/ruby/classes/VPI/S_vpi_value.src/M000431.html +35 -0
  188. data/doc/api/ruby/classes/VPI/S_vpi_value.src/M000432.html +42 -0
  189. data/doc/api/ruby/classes/VPI/S_vpi_value.src/M000433.html +42 -0
  190. data/doc/api/ruby/classes/VPI.html +11152 -0
  191. data/doc/api/ruby/classes/VPI.src/M000029.html +19 -0
  192. data/doc/api/ruby/classes/VPI.src/M000030.html +18 -0
  193. data/doc/api/ruby/classes/VPI.src/M000031.html +19 -0
  194. data/doc/api/ruby/classes/VPI.src/M000033.html +25 -0
  195. data/doc/api/ruby/classes/VPI.src/M000034.html +26 -0
  196. data/doc/api/ruby/classes/VPI.src/M000036.html +16 -0
  197. data/doc/api/ruby/classes/VPI.src/M000037.html +16 -0
  198. data/doc/api/ruby/classes/VPI.src/M000038.html +16 -0
  199. data/doc/api/ruby/classes/VPI.src/M000039.html +16 -0
  200. data/doc/api/ruby/classes/VPI.src/M000040.html +16 -0
  201. data/doc/api/ruby/classes/VPI.src/M000041.html +16 -0
  202. data/doc/api/ruby/classes/VPI.src/M000042.html +16 -0
  203. data/doc/api/ruby/classes/VPI.src/M000043.html +16 -0
  204. data/doc/api/ruby/classes/VPI.src/M000044.html +16 -0
  205. data/doc/api/ruby/classes/VPI.src/M000045.html +16 -0
  206. data/doc/api/ruby/classes/VPI.src/M000046.html +16 -0
  207. data/doc/api/ruby/classes/VPI.src/M000047.html +16 -0
  208. data/doc/api/ruby/classes/VPI.src/M000048.html +16 -0
  209. data/doc/api/ruby/classes/VPI.src/M000049.html +16 -0
  210. data/doc/api/ruby/classes/VPI.src/M000050.html +16 -0
  211. data/doc/api/ruby/classes/VPI.src/M000051.html +16 -0
  212. data/doc/api/ruby/classes/VPI.src/M000052.html +16 -0
  213. data/doc/api/ruby/classes/VPI.src/M000053.html +16 -0
  214. data/doc/api/ruby/classes/VPI.src/M000054.html +16 -0
  215. data/doc/api/ruby/classes/VPI.src/M000055.html +16 -0
  216. data/doc/api/ruby/classes/VPI.src/M000056.html +16 -0
  217. data/doc/api/ruby/classes/VPI.src/M000057.html +16 -0
  218. data/doc/api/ruby/classes/VPI.src/M000058.html +16 -0
  219. data/doc/api/ruby/classes/VPI.src/M000059.html +16 -0
  220. data/doc/api/ruby/classes/VPI.src/M000060.html +16 -0
  221. data/doc/api/ruby/classes/VPI.src/M000061.html +16 -0
  222. data/doc/api/ruby/classes/VPI.src/M000062.html +16 -0
  223. data/doc/api/ruby/classes/VPI.src/M000063.html +16 -0
  224. data/doc/api/ruby/classes/VPI.src/M000064.html +16 -0
  225. data/doc/api/ruby/classes/VPI.src/M000065.html +16 -0
  226. data/doc/api/ruby/classes/VPI.src/M000066.html +16 -0
  227. data/doc/api/ruby/classes/VPI.src/M000067.html +16 -0
  228. data/doc/api/ruby/classes/VPI.src/M000068.html +16 -0
  229. data/doc/api/ruby/classes/VPI.src/M000069.html +16 -0
  230. data/doc/api/ruby/classes/VPI.src/M000070.html +16 -0
  231. data/doc/api/ruby/classes/VPI.src/M000071.html +16 -0
  232. data/doc/api/ruby/classes/VPI.src/M000072.html +16 -0
  233. data/doc/api/ruby/classes/VPI.src/M000073.html +16 -0
  234. data/doc/api/ruby/classes/VPI.src/M000074.html +16 -0
  235. data/doc/api/ruby/classes/VPI.src/M000075.html +16 -0
  236. data/doc/api/ruby/classes/VPI.src/M000076.html +16 -0
  237. data/doc/api/ruby/classes/VPI.src/M000077.html +16 -0
  238. data/doc/api/ruby/classes/VPI.src/M000078.html +16 -0
  239. data/doc/api/ruby/classes/VPI.src/M000079.html +16 -0
  240. data/doc/api/ruby/classes/VPI.src/M000080.html +16 -0
  241. data/doc/api/ruby/classes/VPI.src/M000081.html +16 -0
  242. data/doc/api/ruby/classes/VPI.src/M000082.html +16 -0
  243. data/doc/api/ruby/classes/VPI.src/M000083.html +16 -0
  244. data/doc/api/ruby/classes/VPI.src/M000084.html +16 -0
  245. data/doc/api/ruby/classes/VPI.src/M000085.html +16 -0
  246. data/doc/api/ruby/classes/VPI.src/M000086.html +16 -0
  247. data/doc/api/ruby/classes/VPI.src/M000087.html +16 -0
  248. data/doc/api/ruby/classes/VPI.src/M000088.html +16 -0
  249. data/doc/api/ruby/classes/VPI.src/M000089.html +16 -0
  250. data/doc/api/ruby/classes/VPI.src/M000090.html +16 -0
  251. data/doc/api/ruby/classes/VPI.src/M000091.html +16 -0
  252. data/doc/api/ruby/classes/VPI.src/M000092.html +16 -0
  253. data/doc/api/ruby/classes/VPI.src/M000093.html +16 -0
  254. data/doc/api/ruby/classes/VPI.src/M000094.html +16 -0
  255. data/doc/api/ruby/classes/VPI.src/M000095.html +16 -0
  256. data/doc/api/ruby/classes/VPI.src/M000096.html +16 -0
  257. data/doc/api/ruby/classes/VPI.src/M000097.html +16 -0
  258. data/doc/api/ruby/classes/VPI.src/M000098.html +16 -0
  259. data/doc/api/ruby/classes/VPI.src/M000099.html +16 -0
  260. data/doc/api/ruby/classes/VPI.src/M000100.html +16 -0
  261. data/doc/api/ruby/classes/VPI.src/M000101.html +16 -0
  262. data/doc/api/ruby/classes/VPI.src/M000102.html +16 -0
  263. data/doc/api/ruby/classes/VPI.src/M000103.html +16 -0
  264. data/doc/api/ruby/classes/VPI.src/M000104.html +16 -0
  265. data/doc/api/ruby/classes/VPI.src/M000105.html +16 -0
  266. data/doc/api/ruby/classes/VPI.src/M000106.html +16 -0
  267. data/doc/api/ruby/classes/VPI.src/M000107.html +16 -0
  268. data/doc/api/ruby/classes/VPI.src/M000108.html +16 -0
  269. data/doc/api/ruby/classes/VPI.src/M000109.html +16 -0
  270. data/doc/api/ruby/classes/VPI.src/M000110.html +16 -0
  271. data/doc/api/ruby/classes/VPI.src/M000111.html +16 -0
  272. data/doc/api/ruby/classes/VPI.src/M000112.html +16 -0
  273. data/doc/api/ruby/classes/VPI.src/M000113.html +16 -0
  274. data/doc/api/ruby/classes/VPI.src/M000114.html +16 -0
  275. data/doc/api/ruby/classes/VPI.src/M000115.html +16 -0
  276. data/doc/api/ruby/classes/VPI.src/M000116.html +16 -0
  277. data/doc/api/ruby/classes/VPI.src/M000117.html +16 -0
  278. data/doc/api/ruby/classes/VPI.src/M000118.html +16 -0
  279. data/doc/api/ruby/classes/VPI.src/M000119.html +16 -0
  280. data/doc/api/ruby/classes/VPI.src/M000120.html +16 -0
  281. data/doc/api/ruby/classes/VPI.src/M000121.html +16 -0
  282. data/doc/api/ruby/classes/VPI.src/M000122.html +16 -0
  283. data/doc/api/ruby/classes/VPI.src/M000123.html +16 -0
  284. data/doc/api/ruby/classes/VPI.src/M000124.html +16 -0
  285. data/doc/api/ruby/classes/VPI.src/M000125.html +16 -0
  286. data/doc/api/ruby/classes/VPI.src/M000126.html +16 -0
  287. data/doc/api/ruby/classes/VPI.src/M000127.html +16 -0
  288. data/doc/api/ruby/classes/VPI.src/M000128.html +16 -0
  289. data/doc/api/ruby/classes/VPI.src/M000129.html +16 -0
  290. data/doc/api/ruby/classes/VPI.src/M000130.html +16 -0
  291. data/doc/api/ruby/classes/VPI.src/M000131.html +16 -0
  292. data/doc/api/ruby/classes/VPI.src/M000132.html +16 -0
  293. data/doc/api/ruby/classes/VPI.src/M000133.html +16 -0
  294. data/doc/api/ruby/classes/VPI.src/M000134.html +16 -0
  295. data/doc/api/ruby/classes/VPI.src/M000135.html +16 -0
  296. data/doc/api/ruby/classes/VPI.src/M000136.html +16 -0
  297. data/doc/api/ruby/classes/VPI.src/M000137.html +16 -0
  298. data/doc/api/ruby/classes/VPI.src/M000138.html +16 -0
  299. data/doc/api/ruby/classes/VPI.src/M000139.html +16 -0
  300. data/doc/api/ruby/classes/VPI.src/M000140.html +16 -0
  301. data/doc/api/ruby/classes/VPI.src/M000141.html +16 -0
  302. data/doc/api/ruby/classes/VPI.src/M000142.html +16 -0
  303. data/doc/api/ruby/classes/VPI.src/M000143.html +16 -0
  304. data/doc/api/ruby/classes/VPI.src/M000144.html +16 -0
  305. data/doc/api/ruby/classes/VPI.src/M000145.html +16 -0
  306. data/doc/api/ruby/classes/VPI.src/M000146.html +16 -0
  307. data/doc/api/ruby/classes/VPI.src/M000147.html +16 -0
  308. data/doc/api/ruby/classes/VPI.src/M000148.html +16 -0
  309. data/doc/api/ruby/classes/VPI.src/M000149.html +16 -0
  310. data/doc/api/ruby/classes/VPI.src/M000150.html +16 -0
  311. data/doc/api/ruby/classes/VPI.src/M000151.html +16 -0
  312. data/doc/api/ruby/classes/VPI.src/M000152.html +16 -0
  313. data/doc/api/ruby/classes/VPI.src/M000153.html +16 -0
  314. data/doc/api/ruby/classes/VPI.src/M000154.html +16 -0
  315. data/doc/api/ruby/classes/VPI.src/M000155.html +16 -0
  316. data/doc/api/ruby/classes/VPI.src/M000156.html +16 -0
  317. data/doc/api/ruby/classes/VPI.src/M000157.html +16 -0
  318. data/doc/api/ruby/classes/VPI.src/M000158.html +16 -0
  319. data/doc/api/ruby/classes/VPI.src/M000159.html +16 -0
  320. data/doc/api/ruby/classes/VPI.src/M000160.html +16 -0
  321. data/doc/api/ruby/classes/VPI.src/M000161.html +16 -0
  322. data/doc/api/ruby/classes/VPI.src/M000162.html +16 -0
  323. data/doc/api/ruby/classes/VPI.src/M000163.html +16 -0
  324. data/doc/api/ruby/classes/VPI.src/M000164.html +16 -0
  325. data/doc/api/ruby/classes/VPI.src/M000165.html +16 -0
  326. data/doc/api/ruby/classes/VPI.src/M000166.html +16 -0
  327. data/doc/api/ruby/classes/VPI.src/M000167.html +16 -0
  328. data/doc/api/ruby/classes/VPI.src/M000168.html +16 -0
  329. data/doc/api/ruby/classes/VPI.src/M000169.html +16 -0
  330. data/doc/api/ruby/classes/VPI.src/M000170.html +16 -0
  331. data/doc/api/ruby/classes/VPI.src/M000171.html +16 -0
  332. data/doc/api/ruby/classes/VPI.src/M000172.html +16 -0
  333. data/doc/api/ruby/classes/VPI.src/M000173.html +16 -0
  334. data/doc/api/ruby/classes/VPI.src/M000174.html +16 -0
  335. data/doc/api/ruby/classes/VPI.src/M000175.html +16 -0
  336. data/doc/api/ruby/classes/VPI.src/M000176.html +16 -0
  337. data/doc/api/ruby/classes/VPI.src/M000177.html +16 -0
  338. data/doc/api/ruby/classes/VPI.src/M000178.html +16 -0
  339. data/doc/api/ruby/classes/VPI.src/M000179.html +16 -0
  340. data/doc/api/ruby/classes/VPI.src/M000180.html +16 -0
  341. data/doc/api/ruby/classes/VPI.src/M000181.html +16 -0
  342. data/doc/api/ruby/classes/VPI.src/M000182.html +16 -0
  343. data/doc/api/ruby/classes/VPI.src/M000183.html +16 -0
  344. data/doc/api/ruby/classes/VPI.src/M000184.html +16 -0
  345. data/doc/api/ruby/classes/VPI.src/M000185.html +16 -0
  346. data/doc/api/ruby/classes/VPI.src/M000186.html +16 -0
  347. data/doc/api/ruby/classes/VPI.src/M000187.html +16 -0
  348. data/doc/api/ruby/classes/VPI.src/M000188.html +16 -0
  349. data/doc/api/ruby/classes/VPI.src/M000189.html +16 -0
  350. data/doc/api/ruby/classes/VPI.src/M000190.html +16 -0
  351. data/doc/api/ruby/classes/VPI.src/M000191.html +16 -0
  352. data/doc/api/ruby/classes/VPI.src/M000192.html +16 -0
  353. data/doc/api/ruby/classes/VPI.src/M000193.html +16 -0
  354. data/doc/api/ruby/classes/VPI.src/M000194.html +16 -0
  355. data/doc/api/ruby/classes/VPI.src/M000195.html +16 -0
  356. data/doc/api/ruby/classes/VPI.src/M000196.html +16 -0
  357. data/doc/api/ruby/classes/VPI.src/M000197.html +16 -0
  358. data/doc/api/ruby/classes/VPI.src/M000198.html +16 -0
  359. data/doc/api/ruby/classes/VPI.src/M000199.html +16 -0
  360. data/doc/api/ruby/classes/VPI.src/M000200.html +16 -0
  361. data/doc/api/ruby/classes/VPI.src/M000201.html +16 -0
  362. data/doc/api/ruby/classes/VPI.src/M000202.html +16 -0
  363. data/doc/api/ruby/classes/VPI.src/M000203.html +16 -0
  364. data/doc/api/ruby/classes/VPI.src/M000204.html +16 -0
  365. data/doc/api/ruby/classes/VPI.src/M000205.html +16 -0
  366. data/doc/api/ruby/classes/VPI.src/M000206.html +16 -0
  367. data/doc/api/ruby/classes/VPI.src/M000207.html +16 -0
  368. data/doc/api/ruby/classes/VPI.src/M000208.html +16 -0
  369. data/doc/api/ruby/classes/VPI.src/M000209.html +16 -0
  370. data/doc/api/ruby/classes/VPI.src/M000210.html +16 -0
  371. data/doc/api/ruby/classes/VPI.src/M000211.html +16 -0
  372. data/doc/api/ruby/classes/VPI.src/M000212.html +16 -0
  373. data/doc/api/ruby/classes/VPI.src/M000213.html +16 -0
  374. data/doc/api/ruby/classes/VPI.src/M000214.html +16 -0
  375. data/doc/api/ruby/classes/VPI.src/M000215.html +16 -0
  376. data/doc/api/ruby/classes/VPI.src/M000216.html +16 -0
  377. data/doc/api/ruby/classes/VPI.src/M000217.html +16 -0
  378. data/doc/api/ruby/classes/VPI.src/M000218.html +16 -0
  379. data/doc/api/ruby/classes/VPI.src/M000219.html +16 -0
  380. data/doc/api/ruby/classes/VPI.src/M000220.html +16 -0
  381. data/doc/api/ruby/classes/VPI.src/M000221.html +16 -0
  382. data/doc/api/ruby/classes/VPI.src/M000222.html +16 -0
  383. data/doc/api/ruby/classes/VPI.src/M000223.html +16 -0
  384. data/doc/api/ruby/classes/VPI.src/M000224.html +16 -0
  385. data/doc/api/ruby/classes/VPI.src/M000225.html +16 -0
  386. data/doc/api/ruby/classes/VPI.src/M000226.html +16 -0
  387. data/doc/api/ruby/classes/VPI.src/M000227.html +16 -0
  388. data/doc/api/ruby/classes/VPI.src/M000228.html +16 -0
  389. data/doc/api/ruby/classes/VPI.src/M000229.html +16 -0
  390. data/doc/api/ruby/classes/VPI.src/M000230.html +16 -0
  391. data/doc/api/ruby/classes/VPI.src/M000231.html +16 -0
  392. data/doc/api/ruby/classes/VPI.src/M000232.html +16 -0
  393. data/doc/api/ruby/classes/VPI.src/M000233.html +16 -0
  394. data/doc/api/ruby/classes/VPI.src/M000234.html +16 -0
  395. data/doc/api/ruby/classes/VPI.src/M000235.html +16 -0
  396. data/doc/api/ruby/classes/VPI.src/M000236.html +16 -0
  397. data/doc/api/ruby/classes/VPI.src/M000237.html +16 -0
  398. data/doc/api/ruby/classes/VPI.src/M000238.html +16 -0
  399. data/doc/api/ruby/classes/VPI.src/M000239.html +16 -0
  400. data/doc/api/ruby/classes/VPI.src/M000240.html +16 -0
  401. data/doc/api/ruby/classes/VPI.src/M000241.html +16 -0
  402. data/doc/api/ruby/classes/VPI.src/M000242.html +16 -0
  403. data/doc/api/ruby/classes/VPI.src/M000243.html +16 -0
  404. data/doc/api/ruby/classes/VPI.src/M000244.html +16 -0
  405. data/doc/api/ruby/classes/VPI.src/M000245.html +16 -0
  406. data/doc/api/ruby/classes/VPI.src/M000246.html +16 -0
  407. data/doc/api/ruby/classes/VPI.src/M000247.html +16 -0
  408. data/doc/api/ruby/classes/VPI.src/M000248.html +16 -0
  409. data/doc/api/ruby/classes/VPI.src/M000249.html +16 -0
  410. data/doc/api/ruby/classes/VPI.src/M000250.html +16 -0
  411. data/doc/api/ruby/classes/VPI.src/M000251.html +16 -0
  412. data/doc/api/ruby/classes/VPI.src/M000252.html +16 -0
  413. data/doc/api/ruby/classes/VPI.src/M000253.html +16 -0
  414. data/doc/api/ruby/classes/VPI.src/M000254.html +16 -0
  415. data/doc/api/ruby/classes/VPI.src/M000255.html +16 -0
  416. data/doc/api/ruby/classes/VPI.src/M000256.html +16 -0
  417. data/doc/api/ruby/classes/VPI.src/M000257.html +16 -0
  418. data/doc/api/ruby/classes/VPI.src/M000258.html +16 -0
  419. data/doc/api/ruby/classes/VPI.src/M000259.html +16 -0
  420. data/doc/api/ruby/classes/VPI.src/M000260.html +16 -0
  421. data/doc/api/ruby/classes/VPI.src/M000261.html +16 -0
  422. data/doc/api/ruby/classes/VPI.src/M000262.html +16 -0
  423. data/doc/api/ruby/classes/VPI.src/M000263.html +16 -0
  424. data/doc/api/ruby/classes/VPI.src/M000264.html +16 -0
  425. data/doc/api/ruby/classes/VPI.src/M000265.html +16 -0
  426. data/doc/api/ruby/classes/VPI.src/M000266.html +16 -0
  427. data/doc/api/ruby/classes/VPI.src/M000267.html +16 -0
  428. data/doc/api/ruby/classes/VPI.src/M000268.html +16 -0
  429. data/doc/api/ruby/classes/VPI.src/M000269.html +16 -0
  430. data/doc/api/ruby/classes/VPI.src/M000270.html +16 -0
  431. data/doc/api/ruby/classes/VPI.src/M000271.html +16 -0
  432. data/doc/api/ruby/classes/VPI.src/M000272.html +16 -0
  433. data/doc/api/ruby/classes/VPI.src/M000273.html +16 -0
  434. data/doc/api/ruby/classes/VPI.src/M000274.html +16 -0
  435. data/doc/api/ruby/classes/VPI.src/M000275.html +16 -0
  436. data/doc/api/ruby/classes/VPI.src/M000276.html +16 -0
  437. data/doc/api/ruby/classes/VPI.src/M000277.html +16 -0
  438. data/doc/api/ruby/classes/VPI.src/M000278.html +16 -0
  439. data/doc/api/ruby/classes/VPI.src/M000279.html +16 -0
  440. data/doc/api/ruby/classes/VPI.src/M000280.html +16 -0
  441. data/doc/api/ruby/classes/VPI.src/M000281.html +16 -0
  442. data/doc/api/ruby/classes/VPI.src/M000282.html +16 -0
  443. data/doc/api/ruby/classes/VPI.src/M000283.html +16 -0
  444. data/doc/api/ruby/classes/VPI.src/M000284.html +16 -0
  445. data/doc/api/ruby/classes/VPI.src/M000285.html +16 -0
  446. data/doc/api/ruby/classes/VPI.src/M000286.html +16 -0
  447. data/doc/api/ruby/classes/VPI.src/M000287.html +16 -0
  448. data/doc/api/ruby/classes/VPI.src/M000288.html +16 -0
  449. data/doc/api/ruby/classes/VPI.src/M000289.html +16 -0
  450. data/doc/api/ruby/classes/VPI.src/M000290.html +16 -0
  451. data/doc/api/ruby/classes/VPI.src/M000291.html +16 -0
  452. data/doc/api/ruby/classes/VPI.src/M000292.html +16 -0
  453. data/doc/api/ruby/classes/VPI.src/M000293.html +16 -0
  454. data/doc/api/ruby/classes/VPI.src/M000294.html +16 -0
  455. data/doc/api/ruby/classes/VPI.src/M000295.html +16 -0
  456. data/doc/api/ruby/classes/VPI.src/M000296.html +16 -0
  457. data/doc/api/ruby/classes/VPI.src/M000297.html +16 -0
  458. data/doc/api/ruby/classes/VPI.src/M000298.html +16 -0
  459. data/doc/api/ruby/classes/VPI.src/M000299.html +16 -0
  460. data/doc/api/ruby/classes/VPI.src/M000300.html +16 -0
  461. data/doc/api/ruby/classes/VPI.src/M000301.html +16 -0
  462. data/doc/api/ruby/classes/VPI.src/M000302.html +16 -0
  463. data/doc/api/ruby/classes/VPI.src/M000303.html +16 -0
  464. data/doc/api/ruby/classes/VPI.src/M000304.html +16 -0
  465. data/doc/api/ruby/classes/VPI.src/M000305.html +16 -0
  466. data/doc/api/ruby/classes/VPI.src/M000306.html +16 -0
  467. data/doc/api/ruby/classes/VPI.src/M000307.html +16 -0
  468. data/doc/api/ruby/classes/VPI.src/M000308.html +16 -0
  469. data/doc/api/ruby/classes/VPI.src/M000309.html +16 -0
  470. data/doc/api/ruby/classes/VPI.src/M000310.html +16 -0
  471. data/doc/api/ruby/classes/VPI.src/M000311.html +16 -0
  472. data/doc/api/ruby/classes/VPI.src/M000312.html +16 -0
  473. data/doc/api/ruby/classes/VPI.src/M000313.html +16 -0
  474. data/doc/api/ruby/classes/VPI.src/M000314.html +16 -0
  475. data/doc/api/ruby/classes/VPI.src/M000315.html +16 -0
  476. data/doc/api/ruby/classes/VPI.src/M000316.html +16 -0
  477. data/doc/api/ruby/classes/VPI.src/M000317.html +16 -0
  478. data/doc/api/ruby/classes/VPI.src/M000318.html +16 -0
  479. data/doc/api/ruby/classes/VPI.src/M000319.html +16 -0
  480. data/doc/api/ruby/classes/VPI.src/M000320.html +16 -0
  481. data/doc/api/ruby/classes/VPI.src/M000321.html +16 -0
  482. data/doc/api/ruby/classes/VPI.src/M000322.html +16 -0
  483. data/doc/api/ruby/classes/VPI.src/M000323.html +16 -0
  484. data/doc/api/ruby/classes/VPI.src/M000324.html +16 -0
  485. data/doc/api/ruby/classes/VPI.src/M000325.html +16 -0
  486. data/doc/api/ruby/classes/VPI.src/M000326.html +16 -0
  487. data/doc/api/ruby/classes/VPI.src/M000327.html +16 -0
  488. data/doc/api/ruby/classes/VPI.src/M000328.html +16 -0
  489. data/doc/api/ruby/classes/VPI.src/M000329.html +16 -0
  490. data/doc/api/ruby/classes/VPI.src/M000330.html +16 -0
  491. data/doc/api/ruby/classes/VPI.src/M000331.html +16 -0
  492. data/doc/api/ruby/classes/VPI.src/M000332.html +16 -0
  493. data/doc/api/ruby/classes/VPI.src/M000333.html +16 -0
  494. data/doc/api/ruby/classes/VPI.src/M000334.html +16 -0
  495. data/doc/api/ruby/classes/VPI.src/M000335.html +16 -0
  496. data/doc/api/ruby/classes/VPI.src/M000336.html +16 -0
  497. data/doc/api/ruby/classes/VPI.src/M000337.html +16 -0
  498. data/doc/api/ruby/classes/VPI.src/M000338.html +16 -0
  499. data/doc/api/ruby/classes/VPI.src/M000339.html +16 -0
  500. data/doc/api/ruby/classes/VPI.src/M000340.html +16 -0
  501. data/doc/api/ruby/classes/VPI.src/M000341.html +16 -0
  502. data/doc/api/ruby/classes/VPI.src/M000342.html +16 -0
  503. data/doc/api/ruby/classes/VPI.src/M000343.html +16 -0
  504. data/doc/api/ruby/classes/VPI.src/M000344.html +16 -0
  505. data/doc/api/ruby/classes/VPI.src/M000345.html +16 -0
  506. data/doc/api/ruby/classes/VPI.src/M000346.html +16 -0
  507. data/doc/api/ruby/classes/VPI.src/M000347.html +16 -0
  508. data/doc/api/ruby/classes/VPI.src/M000348.html +16 -0
  509. data/doc/api/ruby/classes/VPI.src/M000349.html +16 -0
  510. data/doc/api/ruby/classes/VPI.src/M000350.html +16 -0
  511. data/doc/api/ruby/classes/VPI.src/M000351.html +16 -0
  512. data/doc/api/ruby/classes/VPI.src/M000352.html +16 -0
  513. data/doc/api/ruby/classes/VPI.src/M000353.html +16 -0
  514. data/doc/api/ruby/classes/VPI.src/M000354.html +16 -0
  515. data/doc/api/ruby/classes/VPI.src/M000355.html +16 -0
  516. data/doc/api/ruby/classes/VPI.src/M000356.html +16 -0
  517. data/doc/api/ruby/classes/VPI.src/M000357.html +16 -0
  518. data/doc/api/ruby/classes/VPI.src/M000358.html +16 -0
  519. data/doc/api/ruby/classes/VPI.src/M000359.html +16 -0
  520. data/doc/api/ruby/classes/VPI.src/M000360.html +16 -0
  521. data/doc/api/ruby/classes/VPI.src/M000361.html +16 -0
  522. data/doc/api/ruby/classes/VPI.src/M000362.html +16 -0
  523. data/doc/api/ruby/classes/VPI.src/M000363.html +16 -0
  524. data/doc/api/ruby/classes/VPI.src/M000364.html +16 -0
  525. data/doc/api/ruby/classes/VPI.src/M000365.html +16 -0
  526. data/doc/api/ruby/classes/VPI.src/M000366.html +16 -0
  527. data/doc/api/ruby/classes/VPI.src/M000367.html +16 -0
  528. data/doc/api/ruby/classes/VPI.src/M000368.html +16 -0
  529. data/doc/api/ruby/classes/VPI.src/M000369.html +16 -0
  530. data/doc/api/ruby/classes/VPI.src/M000370.html +16 -0
  531. data/doc/api/ruby/classes/VPI.src/M000371.html +16 -0
  532. data/doc/api/ruby/classes/VPI.src/M000372.html +16 -0
  533. data/doc/api/ruby/classes/VPI.src/M000373.html +16 -0
  534. data/doc/api/ruby/classes/VPI.src/M000374.html +16 -0
  535. data/doc/api/ruby/classes/VPI.src/M000375.html +16 -0
  536. data/doc/api/ruby/classes/VPI.src/M000376.html +16 -0
  537. data/doc/api/ruby/classes/VPI.src/M000377.html +16 -0
  538. data/doc/api/ruby/classes/VPI.src/M000378.html +16 -0
  539. data/doc/api/ruby/classes/VPI.src/M000379.html +16 -0
  540. data/doc/api/ruby/classes/VPI.src/M000380.html +16 -0
  541. data/doc/api/ruby/classes/VPI.src/M000381.html +16 -0
  542. data/doc/api/ruby/classes/VPI.src/M000382.html +16 -0
  543. data/doc/api/ruby/classes/VPI.src/M000383.html +16 -0
  544. data/doc/api/ruby/classes/VPI.src/M000384.html +16 -0
  545. data/doc/api/ruby/classes/VPI.src/M000385.html +16 -0
  546. data/doc/api/ruby/classes/VPI.src/M000386.html +16 -0
  547. data/doc/api/ruby/classes/VPI.src/M000387.html +16 -0
  548. data/doc/api/ruby/classes/VPI.src/M000388.html +16 -0
  549. data/doc/api/ruby/classes/VPI.src/M000389.html +16 -0
  550. data/doc/api/ruby/classes/VPI.src/M000390.html +16 -0
  551. data/doc/api/ruby/classes/VPI.src/M000391.html +16 -0
  552. data/doc/api/ruby/classes/VPI.src/M000392.html +16 -0
  553. data/doc/api/ruby/classes/VPI.src/M000393.html +16 -0
  554. data/doc/api/ruby/classes/VPI.src/M000394.html +16 -0
  555. data/doc/api/ruby/classes/VPI.src/M000395.html +16 -0
  556. data/doc/api/ruby/classes/VPI.src/M000396.html +16 -0
  557. data/doc/api/ruby/classes/VPI.src/M000397.html +16 -0
  558. data/doc/api/ruby/classes/VPI.src/M000398.html +16 -0
  559. data/doc/api/ruby/classes/VPI.src/M000399.html +16 -0
  560. data/doc/api/ruby/classes/VPI.src/M000400.html +16 -0
  561. data/doc/api/ruby/classes/VPI.src/M000401.html +16 -0
  562. data/doc/api/ruby/classes/VPI.src/M000402.html +16 -0
  563. data/doc/api/ruby/classes/VPI.src/M000403.html +16 -0
  564. data/doc/api/ruby/classes/VPI.src/M000404.html +16 -0
  565. data/doc/api/ruby/classes/VPI.src/M000405.html +16 -0
  566. data/doc/api/ruby/classes/VPI.src/M000406.html +16 -0
  567. data/doc/api/ruby/classes/VPI.src/M000407.html +16 -0
  568. data/doc/api/ruby/classes/VPI.src/M000408.html +16 -0
  569. data/doc/api/ruby/classes/VPI.src/M000409.html +16 -0
  570. data/doc/api/ruby/classes/VPI.src/M000410.html +16 -0
  571. data/doc/api/ruby/classes/VPI.src/M000411.html +16 -0
  572. data/doc/api/ruby/classes/VPI.src/M000412.html +16 -0
  573. data/doc/api/ruby/classes/VPI.src/M000413.html +16 -0
  574. data/doc/api/ruby/classes/VPI.src/M000414.html +16 -0
  575. data/doc/api/ruby/classes/VPI.src/M000415.html +16 -0
  576. data/doc/api/ruby/classes/VPI.src/M000416.html +16 -0
  577. data/doc/api/ruby/classes/VPI.src/M000417.html +16 -0
  578. data/doc/api/ruby/classes/VPI.src/M000418.html +16 -0
  579. data/doc/api/ruby/classes/VPI.src/M000419.html +16 -0
  580. data/doc/api/ruby/classes/VPI.src/M000420.html +16 -0
  581. data/doc/api/ruby/classes/VPI.src/M000421.html +16 -0
  582. data/doc/api/ruby/classes/VPI.src/M000422.html +16 -0
  583. data/doc/api/ruby/classes/VPI.src/M000423.html +16 -0
  584. data/doc/api/ruby/classes/VPI.src/M000424.html +16 -0
  585. data/doc/api/ruby/classes/VPI.src/M000425.html +16 -0
  586. data/doc/api/ruby/classes/VPI.src/M000426.html +16 -0
  587. data/doc/api/ruby/classes/VPI.src/M000427.html +16 -0
  588. data/doc/api/ruby/classes/VPI.src/M000428.html +16 -0
  589. data/doc/api/ruby/classes/VPI.src/M000429.html +16 -0
  590. data/doc/api/ruby/classes/VPI.src/M000430.html +16 -0
  591. data/{ref → doc/api}/ruby/classes/VerilogParser/Module/Port.html +17 -17
  592. data/doc/api/ruby/classes/VerilogParser/Module/Port.src/M000005.html +23 -0
  593. data/doc/api/ruby/classes/VerilogParser/Module/Port.src/M000006.html +18 -0
  594. data/doc/api/ruby/classes/VerilogParser/Module/Port.src/M000007.html +18 -0
  595. data/{ref → doc/api}/ruby/classes/VerilogParser/Module.html +7 -7
  596. data/doc/api/ruby/classes/VerilogParser/Module.src/M000004.html +29 -0
  597. data/{ref → doc/api}/ruby/classes/VerilogParser.html +7 -7
  598. data/doc/api/ruby/classes/VerilogParser.src/M000003.html +26 -0
  599. data/doc/api/ruby/created.rid +1 -0
  600. data/{ref → doc/api}/ruby/files/bin/convert_rb.html +4 -4
  601. data/{ref → doc/api}/ruby/files/bin/generate_rb.html +10 -6
  602. data/doc/api/ruby/files/bin/ruby-vpi.html +169 -0
  603. data/doc/api/ruby/files/bin/ruby-vpi.src/M000001.html +35 -0
  604. data/{ref → doc/api}/ruby/files/lib/ruby-vpi/core/callback_rb.html +3 -3
  605. data/doc/api/ruby/files/lib/ruby-vpi/core/edge-methods_rb.html +107 -0
  606. data/{ref → doc/api}/ruby/files/lib/ruby-vpi/core/edge_rb.html +3 -3
  607. data/{ref → doc/api}/ruby/files/lib/ruby-vpi/core/handle_rb.html +10 -3
  608. data/{ref → doc/api}/ruby/files/lib/ruby-vpi/core/scheduler_rb.html +3 -3
  609. data/{ref → doc/api}/ruby/files/lib/ruby-vpi/core/struct_rb.html +2 -2
  610. data/{ref → doc/api}/ruby/files/lib/ruby-vpi/core_rb.html +3 -3
  611. data/{ref → doc/api}/ruby/files/lib/ruby-vpi/erb_rb.html +2 -2
  612. data/{ref → doc/api}/ruby/files/lib/ruby-vpi/float_rb.html +2 -2
  613. data/{ref → doc/api}/ruby/files/lib/ruby-vpi/integer_rb.html +2 -2
  614. data/{ref → doc/api}/ruby/files/lib/ruby-vpi/rake_rb.html +3 -3
  615. data/{ref → doc/api}/ruby/files/lib/ruby-vpi/rcov_rb.html +3 -4
  616. data/{ref → doc/api}/ruby/files/lib/ruby-vpi/rdoc_rb.html +2 -2
  617. data/{ref → doc/api}/ruby/files/lib/ruby-vpi/runner_boot_loader_rb.html +9 -10
  618. data/doc/api/ruby/files/lib/ruby-vpi/runner_boot_loader_rb.src/M000002.html +17 -0
  619. data/{ref → doc/api}/ruby/files/lib/ruby-vpi/runner_proxy_rb.html +3 -3
  620. data/{ref → doc/api}/ruby/files/lib/ruby-vpi/runner_rb.html +3 -3
  621. data/{ref → doc/api}/ruby/files/lib/ruby-vpi/util_rb.html +2 -2
  622. data/{ref → doc/api}/ruby/files/lib/ruby-vpi/verilog_parser_rb.html +2 -2
  623. data/{ref → doc/api}/ruby/files/lib/ruby-vpi_rb.html +3 -3
  624. data/doc/api/ruby/files/ruby-vpi-dynamic_rb.html +110 -0
  625. data/{ref → doc/api}/ruby/fr_class_index.html +3 -2
  626. data/{ref → doc/api}/ruby/fr_file_index.html +5 -2
  627. data/doc/api/ruby/fr_method_index.html +567 -0
  628. data/{ref → doc/api}/ruby/index.html +5 -5
  629. data/{ref → doc/api}/ruby/rdoc-style.css +0 -0
  630. data/doc/{manual.doc → guide.erb} +379 -121
  631. data/doc/guide.html +3524 -0
  632. data/examples/counter/RSpec/counter_design.rb +7 -7
  633. data/examples/counter/RSpec/counter_loader.rb +1 -0
  634. data/examples/counter/RSpec/counter_proto.rb +8 -6
  635. data/examples/counter/RSpec/counter_runner.rake +9 -4
  636. data/examples/counter/RSpec/counter_spec.rb +13 -13
  637. data/examples/counter/xUnit/counter_design.rb +7 -6
  638. data/examples/counter/xUnit/counter_loader.rb +1 -0
  639. data/examples/counter/xUnit/counter_proto.rb +8 -6
  640. data/examples/counter/xUnit/counter_runner.rake +9 -4
  641. data/examples/counter/xUnit/counter_spec.rb +15 -15
  642. data/examples/pipelined_alu/hw5_unit_design.rb +11 -10
  643. data/examples/pipelined_alu/hw5_unit_loader.rb +1 -0
  644. data/examples/pipelined_alu/hw5_unit_proto.rb +4 -2
  645. data/examples/pipelined_alu/hw5_unit_runner.rake +9 -4
  646. data/examples/pipelined_alu/hw5_unit_spec.rb +18 -18
  647. data/examples/register_file/register_file_design.rb +2 -2
  648. data/examples/register_file/register_file_loader.rb +1 -0
  649. data/examples/register_file/register_file_proto.rb +15 -8
  650. data/examples/register_file/register_file_runner.rake +9 -4
  651. data/examples/register_file/register_file_spec.rb +15 -15
  652. data/ext/main.c +4 -4
  653. data/lib/ruby-vpi/core/edge-methods.rb +32 -0
  654. data/lib/ruby-vpi/core/edge.rb +8 -43
  655. data/lib/ruby-vpi/core/handle.rb +127 -91
  656. data/lib/ruby-vpi/core/scheduler.rb +14 -15
  657. data/lib/ruby-vpi/core.rb +1 -1
  658. data/lib/ruby-vpi/rake.rb +5 -7
  659. data/lib/ruby-vpi/rcov.rb +2 -7
  660. data/lib/ruby-vpi/runner.rb +16 -11
  661. data/lib/ruby-vpi/runner_boot_loader.rb +24 -60
  662. data/lib/ruby-vpi/runner_proxy.rb +2 -6
  663. data/lib/ruby-vpi.rb +56 -14
  664. metadata +809 -368
  665. data/doc/README +0 -9
  666. data/doc/Rakefile +0 -92
  667. data/doc/common.css +0 -108
  668. data/doc/common.inc +0 -14
  669. data/doc/common.tpl +0 -90
  670. data/doc/history.doc +0 -17
  671. data/doc/history.html +0 -2694
  672. data/doc/history.inc +0 -1077
  673. data/doc/history.rb +0 -22
  674. data/doc/history.yaml +0 -1409
  675. data/doc/images/feed-icon-28x28.png +0 -0
  676. data/doc/images/tango/LICENSE +0 -67
  677. data/doc/images/tango/caution.png +0 -0
  678. data/doc/images/tango/caution.svg +0 -290
  679. data/doc/images/tango/home.png +0 -0
  680. data/doc/images/tango/home.svg +0 -386
  681. data/doc/images/tango/important.png +0 -0
  682. data/doc/images/tango/important.svg +0 -163
  683. data/doc/images/tango/next.png +0 -0
  684. data/doc/images/tango/next.svg +0 -191
  685. data/doc/images/tango/note.png +0 -0
  686. data/doc/images/tango/note.svg +0 -483
  687. data/doc/images/tango/prev.png +0 -0
  688. data/doc/images/tango/prev.svg +0 -852
  689. data/doc/images/tango/tip.png +0 -0
  690. data/doc/images/tango/tip.svg +0 -1145
  691. data/doc/images/tango/up.png +0 -0
  692. data/doc/images/tango/up.svg +0 -195
  693. data/doc/images/tango/warning.png +0 -0
  694. data/doc/images/tango/warning.svg +0 -334
  695. data/doc/intro.inc +0 -215
  696. data/doc/lib/doc_format.rb +0 -137
  697. data/doc/lib/doc_proxy.rb +0 -562
  698. data/doc/lib/erb_content.rb +0 -55
  699. data/doc/lib/erb_proxy.rb +0 -42
  700. data/doc/manual.html +0 -3061
  701. data/doc/memo.doc +0 -66
  702. data/doc/memo.html +0 -210
  703. data/doc/print.css +0 -69
  704. data/doc/readme.doc +0 -10
  705. data/doc/readme.html +0 -515
  706. data/doc/rss.erb +0 -29
  707. data/doc/rss.xml +0 -186
  708. data/doc/screen.css +0 -146
  709. data/doc/spacing.css +0 -57
  710. data/index.html +0 -2
  711. data/ref/c/annotated.html +0 -34
  712. data/ref/c/functions.html +0 -182
  713. data/ref/c/functions_vars.html +0 -182
  714. data/ref/c/globals_0x73.html +0 -73
  715. data/ref/c/globals_type.html +0 -88
  716. data/ref/c/structt__vpi__value.html +0 -204
  717. data/ref/ruby/classes/ERB.src/M000024.html +0 -29
  718. data/ref/ruby/classes/FileUtils.src/M000025.html +0 -18
  719. data/ref/ruby/classes/FileUtils.src/M000026.html +0 -18
  720. data/ref/ruby/classes/Float.src/M000019.html +0 -19
  721. data/ref/ruby/classes/Integer.src/M000007.html +0 -25
  722. data/ref/ruby/classes/Integer.src/M000008.html +0 -18
  723. data/ref/ruby/classes/Integer.src/M000009.html +0 -18
  724. data/ref/ruby/classes/Integer.src/M000010.html +0 -18
  725. data/ref/ruby/classes/Integer.src/M000011.html +0 -18
  726. data/ref/ruby/classes/Integer.src/M000012.html +0 -18
  727. data/ref/ruby/classes/Integer.src/M000015.html +0 -25
  728. data/ref/ruby/classes/Integer.src/M000016.html +0 -31
  729. data/ref/ruby/classes/Integer.src/M000017.html +0 -25
  730. data/ref/ruby/classes/Integer.src/M000018.html +0 -30
  731. data/ref/ruby/classes/RDoc.src/M000081.html +0 -40
  732. data/ref/ruby/classes/String.src/M000020.html +0 -36
  733. data/ref/ruby/classes/String.src/M000021.html +0 -41
  734. data/ref/ruby/classes/String.src/M000022.html +0 -18
  735. data/ref/ruby/classes/String.src/M000023.html +0 -18
  736. data/ref/ruby/classes/VPI/Handle.html +0 -898
  737. data/ref/ruby/classes/VPI/Handle.src/M000037.html +0 -18
  738. data/ref/ruby/classes/VPI/Handle.src/M000038.html +0 -21
  739. data/ref/ruby/classes/VPI/Handle.src/M000039.html +0 -18
  740. data/ref/ruby/classes/VPI/Handle.src/M000040.html +0 -18
  741. data/ref/ruby/classes/VPI/Handle.src/M000045.html +0 -18
  742. data/ref/ruby/classes/VPI/Handle.src/M000046.html +0 -18
  743. data/ref/ruby/classes/VPI/Handle.src/M000057.html +0 -18
  744. data/ref/ruby/classes/VPI/Handle.src/M000058.html +0 -18
  745. data/ref/ruby/classes/VPI/Handle.src/M000061.html +0 -18
  746. data/ref/ruby/classes/VPI/Handle.src/M000062.html +0 -18
  747. data/ref/ruby/classes/VPI/Handle.src/M000065.html +0 -24
  748. data/ref/ruby/classes/VPI/Handle.src/M000067.html +0 -21
  749. data/ref/ruby/classes/VPI/Handle.src/M000068.html +0 -28
  750. data/ref/ruby/classes/VPI/Handle.src/M000069.html +0 -50
  751. data/ref/ruby/classes/VPI/Handle.src/M000070.html +0 -19
  752. data/ref/ruby/classes/VPI/Handle.src/M000071.html +0 -19
  753. data/ref/ruby/classes/VPI/Handle.src/M000072.html +0 -18
  754. data/ref/ruby/classes/VPI/Handle.src/M000073.html +0 -30
  755. data/ref/ruby/classes/VPI/Handle.src/M000075.html +0 -18
  756. data/ref/ruby/classes/VPI/Handle.src/M000076.html +0 -40
  757. data/ref/ruby/classes/VPI/Handle.src/M000077.html +0 -31
  758. data/ref/ruby/classes/VPI/S_vpi_time.src/M000078.html +0 -18
  759. data/ref/ruby/classes/VPI/S_vpi_time.src/M000079.html +0 -19
  760. data/ref/ruby/classes/VPI/S_vpi_value.src/M000034.html +0 -35
  761. data/ref/ruby/classes/VPI/S_vpi_value.src/M000035.html +0 -42
  762. data/ref/ruby/classes/VPI/S_vpi_value.src/M000036.html +0 -42
  763. data/ref/ruby/classes/VPI.html +0 -356
  764. data/ref/ruby/classes/VPI.src/M000027.html +0 -19
  765. data/ref/ruby/classes/VPI.src/M000028.html +0 -18
  766. data/ref/ruby/classes/VPI.src/M000029.html +0 -19
  767. data/ref/ruby/classes/VPI.src/M000031.html +0 -25
  768. data/ref/ruby/classes/VPI.src/M000032.html +0 -26
  769. data/ref/ruby/classes/VerilogParser/Module/Port.src/M000004.html +0 -23
  770. data/ref/ruby/classes/VerilogParser/Module/Port.src/M000005.html +0 -18
  771. data/ref/ruby/classes/VerilogParser/Module/Port.src/M000006.html +0 -18
  772. data/ref/ruby/classes/VerilogParser/Module.src/M000003.html +0 -29
  773. data/ref/ruby/classes/VerilogParser.src/M000002.html +0 -26
  774. data/ref/ruby/created.rid +0 -1
  775. data/ref/ruby/files/lib/ruby-vpi/runner_boot_loader_rb.src/M000001.html +0 -17
  776. data/ref/ruby/fr_method_index.html +0 -107
data/doc/guide.html ADDED
@@ -0,0 +1,3524 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
5
+ <meta name="date" content="27 January 2008"/>
6
+ <meta name="author" content="Suraj N. Kurapati"/>
7
+ <meta name="generator" content="Gerbil 1.1.0"/>
8
+ <link rel="alternate" type="application/rss+xml" href="http://ruby-vpi.rubyforge.org/news.xml"/>
9
+ <title>Ruby-VPI 20.0.0 user guide</title>
10
+
11
+ <style type="text/css" media="screen">
12
+ body
13
+ {
14
+ color : #000000;
15
+ background-color : #FFFFFF;
16
+ line-height : 1.5em;
17
+ font-family : Calibri, Verdana, sans-serif;
18
+ }
19
+
20
+ /* emphasis */
21
+
22
+ em,
23
+ blockquote
24
+ {
25
+ font-family : Cambria, Georgia, serif;
26
+ }
27
+
28
+ /* headings */
29
+
30
+ h1,
31
+ h2,
32
+ h3,
33
+ h4,
34
+ h5,
35
+ h6,
36
+ .title
37
+ {
38
+ font-weight : lighter;
39
+ font-family : Constantia, "Book Antiqua", "URW Bookman L", serif;
40
+ }
41
+
42
+ #lof h1,
43
+ #lof h2,
44
+ #lof h3,
45
+ #lof h4,
46
+ #lof h5,
47
+ #lof h6
48
+ {
49
+ margin-top : 1.25em;
50
+ }
51
+
52
+ #content h1,
53
+ #content h2,
54
+ #content h3,
55
+ #content h4,
56
+ #content h5,
57
+ #content h6
58
+ {
59
+ margin-top : 2.5em;
60
+ line-height : 1.25em;
61
+ }
62
+
63
+ #content h1
64
+ {
65
+ font-size : 2.0em;
66
+ }
67
+
68
+ #content h2
69
+ {
70
+ font-size : 1.8em;
71
+ }
72
+
73
+ #content h3
74
+ {
75
+ font-size : 1.6em;
76
+ }
77
+
78
+ #content h4
79
+ {
80
+ font-size : 1.4em;
81
+ }
82
+
83
+ #content h5
84
+ {
85
+ font-size : 1.2em;
86
+ }
87
+
88
+ #content h6
89
+ {
90
+ font-size : 1.0em;
91
+ }
92
+
93
+ /* tables */
94
+
95
+ table
96
+ {
97
+ border : none;
98
+ margin : auto; /* center horizontally */
99
+ margin-top : 1em;
100
+ }
101
+
102
+ th,
103
+ td
104
+ {
105
+ padding : 1em;
106
+ border : 1px solid #C0C0C0;
107
+ vertical-align : top;
108
+ background-color : #FFFFFF;
109
+ }
110
+
111
+ th
112
+ {
113
+ background-color : #F5F5F5;
114
+ }
115
+
116
+ /* document structure */
117
+
118
+ #header
119
+ {
120
+ margin-bottom : 5em;
121
+ text-align : center;
122
+ }
123
+
124
+ #abstract
125
+ {
126
+ margin-bottom : 5em;
127
+ }
128
+
129
+ #toc li
130
+ {
131
+ list-style-type : none;
132
+ }
133
+
134
+ #toc li ul
135
+ {
136
+ padding-bottom : 1em;
137
+ border-left : thick solid #F5F5F5;
138
+ _border-left : none; /* for IE6 */
139
+ }
140
+
141
+ #toc li ul:hover
142
+ {
143
+ border-color : #DCDCDC;
144
+ }
145
+
146
+ #toc > ul
147
+ {
148
+ padding-left : 1em;
149
+ }
150
+
151
+ #references
152
+ {
153
+ margin-top : 5em;
154
+ }
155
+
156
+ #footer
157
+ {
158
+ border-top : thick dotted #DCDCDC;
159
+ padding-top : 1em;
160
+ margin-top : 5em;
161
+ text-align : center;
162
+ }
163
+
164
+ /* document nodes */
165
+
166
+ .part > .title,
167
+ .chapter > .title
168
+ {
169
+ padding-bottom : 0.5em;
170
+ }
171
+
172
+ .part > .title > big,
173
+ .chapter > .title > big
174
+ {
175
+ display : block;
176
+ margin-top : 0.25em;
177
+ }
178
+
179
+ .part .title big,
180
+ .chapter .title big
181
+ {
182
+ _display : block; /* for IE6 */
183
+ _margin-top : 0.25em; /* for IE6 */
184
+ _margin-bottom : 0.75em; /* for IE6 */
185
+ }
186
+
187
+ .paragraph > .title,
188
+ .tip > .title,
189
+ .note > .title,
190
+ .caution > .title,
191
+ .warning > .title,
192
+ .important > .title,
193
+ .figure > .title,
194
+ .table > .title,
195
+ .example > .title,
196
+ .equation > .title,
197
+ .procedure > .title
198
+ {
199
+ font-size : large;
200
+ margin-top : 2em;
201
+ }
202
+
203
+ .paragraph .title,
204
+ .tip .title,
205
+ .note .title,
206
+ .caution .title,
207
+ .warning .title,
208
+ .important .title,
209
+ .figure .title,
210
+ .table .title,
211
+ .example .title,
212
+ .equation .title,
213
+ .procedure .title
214
+ {
215
+ _font-size : large; /* for IE6 */
216
+ _font-weight : bold; /* large is not bold in IE6 */
217
+ _margin-top : 2em; /* for IE6 */
218
+ }
219
+
220
+ .tip ,
221
+ .note ,
222
+ .caution ,
223
+ .warning ,
224
+ .important,
225
+ .figure ,
226
+ .table ,
227
+ .example ,
228
+ .equation ,
229
+ .procedure
230
+ {
231
+ margin : 3em;
232
+ }
233
+
234
+ .tip > .icon,
235
+ .note > .icon,
236
+ .caution > .icon,
237
+ .warning > .icon,
238
+ .important > .icon
239
+ {
240
+ float : left;
241
+ margin : 0 1em 1em 0; /* top right bottom left */
242
+ }
243
+
244
+ .tip .icon,
245
+ .note .icon,
246
+ .caution .icon,
247
+ .warning .icon,
248
+ .important .icon
249
+ {
250
+ _display : none; /* IE6 cannot display embedded images */
251
+ }
252
+
253
+ .figure > .title
254
+ {
255
+ text-align : center;
256
+ }
257
+
258
+ .figure .title
259
+ {
260
+ _text-align : center; /* for IE6 */
261
+ }
262
+
263
+ .figure > .content img
264
+ {
265
+ display : block;
266
+ margin : auto;
267
+ }
268
+
269
+ .figure .content img
270
+ {
271
+ _display : block; /* for IE6 */
272
+ _margin : auto; /* for IE6 */
273
+ }
274
+
275
+ body
276
+ {
277
+ margin : auto;
278
+ padding : 0.5em;
279
+ max-width : 36em;
280
+ }
281
+
282
+ /* hyperlinks */
283
+
284
+ a
285
+ {
286
+ color : #0000FF;
287
+ text-decoration : none;
288
+ }
289
+
290
+ a:visited
291
+ {
292
+ color : #800080;
293
+ }
294
+
295
+ a:hover
296
+ {
297
+ color : #FF0000;
298
+ text-decoration : underline;
299
+ }
300
+
301
+ a:target
302
+ {
303
+ color : #FF0000;
304
+ text-decoration : underline;
305
+ }
306
+
307
+ a.toc:link,
308
+ a.toc:visited
309
+ {
310
+ text-decoration : none;
311
+ z-index : 1;
312
+ }
313
+
314
+ a img
315
+ {
316
+ border : none;
317
+ }
318
+
319
+ /*
320
+ mark external links with a symbol to help the user
321
+ distinguish between internal and external links
322
+ */
323
+ a:after
324
+ {
325
+ content: "∗";
326
+ }
327
+
328
+ a[href^="#"]:after
329
+ {
330
+ content: "";
331
+ }
332
+
333
+ /* source code */
334
+
335
+ tt,
336
+ code,
337
+ pre
338
+ {
339
+ font-family : Consolas, "Lucida Console", monospace;
340
+ }
341
+
342
+ tt
343
+ {
344
+ font-weight : bold;
345
+ color : #A52A2A;
346
+ background-color : #FFFAF0;
347
+ }
348
+
349
+ /* output of syntax colorizer */
350
+ .code
351
+ {
352
+ background-color : #FFFFF0;
353
+ }
354
+
355
+ pre
356
+ {
357
+ line-height : normal;
358
+ border : 1px dashed #C0C0C0;
359
+ background-color : #F5FFDF;
360
+ padding : 1em;
361
+ overflow : auto;
362
+ cursor : text;
363
+ }
364
+
365
+ /*
366
+ pre:hover
367
+ {
368
+ border : none;
369
+ position : fixed;
370
+ z-index : 1;
371
+ margin : 0;
372
+ top : 0;
373
+ left : 0;
374
+ right : 0;
375
+ bottom : 0;
376
+ overflow : auto;
377
+ cursor : text;
378
+ }
379
+ */
380
+
381
+ /* emphasis */
382
+
383
+ blockquote
384
+ {
385
+ margin : 1em;
386
+ border : 5px dotted #C0C0C0;
387
+ padding : 1em;
388
+ color : #444;
389
+ }
390
+
391
+ hr
392
+ {
393
+ color : #FF0000; /* for IE6 */
394
+ background-color : #FF0000; /* for Firefox */
395
+ }
396
+
397
+ </style>
398
+ <style type="text/css" media="print">
399
+ body
400
+ {
401
+ color : #000000;
402
+ background-color : #FFFFFF;
403
+ line-height : 1.5em;
404
+ font-family : Calibri, Verdana, sans-serif;
405
+ }
406
+
407
+ /* emphasis */
408
+
409
+ em,
410
+ blockquote
411
+ {
412
+ font-family : Cambria, Georgia, serif;
413
+ }
414
+
415
+ /* headings */
416
+
417
+ h1,
418
+ h2,
419
+ h3,
420
+ h4,
421
+ h5,
422
+ h6,
423
+ .title
424
+ {
425
+ font-weight : lighter;
426
+ font-family : Constantia, "Book Antiqua", "URW Bookman L", serif;
427
+ }
428
+
429
+ #lof h1,
430
+ #lof h2,
431
+ #lof h3,
432
+ #lof h4,
433
+ #lof h5,
434
+ #lof h6
435
+ {
436
+ margin-top : 1.25em;
437
+ }
438
+
439
+ #content h1,
440
+ #content h2,
441
+ #content h3,
442
+ #content h4,
443
+ #content h5,
444
+ #content h6
445
+ {
446
+ margin-top : 2.5em;
447
+ line-height : 1.25em;
448
+ }
449
+
450
+ #content h1
451
+ {
452
+ font-size : 2.0em;
453
+ }
454
+
455
+ #content h2
456
+ {
457
+ font-size : 1.8em;
458
+ }
459
+
460
+ #content h3
461
+ {
462
+ font-size : 1.6em;
463
+ }
464
+
465
+ #content h4
466
+ {
467
+ font-size : 1.4em;
468
+ }
469
+
470
+ #content h5
471
+ {
472
+ font-size : 1.2em;
473
+ }
474
+
475
+ #content h6
476
+ {
477
+ font-size : 1.0em;
478
+ }
479
+
480
+ /* tables */
481
+
482
+ table
483
+ {
484
+ border : none;
485
+ margin : auto; /* center horizontally */
486
+ margin-top : 1em;
487
+ }
488
+
489
+ th,
490
+ td
491
+ {
492
+ padding : 1em;
493
+ border : 1px solid #C0C0C0;
494
+ vertical-align : top;
495
+ background-color : #FFFFFF;
496
+ }
497
+
498
+ th
499
+ {
500
+ background-color : #F5F5F5;
501
+ }
502
+
503
+ /* document structure */
504
+
505
+ #header
506
+ {
507
+ margin-bottom : 5em;
508
+ text-align : center;
509
+ }
510
+
511
+ #abstract
512
+ {
513
+ margin-bottom : 5em;
514
+ }
515
+
516
+ #toc li
517
+ {
518
+ list-style-type : none;
519
+ }
520
+
521
+ #toc li ul
522
+ {
523
+ padding-bottom : 1em;
524
+ border-left : thick solid #F5F5F5;
525
+ _border-left : none; /* for IE6 */
526
+ }
527
+
528
+ #toc li ul:hover
529
+ {
530
+ border-color : #DCDCDC;
531
+ }
532
+
533
+ #toc > ul
534
+ {
535
+ padding-left : 1em;
536
+ }
537
+
538
+ #references
539
+ {
540
+ margin-top : 5em;
541
+ }
542
+
543
+ #footer
544
+ {
545
+ border-top : thick dotted #DCDCDC;
546
+ padding-top : 1em;
547
+ margin-top : 5em;
548
+ text-align : center;
549
+ }
550
+
551
+ /* document nodes */
552
+
553
+ .part > .title,
554
+ .chapter > .title
555
+ {
556
+ padding-bottom : 0.5em;
557
+ }
558
+
559
+ .part > .title > big,
560
+ .chapter > .title > big
561
+ {
562
+ display : block;
563
+ margin-top : 0.25em;
564
+ }
565
+
566
+ .part .title big,
567
+ .chapter .title big
568
+ {
569
+ _display : block; /* for IE6 */
570
+ _margin-top : 0.25em; /* for IE6 */
571
+ _margin-bottom : 0.75em; /* for IE6 */
572
+ }
573
+
574
+ .paragraph > .title,
575
+ .tip > .title,
576
+ .note > .title,
577
+ .caution > .title,
578
+ .warning > .title,
579
+ .important > .title,
580
+ .figure > .title,
581
+ .table > .title,
582
+ .example > .title,
583
+ .equation > .title,
584
+ .procedure > .title
585
+ {
586
+ font-size : large;
587
+ margin-top : 2em;
588
+ }
589
+
590
+ .paragraph .title,
591
+ .tip .title,
592
+ .note .title,
593
+ .caution .title,
594
+ .warning .title,
595
+ .important .title,
596
+ .figure .title,
597
+ .table .title,
598
+ .example .title,
599
+ .equation .title,
600
+ .procedure .title
601
+ {
602
+ _font-size : large; /* for IE6 */
603
+ _font-weight : bold; /* large is not bold in IE6 */
604
+ _margin-top : 2em; /* for IE6 */
605
+ }
606
+
607
+ .tip ,
608
+ .note ,
609
+ .caution ,
610
+ .warning ,
611
+ .important,
612
+ .figure ,
613
+ .table ,
614
+ .example ,
615
+ .equation ,
616
+ .procedure
617
+ {
618
+ margin : 3em;
619
+ }
620
+
621
+ .tip > .icon,
622
+ .note > .icon,
623
+ .caution > .icon,
624
+ .warning > .icon,
625
+ .important > .icon
626
+ {
627
+ float : left;
628
+ margin : 0 1em 1em 0; /* top right bottom left */
629
+ }
630
+
631
+ .tip .icon,
632
+ .note .icon,
633
+ .caution .icon,
634
+ .warning .icon,
635
+ .important .icon
636
+ {
637
+ _display : none; /* IE6 cannot display embedded images */
638
+ }
639
+
640
+ .figure > .title
641
+ {
642
+ text-align : center;
643
+ }
644
+
645
+ .figure .title
646
+ {
647
+ _text-align : center; /* for IE6 */
648
+ }
649
+
650
+ .figure > .content img
651
+ {
652
+ display : block;
653
+ margin : auto;
654
+ }
655
+
656
+ .figure .content img
657
+ {
658
+ _display : block; /* for IE6 */
659
+ _margin : auto; /* for IE6 */
660
+ }
661
+
662
+ /* headings */
663
+
664
+ h1,
665
+ h2,
666
+ h3,
667
+ h4,
668
+ h5,
669
+ h6
670
+ {
671
+ font-weight : normal;
672
+ }
673
+
674
+ /* hyperlinks */
675
+
676
+ a:link,
677
+ a:visited,
678
+ a:active
679
+ {
680
+ color : #0000FF;
681
+ font-weight : bold;
682
+ text-decoration : underline;
683
+ }
684
+
685
+ a:after
686
+ {
687
+ content : " (" attr(href) ")";
688
+ font-family : sans-serif;
689
+ font-weight : normal;
690
+ font-size : 90%;
691
+ }
692
+
693
+ a[href^="#"]:after
694
+ {
695
+ content : "";
696
+ }
697
+
698
+ a[href^="#"]
699
+ {
700
+ color : #A52A2A;
701
+ font-weight : lighter;
702
+ text-decoration : none;
703
+ font-style : italic;
704
+ }
705
+
706
+ a.toc:link,
707
+ a.toc:visited
708
+ {
709
+ color : inherit;
710
+ .color : #000000; /* for IE6 and IE7 */
711
+ font-weight : inherit;
712
+ text-decoration : none;
713
+ font-style : normal;
714
+ }
715
+
716
+ /* source code */
717
+
718
+ tt
719
+ {
720
+ color : inherit;
721
+ background-color : inherit;
722
+ font-weight : normal;
723
+ }
724
+
725
+ pre,
726
+ .code
727
+ {
728
+ border : none;
729
+ overflow : visible;
730
+ background-color : inherit;
731
+ }
732
+
733
+ /* document structure */
734
+
735
+ #lof
736
+ {
737
+ display : none;
738
+ }
739
+
740
+ /* document nodes */
741
+
742
+ .part > .title > big,
743
+ .chapter > .title > big
744
+ {
745
+ padding-bottom : 0.5em;
746
+ }
747
+
748
+ .part .title big,
749
+ .chapter .title big
750
+ {
751
+ _padding-bottom : 0.5em; /* for IE6 */
752
+ }
753
+
754
+ </style>
755
+ </head>
756
+ <body>
757
+
758
+ <div id="header">
759
+
760
+
761
+ <h1 class="title">Ruby-VPI 20.0.0 user guide</h1>
762
+ <h2 class="authors"><a href="http://snk.tuxfamily.org">Suraj N. Kurapati</a></h2>
763
+ <h3 class="date">27 January 2008</h3>
764
+ <div style="text-align: left; margin-top: 2em">
765
+
766
+ <ul>
767
+ <li><a href="http://ruby-vpi.rubyforge.org/news.xml">News feed</a>
768
+ &#8211; project news and release announcements.</li>
769
+ <li><a href="http://rubyforge.org/frs/?group_id=1339">Download area</a>
770
+ &#8211; place to obtain release packages.</li>
771
+ <li><a href="http://rubyforge.org/mailman/listinfo/ruby-vpi-discuss">Mailing list</a>
772
+ &#8211; ask questions, get help, and discuss.</li>
773
+ <li><a href="api/">Reference</a>
774
+ &#8211; API documentation for source code.</li>
775
+ <li><a href="http://ruby-vpi.rubyforge.org/talks/">Talks</a>
776
+ &#8211; archive of presentations and seminars.</li>
777
+ <li><a href="http://ruby-vpi.rubyforge.org/papers/">Papers</a>
778
+ &#8211; archive of research and publications.</li>
779
+ </ul>
780
+
781
+
782
+ </div>
783
+ </div>
784
+
785
+
786
+
787
+ <div id="toc"><h1>Contents</h1> <ul><li>1&nbsp;&nbsp;<a id="a-606704428" href="#Introduction">Introduction</a><ul><li>1.1&nbsp;&nbsp;<a id="a-606710768" href="#Features">Features</a></li><li>1.2&nbsp;&nbsp;<a id="a-606745598" href="#License">License</a></li><li>1.3&nbsp;&nbsp;<a id="a-606752538" href="#Appetizers">Appetizers</a></li><li>1.4&nbsp;&nbsp;<a id="a-606764318" href="#Applications">Applications</a></li><li>1.5&nbsp;&nbsp;<a id="a-606770018" href="#Related-works">Related works</a></li></ul></li><li>2&nbsp;&nbsp;<a id="a-606777838" href="#setup">Setup</a><ul><li>2.1&nbsp;&nbsp;<a id="a-606779348" href="#setup.reqs">Requirements</a></li><li>2.2&nbsp;&nbsp;<a id="a-606789068" href="#setup.recom">Recommendations</a></li><li>2.3&nbsp;&nbsp;<a id="a-606794098" href="#setup.inst">Installation</a><ul><li>2.3.1&nbsp;&nbsp;<a id="a-606799148" href="#setup.inst.windows">Installing on Windows</a></li></ul></li><li>2.4&nbsp;&nbsp;<a id="a-606801708" href="#setup.maintenance">Maintenance</a></li><li>2.5&nbsp;&nbsp;<a id="a-606803858" href="#setup.manifest">Manifest</a></li></ul></li><li>3&nbsp;&nbsp;<a id="a-606810448" href="#organization">Background</a><ul><li>3.1&nbsp;&nbsp;<a id="a-606815068" href="#Motivation">Motivation</a></li><li>3.2&nbsp;&nbsp;<a id="a-606817088" href="#organization.tests">Tests</a></li></ul></li><li>4&nbsp;&nbsp;<a id="a-606822688" href="#usage">Usage</a><ul><li>4.1&nbsp;&nbsp;<a id="a-606824258" href="#usage.theory">Theory of operation</a><ul><li>4.1.1&nbsp;&nbsp;<a id="a-606835008" href="#Test-files">Test files</a></li></ul></li><li>4.2&nbsp;&nbsp;<a id="a-606840438" href="#overview.relay">Interacting with the Verilog simulator</a></li><li>4.3&nbsp;&nbsp;<a id="a-606846998" href="#vpi">VPI in Ruby</a><ul><li>4.3.1&nbsp;&nbsp;<a id="a-606850438" href="#vpi.handles">Handles</a><ul><li>4.3.1.1&nbsp;&nbsp;<a id="a-606856398" href="#vpi.handles.relatives">Accessing a handle&#8217;s relatives</a></li><li>4.3.1.2&nbsp;&nbsp;<a id="a-606858628" href="#Accessing-a-handle-s-properties">Accessing a handle&#8217;s properties</a></li></ul></li><li>4.3.2&nbsp;&nbsp;<a id="a-606870058" href="#vpi.callbacks">Callbacks</a></li></ul></li><li>4.4&nbsp;&nbsp;<a id="a-606880188" href="#usage.concurrency">Concurrency</a><ul><li>4.4.1&nbsp;&nbsp;<a id="a-606883708" href="#Creating-a-concurrent-process">Creating a concurrent process</a></li></ul></li><li>4.5&nbsp;&nbsp;<a id="a-606890138" href="#usage.prototyping">Prototyping</a><ul><li>4.5.1&nbsp;&nbsp;<a id="a-606894508" href="#Creating-a-prototype">Creating a prototype</a></li></ul></li><li>4.6&nbsp;&nbsp;<a id="a-606905198" href="#usage.debugger">Interactive debugging</a><ul><li>4.6.1&nbsp;&nbsp;<a id="a-606908278" href="#usage.debugger.init">Advanced initialization</a></li></ul></li><li>4.7&nbsp;&nbsp;<a id="a-606910748" href="#usage.runner">Test runner</a><ul><li>4.7.1&nbsp;&nbsp;<a id="a-606913938" href="#usage.runner.env-vars">Environment variables</a><ul><li>4.7.1.1&nbsp;&nbsp;<a id="a-606917008" href="#Variables-as-command-line-arguments">Variables as command-line arguments</a></li></ul></li></ul></li><li>4.8&nbsp;&nbsp;<a id="a-606921818" href="#usage.tools">Tools</a><ul><li>4.8.1&nbsp;&nbsp;<a id="a-606923678" href="#usage.tools.generate">Automated test generation</a></li><li>4.8.2&nbsp;&nbsp;<a id="a-606932168" href="#usage.tools.convert">Verilog to Ruby conversion</a></li></ul></li><li>4.9&nbsp;&nbsp;<a id="a-606934638" href="#usage.tutorial">Tutorial</a><ul><li>4.9.1&nbsp;&nbsp;<a id="a-606947158" href="#usage.tutorial.declare-design">Start with a Verilog design</a></li><li>4.9.2&nbsp;&nbsp;<a id="a-606953958" href="#usage.tutorial.generate-test">Generate a test</a></li><li>4.9.3&nbsp;&nbsp;<a id="a-606966828" href="#usage.tutorial.specification">Specify your expectations</a></li><li>4.9.4&nbsp;&nbsp;<a id="a-606069158" href="#usage.tutorial.implement-proto">Implement the prototype</a></li><li>4.9.5&nbsp;&nbsp;<a id="a-606122988" href="#usage.tutorial.test-proto">Verify the prototype</a></li><li>4.9.6&nbsp;&nbsp;<a id="a-606168938" href="#usage.tutorial.implement-design">Implement the design</a></li><li>4.9.7&nbsp;&nbsp;<a id="a-606269558" href="#usage.tutorial.test-design">Verify the design</a></li><li>4.9.8&nbsp;&nbsp;<a id="a-606358268" href="#usage.examples">More examples</a></li></ul></li></ul></li><li>5&nbsp;&nbsp;<a id="a-606376468" href="#hacking">Hacking</a><ul><li>5.1&nbsp;&nbsp;<a id="a-605850148" href="#hacking.build">Building from source code</a></li><li>5.2&nbsp;&nbsp;<a id="a-605974548" href="#Installing-without-really-installing">Installing without really installing</a></li><li>5.3&nbsp;&nbsp;<a id="a-605757818" href="#hacking.release-packages">Building release packages</a></li><li>5.4&nbsp;&nbsp;<a id="a-607050138" href="#hacking.guide">Editing this guide</a></li></ul></li><li>6&nbsp;&nbsp;<a id="a-607052618" href="#problems">Known problems</a><ul><li>6.1&nbsp;&nbsp;<a id="a-607054268" href="#problem.ivl">Icarus Verilog</a><ul><li>6.1.1&nbsp;&nbsp;<a id="a-607055848" href="#problems.ivl.vpi_handle_by_name.absolute-paths">Give full paths to Verilog objects</a></li><li>6.1.2&nbsp;&nbsp;<a id="a-607061068" href="#problems.ivl.vpi_handle_by_name.connect-registers">Registers must be connected</a></li><li>6.1.3&nbsp;&nbsp;<a id="a-607070908" href="#problems.ivl.vpi_reset">VPI::reset</a></li></ul></li></ul></li><li>7&nbsp;&nbsp;<a id="a-607073798" href="#glossary">Glossary</a><ul><li>7.1&nbsp;&nbsp;<a id="a-607075458" href="#glossary.test">Test</a></li><li>7.2&nbsp;&nbsp;<a id="a-607080108" href="#glossary.design">Design</a></li><li>7.3&nbsp;&nbsp;<a id="a-607083458" href="#glossary.specification">Specification</a></li><li>7.4&nbsp;&nbsp;<a id="a-607088168" href="#glossary.expectation">Expectation</a></li><li>7.5&nbsp;&nbsp;<a id="a-607090238" href="#glossary.handle">Handle</a></li><li>7.6&nbsp;&nbsp;<a id="a-607093668" href="#glossary.rake">Rake</a></li><li>7.7&nbsp;&nbsp;<a id="a-607095818" href="#glossary.RSpec">RSpec</a></li><li>7.8&nbsp;&nbsp;<a id="a-607099338" href="#glossary.TDD">Test driven development</a></li><li>7.9&nbsp;&nbsp;<a id="a-607101548" href="#glossary.BDD">Behavior driven development</a></li></ul></li></ul></div>
788
+
789
+ <div id="lof"><h1>Cautions</h1> <ol><li><a id="a-606881928" href="#Assignments-inside-processes-are-non-blocking">Assignments inside processes are non-blocking</a></li><li><a id="a-606928078" href="#Do-not-rename-generated-files">Do not rename generated files</a></li></ol><h1>Examples</h1> <ol><li><a id="a-606871738" href="#ex:callback">Using a callback for value change notification</a></li><li><a id="a-606885348" href="#An-edge-triggered-always-block">An edge-triggered &#8220;always&#8221; block</a></li><li><a id="a-606887298" href="#A-change-triggered-combinational-always-block">A change-triggered (combinational) &#8220;always&#8221; block</a></li><li><a id="a-606919158" href="#Running-a-test-with-environment-variables">Running a test with environment variables</a></li><li><a id="a-606950328" href="#fig:counter.v_decl">Declaration of a simple up-counter with synchronous reset</a></li><li><a id="a-606962678" href="#fig:generate-test.RSpec">Generating a test with specification in RSpec format</a></li><li><a id="a-606964548" href="#fig:generate-test.xUnit">Generating a test with specification in xUnit format</a></li><li><a id="a-606972788" href="#fig:RSpec-counter_spec.rb">Specification implemented in RSpec format</a></li><li><a id="a-606975088" href="#fig:xUnit-counter_spec.rb">Specification implemented in xUnit format</a></li><li><a id="a-606100048" href="#fig:counter_proto.rb">Ruby prototype of our Verilog design</a></li><li><a id="a-606139338" href="#fig:test-proto.RSpec">Running a test with specification in RSpec format</a></li><li><a id="a-606145238" href="#fig:test-proto.unit-test">Running a test with specification in xUnit format</a></li><li><a id="a-606237758" href="#fig:counter.v_impl">Implementation of a simple up-counter with synchronous reset</a></li><li><a id="a-606307738" href="#fig:test-design.RSpec">Running a test with specification in RSpec format</a></li><li><a id="a-606325118" href="#fig:test-design.unit-test">Running a test with specification in xUnit format</a></li><li><a id="a-607058828" href="#ex:TestFoo">Part of a bench which instantiates a Verilog design</a></li><li><a id="a-607066798" href="#ex:TestFoo_bad">Bad design with unconnected registers</a></li><li><a id="a-607068638" href="#ex:TestFoo_fix">Fixed design with wired registers</a></li></ol><h1>Figures</h1> <ol><li><a id="a-606812008" href="#fig:organization.detail">Where does Ruby-VPI fit in?</a></li><li><a id="a-606820058" href="#fig:organization">Organization of a test in Ruby-VPI</a></li><li><a id="a-606843408" href="#fig:ruby_relay">Interaction between Ruby and Verilog</a></li><li><a id="a-606862348" href="#fig:method-naming-format">Method naming format for accessing a handle&#8217;s properties</a></li></ol><h1>Notes</h1> <ol><li><a id="a-606848628" href="#Constants-are-capitalized-in-Ruby">Constants are capitalized in Ruby</a></li></ol><h1>Tables</h1> <ol><li><a id="a-606865648" href="#tbl:accessors">Possible accessors and their implications</a></li><li><a id="a-606867538" href="#ex:properties">Examples of accessing a handle&#8217;s properties</a></li></ol><h1>Tips</h1> <ol><li><a id="a-606795708" href="#Tuning-for-maximum-performance">Tuning for maximum performance</a></li><li><a id="a-606929888" href="#Using-kdiff3-with-the-automated-test-generator.">Using <strong>kdiff3</strong> with the automated test generator.</a></li><li><a id="a-606150528" href="#What-can-the-test-runner-do">What can the test runner do?</a></li></ol></div>
790
+
791
+ <div id="content">
792
+
793
+ <div class="chapter">
794
+ <h1 class="title">
795
+ Chapter
796
+ <a class="toc" id="Introduction" href="#a-606704428">1</a>
797
+
798
+ <br/>
799
+
800
+ <big>Introduction</big>
801
+ </h1>
802
+
803
+ <div class="content">Ruby-VPI is a library that provides the entire <a href="http://ieeexplore.ieee.org/xpl/standardstoc.jsp?isnumber=33945"><span class="caps">IEEE 1364</span>-2005 Verilog VPI</a> interface to <a href="http://www.ruby-lang.org">Ruby</a> scripts. It also serves as <strong>platform for unit testing</strong>, rapid <strong>prototyping</strong>, and systems <strong>integration</strong> of Verilog modules through Ruby:
804
+ <ul>
805
+ <li>Create complex Verilog test benches easily and wholly in Ruby.</li>
806
+ <li>Apply agile software development practices to develop hardware.</li>
807
+ <li>Perform <a href="http://ruby-vpi.rubyforge.org/papers/masters_thesis.html">specification-driven functional verification</a> (<a href="http://ruby-vpi.rubyforge.org/papers/masters_thesis.pdf">PDF version</a>).</li>
808
+ </ul>
809
+
810
+
811
+ <p>Ruby-VPI is <strong>open source software</strong> (see <a class="xref" href="#License">Section 1.2: <em>License</em></a>) so feel free to contribute your improvements and discuss your ideas in the <a href="http://rubyforge.org/mailman/listinfo/ruby-vpi-discuss">project mailing list</a>. See <a class="xref" href="#hacking">Chapter 5: <em>Hacking</em></a> for details.</p>
812
+
813
+
814
+ <p><div class="section">
815
+ <h2 class="title">
816
+ <a class="toc" id="Features" href="#a-606710768">1.1</a>&nbsp;&nbsp;Features
817
+ </h2>
818
+ <div class="content"><div class="paragraph">
819
+ <p class="title">Portable</p>
820
+ <div class="content"><ul>
821
+ <li>Works on Windows, Mac OSX, GNU/Linux, and UNIX.</li>
822
+ <li>Supports all <a class="xref" href="#setup.reqs.sim">major Verilog simulators</a> available today.</li>
823
+ </ul></div>
824
+ </div>
825
+ <div class="paragraph">
826
+ <p class="title">Agile</p>
827
+ <div class="content"><ul>
828
+ <li>Enables <a href="http://agilemanifesto.org">agile practices</a> such as
829
+ <ul>
830
+ <li><a href="http://www.testdriven.com">test-driven</a> development</li>
831
+ <li><a href="http://behaviour-driven.org">behavior-driven</a> development</li>
832
+ <li><a class="xref" href="#usage.tutorial.implement-proto">rapid prototyping</a> for design exploration</li>
833
+ </ul></li>
834
+ </ul>
835
+
836
+
837
+ <ul>
838
+ <li>Eliminates unneccesary work:
839
+ <ul>
840
+ <li><a class="xref" href="#usage.tutorial.specification">Specifications</a> are executable, portable, and human-readable.</li>
841
+ <li><a class="xref" href="#usage.tools.generate">Automated test generator</a> helps you accomodate design changes with minimal effort.</li>
842
+ <li>There is <strong>absolutely no compiling</strong>!</li>
843
+ </ul></li>
844
+ </ul></div>
845
+ </div>
846
+ <div class="paragraph">
847
+ <p class="title">Powerful</p>
848
+ <div class="content"><p style="float:right"><img src="images/ruby/logo-reflection.png" title="the Ruby logo" alt="the Ruby logo" /></p>
849
+
850
+
851
+ <ul>
852
+ <li>Employs the <a href="http://www.ruby-lang.org/en/about/">power and elegance</a> of Ruby:
853
+ <ul>
854
+ <li><strong>Unlimited length integers</strong></li>
855
+ <li>Automatic memory management (garbage collection)</li>
856
+ <li>Regular expressions</li>
857
+ <li>Closures for functional programming</li>
858
+ <li>Pure OOP with dynamic typing</li>
859
+ <li>Portable multi-threading (green threads)</li>
860
+ <li>Native system calls and I/O</li>
861
+ <li>Highly readable and maintainable code</li>
862
+ </ul></li>
863
+ </ul>
864
+
865
+
866
+ <ul>
867
+ <li>Uses <a href="http://rubyforge.org/projects/ruby-debug/">ruby-debug</a> for <a class="xref" href="#usage.debugger">interactive debugging</a>.</li>
868
+ <li>Uses <a href="http://eigenclass.org/hiki.rb?rcov">rcov</a> for test <a class="xref" href="#usage.runner.env-vars">coverage analysis and report generation</a>.</li>
869
+ </ul></div>
870
+ </div></div>
871
+ </div>
872
+ <div class="section">
873
+ <h2 class="title">
874
+ <a class="toc" id="License" href="#a-606745598">1.2</a>&nbsp;&nbsp;License
875
+ </h2>
876
+ <div class="content"><p>Copyright 2006 Suraj N. Kurapati &lt;SNK at GNA dot ORG&gt;<br/>
877
+ Copyright 1999 Kazuhiro HIWADA &lt;HIWADA at KUEE dot KYOTO-U dot AC dot JP&gt;<br/></p>
878
+
879
+
880
+ <p>Permission is hereby granted, free of charge, to any person obtaining a
881
+ copy of this software and associated documentation files (the &quot;Software&quot;),
882
+ to deal in the Software without restriction, including without limitation
883
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
884
+ and/or sell copies of the Software, and to permit persons to whom the
885
+ Software is furnished to do so, subject to the following conditions:</p>
886
+
887
+
888
+ <ul>
889
+ <li>All copies and substantial portions of the Software (the &quot;Derivatives&quot;)
890
+ and their corresponding machine-readable source code (the &quot;Code&quot;) must
891
+ include the above copyright notice and this permission notice.</li>
892
+ </ul>
893
+
894
+
895
+ <ul>
896
+ <li>Upon distribution, the Derivatives must be accompanied either by the Code
897
+ or&mdash;provided that the Code is obtainable for no more than the cost of
898
+ distribution plus a nominal fee&mdash;by information on how to obtain the Code.</li>
899
+ </ul>
900
+
901
+
902
+ <p><span class="caps">THE SOFTWARE IS PROVIDED</span> &quot;AS IS&quot;, <span class="caps">WITHOUT WARRANTY OF ANY KIND</span>, EXPRESS OR
903
+ IMPLIED, INCLUDING <span class="caps">BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY</span>, FITNESS
904
+ <span class="caps">FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT</span>. IN <span class="caps">NO EVENT SHALL THE AUTHORS OR</span>
905
+ <span class="caps">COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM</span>, DAMAGES <span class="caps">OR OTHER LIABILITY</span>, WHETHER
906
+ <span class="caps">IN AN ACTION OF CONTRACT</span>, TORT <span class="caps">OR OTHERWISE</span>, ARISING FROM, OUT <span class="caps">OF OR IN</span>
907
+ <span class="caps">CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE</span>.</p></div>
908
+ </div>
909
+ <div class="section">
910
+ <h2 class="title">
911
+ <a class="toc" id="Appetizers" href="#a-606752538">1.3</a>&nbsp;&nbsp;Appetizers
912
+ </h2>
913
+ <div class="content">Here is a tiny sampling of code to whet your appetite. See <a class="xref" href="#usage.tutorial">the tutorial</a> for more samples.
914
+
915
+
916
+ <ul>
917
+ <li>Assign the value 2<sup>2048</sup> to a register:
918
+ <pre class="code">
919
+ <span style="color:#888"># NOTE: these are all equivalent</span>
920
+
921
+ your_register.intVal = <span style="color:#00D; font-weight:bold">2</span> ** <span style="color:#00D; font-weight:bold">2048</span>
922
+ your_register.put_value <span style="color:#00D; font-weight:bold">2</span> ** <span style="color:#00D; font-weight:bold">2048</span>
923
+ </pre></li>
924
+ </ul>
925
+
926
+
927
+ <ul>
928
+ <li>Check if all nets in a module are at high impedance:
929
+ <pre class="code">
930
+ your_module.all_net? { |your_net| your_net.z? }
931
+
932
+ <span style="color:#888"># or, alternatively:</span>
933
+
934
+ your_nets = your_module.net_a
935
+ your_nets.all? { |net| net.z? }
936
+ </pre></li>
937
+ </ul>
938
+
939
+
940
+ <ul>
941
+ <li>See a register&#8217;s path, width, and location (file &#38; line number):
942
+ <pre class="code">
943
+ <span style="color:#888"># NOTE: these are all equivalent</span>
944
+
945
+ puts your_register
946
+ p <span style="color:#A60">:path</span> =&gt; your_register.fullName
947
+ p <span style="color:#A60">:width</span> =&gt; your_register.size
948
+ p <span style="color:#A60">:file</span> =&gt; your_register.fileName
949
+ p <span style="color:#A60">:line</span> =&gt; your_register.lineNo
950
+ </pre></li>
951
+ </ul>
952
+
953
+
954
+ <ul>
955
+ <li>Access the first five elements in a memory:
956
+ <pre class="code">
957
+ <span style="color:#888"># NOTE: these are all equivalent</span>
958
+
959
+ your_memory.memoryWord_a.first(<span style="color:#00D; font-weight:bold">5</span>)
960
+ your_memory.memoryWord_a[<span style="color:#00D; font-weight:bold">0</span>..<span style="color:#00D; font-weight:bold">4</span>]
961
+ your_memory.memoryWord_a[<span style="color:#00D; font-weight:bold">0</span>...<span style="color:#00D; font-weight:bold">5</span>]
962
+ your_memory.memoryWord_a[<span style="color:#00D; font-weight:bold">0</span>, <span style="color:#00D; font-weight:bold">5</span>]
963
+ </pre></li>
964
+ </ul>
965
+
966
+
967
+ <ul>
968
+ <li>Clear a memory by filling it with zeroes:
969
+ <pre class="code">
970
+ <span style="color:#888"># NOTE: these are all equivalent</span>
971
+
972
+ your_memory.each_memoryWord { |w| w.f! }
973
+ your_memory.each_memoryWord { |w| w.vpi0! }
974
+ your_memory.each_memoryWord { |w| w.intVal = <span style="color:#00D; font-weight:bold">0</span> }
975
+ your_memory.each_memoryWord { |w| w.put_value <span style="color:#00D; font-weight:bold">0</span> }
976
+ </pre></li>
977
+ </ul></div>
978
+ </div>
979
+ <div class="section">
980
+ <h2 class="title">
981
+ <a class="toc" id="Applications" href="#a-606764318">1.4</a>&nbsp;&nbsp;Applications
982
+ </h2>
983
+ <div class="content">Examples of tasks that can be performed with Ruby-VPI are:
984
+
985
+
986
+ <ul>
987
+ <li>From the second edition of <a href="http://www.sutherland-hdl.com/publications.html"><em>The Verilog PLI Handbook</em></a>:
988
+ <ul>
989
+ <li>C language bus-functional models</li>
990
+ <li>Reading test vector files</li>
991
+ <li>Delay calculation</li>
992
+ <li>Custom output displays</li>
993
+ <li>Co-simulation</li>
994
+ <li>Design debug utilities</li>
995
+ <li>Simulation analysis</li>
996
+ </ul></li>
997
+ </ul>
998
+
999
+
1000
+ <ul>
1001
+ <li>Adapted from <a href="http://embedded.eecs.berkeley.edu/Alumni/pinhong/scriptEDA/">Pin Hong&#8217;s</a> observations:
1002
+ <ul>
1003
+ <li>Writing hardware models in Ruby</li>
1004
+ <li>Dumping or processing netlist data from Verilog database</li>
1005
+ <li>Dumping or processing simulation data</li>
1006
+ <li>Feeding dynamic simulation stimuli</li>
1007
+ <li>Back-annotating delay information</li>
1008
+ <li>Interactive logic simulation</li>
1009
+ <li>Building a distributed simulation</li>
1010
+ </ul></li>
1011
+ </ul></div>
1012
+ </div>
1013
+ <div class="section">
1014
+ <h2 class="title">
1015
+ <a class="toc" id="Related-works" href="#a-606770018">1.5</a>&nbsp;&nbsp;Related works
1016
+ </h2>
1017
+ <div class="content"><ul>
1018
+ <li><a href="http://anvil.sourceforge.net">ANVIL</a> is a C++ interface to VPI.</li>
1019
+ <li><a href="http://teal.sourceforge.net">Teal</a> is a C++ interface to VPI.</li>
1020
+ <li><a href="http://jove.sourceforge.net">JOVE</a> is a Java interface to VPI.</li>
1021
+ <li><a href="http://embedded.eecs.berkeley.edu/Alumni/pinhong/scriptEDA/">ScriptEDA</a> is a Perl, Python, and Tcl interface to VPI.</li>
1022
+ <li><a href="http://rhdl.rubyforge.org">RHDL</a> is a hardware description and verification language based on Ruby.</li>
1023
+ <li><a href="http://myhdl.jandecaluwe.com">MyHDL</a> is a hardware description and verification language based on Python, which features conversion to Verilog and co-simulation.</li>
1024
+ </ul>
1025
+
1026
+
1027
+ <p><div class="paragraph">
1028
+ <p class="title">Ye olde PLI</p>
1029
+ <div class="content">The following projects utilize the archaic <strong>tf</strong> and <strong>acc</strong> PLI interfaces, which have been officially deprecated in IEEE Std 1364-2005.
1030
+
1031
+
1032
+ <ul>
1033
+ <li><a href="http://www.nelsim.com">ScriptSim</a> is a Perl, Python, and Tcl/Tk interface to PLI.</li>
1034
+ <li><a href="http://www.veripool.com/verilog-pli.html">Verilog::Pli</a> is a Perl interface to PLI.</li>
1035
+ </ul></div>
1036
+ </div></p></div>
1037
+ </div></p></div>
1038
+ </div>
1039
+ <div class="chapter">
1040
+ <h1 class="title">
1041
+ Chapter
1042
+ <a class="toc" id="setup" href="#a-606777838">2</a>
1043
+
1044
+ <br/>
1045
+
1046
+ <big>Setup</big>
1047
+ </h1>
1048
+
1049
+ <div class="content"><div class="section">
1050
+ <h2 class="title">
1051
+ <a class="toc" id="setup.reqs" href="#a-606779348">2.1</a>&nbsp;&nbsp;Requirements
1052
+ </h2>
1053
+ <div class="content"><p>Your system needs the following software to run Ruby-VPI.</p>
1054
+
1055
+
1056
+ <p><div class="paragraph">
1057
+ <p class="title">Verilog simulator</p>
1058
+ <div class="content">Ruby-VPI is known to work with the following simulators. However, you should be able to use it with any Verilog simulator that supports VPI.
1059
+
1060
+
1061
+ <table border="1">
1062
+ <tr>
1063
+ <th>Simulator </th>
1064
+ <th>Notes </th>
1065
+ </tr>
1066
+ <tr>
1067
+ <td> <a href="http://www.synopsys.com/products/simulation/simulation.html">Synopsys VCS</a> </td>
1068
+ <td> Any version that supports the <tt>-load</tt> option is acceptable. </td>
1069
+ </tr>
1070
+ <tr>
1071
+ <td> <a href="http://www.model.com">Mentor Modelsim</a> </td>
1072
+ <td> Any version that supports the <tt>-pli</tt> option is acceptable. </td>
1073
+ </tr>
1074
+ <tr>
1075
+ <td> <a href="http://www.cadence.com/products/functional_ver/nc-verilog/">Cadence NC-Sim</a> </td>
1076
+ <td> Any version that supports the <tt>+loadvpi</tt> option is acceptable. </td>
1077
+ </tr>
1078
+ <tr>
1079
+ <td> <a href="http://www.pragmatic-c.com/gpl-cver/">GPL Cver</a> </td>
1080
+ <td> Version 2.11a or newer is acceptable. </td>
1081
+ </tr>
1082
+ <tr>
1083
+ <td> <a href="http://www.geda.seul.org/tools/icarus/index.html">Icarus Verilog</a> </td>
1084
+ <td> Version 0.8 is <em>mostly</em> acceptable because you <strong>will not</strong> be able to <a class="xref" href="#vpi.handles.relatives">access child handles through method calls</a>. The reason for this limitation is explained in <a class="xref" href="#problems.ivl.vpi_handle_by_name.absolute-paths">Section 6.1.1: <em>Give full paths to Verilog objects</em></a>. </td>
1085
+ </tr>
1086
+ </table></div>
1087
+ </div>
1088
+ <div class="paragraph">
1089
+ <p class="title">Compilers</p>
1090
+ <div class="content"><table border="1">
1091
+ <tr>
1092
+ <th>Software </th>
1093
+ <th>Notes </th>
1094
+ </tr>
1095
+ <tr>
1096
+ <td> <a href="http://en.wikipedia.org/wiki/Make">make</a> </td>
1097
+ <td> Any flavor or distribution should be acceptable. </td>
1098
+ </tr>
1099
+ <tr>
1100
+ <td> C compiler </td>
1101
+ <td> the <a href="http://www.gnu.org/software/gcc/" title="GCC">GNU Compiler Collection</a> is preferred, but any C compiler should be acceptable. </td>
1102
+ </tr>
1103
+ <tr>
1104
+ <td> <a href="http://www.swig.org/download.html">SWIG</a> </td>
1105
+ <td> Version 1.3.29 or newer is required. </td>
1106
+ </tr>
1107
+ <tr>
1108
+ <td> <a href="http://www.ruby-lang.org/en/downloads/">Ruby</a> </td>
1109
+ <td> Version 1.8 or newer, including header and linkable object files for building extensions, is required. You can install Ruby by following <a href="http://www.ruby-lang.org/en/downloads/">these instructions</a>. </td>
1110
+ </tr>
1111
+ </table></div>
1112
+ </div>
1113
+ <div class="paragraph">
1114
+ <p class="title">Libraries</p>
1115
+ <div class="content"><table border="1">
1116
+ <tr>
1117
+ <th>Library </th>
1118
+ <th>Notes </th>
1119
+ </tr>
1120
+ <tr>
1121
+ <td> <a href="http://en.wikipedia.org/wiki/Pthreads" title="pthreads">POSIX threads</a> </td>
1122
+ <td> Header and linkable object files, and operating system support for this library are necessary. </td>
1123
+ </tr>
1124
+ <tr>
1125
+ <td> <a href="http://rubyforge.org/frs/?group_id=126">RubyGems</a> </td>
1126
+ <td> Any recent version should be acceptable. You can install RubyGems by following <a href="http://www.rubygems.org/read/chapter/3">these instructions</a>. </td>
1127
+ </tr>
1128
+ </table></div>
1129
+ </div></p></div>
1130
+ </div>
1131
+ <div class="section">
1132
+ <h2 class="title">
1133
+ <a class="toc" id="setup.recom" href="#a-606789068">2.2</a>&nbsp;&nbsp;Recommendations
1134
+ </h2>
1135
+ <div class="content"><p>The following software might make your interactions with Ruby-VPI more pleasant.</p>
1136
+
1137
+
1138
+ <p><div class="paragraph">
1139
+ <p class="title">Text merging tool</p>
1140
+ <div class="content">An <em>interactive</em> text merging tool can greatly simplify the process of transferring wanted changes from one file to another. In particular, such tools are especially beneficial when using the <a class="xref" href="#usage.tools.generate">automated test generator</a>. A handful of the currently available open-source text merging tools are listed below.
1141
+
1142
+
1143
+ <table border="1">
1144
+ <tr>
1145
+ <th>Software </th>
1146
+ <th>Description </th>
1147
+ </tr>
1148
+ <tr>
1149
+ <td> <a href="http://kdiff3.sourceforge.net/">kdiff3</a> </td>
1150
+ <td> A graphical, three-way merging tool for KDE. </td>
1151
+ </tr>
1152
+ <tr>
1153
+ <td> <a href="http://meld.sourceforge.net/">meld</a> </td>
1154
+ <td> A graphical, three-way merging tool for GNOME. </td>
1155
+ </tr>
1156
+ <tr>
1157
+ <td> <a href="http://tkdiff.sourceforge.net/">tkdiff</a> </td>
1158
+ <td> A graphical, two-way merging tool that uses the cross-platform Tk windowing toolkit. </td>
1159
+ </tr>
1160
+ <tr>
1161
+ <td> <a href="http://furius.ca/xxdiff/">xxdiff</a> </td>
1162
+ <td> A graphical, three-way merging tool. </td>
1163
+ </tr>
1164
+ <tr>
1165
+ <td> <a href="http://elonen.iki.fi/code/imediff/">imediff2</a> </td>
1166
+ <td> A textual, fullscreen two-way merging tool. It is very useful when you are working remotely via SSH. </td>
1167
+ </tr>
1168
+ </table></div>
1169
+ </div></p></div>
1170
+ </div>
1171
+ <div class="section">
1172
+ <h2 class="title">
1173
+ <a class="toc" id="setup.inst" href="#a-606794098">2.3</a>&nbsp;&nbsp;Installation
1174
+ </h2>
1175
+ <div class="content"><p><div class="tip">
1176
+ <p class="title"><a class="toc" id="Tuning-for-maximum-performance" href="#a-606795708">Tip 1</a>.&nbsp;&nbsp;Tuning for maximum performance</p>
1177
+
1178
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgI
1179
+ fAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3
1180
+ Lmlua3NjYXBlLm9yZ5vuPBoAAAyOSURBVGiB1ZlrkB3Fdcf/5/Q87r1z7z7u
1181
+ vrSrXa3QC7EIyUFCSWwnJIAN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214
+ vWtas31uwpu1hAhsiwNLCGkJlgnbitZmvc4zp19ho6NvrzrAM08+NqXC4DMX
1215
+ Xv1RsLWzWRCTZqZICERCIHprovymiuLayTMT3xzP106lHCvdmLG3dDQld63J
1216
+ enc0pJPX+YE8z0IMGTt53LI4FBZJS0BagmVfT8vWgYFBNTw6+tyhQ189t1Rd
1217
+ y9oTH3rqy4f2fvpv7990/cju69q7nemSr5k5YuJoPF+7srGzoSvtuTxZlueK
1218
+ fvRz1xK+Y1MgiBUxdCKZabFd975CoXzOYbKMERwLspqSdk9z0tnwT//yrYqR
1219
+ +OxyNC27KqHI3P+Tl/99LhEVM+taMykGacGkY4OgUAlGshm30WFSQpC0bAot
1220
+ QYHlkG8Ly29IJZuVil+3iSqWTaHFpFoyybbetoY79z+1P/arlQeXu71cNsAz
1221
+ Tz42pf3ybx974Xk/EVfbmtNugpk0Mel8RY3ZZFLMpGzByiaWjuDQsThIuuzH
1222
+ MsjIOD4rLAotwdKxLNPZ6N375P798fDl0T89fOArLy1XzzXVhQ4e/NpYFNRu
1223
+ /8mJY4muZq9FEDQT6WIlmC3MzrgUKVcQKWGRFMSha7EfVqtObvKKkKEcFcRS
1224
+ CFYtDcntA0OD/uWRkS89ffCx716LlmsubB08+PiF3MTEf2q/mBVCMBEMk1D5
1225
+ QqkwV8hliVhbhMh2WDmCw6HBX7UX8rMjlu34FkGxYe0w73jp+Esp24ivX6uO
1226
+ FVXmlAyfGR8doUbPTVP9O81EhmeGBy+1MyM24FgwtBCWOnfm9U4IGnSEUUKw
1227
+ ZmFiBrpzE7lzTz31pSW/ea9uK6rMCYhTA5cuJbfuuLljYLw0JaszbYh8PXz5
1228
+ 4gbvZ9V7PC+yTRxWpqcKswMD422t7cmhwC+ku9dv9710U28gQxOE/rI28asK
1229
+ cOjQl4f/8q8+NzQ5ermjwTaNuZk32i2KUglX0dTUOPr6NsC2ErgyNon16zNI
1230
+ uDN/ODY2PjYydun0H+z51Ieeff5IYCJ97H0DAIBYqo9/5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VdeCS5evPh3Z86ceW1eeDhvwfxRLhIfLe4bY6J30rWkJJ4PmXcyaxGAe/r0
1248
+ 6Yu+74+dOHFCTU5OIp/P480334zCMMydOXNmDEAGQApAYuGe+futdxqDiOgd
1249
+ ta22BwC4nZ2dXdu2bfujlpaWe4wxNDMz84OzZ88em5qamkZ9ppfjAflu+bDc
1250
+ HGAANv6XHFhk9iI4CwDNm5m3aJG9Ww4o1MPnXQVe09fovEsXBC+AXO16LBK/
1251
+ 0BYggPpqs9jeBlvqCnTNAP/jIXWgBeNF/YXzBfHxIoC3z5cj+Or2X3r9Ye2F
1252
+ 1izgAAAAAElFTkSuQmCC
1253
+ " alt="tip" class="icon"/>
1254
+
1255
+ <div class="content">You can tune your installation of Ruby-VPI for maximum performance by adding your C compiler&#8217;s optimization flag to the <code class="code"><span style="color:#036; font-weight:bold">CFLAGS</span></code> environment variable <em>before</em> you run the installation command (shown below). For example, if your C compiler is GCC, then you can set <code class="code"><span style="color:#036; font-weight:bold">CFLAGS</span></code> to <tt>-O9</tt> for maximum optimization.</div>
1256
+ </div>
1257
+ Once your system has the <a class="xref" href="#setup.reqs">necessary requirements</a>, you can install Ruby-VPI by running the following commands:</p>
1258
+
1259
+
1260
+ <pre>gem install ruby-vpi
1261
+ ruby-vpi -v</pre>
1262
+
1263
+
1264
+ Otherwise, follow these instructions:
1265
+ <ol>
1266
+ <li>Download the newest <tt>tar.gz</tt> release package from <a href="http://rubyforge.org/frs/?group_id=1339">the project download area</a>.</li>
1267
+ <li>Extract the release package anywhere you want on your system.</li>
1268
+ <li>Go inside the extracted directory and run the following commands:</li>
1269
+ </ol>
1270
+
1271
+
1272
+ <pre>rake build
1273
+ ruby bin/ruby-vpi -v</pre>
1274
+
1275
+
1276
+ <p>If the installation was successful, then you will see output like this: <pre>ruby-vpi 20.0.0 (2008-01-27) http://ruby-vpi.rubyforge.org /home/sun/src/ruby-vpi
1277
+ </pre></p>
1278
+
1279
+
1280
+ <p>Otherwise, you can ask for help in the <a href="http://rubyforge.org/mailman/listinfo/ruby-vpi-discuss">project mailing list</a>.</p>
1281
+
1282
+
1283
+ <p><div class="section">
1284
+ <h3 class="title">
1285
+ <a class="toc" id="setup.inst.windows" href="#a-606799148">2.3.1</a>&nbsp;&nbsp;Installing on Windows
1286
+ </h3>
1287
+ <div class="content"><p>After Ruby-VPI is compiled, it is linked to symbols whose names begin with <tt>_vpi</tt>. In GNU/Linux and similar operating systems, these symbols are allowed to be undefined. However, this is not the case in Windows because we <a href="http://sourceware.org/ml/cygwin/2001-12/msg01293.html">cannot compile a shared object file with references to undefined symbols in Windows</a>.</p>
1288
+
1289
+
1290
+ <p>One solution to this problem is to supply the Verilog simulator&#8217;s VPI object file, which contains definitions of all VPI symbols, to the linker. The following steps illustrate this process.</p>
1291
+
1292
+
1293
+ <ol>
1294
+ <li>Install <a href="http://www.cygwin.com">Cygwin</a>, the Linux-like environment for Windows.</li>
1295
+ <li>Search for object files whose names end with <tt>.so</tt>, <tt>.o</tt>, or <tt>.dll</tt> in your Verilog simulator&#8217;s installation directory.</li>
1296
+ <li>Determine which object files, among those found in the previous step, contain symbols whose names begin with &#8220;_vpi&#8221; by running the following command in Cygwin: <pre>for x in *.{o,so,dll}; do nm $x | grep -q '[Tt] _vpi' &amp;&amp; echo $x; done</pre>
1297
+ <ul>
1298
+ <li>If you are using Mentor Modelsim, the desired object file can be found at a path similar to <tt>C:\Modeltech\win32\libvsim.dll</tt>.</li>
1299
+ <li>If you are using GPL Cver, the desired object file can be found at a path similar to <tt>C:\gplcver\objs\v_vpi.o</tt>.</li>
1300
+ </ul>
1301
+ </li>
1302
+ <li>Assign the path of the object file (determined in the previous step) to the <code class="code"><span style="color:#036; font-weight:bold">LDFLAGS</span></code> environment variable. For example, if the object file&#8217;s path is <tt>/foo/bar/vpi.so</tt>, then you would run the following command in Cygwin: <pre>export LDFLAGS=/foo/bar/vpi.so</pre></li>
1303
+ <li>You may now install Ruby-VPI by running the following command in Cygwin: <pre>gem install ruby-vpi</pre></li>
1304
+ </ol></div>
1305
+ </div></p></div>
1306
+ </div>
1307
+ <div class="section">
1308
+ <h2 class="title">
1309
+ <a class="toc" id="setup.maintenance" href="#a-606801708">2.4</a>&nbsp;&nbsp;Maintenance
1310
+ </h2>
1311
+ <div class="content"><p>You can upgrade to the latest release of Ruby-VPI by running the following command:</p>
1312
+
1313
+
1314
+ <pre>gem update ruby-vpi</pre>
1315
+
1316
+
1317
+ <p>You can uninstall Ruby-VPI by running the following command:</p>
1318
+
1319
+
1320
+ <pre>gem uninstall ruby-vpi</pre>
1321
+
1322
+
1323
+ <p>Learn more about using RubyGems in <a href="http://www.rubygems.org">the RubyGems user guide</a>.</p></div>
1324
+ </div>
1325
+ <div class="section">
1326
+ <h2 class="title">
1327
+ <a class="toc" id="setup.manifest" href="#a-606803858">2.5</a>&nbsp;&nbsp;Manifest
1328
+ </h2>
1329
+ <div class="content">Now that Ruby-VPI is installed on your system, let us examine its installation directory.
1330
+ <ul>
1331
+ <li>If you installed Ruby-VPI manually, then you already know the location of its installation directory.</li>
1332
+ <li>If you installed Ruby-VPI using RubyGems, then run <pre>ruby-vpi -v</pre> and select the right-most item in the output&mdash;that is the path of Ruby-VPI&#8217;s installation directory.</li>
1333
+ </ul>
1334
+
1335
+
1336
+ Inside Ruby-VPI&#8217;s installation directory, you will see (among other things) the following items:
1337
+ <ul>
1338
+ <li><tt>bin/</tt> &#8211; contains executable programs (see <a class="xref" href="#usage.tools">Section 4.8: <em>Tools</em></a>).</li>
1339
+ <li><tt>doc/</tt> &#8211; contains user documentation in various formats.</li>
1340
+ <li><tt>ref/</tt> &#8211; contains reference API documentation in HTML format.</li>
1341
+ <li><tt>examples/</tt> &#8211; contains example Ruby-VPI tests (see <a class="xref" href="#usage.examples">Section 4.9.8: <em>More examples</em></a>).</li>
1342
+ <li><tt>ext/</tt> &#8211; contains source code, written in the C language, for the <a class="xref" href="#organization">core of Ruby-VPI</a>.</li>
1343
+ <li><tt>lib/</tt> &#8211; contains Ruby libraries provided by Ruby-VPI.</li>
1344
+ </ul></div>
1345
+ </div></div>
1346
+ </div>
1347
+ <div class="chapter">
1348
+ <h1 class="title">
1349
+ Chapter
1350
+ <a class="toc" id="organization" href="#a-606810448">3</a>
1351
+
1352
+ <br/>
1353
+
1354
+ <big>Background</big>
1355
+ </h1>
1356
+
1357
+ <div class="content"><p>Ruby-VPI is a bridge between <span class="caps">IEEE 1364</span>-2005 Verilog VPI and the Ruby language. It enables Ruby programs to use VPI either (1) in the same, verbose way that C programs do, or (2) in a simpler, higher level way.</p>
1358
+
1359
+
1360
+ <p><div class="figure">
1361
+ <p class="title"><a class="toc" id="fig:organization.detail" href="#a-606812008">Figure 1</a>.&nbsp;&nbsp;Where does Ruby-VPI fit in?</p>
1362
+ <div class="content"><img src="figures/organization_detailed.png" alt="" /></div>
1363
+ </div>
1364
+ As <a class="xref" href="#fig:organization.detail">Figure 1: <em>Where does Ruby-VPI fit in?</em></a> shows, Ruby-VPI is composed of two complementary parts: one interacts with VPI through the C language, while the other interacts with an executable specification written in the Ruby language. The former is complied during installation to produce dynamically loadable C libraries&#8212;-each tailored to accommodate the quirks of its respective Verilog simulator. The latter is not compiled because Ruby programs are interpreted dynamically.</p>
1365
+
1366
+
1367
+ <p><div class="section">
1368
+ <h2 class="title">
1369
+ <a class="toc" id="Motivation" href="#a-606815068">3.1</a>&nbsp;&nbsp;Motivation
1370
+ </h2>
1371
+ <div class="content">If you would like to know why Ruby-VPI developed, please read this <a href="http://ruby-vpi.rubyforge.org/papers/masters_thesis.html#tth_sEc5.2">motivation section</a> of my masters thesis.</div>
1372
+ </div>
1373
+ <div class="section">
1374
+ <h2 class="title">
1375
+ <a class="toc" id="organization.tests" href="#a-606817088">3.2</a>&nbsp;&nbsp;Tests
1376
+ </h2>
1377
+ <div class="content"><p>In Ruby-VPI, the process of functional verification is neatly packaged into self-contained, executable tests. As <a class="xref" href="#fig:organization">Figure 2: <em>Organization of a test in Ruby-VPI</em></a> illustrates, a test is composed of a <strong>bench</strong>, a <strong>design</strong>, and a <strong>specification</strong>.</p>
1378
+
1379
+
1380
+ <p><div class="figure">
1381
+ <p class="title"><a class="toc" id="fig:organization" href="#a-606820058">Figure 2</a>.&nbsp;&nbsp;Organization of a test in Ruby-VPI</p>
1382
+ <div class="content"><img src="figures/organization.png" alt="" /></div>
1383
+ </div>
1384
+ <strong>The bench</strong> is Ruby-VPI. It defines the environment in which functional verification takes place. This is analogous to a workbench in an electronics laboratory that is furnished with tools of measurement and manipulation such as oscilloscopes, voltmeters, soldering irons, and so on which enable engineers to verify electronic components and locate the source of defects within those components.</p>
1385
+
1386
+
1387
+ <p><strong>The design</strong> is an instantiated Verilog module. To extend the analogy of the electronics laboratory, it corresponds to the electronic component that is verified by an engineer.</p>
1388
+
1389
+
1390
+ <p><strong>The specification</strong> is a Ruby program. In the electronics laboratory analogy, it corresponds to the engineer who inspects, manipulates, and verifies the electronic component. In terms of specification-driven functional verification, it corresponds to the executable specification.</p></div>
1391
+ </div></p></div>
1392
+ </div>
1393
+ <div class="chapter">
1394
+ <h1 class="title">
1395
+ Chapter
1396
+ <a class="toc" id="usage" href="#a-606822688">4</a>
1397
+
1398
+ <br/>
1399
+
1400
+ <big>Usage</big>
1401
+ </h1>
1402
+
1403
+ <div class="content"><div class="section">
1404
+ <h2 class="title">
1405
+ <a class="toc" id="usage.theory" href="#a-606824258">4.1</a>&nbsp;&nbsp;Theory of operation
1406
+ </h2>
1407
+ <div class="content"><p>When you run a Ruby-VPI test, the following chain reaction occurs.</p>
1408
+
1409
+
1410
+ <p><div class="paragraph">
1411
+ <p class="title">Rake (via the <tt>Rakefile</tt>)</p>
1412
+ <div class="content"><ol>
1413
+ <li>Specifies a user-defined Ruby script that will be loaded
1414
+ by Ruby-VPI once the simulator has been launched.</li>
1415
+ <li>Determines where all necessary Verilog modules &#38; Verilog libraries
1416
+ are and launches the Verilog simulator with this knowledge.</li>
1417
+ </ol></div>
1418
+ </div>
1419
+ <div class="paragraph">
1420
+ <p class="title">Verilog simulator</p>
1421
+ <div class="content"><ol>
1422
+ <li>Launches the Ruby interpreter and loads Ruby-VPI into it.</li>
1423
+ </ol></div>
1424
+ </div>
1425
+ <div class="paragraph">
1426
+ <p class="title">Ruby-VPI</p>
1427
+ <div class="content"><ol>
1428
+ <li>Establishes the <a class="xref" href="#vpi">basic verification environment</a> (the nice library for <a class="xref" href="#vpi.handles">working with VPI handles</a>, and so on).</li>
1429
+ <li>Loads the user-defined Ruby script that was specified by Rake.</li>
1430
+ </ol></div>
1431
+ </div>
1432
+ <div class="paragraph">
1433
+ <p class="title">User-defined Ruby script</p>
1434
+ <div class="content"><ol>
1435
+ <li>Determines what Verilog modules are going to be tested.</li>
1436
+ <li>Determines what Ruby files are going to do the testing.</li>
1437
+ <li>Associates them together and starts the simulation.</li>
1438
+ </ol>
1439
+
1440
+
1441
+ <p>For example, consider this user-defined Ruby script:
1442
+ <pre class="code">
1443
+ designHandle = vpi_handle_by_name(<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">whatever</span><span style="color:#710">&quot;</span></span>, <span style="color:#038; font-weight:bold">nil</span>)
1444
+ testFiles = <span style="color:#036; font-weight:bold">Dir</span>[<span style="background-color:#fff0f0"><span style="color:#710">'</span><span style="color:#D20">path/to/files/*.whatever</span><span style="color:#710">'</span></span>]
1445
+
1446
+ <span style="color:#036; font-weight:bold">RubyVPI</span>.load_test( designHandle, testFiles )
1447
+ </pre></p>
1448
+
1449
+
1450
+ Here, the <code class="code"><span style="color:#036; font-weight:bold">RubyVPI</span>.load_test</code> method will:
1451
+ <ol>
1452
+ <li>Create a temporary module (a sandbox).</li>
1453
+ <li>Define a constant named <code class="code"><span style="color:#036; font-weight:bold">DUT</span></code> inside the sandbox.</li>
1454
+ <li>Load all the test files into the sandbox.</li>
1455
+ </ol>
1456
+
1457
+
1458
+ <p>In this manner, we can (1) load as many tests into the simulation as we wish and (2) use any files we want (and organize them however we like) to perform the testing.</p></div>
1459
+ </div>
1460
+ <div class="section">
1461
+ <h3 class="title">
1462
+ <a class="toc" id="Test-files" href="#a-606835008">4.1.1</a>&nbsp;&nbsp;Test files
1463
+ </h3>
1464
+ <div class="content"><p>Ruby-VPI tests (when produced by the <a class="xref" href="#usage.tools.generate">automated test generator</a>) are typically composed of the following files.</p>
1465
+
1466
+
1467
+ <ul>
1468
+ <li><tt>runner.rake</tt>
1469
+ <ul>
1470
+ <li>Launches the Verilog simulator, loads Ruby-VPI into it, and executes the user-defined Ruby script.</li>
1471
+ </ul></li>
1472
+ </ul>
1473
+
1474
+
1475
+ <ul>
1476
+ <li><tt>design.rb</tt>
1477
+ <ul>
1478
+ <li>Defines convenience methods on the <code class="code"><span style="color:#036; font-weight:bold">DUT</span></code> object.</li>
1479
+ <li>May define other data structures to aid the testing.</li>
1480
+ </ul></li>
1481
+ </ul>
1482
+
1483
+
1484
+ <ul>
1485
+ <li><tt>proto.rb</tt>
1486
+ <ul>
1487
+ <li>Uses the <a class="xref" href="#usage.concurrency">concurrency model</a> to emulate the design under test&#8217;s Verilog implementation.</li>
1488
+ </ul></li>
1489
+ </ul>
1490
+
1491
+
1492
+ <ul>
1493
+ <li><tt>spec.rb</tt>
1494
+ <ul>
1495
+ <li>Does some tests on the <code class="code"><span style="color:#036; font-weight:bold">DUT</span></code> object.</li>
1496
+ <li>If you want to test multiple Verilog objects, then simply
1497
+ use the <code class="code">vpi_handle_by_name()</code> function to get access to
1498
+ the Verilog objects you want and proceed as usual.</li>
1499
+ </ul></li>
1500
+ </ul>
1501
+
1502
+
1503
+ <ul>
1504
+ <li><tt>loader.rb</tt>
1505
+ <ul>
1506
+ <li>The user-defined Ruby script which loads the test.</li>
1507
+ </ul></li>
1508
+ </ul>
1509
+
1510
+
1511
+ <p>Note that because the user-defined Ruby script (<tt>loader.rb</tt> among the files above) decides what files to load, you are free to organize your tests however you like. As a result, the files presented above are a mere <em>convention</em> that you can <em>choose</em> to follow rather than being forced to follow.</p></div>
1512
+ </div></p></div>
1513
+ </div><div class="section">
1514
+ <h2 class="title">
1515
+ <a class="toc" id="overview.relay" href="#a-606840438">4.2</a>&nbsp;&nbsp;Interacting with the Verilog simulator
1516
+ </h2>
1517
+ <div class="content"><p>In a typical VPI application written in C, the <em>Verilog simulator</em> is in charge. Verilog code temporarily transfers control to C by invoking C functions, which return control to Verilog when they finish.</p>
1518
+
1519
+
1520
+ <p>In contrast, Ruby-VPI puts the <em>specification</em> in charge. The specification temporarily transfers control to the Verilog simulator by invoking the <code class="code">advance_time</code> method, which returns control to the specification after a given number of time steps. This process is illustrated in <a class="xref" href="#fig:ruby_relay">Figure 3: <em>Interaction between Ruby and Verilog</em></a>. You can also use the <code class="code">wait</code> method, which is just an alias to the <code class="code">advance_time</code> method, if you prefer.</p>
1521
+
1522
+
1523
+ <p>Ruby-VPI&#8217;s approach is the same as any software testing framework, where the <em>specification</em> drives the design under test. In contrast, the VPI &#38; C approach is literally <em>backwards</em> because the design under test drives the specification.</p>
1524
+
1525
+
1526
+ <p><div class="figure">
1527
+ <p class="title"><a class="toc" id="fig:ruby_relay" href="#a-606843408">Figure 3</a>.&nbsp;&nbsp;Interaction between Ruby and Verilog</p>
1528
+ <div class="content"><img src="figures/ruby_relay.png" alt="" />
1529
+
1530
+
1531
+ <ol>
1532
+ <li>The current simulation time is <em>X</em>.</li>
1533
+ <li>The specification invokes the <code class="code">advance_time</code> method with parameter <em>Y</em>, which specifies the number of simulation time steps to be simulated.</li>
1534
+ <li>The Verilog simulator is now in control (temporarily).</li>
1535
+ <li>The current simulation time has <em>not</em> changed; it is still <em>X</em>.</li>
1536
+ <li>The Verilog simulator simulates <em>Y</em> simulation time steps.</li>
1537
+ <li>The current simulation time is now <em>X + Y</em>.</li>
1538
+ <li>The Verilog simulator returns control back to the specification.</li>
1539
+ </ol></div>
1540
+ </div>
1541
+ Another means of transferring control from the specification to the Verilog simulator is the <a class="xref" href="#vpi.callbacks">VPI callback</a>.</p></div>
1542
+ </div>
1543
+ <div class="section">
1544
+ <h2 class="title">
1545
+ <a class="toc" id="vpi" href="#a-606846998">4.3</a>&nbsp;&nbsp;VPI in Ruby
1546
+ </h2>
1547
+ <div class="content"><p>Ruby-VPI provides the <em>entire</em> IEEE Std 1364-2005 VPI interface to Ruby. This section will show you how to make use of it.</p>
1548
+
1549
+
1550
+ <p><div class="note">
1551
+ <p class="title"><a class="toc" id="Constants-are-capitalized-in-Ruby" href="#a-606848628">Note 1</a>.&nbsp;&nbsp;Constants are capitalized in Ruby</p>
1552
+
1553
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgI
1554
+ fAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3
1555
+ Lmlua3NjYXBlLm9yZ5vuPBoAAAmCSURBVGiB1ZltbJXlGcd/9/N+Tlssh1Ja
1556
+ hNEJaK2UFxFptqC2wGCSTWdM3DSQzWVDEzVxy4xfjNkHQ8xMnEEXviwZ62Rj
1557
+ 6siWTcVBZeJA5yBQpOWlKNZSaEvpyyk95zwv970Pp+fY5/S0tFBkXsmTc67n
1558
+ eu77+f/u6349Ryil+Cqbdq0FXKldEuClp+3nfvVz/eJLT9vPXQv/igFc13tq
1559
+ w4/ujLqu99S18C9lRr6br7zyyi2WZb2eSqUqpVSUlE5BSmW8/PLL6sv2bdtu
1560
+ TiaT9z/++ONN486AZVm/XLiw+qZlt98Wun/bsqUhf+nSJSF/ya2LQv6ixQtD
1561
+ /sJFC0L+guqqkF91S2XIr6y6idlfm1Vp2/Yz+XSOCiCEqDJMQ3ze+hm6bnC+
1562
+ sx9d1zl+vBlN1znf2Y+m6TQfa0LTvvCbmo6G/KNHj4T8Ix83hvzGI4dD/uHG
1563
+ QyG/peUElmUJIURlPp2jAkgpiwXg+R5FM9dRv3U/heXrkFJSWHZ32i/7NlJK
1564
+ CsrWUr91P9EZa5FSEildQ/3W/USmfwspJc701dRv3Y9dshopJda0VdRv3Y8V
1565
+ W4mU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sWYzhR0XSdQOslk
1598
+ ksw7hBAIIdA0LfuZ2cbkvs80TaGUKh8TwPf9UsuykFKGIGpqanLLZVPbffNc
1599
+ vvfQY3heGsjzPDzPy3at3Exqmoau6+i6jmmaGIaB4zg4joNhGKEsZ0xKyZCu
1600
+ GZcCKMnsRIf3QV3XRwBkYmUzK0JAmSsIguz3fK2t6zqapqFp2og6873Hsiw8
1601
+ z5s+JkAqlZqaycDlTKO5gsZTbjynvkwGXNedOiaA67pT8gFMBOJqxDIAqVRq
1602
+ xI+8IYBEIlE4lKoJn4evZiwDkEgkinKfyeZ748aNpuu6pmma2QzkXplKv+yY
1603
+ lBLTNEkmk86CBQus4QDZDDQ2Nl4/f/5817Isp7S0NDv3T6aNZzUfzXzfRwjh
1604
+ K6XmCCHOAoNKKWkACCEKqqurpwkhZEtLC42NjZOledKsuroaTdOU67olwACg
1605
+ CSEGDCGEBdiu6zq+75NMJkNL+v+LJRIJfN8nkUhEgAgQAK5BehzoPT098e7u
1606
+ bj2VSjFnzpxrKjafSSm5cOEC/f39KUAnrVsTgAkUAYU1NTUPx2KxjUEQTLmW
1607
+ YvOZpmnxjo6O3x48eHA76S4UB3qEUgohRBQoGLoyKTJJp+nyR97kmA1IwANS
1608
+ wODQ1auUSmYP9UNjoQBwAIv0DBUMFb6WZpNuRB9wSYsfUEr5kOdfSiGETrr1
1609
+ DUCQhrhWJkj394A0gKeUCjVo3r9Zv0r2P3yyQqPd16MPAAAAAElFTkSuQmCC
1610
+ " alt="note" class="icon"/>
1611
+
1612
+ <div class="content"><p>In the remainder of this guide, you may be surprised to see that VPI constants such as <code class="code">vpiIntVal</code> are written with a captialized name, as <code class="code"><span style="color:#036; font-weight:bold">VpiIntVal</span></code>. The reason for this discrepancy is that in Ruby, the names of constants are capitalized.</p>
1613
+
1614
+
1615
+ <p>However, keep in mind that Ruby-VPI provides all VPI constants in both (1) their original, uncapitalized form and (2) their capitalized Ruby form. You may use either version according to your preference; they are functionally equivalent.</p></div>
1616
+ </div>
1617
+ <div class="section">
1618
+ <h3 class="title">
1619
+ <a class="toc" id="vpi.handles" href="#a-606850438">4.3.1</a>&nbsp;&nbsp;Handles
1620
+ </h3>
1621
+ <div class="content"><p>A <strong>handle</strong> is a reference to an object (such as a module, register, wire, and so on) inside the Verilog simulation. Handles allows you to inspect and manipulate the design under test and its internal components. They are instances of the <code class="code"><span style="color:#036; font-weight:bold">VPI</span>::<span style="color:#036; font-weight:bold">Handle</span></code> class (see <a href="api/ruby/classes/VPI/Handle.html">reference documentation</a> for details) in Ruby-VPI.</p>
1622
+
1623
+
1624
+ <p>Handles have various <strong>properties</strong>, listed in the second column of <a class="xref" href="#tbl:accessors">Table 1: <em>Possible accessors and their implications</em></a>, which provide different kinds of information about the underlying Verilog objects they represent. These properties are accessed through the VPI functions listed in the last column of <a class="xref" href="#tbl:accessors">Table 1: <em>Possible accessors and their implications</em></a>.</p>
1625
+
1626
+
1627
+ <p>Handles are typically obtained through the <code class="code">vpi_handle_by_name</code> and <code class="code">vpi_handle</code> functions. These functions are hierarchical in nature, as they allow you to obtain new handles that are related to existing ones. For example, to obtain a handle to a register contained within a module, one would typically write: <code class="code">your_reg = vpi_handle( <span style="color:#036; font-weight:bold">VpiReg</span>, your_handle )</code></p>
1628
+
1629
+
1630
+ <p><div class="paragraph">
1631
+ <p class="title">Shortcuts for productivity</p>
1632
+ <div class="content">Given a handle, Ruby-VPI allows you to access (1) its relatives and (2) its properties simply by invoking methods on the handle. If a handle&#8217;s relative happens to have the same name as one its properties, then the relative is given priority because a handle&#8217;s properties can always be accessed explicitly through the <code class="code">handle.get_value</code> and <code class="code">handle.put_value</code> methods.</div>
1633
+ </div>
1634
+ <div class="section">
1635
+ <h4 class="title">
1636
+ <a class="toc" id="vpi.handles.relatives" href="#a-606856398">4.3.1.1</a>&nbsp;&nbsp;Accessing a handle&#8217;s relatives
1637
+ </h4>
1638
+ <div class="content"><p>Imagine that the design under test, say <em>foo</em>, instantiated a Verilog module named <em>bar</em>, which in turn contained a register named <em>baz</em>. To access baz from Ruby, one could employ VPI idioms by writing:</p>
1639
+
1640
+
1641
+ <pre class="code">
1642
+ foo = vpi_handle_by_name( <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">foo</span><span style="color:#710">&quot;</span></span>, <span style="color:#038; font-weight:bold">nil</span> )
1643
+ bar = vpi_handle_by_name( <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">bar</span><span style="color:#710">&quot;</span></span>, foo )
1644
+ baz = vpi_handle_by_name( <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">baz</span><span style="color:#710">&quot;</span></span>, bar )
1645
+ </pre>
1646
+
1647
+
1648
+ <p>or by writing:</p>
1649
+
1650
+
1651
+ <code class="code">baz = vpi_handle_by_name( <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">foo.bar.bar</span><span style="color:#710">&quot;</span></span>, <span style="color:#038; font-weight:bold">nil</span> )</code>
1652
+
1653
+
1654
+ <p>These idioms seem excessively verbose in a higher level language such as Ruby, so Ruby-VPI allows you to access a handle&#8217;s relative by simply invoking the relative&#8217;s name as a method on the handle:</p>
1655
+
1656
+
1657
+ <code class="code">foo.bar.baz</code></div>
1658
+ </div>
1659
+ <div class="section">
1660
+ <h4 class="title">
1661
+ <a class="toc" id="Accessing-a-handle-s-properties" href="#a-606858628">4.3.1.2</a>&nbsp;&nbsp;Accessing a handle&#8217;s properties
1662
+ </h4>
1663
+ <div class="content"><p>Imagine that the design under test, say <em>foo</em>, contained a register named <em>bar</em>. To access the integer value of <em>bar</em> in Ruby-VPI, one could employ VPI idioms by writing:</p>
1664
+
1665
+
1666
+ <pre class="code">
1667
+ wrapper = <span style="color:#036; font-weight:bold">S_vpi_value</span>.new
1668
+ wrapper.format = <span style="color:#036; font-weight:bold">VpiIntVal</span>
1669
+ vpi_get_value( foo.bar, wrapper )
1670
+ result = wrapper.value.integer
1671
+ </pre>
1672
+
1673
+
1674
+ <p>or, if <em>bar</em> is capable of storing more than 32 bits, one would convert a string representation of bar&#8217;s integer value into a limitless Ruby integer by writing:</p>
1675
+
1676
+
1677
+ <pre class="code">
1678
+ wrapper = <span style="color:#036; font-weight:bold">S_vpi_value</span>.new
1679
+ wrapper.format = <span style="color:#036; font-weight:bold">VpiHexStrVal</span>
1680
+ vpi_get_value( foo.bar, wrapper )
1681
+ result = wrapper.value.str.to_i( <span style="color:#00D; font-weight:bold">16</span> )
1682
+ </pre>
1683
+
1684
+
1685
+ <p>These idioms seem excessively verbose in a higher level language such as Ruby, so Ruby-VPI allows you to access a handle&#8217;s properties by simply invoking property names, using the special naming format shown in <a class="xref" href="#fig:method-naming-format">Figure 4: <em>Method naming format for accessing a handle&#8217;s properties</em></a>, as methods on the handle:</p>
1686
+
1687
+
1688
+ <code class="code">result = foo.bar.intVal</code></div>
1689
+ </div>
1690
+ <div class="figure">
1691
+ <p class="title"><a class="toc" id="fig:method-naming-format" href="#a-606862348">Figure 4</a>.&nbsp;&nbsp;Method naming format for accessing a handle&#8217;s properties</p>
1692
+ <div class="content"><table border="1">
1693
+ <tr>
1694
+ <th>Operation </th>
1695
+ <th>_ </th>
1696
+ <th>Property </th>
1697
+ <th>_ </th>
1698
+ <th>Accessor </th>
1699
+ <th>Addendum </th>
1700
+ </tr>
1701
+ <tr>
1702
+ <td colspan="2">optional </td>
1703
+ <td> required </td>
1704
+ <td colspan="3">optional </td>
1705
+ </tr>
1706
+ </table>
1707
+
1708
+
1709
+
1710
+
1711
+ <ul>
1712
+ <li><strong>Operation</strong> suggests a method that should be invoked in the context of the <strong>Property</strong> parameter. All methods in <a href="http://www.ruby-doc.org/core/classes/Enumerable.html">Ruby&#8217;s <code class="code"><span style="color:#036; font-weight:bold">Enumerable</span></code> module</a> are valid operations.</li>
1713
+ </ul>
1714
+
1715
+
1716
+ <ul>
1717
+ <li><strong>Property</strong> suggests a VPI property that should be accessed. The &#8220;vpi&#8221; prefix, which is common to all VPI properties, can be omitted if you wish. For example, the VPI property &#8220;vpiFullName&#8221; is considered equivalent to &#8220;fullName&#8221; and &#8220;FullName&#8221;, but not equivalent to &#8220;full_name&#8221;.</li>
1718
+ </ul>
1719
+
1720
+
1721
+ <ul>
1722
+ <li><strong>Accessor</strong> suggests a VPI function that should be used in order to access the VPI property. When this parameter is not specified, Ruby-VPI will attempt to <em>guess</em> the value of this parameter.
1723
+
1724
+ <p><a class="xref" href="#tbl:accessors">Table 1: <em>Possible accessors and their implications</em></a> shows a list of valid accessors and how they influence the means by which a property is accessed.</p></li>
1725
+ </ul>
1726
+
1727
+
1728
+ <ul>
1729
+ <li>When <strong>Addendum</strong> is an equal sign (=), it suggests that the specified VPI property should be written to.
1730
+
1731
+ <p>When it is a question mark (?), it suggests that the specified VPI property should be accessed as a boolean value. This suggestion is the same as specifying &#8220;b&#8221; as the <strong>Accessor</strong>.</p></li>
1732
+ </ul></div>
1733
+ </div>
1734
+ <div class="table">
1735
+ <p class="title"><a class="toc" id="tbl:accessors" href="#a-606865648">Table 1</a>.&nbsp;&nbsp;Possible accessors and their implications</p>
1736
+ <div class="content"><table border="1">
1737
+ <tr>
1738
+ <th>Accessor </th>
1739
+ <th>Kind of value accessed </th>
1740
+ <th>VPI functions used to access the value </th>
1741
+ </tr>
1742
+ <tr>
1743
+ <td> d </td>
1744
+ <td> delay </td>
1745
+ <td> <code class="code">vpi_get_delays</code>, <code class="code">vpi_put_delays</code> </td>
1746
+ </tr>
1747
+ <tr>
1748
+ <td> l </td>
1749
+ <td> logic </td>
1750
+ <td> <code class="code">vpi_get_value</code>, <code class="code">vpi_put_value</code> </td>
1751
+ </tr>
1752
+ <tr>
1753
+ <td> i </td>
1754
+ <td> integer </td>
1755
+ <td> <code class="code">vpi_get</code> </td>
1756
+ </tr>
1757
+ <tr>
1758
+ <td> b </td>
1759
+ <td> boolean </td>
1760
+ <td> <code class="code">vpi_get</code> </td>
1761
+ </tr>
1762
+ <tr>
1763
+ <td> s </td>
1764
+ <td> string </td>
1765
+ <td> <code class="code">vpi_get_str</code> </td>
1766
+ </tr>
1767
+ <tr>
1768
+ <td> h </td>
1769
+ <td> handle </td>
1770
+ <td> <code class="code">vpi_handle</code> </td>
1771
+ </tr>
1772
+ <tr>
1773
+ <td> a </td>
1774
+ <td> array </td>
1775
+ <td> <code class="code">vpi_iterate</code> </td>
1776
+ </tr>
1777
+ </table></div>
1778
+ </div>
1779
+ <div class="table">
1780
+ <p class="title"><a class="toc" id="ex:properties" href="#a-606867538">Table 2</a>.&nbsp;&nbsp;Examples of accessing a handle&#8217;s properties</p>
1781
+ <div class="content"><table border="1">
1782
+ <tr>
1783
+ <th rowspan="2">Ruby expression </th>
1784
+ <th colspan="6">Method naming format </th>
1785
+ <th rowspan="2">Description </th>
1786
+ </tr>
1787
+ <tr>
1788
+ <th>Operation </th>
1789
+ <th>_ </th>
1790
+ <th>Property </th>
1791
+ <th>_ </th>
1792
+ <th>Accessor </th>
1793
+ <th>Addendum </th>
1794
+ </tr>
1795
+ <tr>
1796
+ <td> <code class="code">handle.vpiIntVal</code> </td>
1797
+ <td> &nbsp; </td>
1798
+ <td> &nbsp; </td>
1799
+ <td> vpiIntVal </td>
1800
+ <td> &nbsp; </td>
1801
+ <td> &nbsp; </td>
1802
+ <td> &nbsp; </td>
1803
+ <td rowspan="4">Obtain the <em>logic value</em> of the handle&#8217;s <code class="code"><span style="color:#036; font-weight:bold">VpiIntVal</span></code> property. </td>
1804
+ </tr>
1805
+ <tr>
1806
+ <td> <code class="code">handle.vpiIntVal_l</code> </td>
1807
+ <td> &nbsp; </td>
1808
+ <td> &nbsp; </td>
1809
+ <td> vpiIntVal </td>
1810
+ <td> _ </td>
1811
+ <td> l </td>
1812
+ <td> &nbsp; </td>
1813
+ </tr>
1814
+ <tr>
1815
+ <td> <code class="code">handle.intVal</code> </td>
1816
+ <td> &nbsp; </td>
1817
+ <td> &nbsp; </td>
1818
+ <td> intVal </td>
1819
+ <td> &nbsp; </td>
1820
+ <td> &nbsp; </td>
1821
+ <td> &nbsp; </td>
1822
+ </tr>
1823
+ <tr>
1824
+ <td> <code class="code">handle.intVal_l</code> </td>
1825
+ <td> &nbsp; </td>
1826
+ <td> &nbsp; </td>
1827
+ <td> intVal </td>
1828
+ <td> _ </td>
1829
+ <td> l </td>
1830
+ <td> &nbsp; </td>
1831
+ </tr>
1832
+ <tr>
1833
+ <td> <code class="code">handle.vpiIntVal = <span style="color:#00D; font-weight:bold">15</span></code> </td>
1834
+ <td> &nbsp; </td>
1835
+ <td> &nbsp; </td>
1836
+ <td> vpiIntVal </td>
1837
+ <td> &nbsp; </td>
1838
+ <td> &nbsp; </td>
1839
+ <td> = </td>
1840
+ <td rowspan="4">Assign the integer 15 to the <em>logic value</em> of the handle&#8217;s <code class="code"><span style="color:#036; font-weight:bold">VpiIntVal</span></code> property. </td>
1841
+ </tr>
1842
+ <tr>
1843
+ <td> <code class="code">handle.vpiIntVal_l = <span style="color:#00D; font-weight:bold">15</span></code> </td>
1844
+ <td> &nbsp; </td>
1845
+ <td> &nbsp; </td>
1846
+ <td> vpiIntVal </td>
1847
+ <td> _ </td>
1848
+ <td> l </td>
1849
+ <td> = </td>
1850
+ </tr>
1851
+ <tr>
1852
+ <td> <code class="code">handle.intVal = <span style="color:#00D; font-weight:bold">15</span></code> </td>
1853
+ <td> &nbsp; </td>
1854
+ <td> &nbsp; </td>
1855
+ <td> intVal </td>
1856
+ <td> &nbsp; </td>
1857
+ <td> &nbsp; </td>
1858
+ <td> = </td>
1859
+ </tr>
1860
+ <tr>
1861
+ <td> <code class="code">handle.intVal_l = <span style="color:#00D; font-weight:bold">15</span></code> </td>
1862
+ <td> &nbsp; </td>
1863
+ <td> &nbsp; </td>
1864
+ <td> intVal </td>
1865
+ <td> _ </td>
1866
+ <td> l </td>
1867
+ <td> = </td>
1868
+ </tr>
1869
+ <tr>
1870
+ <td> <code class="code">handle.vpiType</code> </td>
1871
+ <td> &nbsp; </td>
1872
+ <td> &nbsp; </td>
1873
+ <td> vpiType </td>
1874
+ <td> &nbsp; </td>
1875
+ <td> &nbsp; </td>
1876
+ <td> &nbsp; </td>
1877
+ <td rowspan="4">Obtain the <em>integer value</em> of the handle&#8217;s <code class="code"><span style="color:#036; font-weight:bold">VpiType</span></code> property. </td>
1878
+ </tr>
1879
+ <tr>
1880
+ <td> <code class="code">handle.vpiType_i</code> </td>
1881
+ <td> &nbsp; </td>
1882
+ <td> &nbsp; </td>
1883
+ <td> vpiType </td>
1884
+ <td> _ </td>
1885
+ <td> i </td>
1886
+ <td> &nbsp; </td>
1887
+ </tr>
1888
+ <tr>
1889
+ <td> <code class="code">handle.type</code> </td>
1890
+ <td> &nbsp; </td>
1891
+ <td> &nbsp; </td>
1892
+ <td> type </td>
1893
+ <td> &nbsp; </td>
1894
+ <td> &nbsp; </td>
1895
+ <td> &nbsp; </td>
1896
+ </tr>
1897
+ <tr>
1898
+ <td> <code class="code">handle.type_i</code> </td>
1899
+ <td> &nbsp; </td>
1900
+ <td> &nbsp; </td>
1901
+ <td> type </td>
1902
+ <td> _ </td>
1903
+ <td> i </td>
1904
+ <td> &nbsp; </td>
1905
+ </tr>
1906
+ <tr>
1907
+ <td> <code class="code">handle.vpiProtected</code> </td>
1908
+ <td> &nbsp; </td>
1909
+ <td> &nbsp; </td>
1910
+ <td> vpiProtected </td>
1911
+ <td> &nbsp; </td>
1912
+ <td> &nbsp; </td>
1913
+ <td> &nbsp; </td>
1914
+ <td rowspan="6">Obtain the <em>boolean value</em> of the handle&#8217;s <code class="code"><span style="color:#036; font-weight:bold">VpiProtected</span></code> property. </td>
1915
+ </tr>
1916
+ <tr>
1917
+ <td> <code class="code">handle.vpiProtected_b</code> </td>
1918
+ <td> &nbsp; </td>
1919
+ <td> &nbsp; </td>
1920
+ <td> vpiProtected </td>
1921
+ <td> _ </td>
1922
+ <td> b </td>
1923
+ <td> &nbsp; </td>
1924
+ </tr>
1925
+ <tr>
1926
+ <td> <code class="code">handle.vpiProtected?</code> </td>
1927
+ <td> &nbsp; </td>
1928
+ <td> &nbsp; </td>
1929
+ <td> vpiProtected </td>
1930
+ <td> &nbsp; </td>
1931
+ <td> &nbsp; </td>
1932
+ <td> ? </td>
1933
+ </tr>
1934
+ <tr>
1935
+ <td> <code class="code">handle.protected</code> </td>
1936
+ <td> &nbsp; </td>
1937
+ <td> &nbsp; </td>
1938
+ <td> protected </td>
1939
+ <td> &nbsp; </td>
1940
+ <td> &nbsp; </td>
1941
+ <td> &nbsp; </td>
1942
+ </tr>
1943
+ <tr>
1944
+ <td> <code class="code">handle.protected_b</code> </td>
1945
+ <td> &nbsp; </td>
1946
+ <td> &nbsp; </td>
1947
+ <td> protected </td>
1948
+ <td> _ </td>
1949
+ <td> b </td>
1950
+ <td> &nbsp; </td>
1951
+ </tr>
1952
+ <tr>
1953
+ <td> <code class="code">handle.protected?</code> </td>
1954
+ <td> &nbsp; </td>
1955
+ <td> &nbsp; </td>
1956
+ <td> protected </td>
1957
+ <td> &nbsp; </td>
1958
+ <td> &nbsp; </td>
1959
+ <td> ? </td>
1960
+ </tr>
1961
+ <tr>
1962
+ <td> <code class="code">handle.vpiFullName</code> </td>
1963
+ <td> &nbsp; </td>
1964
+ <td> &nbsp; </td>
1965
+ <td> vpiFullName </td>
1966
+ <td> &nbsp; </td>
1967
+ <td> &nbsp; </td>
1968
+ <td> &nbsp; </td>
1969
+ <td rowspan="4">Obtain the <em>string value</em> of the handle&#8217;s <code class="code"><span style="color:#036; font-weight:bold">VpiFullName</span></code> property. </td>
1970
+ </tr>
1971
+ <tr>
1972
+ <td> <code class="code">handle.vpiFullName_s</code> </td>
1973
+ <td> &nbsp; </td>
1974
+ <td> &nbsp; </td>
1975
+ <td> vpiFullName </td>
1976
+ <td> _ </td>
1977
+ <td> s </td>
1978
+ <td> &nbsp; </td>
1979
+ </tr>
1980
+ <tr>
1981
+ <td> <code class="code">handle.fullName</code> </td>
1982
+ <td> &nbsp; </td>
1983
+ <td> &nbsp; </td>
1984
+ <td> fullName </td>
1985
+ <td> &nbsp; </td>
1986
+ <td> &nbsp; </td>
1987
+ <td> &nbsp; </td>
1988
+ </tr>
1989
+ <tr>
1990
+ <td> <code class="code">handle.fullName_s</code> </td>
1991
+ <td> &nbsp; </td>
1992
+ <td> &nbsp; </td>
1993
+ <td> fullName </td>
1994
+ <td> _ </td>
1995
+ <td> s </td>
1996
+ <td> &nbsp; </td>
1997
+ </tr>
1998
+ <tr>
1999
+ <td> <code class="code">handle.vpiParent</code> </td>
2000
+ <td> &nbsp; </td>
2001
+ <td> &nbsp; </td>
2002
+ <td> vpiParent </td>
2003
+ <td> &nbsp; </td>
2004
+ <td> &nbsp; </td>
2005
+ <td> &nbsp; </td>
2006
+ <td rowspan="4">Obtain the <em>handle value</em> of the handle&#8217;s <code class="code"><span style="color:#036; font-weight:bold">VpiParent</span></code> property. </td>
2007
+ </tr>
2008
+ <tr>
2009
+ <td> <code class="code">handle.vpiParent_h</code> </td>
2010
+ <td> &nbsp; </td>
2011
+ <td> &nbsp; </td>
2012
+ <td> vpiParent </td>
2013
+ <td> _ </td>
2014
+ <td> h </td>
2015
+ <td> &nbsp; </td>
2016
+ </tr>
2017
+ <tr>
2018
+ <td> <code class="code">handle.parent</code> </td>
2019
+ <td> &nbsp; </td>
2020
+ <td> &nbsp; </td>
2021
+ <td> parent </td>
2022
+ <td> &nbsp; </td>
2023
+ <td> &nbsp; </td>
2024
+ <td> &nbsp; </td>
2025
+ </tr>
2026
+ <tr>
2027
+ <td> <code class="code">handle.parent_h</code> </td>
2028
+ <td> &nbsp; </td>
2029
+ <td> &nbsp; </td>
2030
+ <td> parent </td>
2031
+ <td> _ </td>
2032
+ <td> h </td>
2033
+ <td> &nbsp; </td>
2034
+ </tr>
2035
+ <tr>
2036
+ <td> <code class="code">handle.each_vpiNet {|net| puts net.fullName}</code> </td>
2037
+ <td> each </td>
2038
+ <td> _ </td>
2039
+ <td> vpiNet </td>
2040
+ <td> &nbsp; </td>
2041
+ <td> &nbsp; </td>
2042
+ <td> &nbsp; </td>
2043
+ <td rowspan="2">Use the <code class="code">each</code> operation to print the full name of each <code class="code"><span style="color:#036; font-weight:bold">VpiNet</span></code> object associated with the handle. </td>
2044
+ </tr>
2045
+ <tr>
2046
+ <td> <code class="code">handle.each_net {|net| puts net.fullName}</code> </td>
2047
+ <td> each </td>
2048
+ <td> _ </td>
2049
+ <td> net </td>
2050
+ <td> &nbsp; </td>
2051
+ <td> &nbsp; </td>
2052
+ <td> &nbsp; </td>
2053
+ </tr>
2054
+ <tr>
2055
+ <td> <code class="code">handle.all_vpiReg? {|reg| reg.size == <span style="color:#00D; font-weight:bold">1</span>}</code> </td>
2056
+ <td> all? </td>
2057
+ <td> _ </td>
2058
+ <td> vpiReg </td>
2059
+ <td> &nbsp; </td>
2060
+ <td> &nbsp; </td>
2061
+ <td> &nbsp; </td>
2062
+ <td rowspan="2">Use the <code class="code">all?</code> operation to check whether all <code class="code"><span style="color:#036; font-weight:bold">VpiReg</span></code> objects associated with the handle are capable of storing only one bit of information. </td>
2063
+ </tr>
2064
+ <tr>
2065
+ <td> <code class="code">handle.all_reg? {|reg| reg.size == <span style="color:#00D; font-weight:bold">1</span>}</code> </td>
2066
+ <td> all? </td>
2067
+ <td> _ </td>
2068
+ <td> reg </td>
2069
+ <td> &nbsp; </td>
2070
+ <td> &nbsp; </td>
2071
+ <td> &nbsp; </td>
2072
+ </tr>
2073
+ <tr>
2074
+ <td> <code class="code">handle.select_vpiNet {|net| net.x?}</code> </td>
2075
+ <td> select </td>
2076
+ <td> _ </td>
2077
+ <td> VpiNet </td>
2078
+ <td> &nbsp; </td>
2079
+ <td> &nbsp; </td>
2080
+ <td> &nbsp; </td>
2081
+ <td rowspan="2">Use the <code class="code">select</code> operation to obtain a list of <code class="code"><span style="color:#036; font-weight:bold">VpiNet</span></code> objects whose <em>logic value</em> is unknown (x).</td>
2082
+ </tr>
2083
+ <tr>
2084
+ <td> <code class="code">handle.select_net {|net| net.x?}</code> </td>
2085
+ <td> select </td>
2086
+ <td> _ </td>
2087
+ <td> net </td>
2088
+ <td> &nbsp; </td>
2089
+ <td> &nbsp; </td>
2090
+ <td> &nbsp; </td>
2091
+ </tr>
2092
+ </table></div>
2093
+ </div></p></div>
2094
+ </div>
2095
+ <div class="section">
2096
+ <h3 class="title">
2097
+ <a class="toc" id="vpi.callbacks" href="#a-606870058">4.3.2</a>&nbsp;&nbsp;Callbacks
2098
+ </h3>
2099
+ <div class="content"><p>A <em>callback</em> is a mechanism that makes the Verilog simuluator execute a block of code (known as a &#8220;callback handler&#8221;) when some prescribed event occurs in the simulation.</p>
2100
+
2101
+
2102
+ <p>Callbacks are added using the <code class="code">vpi_register_cb</code> function and removed using the <code class="code">vpi_remove_cb</code> function. However, instead of storing the address of a C function in the <code class="code">cb_rtn</code> field of the <code class="code">s_cb_data</code> structure (as you would do in C) you pass a block of code to the <code class="code">vpi_register_cb</code> method in Ruby. This block will be executed whenever the callback occurs.</p>
2103
+
2104
+
2105
+ <p><div class="example">
2106
+ <p class="title"><a class="toc" id="ex:callback" href="#a-606871738">Example 1</a>.&nbsp;&nbsp;Using a callback for value change notification</p>
2107
+ <div class="content"><p>This example shows how to use a callback for notification of changes in a handle&#8217;s <code class="code"><span style="color:#036; font-weight:bold">VpiIntVal</span></code> property. When you no longer need this callback, you can tear it down using <code class="code">vpi_remove_cb</code>.</p>
2108
+
2109
+
2110
+ <p>In this example, the handle being monitored is the <code class="code"><span style="color:#036; font-weight:bold">Counter</span>.count</code> signal from <a class="xref" href="#fig:counter.v_decl">Example 5: <em>Declaration of a simple up-counter with synchronous reset</em></a>.</p>
2111
+
2112
+
2113
+ <pre class="code">
2114
+ time = <span style="color:#036; font-weight:bold">S_vpi_time</span>.new
2115
+ time.type = <span style="color:#036; font-weight:bold">VpiSimTime</span>
2116
+ time.low = <span style="color:#00D; font-weight:bold">0</span>
2117
+ time.high = <span style="color:#00D; font-weight:bold">0</span>
2118
+
2119
+ value = <span style="color:#036; font-weight:bold">S_vpi_value</span>.new
2120
+ value.format = <span style="color:#036; font-weight:bold">VpiIntVal</span>
2121
+
2122
+ alarm = <span style="color:#036; font-weight:bold">S_cb_data</span>.new
2123
+ alarm.reason = <span style="color:#036; font-weight:bold">CbValueChange</span>
2124
+ alarm.obj = <span style="color:#036; font-weight:bold">Counter</span>.count
2125
+ alarm.time = time
2126
+ alarm.value = value
2127
+ alarm.index = <span style="color:#00D; font-weight:bold">0</span>
2128
+
2129
+ vpi_register_cb( alarm ) <span style="color:#080; font-weight:bold">do</span> |info|
2130
+ time = info.time.integer
2131
+ count = info.value.value.integer
2132
+ puts <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">hello from callback! time=</span><span style="background: #eee"><span style="font-weight: bold; color: #888">#{</span>time<span style="font-weight: bold; color: #888">}</span></span><span style="color:#D20"> count=</span><span style="background: #eee"><span style="font-weight: bold; color: #888">#{</span>count<span style="font-weight: bold; color: #888">}</span></span><span style="color:#710">&quot;</span></span>
2133
+ <span style="color:#080; font-weight:bold">end</span>
2134
+ </pre>
2135
+
2136
+
2137
+ <p>Append this code to the <tt>RSpec/counter_spec.rb</tt> file (provided in <a class="xref" href="#usage.examples">Section 4.9.8: <em>More examples</em></a> and discussed in <a class="xref" href="#usage.tutorial.specification">Section 4.9.3: <em>Specify your expectations</em></a>) and run the <a class="xref" href="#usage.tutorial">counter_RSpec test</a></p></div>
2138
+ </div></p></div>
2139
+ </div></p></div>
2140
+ </div>
2141
+ <div class="section">
2142
+ <h2 class="title">
2143
+ <a class="toc" id="usage.concurrency" href="#a-606880188">4.4</a>&nbsp;&nbsp;Concurrency
2144
+ </h2>
2145
+ <div class="content"><p>Ruby-VPI provides a concurrency model that allows you to run blocks of code in parallel. These blocks of code are known as <em>concurrent processes</em> and they are equivalent to the &#8220;initial&#8221;, &#8220;always&#8221; and &#8220;forever&#8221; blocks in Verilog.</p>
2146
+
2147
+
2148
+ <p>Ruby-VPI&#8217;s concurrency model imposes two important constraints, which are inspired by <a href="http://en.wikipedia.org/wiki/GPGPU">GPGPU and fragment/vertex shader programming</a>, in order to avoid race conditions and to make parallel programming simpler.</p>
2149
+
2150
+
2151
+ <p>First, <strong>all processes execute in the <em>same</em> time step</strong>. That is, we only advance the <em>entire</em> simulation to the next time step when <em>all</em> processes are finished with the current time step. In this manner, we avoid race conditions where a process advances the entire simulation to a future time step but the other processes still think they are executing in the original time step (because they were not notified of the advancement).</p>
2152
+
2153
+
2154
+ <p>Second, <strong>all processes see the <em>same</em> input</strong> (the state of the simulation database at the start of the current time step) while executing in a time step. That is, when a process modifies the simulation database, say, by changing the logic value of a register, the modification only takes effect at the <em>end</em> of the current time step. In this manner, we avoid race conditions where one process modifies the simulation midflight but some/all of other processes are unaware of that modification (because they were not notified of its occurence).</p>
2155
+
2156
+
2157
+ <p>Note that these constraints are automatically enforced &#8220;under the hood&#8221;, so to speak, by Ruby-VPI. As a user, you need not do anything extra to implement or support these constraints; they are already taken care of.</p>
2158
+
2159
+
2160
+ <p><div class="caution">
2161
+ <p class="title"><a class="toc" id="Assignments-inside-processes-are-non-blocking" href="#a-606881928">Caution 1</a>.&nbsp;&nbsp;Assignments inside processes are non-blocking</p>
2162
+
2163
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgI
2164
+ fAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3
2165
+ Lmlua3NjYXBlLm9yZ5vuPBoAAAiESURBVGiB7ZpdbBzVFcd/Z2Znd2d3vbtm
2166
+ /RWvsbEdfyauSWzq2MZWEFVD5AqBaBpRVyaKoaakEBMEBRRVBaukKiqhQF+i
2167
+ ioRU9MVUah+ChCIeEiXEIcRECShxxJflOqmxk8gmXq/Xu3v7sB84ju049oYU
2168
+ qUe6ujM7d+75/e+ZO/fMzIpSiu+zaTcbYKn2fwE32773Aiw3pFcR2QsvCWxS
2169
+ YAj8yw6/2qBUKNWuboiAv8FffIWFm8qam03Rdb744IOf/+fMmWzgJ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Oa5owAPP++7GUlQEQPH0an98vhtNZtVvkRzdcgAX+tHzNGluor4/I6CgA
2187
+ 9i1b0EwzCQ/gdDqvEJAwEQFNw/XMMwCoUIjJs2cprqx0WhYRhesSsFfkB4bL
2188
+ 9eOcykp9/MiRWAe33oo9nipMH+WZEUgcTxT7unUYq1YBsRTD4/Nher35u0V+
2189
+ esMEaPDnkvp6M3jyJNFAAABz61awWK5auKaPelpaWhJ8ulD3888DoCIRgmfO
2190
+ UFRe7tDh1etJtxcs4C2RRtstt/wwo7hYxo8dA0AvKcF2331XwcOVl830OTC9
2191
+ tjY0YGtqAiDU34/L4cDt86XfBptTLkDgjdL6esfE8eOoyUkAzG3bEF2/Cn62
2192
+ CMw8nqjdzz0Xa6QUwdOnKSwtdQjs6BYxUyZgr8h6Z1ZWiTc3l8DHHwNgqarC
2193
+ ds89SZCZcNPngNPpnBUewLpqFWZLCwBT589jF+GW7GwzCFtTIyDm6fWyxkbn
2194
+ +NGjqHAYAMfTT18BMhNuoREQEdzPPgvxSAb7+sgvLjaVyPY9It4lC9gDG715
2195
+ eTkur5eJTz4BwKirw2hqmhMeoKioiPb2dtrb2yksLJwTHsBaWopzwwYAwhcu
2196
+ YASDZC1bZtFh+7X45k0lXhCxFMLAHRs35kRPnEjm+57ubow77pgTPlEPDAwA
2197
+ UFBQMCd8oo4MDnJ+zRpUKITudmOsXMnxnp6gFo0W/UKp83MxzhuBfHgko7jY
2198
+ bTcMgmfPAmC9664Fwb/88ss0NDTQ2NjIzp0754UXESx5ebja2mJixsaQ0VFy
2199
+ /X49CjvmY5wzAt0iZlBksK61NT10+DCTX34JInj37cNSWTkvvIhQU1PD0NAQ
2200
+ ADk5OfT29s4Jn6gjIyMM1tSgAgE008RaXU3vsWPBUCRS1a7UZ7NxzhmBCXgy
2201
+ p7zctExOxuABW0vLguABamtrk31VV1dfEx7AkpmJ59FHgViip0ZGyPP7DSu8
2202
+ MhfnrBHYJeIxNe3f9W1trsD+/UwNDoKuk75/P3pR0TVBRIQLFy7w9ttvA9Da
2203
+ 2kpWVtY1zxERomNjDKxeTfTSJcRqxVZdzYkTJ4KRqamGNqU+nsk6awTssD2v
2204
+ qsqQixdj8ID9gQcWDA+QkZFBZ2cnnZ2dC4YH0D0evFtjS4AKhYgODZHv99u0
2205
+ ORK9qwT8VSRbdP2xgtpa2+V4wiZWK47OzgXBTy8LETpbW29HB3p2NhB7i+FL
2206
+ TxfdZlu9R2TtvAJExKrgd/kVFUZ0aIjw8HBsVMrKkg/q1wOyWKFit2PW1QGx
2207
+ RC88NMStOTmmBn+U6YsP0z5wiIgdcBmwLnvlSmPi0KFko/CpUwwXFc0U/51Z
2208
+ +Ouv8a5Ygervr/aCR0RGVXzyagAiogN2wBGFaGRyEt3nQwzjpkEnTdPQnE7C
2209
+ U1MAwakYZzLRS0RAj29bzsE/+w4f/nVlc7PNV1MDmhZ7WasURKOoaDS5jVKx
2210
+ /dm2E22i0W+3Z2s/89gsfoKTk3zR3z9xEf4xHmNNpsCilEJiDxBuIA1I+z08
2211
+ lQP3aeBFBNHmWbBT/aV/Wn8qvh+F0Uuw73noCsEocEkpFUwKABARJ+CKFwex
2212
+ MFmBqURf37Fpcf9hIAgEgHFgDBhLzIHkJFZKjYuIAiJACJiIH79ZAhKXdSTO
2213
+ ECQGPj690VUrcfw2ZYuXhICbYRZiUUhEYFLNkjYs6s3c/5J97/9q8F/RUcwR
2214
+ 4xicOQAAAABJRU5ErkJggg==
2215
+ " alt="caution" class="icon"/>
2216
+
2217
+ <div class="content">As a result of the constraints described above, all assignments inside processes are treated like Verilog&#8217;s non-blocking assignments. Think about it: blocking assignments allow a process to make changes to simulation values (possibly) before other processes read those values. Since the second constraint makes all processes see the same input while they are executing, it is impossible to support blocking assignments inside processes.</div>
2218
+ </div>
2219
+ <div class="section">
2220
+ <h3 class="title">
2221
+ <a class="toc" id="Creating-a-concurrent-process" href="#a-606883708">4.4.1</a>&nbsp;&nbsp;Creating a concurrent process
2222
+ </h3>
2223
+ <div class="content"><p>You can create a concurrent proceess by passing a block of code to the <code class="code">process</code> method. Once the process finishes executing this block of code, it will disappear automatically. This behavior mimics the &#8220;initial&#8221; blocks of the Verilog language.</p>
2224
+
2225
+
2226
+ <p>You can create concurrent processes that <em>loop forever</em> by passing a block of code to the <code class="code">always</code> and <code class="code">forever</code> methods, which mimic the &#8220;always&#8221; and &#8220;forever&#8221; blocks, respectively, of the Verilog language.</p>
2227
+
2228
+
2229
+ <p><div class="example">
2230
+ <p class="title"><a class="toc" id="An-edge-triggered-always-block" href="#a-606885348">Example 2</a>.&nbsp;&nbsp;An edge-triggered &#8220;always&#8221; block</p>
2231
+ <div class="content"><p>Suppose you have the following Verilog code:</p>
2232
+
2233
+
2234
+ <pre class="code" lang="verilog">
2235
+ always @(posedge clock1 and negedge clock2) begin
2236
+ foo &lt;= foo + 1;
2237
+ bar = bar + 5;
2238
+ end
2239
+ </pre>
2240
+
2241
+
2242
+ <p>In Ruby-VPI, this code would be written as:</p>
2243
+
2244
+
2245
+ <pre class="code">
2246
+ always <span style="color:#080; font-weight:bold">do</span>
2247
+ wait <span style="color:#080; font-weight:bold">until</span> clock.posedge? <span style="color:#080; font-weight:bold">and</span> clock2.negedge?
2248
+
2249
+ foo.intVal += <span style="color:#00D; font-weight:bold">1</span>
2250
+ bar.intVal += <span style="color:#00D; font-weight:bold">5</span> <span style="color:#888"># this is a NON-blocking assignment!</span>
2251
+ <span style="color:#080; font-weight:bold">end</span>
2252
+ </pre></div>
2253
+ </div>
2254
+ <div class="example">
2255
+ <p class="title"><a class="toc" id="A-change-triggered-combinational-always-block" href="#a-606887298">Example 3</a>.&nbsp;&nbsp;A change-triggered (combinational) &#8220;always&#8221; block</p>
2256
+ <div class="content"><p>Suppose you have the following Verilog code:</p>
2257
+
2258
+
2259
+ <pre class="code" lang="verilog">
2260
+ always @(apple, banana, cherry, date) begin
2261
+ $display(&quot;Yum! Fruits are good for health!&quot;);
2262
+ end
2263
+ </pre>
2264
+
2265
+
2266
+ <p>In Ruby-VPI, this code would be written as:</p>
2267
+
2268
+
2269
+ <pre class="code">
2270
+ always <span style="color:#080; font-weight:bold">do</span>
2271
+ wait <span style="color:#080; font-weight:bold">until</span> apple.change? <span style="color:#080; font-weight:bold">or</span> banana.change? <span style="color:#080; font-weight:bold">or</span> cherry.change? <span style="color:#080; font-weight:bold">or</span> date.change?
2272
+ puts <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Yum! Fruits are good for health!</span><span style="color:#710">&quot;</span></span>
2273
+ <span style="color:#080; font-weight:bold">end</span>
2274
+ </pre>
2275
+
2276
+
2277
+ <p>Or, if you are lazy like I am, you can express the sensitivity list programatically:</p>
2278
+
2279
+
2280
+ <pre class="code">
2281
+ always <span style="color:#080; font-weight:bold">do</span>
2282
+ wait <span style="color:#080; font-weight:bold">until</span> [apple, banana, cherry, date].any? {|x| x.change?}
2283
+ puts <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">Yum! Fruits are good for health!</span><span style="color:#710">&quot;</span></span>
2284
+ <span style="color:#080; font-weight:bold">end</span>
2285
+ </pre></div>
2286
+ </div></p></div>
2287
+ </div></p></div>
2288
+ </div>
2289
+ <div class="section">
2290
+ <h2 class="title">
2291
+ <a class="toc" id="usage.prototyping" href="#a-606890138">4.5</a>&nbsp;&nbsp;Prototyping
2292
+ </h2>
2293
+ <div class="content"><p>Ruby-VPI enables you to rapidly prototype your designs in Ruby without having to do full-scale implementations in Verilog. This lets you explore and evaluate different design choices quickly.</p>
2294
+
2295
+
2296
+ <p>The prototyping process is completely transparent: there is absolutely no difference, in the eyes of your executable specification, between a real Verilog design or its Ruby prototype. In addition, the prototyping process is completely standard-based: Ruby prototypes emulate the behavior of real Verilog designs using <em>nothing more</em> than the VPI itself.</p>
2297
+
2298
+
2299
+ <p>For example, compare the Verilog design shown in <a class="xref" href="#fig:counter.v_impl">Example 13: <em>Implementation of a simple up-counter with synchronous reset</em></a> with its Ruby prototype shown in figure <a class="xref" href="#fig:counter_proto.rb">Example 10: <em>Ruby prototype of our Verilog design</em></a>. The prototype uses only VPI to (1) detect changes in its inputs and (2) manipulate its outputs accordingly. In addition, notice how well the prototype&#8217;s syntax reflects the intended behavior of the Verilog design. This similarity facilitates rapid translation of a prototype from Ruby into Verilog later in the design process.</p>
2300
+
2301
+
2302
+ <p><div class="section">
2303
+ <h3 class="title">
2304
+ <a class="toc" id="Creating-a-prototype" href="#a-606894508">4.5.1</a>&nbsp;&nbsp;Creating a prototype
2305
+ </h3>
2306
+ <div class="content"><ol>
2307
+ <li>Start with a <a class="xref" href="#usage.tutorial.declare-design">Verilog module declaration</a> for your design.</li>
2308
+ <li><a class="xref" href="#usage.tutorial.generate-test">Generate a test</a> using that module declaration.</li>
2309
+ <li><a class="xref" href="#usage.tutorial.implement-proto">Implement the prototype</a> in the generated <tt>proto.rb</tt> file.</li>
2310
+ <li><a class="xref" href="#usage.tutorial.test-proto">Verify the prototype</a> against its specification.</li>
2311
+ </ol>
2312
+
2313
+
2314
+ <p>Once you are satisfied with your prototype, you can proceed to <a class="xref" href="#usage.tutorial.implement-design">implement your design in Verilog</a>. This process is often a simple translation your Ruby prototype into your Verilog. At the very least, your prototype serves as a reference while you are implementing your Verilog design.</p>
2315
+
2316
+
2317
+ <p>Once your design has been implemented in Verilog, you can use the <em>same</em> specification, which was originally used to verify your prototype, to verify your Verilog design (see <a class="xref" href="#usage.runner">Section 4.7: <em>Test runner</em></a> for details).</p></div>
2318
+ </div></p></div>
2319
+ </div>
2320
+ <div class="section">
2321
+ <h2 class="title">
2322
+ <a class="toc" id="usage.debugger" href="#a-606905198">4.6</a>&nbsp;&nbsp;Interactive debugging
2323
+ </h2>
2324
+ <div class="content"><p>The <a href="http://www.datanoise.com/articles/category/ruby-debug">ruby-debug project</a> serves as the interactive debugger for Ruby-VPI.</p>
2325
+
2326
+
2327
+ <ol>
2328
+ <li>Enable the debugger by activating the <code class="code"><span style="color:#036; font-weight:bold">DEBUGGER</span></code> environment variable (see <a class="xref" href="#usage.runner">Section 4.7: <em>Test runner</em></a> for details).</li>
2329
+ <li>Put the <code class="code">debugger</code> command in your code&#8212;anywhere you wish to activate an interactive debugging session. These commands are automatically ignored when the debugger is disabled; so you can safely leave them in your code, if you wish.</li>
2330
+ </ol>
2331
+
2332
+
2333
+ <p><div class="section">
2334
+ <h3 class="title">
2335
+ <a class="toc" id="usage.debugger.init" href="#a-606908278">4.6.1</a>&nbsp;&nbsp;Advanced initialization
2336
+ </h3>
2337
+ <div class="content">By default, Ruby-VPI enables the debugger by invoking the <code class="code"><span style="color:#036; font-weight:bold">Debugger</span>.start</code> method. If you wish to perform more advanced initialization, such as having the debugger accept remote network connections for interfacing with a remote debugging session or perhaps with an IDE (see <a href="http://www.datanoise.com/articles/category/ruby-debug">the ruby-debug documentation</a> for details), then:
2338
+
2339
+
2340
+ <ol>
2341
+ <li>Deactivate the <code class="code"><span style="color:#036; font-weight:bold">DEBUG</span></code> environment variable.</li>
2342
+ <li>Put your own code, which initializes the debugger, at the top of your test&#8217;s <tt>spec.rb</tt> file.</li>
2343
+ </ol></div>
2344
+ </div></p></div>
2345
+ </div>
2346
+ <div class="section">
2347
+ <h2 class="title">
2348
+ <a class="toc" id="usage.runner" href="#a-606910748">4.7</a>&nbsp;&nbsp;Test runner
2349
+ </h2>
2350
+ <div class="content"><p>A test runner is a file, generated by the <a class="xref" href="#usage.tools.generate">automated test generator</a> whose name ends with <tt>.rake</tt>. It helps you run generated tests&#8212;you can think of it as a <em>makefile</em> if you are familiar with C programming in a UNIX environment.</p>
2351
+
2352
+
2353
+ <p>When you invoke a test runner without any arguments, it will show you a list of available tasks:
2354
+ <pre>% rake -f your_test_runner.rake
2355
+
2356
+ (in /home/sun/src/ruby-vpi)
2357
+ rake clean # Remove any temporary products.
2358
+ rake clobber # Remove any generated file.
2359
+ rake cver # Simulate with GPL Cver.
2360
+ rake default # Show a list of available tasks.
2361
+ rake ivl # Simulate with Icarus Verilog.
2362
+ rake ncsim # Simulate with Cadence NC-Sim.
2363
+ rake setup # User-defined task that is invoked before the simulator runs.
2364
+ rake vcs # Simulate with Synopsys VCS.
2365
+ rake vsim # Simulate with Mentor Modelsim.
2366
+ </pre></p>
2367
+
2368
+
2369
+ <p><div class="section">
2370
+ <h3 class="title">
2371
+ <a class="toc" id="usage.runner.env-vars" href="#a-606913938">4.7.1</a>&nbsp;&nbsp;Environment variables
2372
+ </h3>
2373
+ <div class="content"><p>Test runners support the following <em>environment</em> variables, which allow you to easily change the behavior of the test runner.</p>
2374
+
2375
+
2376
+ <ul>
2377
+ <li><code class="code"><span style="color:#036; font-weight:bold">PROTOTYPE</span></code> enables the Ruby prototype for the design under test so that the prototype, rather than the real Verilog design, is verified by the specification.</li>
2378
+ <li><code class="code"><span style="color:#036; font-weight:bold">COVERAGE</span></code> enables code coverage analysis and generation of code coverage reports.</li>
2379
+ <li><code class="code"><span style="color:#036; font-weight:bold">PROFILER</span></code> enables the <a href="http://ruby-prof.rubyforge.org">ruby-prof</a> Ruby code profiler, which collects statistics on the runtime usage of the source code. This data allows you to identify performance bottlenecks.</li>
2380
+ <li><code class="code"><span style="color:#036; font-weight:bold">DEBUGGER</span></code> enables the <a class="xref" href="#usage.debugger">interactive debugger</a> in its <a href="http://www.datanoise.com/articles/2006/12/20/post-mortem-debugging">post-mortem debugging mode</a>.</li>
2381
+ </ul>
2382
+
2383
+
2384
+ <p>To activate these variables, simply assign the number 1 to them. For example, <code class="code"><span style="color:#036; font-weight:bold">DEBUGGER</span>=<span style="color:#00D; font-weight:bold">1</span></code> activates the <code class="code"><span style="color:#036; font-weight:bold">DEBUGGER</span></code> variable.</p>
2385
+
2386
+
2387
+ <p>To deactivate these variables, simply assign a different value to them or <strong>unset</strong> them in your shell. For example, both <code class="code"><span style="color:#036; font-weight:bold">DEBUGGER</span>=<span style="color:#00D; font-weight:bold">0</span></code> and <code class="code"><span style="color:#036; font-weight:bold">DEBUGGER</span>=</code> dectivate the <code class="code"><span style="color:#036; font-weight:bold">DEBUGGER</span></code> variable.</p>
2388
+
2389
+
2390
+ <p><div class="section">
2391
+ <h4 class="title">
2392
+ <a class="toc" id="Variables-as-command-line-arguments" href="#a-606917008">4.7.1.1</a>&nbsp;&nbsp;Variables as command-line arguments
2393
+ </h4>
2394
+ <div class="content">You can specify variable assignments as arguments to the <strong>rake</strong> command. For example, <pre>rake DEBUGGER=1</pre> is equivalent to
2395
+ <pre>
2396
+ DEBUGGER=1
2397
+ export DEBUGGER
2398
+ rake
2399
+ </pre> in Bourne shell or
2400
+ <pre>
2401
+ setenv DEBUGGER 1
2402
+ rake
2403
+ </pre> in C shell.</div>
2404
+ </div></p>
2405
+
2406
+
2407
+ <p><div class="example">
2408
+ <p class="title"><a class="toc" id="Running-a-test-with-environment-variables" href="#a-606919158">Example 4</a>.&nbsp;&nbsp;Running a test with environment variables</p>
2409
+ <div class="content"><p>Below, we enable the prototype and code coverage analysis:
2410
+ <pre>rake -f your_test_runner.rake PROTOTYPE=1 COVERAGE=1</pre></p>
2411
+
2412
+
2413
+ <p>Below, we <em>disable</em> the prototype and enable the code coverage analysis. These invocations are equivalent if the <code class="code"><span style="color:#036; font-weight:bold">PROTOTYPE</span></code> environment variable is unset.
2414
+ <pre>rake -f your_test_runner.rake PROTOTYPE=0 COVERAGE=1</pre>
2415
+ <pre>rake -f your_test_runner.rake PROTOTYPE= COVERAGE=1</pre>
2416
+ <pre>rake -f your_test_runner.rake COVERAGE=1</pre></p></div>
2417
+ </div></p></div>
2418
+ </div></p></div>
2419
+ </div>
2420
+ <div class="section">
2421
+ <h2 class="title">
2422
+ <a class="toc" id="usage.tools" href="#a-606921818">4.8</a>&nbsp;&nbsp;Tools
2423
+ </h2>
2424
+ <div class="content"><p>The <strong>ruby-vpi</strong> command serves as a front-end to the tools provided by Ruby-VPI. You can see its help information (reproduced below) by simply running the command without any arguments.</p>
2425
+
2426
+
2427
+ <pre>This is a front-end for tools provided by Ruby-VPI.
2428
+
2429
+ Usage:
2430
+ ruby-vpi Show this help message
2431
+ ruby-vpi -v Show version information
2432
+ ruby-vpi TOOL --help Show help message for TOOL
2433
+ ruby-vpi TOOL arguments... Run TOOL with some arguments
2434
+
2435
+ Tools:
2436
+ convert Converts Verilog `defines, constants, ranges, etc. into Ruby syntax.
2437
+ generate Generates test skeletons from Verilog 2001/1995 module declarations.
2438
+
2439
+ Simulators:
2440
+ cver GPL Cver
2441
+ ivl Icarus Verilog
2442
+ ncsim Cadence NC-Sim
2443
+ vcs Synopsys VCS
2444
+ vsim Mentor Modelsim
2445
+ </pre>
2446
+
2447
+
2448
+ <p><div class="section">
2449
+ <h3 class="title">
2450
+ <a class="toc" id="usage.tools.generate" href="#a-606923678">4.8.1</a>&nbsp;&nbsp;Automated test generation
2451
+ </h3>
2452
+ <div class="content"><p>The <strong>generate</strong> tool generates scaffolding for Ruby-VPI tests from Verilog module declarations (written in either Verilog 2001 or Verilog 95 style).</p>
2453
+
2454
+
2455
+ A Ruby-VPI test is composed of the following files:
2456
+ <ul>
2457
+ <li><tt>runner.rake</tt> runs the test by starting a Verilog simulator and loading Ruby-VPI into it.</li>
2458
+ <li><tt>spec.rb</tt> is the executable specification for the design under test.</li>
2459
+ <li><tt>design.rb</tt> is an optional file that provides convenience methods for controlling the design under test.</li>
2460
+ <li><tt>proto.rb</tt> is an optional file that defines a Ruby prototype of the design under test.</li>
2461
+ <li><tt>loader.rb</tt> is a user-defined Ruby script which loads the test (see <a class="xref" href="#usage.theory">Section 4.1: <em>Theory of operation</em></a>).</li>
2462
+ <li><tt>Rakefile</tt> is an optional file that recursively executes all <tt>runner.rake</tt> files found immediately within or beneath the current directory. It lets you simply run <pre>rake ...</pre> instead of having to write <pre>rake -f runner.rake ...</pre> every time.</li>
2463
+ </ul>
2464
+
2465
+
2466
+ <p>As <a class="xref" href="#fig:generate-test.RSpec">Example 6: <em>Generating a test with specification in RSpec format</em></a> shows, the name of each generated file is prefixed with the name of the Verilog module for which the test was generated. This convention helps organize tests within the file system, so that they are readily distinguishable from one another.</p>
2467
+
2468
+
2469
+ <p><div class="caution">
2470
+ <p class="title"><a class="toc" id="Do-not-rename-generated-files" href="#a-606928078">Caution 2</a>.&nbsp;&nbsp;Do not rename generated files</p>
2471
+
2472
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgI
2473
+ fAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3
2474
+ Lmlua3NjYXBlLm9yZ5vuPBoAAAiESURBVGiB7ZpdbBzVFcd/Z2Znd2d3vbtm
2475
+ /RWvsbEdfyauSWzq2MZWEFVD5AqBaBpRVyaKoaakEBMEBRRVBaukKiqhQF+i
2476
+ ioRU9MVUah+ChCIeEiXEIcRECShxxJflOqmxk8gmXq/Xu3v7sB84ju049oYU
2477
+ qUe6ujM7d+75/e+ZO/fMzIpSiu+zaTcbYKn2fwE32773Aiw3pFcR2QsvCWxS
2478
+ YAj8yw6/2qBUKNWuboiAv8FffIWFm8qam03Rdb744IOf/+fMmWzgJ6n2lfJL
2479
+ 6E2RaqvL9VDVvfeak0ePEnj/fcruvttudbvX7hZZl2p/KRdghddKm5vN4MmT
2480
+ BM+cIdTfT+D4cSoaG50avI6IpNJfSgW8KXKn3eer9RUXy+XDh5O/Bz76CI/f
2481
+ jzszc9lu+FkqfaZUgAFvlDU1OQI9PajQt/NVhcOM9/RQWl/vssDOF0RSNvdS
2482
+ JuAtkRbnsmXLPbm5BHp7AdBXr8ZSXw/AxKef4vR4SPf73bfBI6nymxoBIqLB
2483
+ a+XNzc7Lhw6hIhHQNMwXX8SxYwcYBijF5SNHKK6rcwq8tEvEkQrXKRGwBx5M
2484
+ LyjIdrrdTJw6BYDR0oKlvBwtLw/bgw8CMPnZZ9hEyCwstFnhqVT4XrKAXSKG
2485
+ wCslzc3OywcPglKg65idnQCICPYtWxBHbMAv9/RQVFtraiK/+btI+lL9L1mA
2486
+ BX6ZXVKSZtM0gn19AFg3bEArKE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Z2s/89gsfoKTk3zR3z9xEf4xHmNNpsCilEJiDxBuIA1I+z08
2520
+ lQP3aeBFBNHmWbBT/aV/Wn8qvh+F0Uuw73noCsEocEkpFUwKABARJ+CKFwex
2521
+ MFmBqURf37Fpcf9hIAgEgHFgDBhLzIHkJFZKjYuIAiJACJiIH79ZAhKXdSTO
2522
+ ECQGPj690VUrcfw2ZYuXhICbYRZiUUhEYFLNkjYs6s3c/5J97/9q8F/RUcwR
2523
+ 4xicOQAAAABJRU5ErkJggg==
2524
+ " alt="caution" class="icon"/>
2525
+
2526
+ <div class="content">Ruby-VPI uses the convention described above to dynamically create a direct Ruby interface to the design under test, so <em>do not</em> rename the generated files arbitrarily.</div>
2527
+ </div>
2528
+ By producing multiple files, the automated test generator physically decouples the various parts of a test. As a result, when the interface of a Verilog module changes, you can simply regenerate the test to incorporate those changes without diverting your focus from the task at hand. Furthermore, the incorporation of changes can be catalyzed by interactive text merging tools, which allow you to selectively accept or reject the merging of changes into your source code. Fully automated text merging tools may also be used for this purpose.</p>
2529
+
2530
+
2531
+ <p>You can try this tool by running the <pre>ruby-vpi generate --help</pre> command.</p>
2532
+
2533
+
2534
+ <p><div class="tip">
2535
+ <p class="title"><a class="toc" id="Using-kdiff3-with-the-automated-test-generator." href="#a-606929888">Tip 2</a>.&nbsp;&nbsp;Using <strong>kdiff3</strong> with the automated test generator.</p>
2536
+
2537
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgI
2538
+ fAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3
2539
+ Lmlua3NjYXBlLm9yZ5vuPBoAAAyOSURBVGiB1ZlrkB3Fdcf/5/Q87r1z7z7u
2540
+ vrSrXa3QC7EIyUFCSWwnJIANFiGJXdQSICRllGDni4LjqviDnQ+ufHEKx2BX
2541
+ ygg9cEwVriBcMsZOHFlEWCo/glFhrAeSxe6ifWnvPu7ev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ICERCIHprovymiuLayTMT3xzP106lHCvdmLG3dDQld63J
2575
+ enc0pJPX+YE8z0IMGTt53LI4FBZJS0BagmVfT8vWgYFBNTw6+tyhQ189t1Rd
2576
+ y9oTH3rqy4f2fvpv7990/cju69q7nemSr5k5YuJoPF+7srGzoSvtuTxZlueK
2577
+ fvRz1xK+Y1MgiBUxdCKZabFd975CoXzOYbKMERwLspqSdk9z0tnwT//yrYqR
2578
+ +OxyNC27KqHI3P+Tl/99LhEVM+taMykGacGkY4OgUAlGshm30WFSQpC0bAot
2579
+ QYHlkG8Ly29IJZuVil+3iSqWTaHFpFoyybbetoY79z+1P/arlQeXu71cNsAz
2580
+ Tz42pf3ybx974Xk/EVfbmtNugpk0Mel8RY3ZZFLMpGzByiaWjuDQsThIuuzH
2581
+ MsjIOD4rLAotwdKxLNPZ6N375P798fDl0T89fOArLy1XzzXVhQ4e/NpYFNRu
2582
+ /8mJY4muZq9FEDQT6WIlmC3MzrgUKVcQKWGRFMSha7EfVqtObvKKkKEcFcRS
2583
+ CFYtDcntA0OD/uWRkS89ffCx716LlmsubB08+PiF3MTEf2q/mBVCMBEMk1D5
2584
+ QqkwV8hliVhbhMh2WDmCw6HBX7UX8rMjlu34FkGxYe0w73jp+Esp24ivX6uO
2585
+ FVXmlAyfGR8doUbPTVP9O81EhmeGBy+1MyM24FgwtBCWOnfm9U4IGnSEUUKw
2586
+ ZmFiBrpzE7lzTz31pSW/ea9uK6rMCYhTA5cuJbfuuLljYLw0JaszbYh8PXz5
2587
+ 4gbvZ9V7PC+yTRxWpqcKswMD422t7cmhwC+ku9dv9710U28gQxOE/rI28asK
2588
+ cOjQl4f/8q8+NzQ5ermjwTaNuZk32i2KUglX0dTUOPr6NsC2ErgyNon16zNI
2589
+ uDN/ODY2PjYydun0H+z51Ieeff5IYCJ97H0DAIBYqo9/5/nnzv753ofaUj3b
2590
+ rOn8KLq6Q0xOXIFtJ2FbgON42LxlM7q62oUxTm8qtaX3/PkzpXPnz506dOjx
2591
+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Ip/P480334zCMMydOXNmDEAGQApAYuGe+futdxqDiOgd
2608
+ ta22BwC4nZ2dXdu2bfujlpaWe4wxNDMz84OzZ88em5qamkZ9ppfjAflu+bDc
2609
+ HGAANv6XHFhk9iI4CwDNm5m3aJG9Ww4o1MPnXQVe09fovEsXBC+AXO16LBK/
2610
+ 0BYggPpqs9jeBlvqCnTNAP/jIXWgBeNF/YXzBfHxIoC3z5cj+Or2X3r9Ye2F
2611
+ 1izgAAAAAElFTkSuQmCC
2612
+ " alt="tip" class="icon"/>
2613
+
2614
+ <div class="content"><ol>
2615
+ <li>Create a file named <tt>merge2</tt> with the following content: <pre class="code">
2616
+ <span style="color:#888">#!/bin/sh</span>
2617
+ <span style="color:#888"># args: old file, new file</span>
2618
+ kdiff3 --auto --output <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">$2</span><span style="color:#710">&quot;</span></span> <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">$@</span><span style="color:#710">&quot;</span></span>
2619
+ </pre></li>
2620
+ <li>Make the file executable by running the <pre>chmod +x merge2</pre> command.</li>
2621
+ <li>Place the file somewhere accessible by your <code class="code"><span style="color:#036; font-weight:bold">PATH</span></code> environment variable.</li>
2622
+ <li>Assign the value &#8220;merge2&#8221; to the <code class="code"><span style="color:#036; font-weight:bold">MERGER</span></code> environment variable using your shell&#8217;s <strong>export</strong> or <strong>setenv</strong> command.</li>
2623
+ </ol>
2624
+
2625
+
2626
+ <p>From now on, <strong>kdiff3</strong> will be invoked to help you transfer your changes between generated files. When you are finished transferring changes, simply issue the &#8220;save the file&#8221; command and quit <strong>kdiff3</strong>. Or, if you do not want to transfer any changes, simply quit <strong>kdiff3</strong> <em>without</em> saving the file.</p></div>
2627
+ </div></p></div>
2628
+ </div>
2629
+ <div class="section">
2630
+ <h3 class="title">
2631
+ <a class="toc" id="usage.tools.convert" href="#a-606932168">4.8.2</a>&nbsp;&nbsp;Verilog to Ruby conversion
2632
+ </h3>
2633
+ <div class="content"><p>The <strong>convert</strong> tool can be used to convert Verilog header files into Ruby. You can try it by running the <pre>ruby-vpi convert --help</pre> command.</p>
2634
+
2635
+
2636
+ <p>By converting Verilog header files into Ruby, your test can utilize the same <code class="code"><span style="background-color:#f0fff0"><span style="color:#161">`</span><span style="color:#2B2">define</span></span></code> constants that are used in the Verilog design.</p></div>
2637
+ </div></p></div>
2638
+ </div>
2639
+ <div class="section">
2640
+ <h2 class="title">
2641
+ <a class="toc" id="usage.tutorial" href="#a-606934638">4.9</a>&nbsp;&nbsp;Tutorial
2642
+ </h2>
2643
+ <div class="content"><ol>
2644
+ <li><a class="xref" href="#usage.tutorial.declare-design">Declare a design</a> using Verilog 2001 syntax.</li>
2645
+ <li><a class="xref" href="#usage.tutorial.generate-test">Generate a test</a> for the design using the <a class="xref" href="#usage.tools.generate">automated test generator</a> tool.</li>
2646
+ <li><a class="xref" href="#usage.tutorial.specification">Identify your expectations</a> for the design and implement them in the specification.</li>
2647
+ <li>(Optional) <a class="xref" href="#usage.tutorial.implement-proto">Implement the prototype</a> of the design in Ruby.</li>
2648
+ <li>(Optional) <a class="xref" href="#usage.tutorial.test-proto">Verify the prototype</a> against the specification.</li>
2649
+ <li><a class="xref" href="#usage.tutorial.implement-design">Implement the design</a> in Verilog once the prototype has been verified.</li>
2650
+ <li><a class="xref" href="#usage.tutorial.test-design">Verify the design</a> against the specification.</li>
2651
+ </ol>
2652
+
2653
+
2654
+ <p><div class="section">
2655
+ <h3 class="title">
2656
+ <a class="toc" id="usage.tutorial.declare-design" href="#a-606947158">4.9.1</a>&nbsp;&nbsp;Start with a Verilog design
2657
+ </h3>
2658
+ <div class="content"><p>First, we need a Verilog design to test. In this tutorial, <a class="xref" href="#fig:counter.v_decl">Example 5: <em>Declaration of a simple up-counter with synchronous reset</em></a> will serve as our design under test. Its interface is composed of the following parts:</p>
2659
+
2660
+
2661
+ <ul>
2662
+ <li><code class="code"><span style="color:#036; font-weight:bold">Size</span></code> defines the number of bits used to represent the counter&#8217;s value.</li>
2663
+ <li><code class="code">clock</code> causes the <code class="code">count</code> register to increment whenever it reaches a positive edge.</li>
2664
+ <li><code class="code">reset</code> causes the <code class="code">count</code> register to become zero when asserted.</li>
2665
+ <li><code class="code">count</code> is a register that contains the counter&#8217;s value.</li>
2666
+ </ul>
2667
+
2668
+
2669
+ <p><div class="example">
2670
+ <p class="title"><a class="toc" id="fig:counter.v_decl" href="#a-606950328">Example 5</a>.&nbsp;&nbsp;Declaration of a simple up-counter with synchronous reset</p>
2671
+ <div class="content"><pre class="code" lang="verilog">
2672
+ module counter #(parameter Size = 5) (
2673
+ input clock,
2674
+ input reset,
2675
+ output reg [Size-1 : 0] count
2676
+ );
2677
+ endmodule
2678
+ </pre></div>
2679
+ </div>
2680
+ Before we continue, save the source code shown in <a class="xref" href="#fig:counter.v_decl">Example 5: <em>Declaration of a simple up-counter with synchronous reset</em></a> into a file named <tt>counter.v</tt>.</p></div>
2681
+ </div>
2682
+ <div class="section">
2683
+ <h3 class="title">
2684
+ <a class="toc" id="usage.tutorial.generate-test" href="#a-606953958">4.9.2</a>&nbsp;&nbsp;Generate a test
2685
+ </h3>
2686
+ <div class="content"><p>Now that we have a Verilog design to test, we shall use the <a class="xref" href="#usage.tools.generate">generate</a> tool to generate some scaffolding for our test. This tool allows us to implement our specification using RSpec, xUnit, or any other format.</p>
2687
+
2688
+
2689
+ Each format represents a different software development methodology:
2690
+ <ul>
2691
+ <li>RSpec represents <a class="xref" href="#glossary.BDD">BDD</a></li>
2692
+ <li>xUnit represents <a class="xref" href="#glossary.TDD">TDD</a></li>
2693
+ <li>our own format can represent another methodology</li>
2694
+ </ul>
2695
+
2696
+
2697
+ <p>In this tutorial, you will see how both RSpec and xUnit formats are used. So let us make separate directories for both formats to avoid generated tests from overwriting each other:
2698
+ <pre>
2699
+ mkdir RSpec xUnit
2700
+ cp counter.v RSpec
2701
+ cp counter.v xUnit
2702
+ </pre></p>
2703
+
2704
+
2705
+ <p>Once we have decided how we want to implement our specification, we can proceed to generate a test for our design. This process is illustrated by <a class="xref" href="#fig:generate-test.RSpec">Example 6: <em>Generating a test with specification in RSpec format</em></a> and <a class="xref" href="#fig:generate-test.xUnit">Example 7: <em>Generating a test with specification in xUnit format</em></a>.</p>
2706
+
2707
+
2708
+ <p><div class="example">
2709
+ <p class="title"><a class="toc" id="fig:generate-test.RSpec" href="#a-606962678">Example 6</a>.&nbsp;&nbsp;Generating a test with specification in RSpec format</p>
2710
+ <div class="content"><pre>
2711
+ $ ruby-vpi generate counter.v --RSpec
2712
+
2713
+ module counter
2714
+ create counter_runner.rake
2715
+ create counter_design.rb
2716
+ create counter_proto.rb
2717
+ create counter_spec.rb
2718
+ create Rakefile
2719
+ </pre></div>
2720
+ </div>
2721
+ <div class="example">
2722
+ <p class="title"><a class="toc" id="fig:generate-test.xUnit" href="#a-606964548">Example 7</a>.&nbsp;&nbsp;Generating a test with specification in xUnit format</p>
2723
+ <div class="content"><pre>
2724
+ $ ruby-vpi generate counter.v --xUnit
2725
+
2726
+ module counter
2727
+ create counter_runner.rake
2728
+ create counter_design.rb
2729
+ create counter_proto.rb
2730
+ create counter_spec.rb
2731
+ create Rakefile
2732
+ </pre></div>
2733
+ </div></p></div>
2734
+ </div>
2735
+ <div class="section">
2736
+ <h3 class="title">
2737
+ <a class="toc" id="usage.tutorial.specification" href="#a-606966828">4.9.3</a>&nbsp;&nbsp;Specify your expectations
2738
+ </h3>
2739
+ <div class="content"><p>So far, the test generation tool has created a basic foundation for our test Now we must build upon this foundation by identifying our <a class="xref" href="#glossary.expectation">expectation</a> of the design under test. That is, how do we expect the design to <em>behave</em> under certain conditions?</p>
2740
+
2741
+
2742
+ Here are some reasonable expectations for our simple counter:
2743
+ <ul>
2744
+ <li>A resetted counter&#8217;s value should be zero.</li>
2745
+ <li>A resetted counter&#8217;s value should increment by one count upon each rising clock edge.</li>
2746
+ <li>A counter with the maximum value should overflow upon increment.</li>
2747
+ </ul>
2748
+
2749
+
2750
+ <p>Now that we have identified a set of expectations for our design, we are ready to implement them in our specification. This process is illustrated by <a class="xref" href="#fig:RSpec-counter_spec.rb">Example 8: <em>Specification implemented in RSpec format</em></a> and <a class="xref" href="#fig:xUnit-counter_spec.rb">Example 9: <em>Specification implemented in xUnit format</em></a>.</p>
2751
+
2752
+
2753
+ <div class="example">
2754
+ <p class="title"><a class="toc" id="fig:RSpec-counter_spec.rb" href="#a-606972788">Example 8</a>.&nbsp;&nbsp;Specification implemented in RSpec format</p>
2755
+ <div class="content"><pre class="code">require <span style="background-color:#fff0f0"><span style="color:#710">'</span><span style="color:#D20">spec</span><span style="color:#710">'</span></span>
2756
+
2757
+ <span style="color:#888"># lowest upper bound of counter's value</span>
2758
+ <span style="color:#036; font-weight:bold">LIMIT</span> = <span style="color:#00D; font-weight:bold">2</span> ** <span style="color:#036; font-weight:bold">DUT</span>.<span style="color:#036; font-weight:bold">Size</span>.intVal
2759
+
2760
+ <span style="color:#888"># maximum allowed value for a counter</span>
2761
+ <span style="color:#036; font-weight:bold">MAX</span> = <span style="color:#036; font-weight:bold">LIMIT</span> - <span style="color:#00D; font-weight:bold">1</span>
2762
+
2763
+ describe <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">A </span><span style="background: #eee"><span style="font-weight: bold; color: #888">#{</span><span style="color:#036; font-weight:bold">DUT</span>.name<span style="font-weight: bold; color: #888">}</span></span><span style="color:#D20"> after being reset</span><span style="color:#710">&quot;</span></span> <span style="color:#080; font-weight:bold">do</span>
2764
+ setup <span style="color:#080; font-weight:bold">do</span>
2765
+ <span style="color:#036; font-weight:bold">DUT</span>.reset! <span style="color:#888"># reset the counter</span>
2766
+ <span style="color:#080; font-weight:bold">end</span>
2767
+
2768
+ it <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">should be zero</span><span style="color:#710">&quot;</span></span> <span style="color:#080; font-weight:bold">do</span>
2769
+ <span style="color:#036; font-weight:bold">DUT</span>.count.intVal.should == <span style="color:#00D; font-weight:bold">0</span>
2770
+ <span style="color:#080; font-weight:bold">end</span>
2771
+
2772
+ it <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">should increment upon each subsequent posedge</span><span style="color:#710">&quot;</span></span> <span style="color:#080; font-weight:bold">do</span>
2773
+ <span style="color:#036; font-weight:bold">LIMIT</span>.times <span style="color:#080; font-weight:bold">do</span> |i|
2774
+ <span style="color:#036; font-weight:bold">DUT</span>.count.intVal.should == i
2775
+ <span style="color:#036; font-weight:bold">DUT</span>.cycle! <span style="color:#888"># increment the counter</span>
2776
+ <span style="color:#080; font-weight:bold">end</span>
2777
+ <span style="color:#080; font-weight:bold">end</span>
2778
+ <span style="color:#080; font-weight:bold">end</span>
2779
+
2780
+ describe <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">A </span><span style="background: #eee"><span style="font-weight: bold; color: #888">#{</span><span style="color:#036; font-weight:bold">DUT</span>.name<span style="font-weight: bold; color: #888">}</span></span><span style="color:#D20"> with the maximum value</span><span style="color:#710">&quot;</span></span> <span style="color:#080; font-weight:bold">do</span>
2781
+ setup <span style="color:#080; font-weight:bold">do</span>
2782
+ <span style="color:#036; font-weight:bold">DUT</span>.reset! <span style="color:#888"># reset the counter</span>
2783
+
2784
+ <span style="color:#888"># increment the counter to maximum value</span>
2785
+ <span style="color:#036; font-weight:bold">MAX</span>.times { <span style="color:#036; font-weight:bold">DUT</span>.cycle! }
2786
+ <span style="color:#036; font-weight:bold">DUT</span>.count.intVal.should == <span style="color:#036; font-weight:bold">MAX</span>
2787
+ <span style="color:#080; font-weight:bold">end</span>
2788
+
2789
+ it <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">should overflow upon increment</span><span style="color:#710">&quot;</span></span> <span style="color:#080; font-weight:bold">do</span>
2790
+ <span style="color:#036; font-weight:bold">DUT</span>.cycle! <span style="color:#888"># increment the counter</span>
2791
+ <span style="color:#036; font-weight:bold">DUT</span>.count.intVal.should == <span style="color:#00D; font-weight:bold">0</span>
2792
+ <span style="color:#080; font-weight:bold">end</span>
2793
+ <span style="color:#080; font-weight:bold">end</span></pre></div>
2794
+ </div>
2795
+ <div class="example">
2796
+ <p class="title"><a class="toc" id="fig:xUnit-counter_spec.rb" href="#a-606975088">Example 9</a>.&nbsp;&nbsp;Specification implemented in xUnit format</p>
2797
+ <div class="content"><pre class="code">require <span style="background-color:#fff0f0"><span style="color:#710">'</span><span style="color:#D20">test/unit</span><span style="color:#710">'</span></span>
2798
+
2799
+ <span style="color:#888"># lowest upper bound of counter's value</span>
2800
+ <span style="color:#036; font-weight:bold">LIMIT</span> = <span style="color:#00D; font-weight:bold">2</span> ** <span style="color:#036; font-weight:bold">DUT</span>.<span style="color:#036; font-weight:bold">Size</span>.intVal
2801
+
2802
+ <span style="color:#888"># maximum allowed value for a counter</span>
2803
+ <span style="color:#036; font-weight:bold">MAX</span> = <span style="color:#036; font-weight:bold">LIMIT</span> - <span style="color:#00D; font-weight:bold">1</span>
2804
+
2805
+ <span style="color:#080; font-weight:bold">class</span> <span style="color:#B06; font-weight:bold">A_counter_after_being_reset</span> &lt; <span style="color:#036; font-weight:bold">Test</span>::<span style="color:#036; font-weight:bold">Unit</span>::<span style="color:#036; font-weight:bold">TestCase</span>
2806
+ <span style="color:#080; font-weight:bold">def</span> <span style="color:#06B; font-weight:bold">setup</span>
2807
+ <span style="color:#036; font-weight:bold">DUT</span>.reset! <span style="color:#888"># reset the counter</span>
2808
+ <span style="color:#080; font-weight:bold">end</span>
2809
+
2810
+ <span style="color:#080; font-weight:bold">def</span> <span style="color:#06B; font-weight:bold">test_should_be_zero</span>
2811
+ assert_equal( <span style="color:#00D; font-weight:bold">0</span>, <span style="color:#036; font-weight:bold">DUT</span>.count.intVal )
2812
+ <span style="color:#080; font-weight:bold">end</span>
2813
+
2814
+ <span style="color:#080; font-weight:bold">def</span> <span style="color:#06B; font-weight:bold">test_should_increment_upon_each_subsequent_posedge</span>
2815
+ <span style="color:#036; font-weight:bold">LIMIT</span>.times <span style="color:#080; font-weight:bold">do</span> |i|
2816
+ assert_equal( i, <span style="color:#036; font-weight:bold">DUT</span>.count.intVal )
2817
+ <span style="color:#036; font-weight:bold">DUT</span>.cycle! <span style="color:#888"># increment the counter</span>
2818
+ <span style="color:#080; font-weight:bold">end</span>
2819
+ <span style="color:#080; font-weight:bold">end</span>
2820
+ <span style="color:#080; font-weight:bold">end</span>
2821
+
2822
+ <span style="color:#080; font-weight:bold">class</span> <span style="color:#B06; font-weight:bold">A_counter_with_the_maximum_value</span> &lt; <span style="color:#036; font-weight:bold">Test</span>::<span style="color:#036; font-weight:bold">Unit</span>::<span style="color:#036; font-weight:bold">TestCase</span>
2823
+ <span style="color:#080; font-weight:bold">def</span> <span style="color:#06B; font-weight:bold">setup</span>
2824
+ <span style="color:#036; font-weight:bold">DUT</span>.reset! <span style="color:#888"># reset the counter</span>
2825
+
2826
+ <span style="color:#888"># increment the counter to maximum value</span>
2827
+ <span style="color:#036; font-weight:bold">MAX</span>.times { <span style="color:#036; font-weight:bold">DUT</span>.cycle! }
2828
+ assert_equal( <span style="color:#036; font-weight:bold">MAX</span>, <span style="color:#036; font-weight:bold">DUT</span>.count.intVal )
2829
+ <span style="color:#080; font-weight:bold">end</span>
2830
+
2831
+ <span style="color:#080; font-weight:bold">def</span> <span style="color:#06B; font-weight:bold">test_should_overflow_upon_increment</span>
2832
+ <span style="color:#036; font-weight:bold">DUT</span>.cycle! <span style="color:#888"># increment the counter</span>
2833
+ assert_equal( <span style="color:#00D; font-weight:bold">0</span>, <span style="color:#036; font-weight:bold">DUT</span>.count.intVal )
2834
+ <span style="color:#080; font-weight:bold">end</span>
2835
+ <span style="color:#080; font-weight:bold">end</span></pre></div>
2836
+ </div>
2837
+ Before we continue,
2838
+ <ol>
2839
+ <li>Replace the contents of the file named <tt>RSpec/counter_spec.rb</tt> with the source code shown in <a class="xref" href="#fig:RSpec-counter_spec.rb">Example 8: <em>Specification implemented in RSpec format</em></a>.</li>
2840
+ <li>Replace the contents of the file named <tt>xUnit/counter_spec.rb</tt> with the source code shown in <a class="xref" href="#fig:xUnit-counter_spec.rb">Example 9: <em>Specification implemented in xUnit format</em></a>.</li>
2841
+ </ol></div>
2842
+ </div>
2843
+ <div class="section">
2844
+ <h3 class="title">
2845
+ <a class="toc" id="usage.tutorial.implement-proto" href="#a-606069158">4.9.4</a>&nbsp;&nbsp;Implement the prototype
2846
+ </h3>
2847
+ <div class="content"><p>Now that we have a specification against which to verify our design let us build a prototype of our design. By doing so, we exercise our specification, experience potential problems that may arise when we later implement our design in Verilog, and gain confidence in our work. The result of this proceess is illustrated by <a class="xref" href="#fig:counter_proto.rb">Example 10: <em>Ruby prototype of our Verilog design</em></a>.</p>
2848
+
2849
+
2850
+ <p><div class="example">
2851
+ <p class="title"><a class="toc" id="fig:counter_proto.rb" href="#a-606100048">Example 10</a>.&nbsp;&nbsp;Ruby prototype of our Verilog design</p>
2852
+ <div class="content"><pre class="code"><span style="color:#080; font-weight:bold">if</span> <span style="color:#036; font-weight:bold">RubyVPI</span>::<span style="color:#036; font-weight:bold">USE_PROTOTYPE</span>
2853
+ always <span style="color:#080; font-weight:bold">do</span>
2854
+ wait <span style="color:#080; font-weight:bold">until</span> <span style="color:#036; font-weight:bold">DUT</span>.clock.posedge?
2855
+
2856
+ <span style="color:#080; font-weight:bold">if</span> <span style="color:#036; font-weight:bold">DUT</span>.reset.t?
2857
+ <span style="color:#036; font-weight:bold">DUT</span>.count.intVal = <span style="color:#00D; font-weight:bold">0</span>
2858
+ <span style="color:#080; font-weight:bold">else</span>
2859
+ <span style="color:#036; font-weight:bold">DUT</span>.count.intVal += <span style="color:#00D; font-weight:bold">1</span>
2860
+ <span style="color:#080; font-weight:bold">end</span>
2861
+ <span style="color:#080; font-weight:bold">end</span>
2862
+ <span style="color:#080; font-weight:bold">end</span></pre></div>
2863
+ </div>
2864
+ Before we continue, replace the contents of the files named <tt>RSpec/counter_proto.rb</tt> and <tt>xUnit/counter_proto.rb</tt> with the source code shown in <a class="xref" href="#fig:counter_proto.rb">Example 10: <em>Ruby prototype of our Verilog design</em></a>.</p></div>
2865
+ </div>
2866
+ <div class="section">
2867
+ <h3 class="title">
2868
+ <a class="toc" id="usage.tutorial.test-proto" href="#a-606122988">4.9.5</a>&nbsp;&nbsp;Verify the prototype
2869
+ </h3>
2870
+ <div class="content"><p>Now that we have implemented our prototype, we are ready to verify it against our specification by running the test This process is illustrated by <a class="xref" href="#fig:test-proto.RSpec">Example 11: <em>Running a test with specification in RSpec format</em></a> and <a class="xref" href="#fig:test-proto.unit-test">Example 12: <em>Running a test with specification in xUnit format</em></a>.</p>
2871
+
2872
+
2873
+ <p>In these examples, the <code class="code"><span style="color:#036; font-weight:bold">PROTOTYPE</span></code> environment variable is assigned the value 1 while running the test so that, instead of our design, our prototype is verified against our specification (see <a class="xref" href="#usage.runner.env-vars">Section 4.7.1: <em>Environment variables</em></a> for details). Also, the <a class="xref" href="#setup.reqs">GPL Cver simulator</a> denoted by <em>cver</em>, is used to run the simulation.</p>
2874
+
2875
+
2876
+ <p><div class="example">
2877
+ <p class="title"><a class="toc" id="fig:test-proto.RSpec" href="#a-606139338">Example 11</a>.&nbsp;&nbsp;Running a test with specification in RSpec format</p>
2878
+ <div class="content"><pre>
2879
+ $ cd RSpec
2880
+ $ rake cver PROTOTYPE=1
2881
+
2882
+ Ruby-VPI: prototype is enabled
2883
+ ...
2884
+
2885
+ Finished in 0.05106 seconds
2886
+
2887
+ 3 examples, 0 failures
2888
+ cd -
2889
+ </pre></div>
2890
+ </div>
2891
+ <div class="example">
2892
+ <p class="title"><a class="toc" id="fig:test-proto.unit-test" href="#a-606145238">Example 12</a>.&nbsp;&nbsp;Running a test with specification in xUnit format</p>
2893
+ <div class="content"><pre>
2894
+ $ cd xUnit
2895
+ $ rake cver PROTOTYPE=1
2896
+
2897
+ Ruby-VPI: prototype is enabled
2898
+ Loaded suite counter
2899
+ Started
2900
+ ...
2901
+ Finished in 0.043859 seconds.
2902
+
2903
+ 3 tests, 35 assertions, 0 failures, 0 errors
2904
+ </pre></div>
2905
+ </div>
2906
+ <div class="tip">
2907
+ <p class="title"><a class="toc" id="What-can-the-test-runner-do" href="#a-606150528">Tip 3</a>.&nbsp;&nbsp;What can the test runner do?</p>
2908
+
2909
+ <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgI
2910
+ fAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3
2911
+ Lmlua3NjYXBlLm9yZ5vuPBoAAAyOSURBVGiB1ZlrkB3Fdcf/5/Q87r1z7z7u
2912
+ vrSrXa3QC7EIyUFCSWwnJIANFiGJXdQSICRllGDni4LjqviDnQ+ufHEKx2BX
2913
+ ygg9cEwVriBcMsZOHFlEWCo/glFhrAeSxe6ifWnvPu7evc+Z6Z6ezoe7S7aU
2914
+ QO1qF5N01anpmaqZ/v/6nNMzfYaMMfj/3Pj9FrDSZq3Wg4iIPvnIX+8G2fcS
2915
+ 2R+BiTtMHGUBgNiaBfGkMeo4jPr2Nw589edmlVxPq/Gchx/5m1uJnWdT6aZM
2916
+ z+ZdXsfaXuF5KXipBAQDoQwR+D5yV0b14BuvVstz+bKJ5YNPH/jKyfcVYO/e
2917
+ z2ViQV9zk8l7b761P93a1oF8SWKm7KMaSgRSARQj5QpkkjZ6Wj30tnuYmp7F
2918
+ 8RefrVbL1edZm32HD/9D+dcOsPeRz3wMZD/TtemW9I07b01MFBRGpipoyhAa
2919
+ 04yGlECjJ5BwGLUwQiVQmJ4LMFUM0NfTgh3rszh58sfh+dOnyjDqzw4fePwH
2920
+ vzaAhz/92ftsJ3V4+4fv87zGdlwar8JLxtix0UM2YwEwMCYGMcWAMXE8f8kA
2921
+ Ssf4xeCMqYWab9veI6rlCr773D/XfL/08NP7//G59xzgk488eguR+/KuO//C
2922
+ C+IU8mWJD2xKYG2rM69Sg5g0DAwRYgMYoJ6yxhgYA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ASnIhIIptJgCFuSXamokMig4lvBtiwNbcGBZFNoWhdm0wxU/jEBcXKqupe8H
2940
+ mC+WSzMd6WQGJR9qYtb3u1o8ZDOuJsQRIBQR1VccQNbXf1JMFIGgZaQLs2U5
2941
+ o1SsHYutiIwmig3AgDYcW0a0N3n2bLEUgnh8ybKWDBAF3yrnBmtNKUcL4kgI
2942
+ igaulEpXZqolP4z9G9c1re9tTXWnHJEAQRJRoGNTVHGcmyvLC8WSHEQcV9ak
2943
+ wts3NslPuRYHjuDQEhQKi6UlWGbTicTY6KihWL2w6gDKEi9Mjf4qziaNSbpW
2944
+ LIgiY4ycLgbFoVxpohqqCgkRrW3xNq/NJn/DFXGTDe0ZFTa5HHa3efrDG9qs
2945
+ vWtas31uwpu1hAhsiwNLCGkJlgnbitZmvc4zp19ho6NvrzrAM08+NqXC4DMX
2946
+ Xv1RsLWzWRCTZqZICERCIHprovymiuLayTMT3xzP106lHCvdmLG3dDQld63J
2947
+ enc0pJPX+YE8z0IMGTt53LI4FBZJS0BagmVfT8vWgYFBNTw6+tyhQ189t1Rd
2948
+ y9oTH3rqy4f2fvpv7990/cju69q7nemSr5k5YuJoPF+7srGzoSvtuTxZlueK
2949
+ fvRz1xK+Y1MgiBUxdCKZabFd975CoXzOYbKMERwLspqSdk9z0tnwT//yrYqR
2950
+ +OxyNC27KqHI3P+Tl/99LhEVM+taMykGacGkY4OgUAlGshm30WFSQpC0bAot
2951
+ QYHlkG8Ly29IJZuVil+3iSqWTaHFpFoyybbetoY79z+1P/arlQeXu71cNsAz
2952
+ Tz42pf3ybx974Xk/EVfbmtNugpk0Mel8RY3ZZFLMpGzByiaWjuDQsThIuuzH
2953
+ MsjIOD4rLAotwdKxLNPZ6N375P798fDl0T89fOArLy1XzzXVhQ4e/NpYFNRu
2954
+ /8mJY4muZq9FEDQT6WIlmC3MzrgUKVcQKWGRFMSha7EfVqtObvKKkKEcFcRS
2955
+ CFYtDcntA0OD/uWRkS89ffCx716LlmsubB08+PiF3MTE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qQcP87hIQQICJEWmN8fBbGMNZ1t8N27Fv27NncvdLxVxxCUiY41pqCQOLq
2973
+ ENKxwVyhjOnpPCqVKnrWtSE/ncfgTB5kjC4WQ0NENuq1VXMtP/6uCYCIeP5e
2974
+ BlC+664tf3/06MXPT+Rsa+PGMazp7EIy5aFSriKfL2Bqchpzc3OolMoYHcvh
2975
+ ypWcqtXk53/601EfgId65U4TkZ7vR8aYeElalgNNRGJe+OKjACB27Oja1Nqa
2976
+ ujuZbLjb89Lbk0kL5fIc4ljDcTyEYQSl1PlKpfDi5cul7w8Pz+YAKMxXtq+y
2977
+ aOFo6n9OVg5ARNa86MUAC30HgAsgsWvXrt/cunXrEw899FDSdV0UCgUMDQ3h
2978
+ lVdeCS5evPh3Z86ceW1eeDhvwfxRLhIfLe4bY6J30rWkJJ4PmXcyaxGAe/r0
2979
+ 6Yu+74+dOHFCTU5OIp/P480334zCMMydOXNmDEAGQApAYuGe+futdxqDiOgd
2980
+ ta22BwC4nZ2dXdu2bfujlpaWe4wxNDMz84OzZ88em5qamkZ9ppfjAflu+bDc
2981
+ HGAANv6XHFhk9iI4CwDNm5m3aJG9Ww4o1MPnXQVe09fovEsXBC+AXO16LBK/
2982
+ 0BYggPpqs9jeBlvqCnTNAP/jIXWgBeNF/YXzBfHxIoC3z5cj+Or2X3r9Ye2F
2983
+ 1izgAAAAAElFTkSuQmCC
2984
+ " alt="tip" class="icon"/>
2985
+
2986
+ <div class="content">If you invoke the test runner (1) without any arguments or (2) with the <tt>--tasks</tt> option, it will show you a list of tasks that it can perform for you.</div>
2987
+ </div></p></div>
2988
+ </div>
2989
+ <div class="section">
2990
+ <h3 class="title">
2991
+ <a class="toc" id="usage.tutorial.implement-design" href="#a-606168938">4.9.6</a>&nbsp;&nbsp;Implement the design
2992
+ </h3>
2993
+ <div class="content"><p>Now that we have implemented and verified our prototype, we are ready to implement our design This is often quite simple because we translate <em>existing</em> code from Ruby (our prototype) into Verilog (our design). The result of this process is illustrated by <a class="xref" href="#fig:counter.v_impl">Example 13: <em>Implementation of a simple up-counter with synchronous reset</em></a>.</p>
2994
+
2995
+
2996
+ <p><div class="example">
2997
+ <p class="title"><a class="toc" id="fig:counter.v_impl" href="#a-606237758">Example 13</a>.&nbsp;&nbsp;Implementation of a simple up-counter with synchronous reset</p>
2998
+ <div class="content"><pre class="code" lang="verilog">/**
2999
+ A simple up-counter with synchronous reset.
3000
+
3001
+ @param Size Number of bits used to represent the counter's value.
3002
+ @param clock Increments the counter's value upon each positive edge.
3003
+ @param reset Zeroes the counter's value when asserted.
3004
+ @param count The counter's value.
3005
+ */
3006
+ module counter #(parameter Size = 5) (
3007
+ input clock,
3008
+ input reset,
3009
+ output reg [Size-1 : 0] count
3010
+ );
3011
+ always @(posedge clock) begin
3012
+ if (reset)
3013
+ count &lt;= 0;
3014
+ else
3015
+ count &lt;= count + 1;
3016
+ end
3017
+ endmodule</pre></div>
3018
+ </div>
3019
+ Before we continue, replace the contents of the files named <tt>RSpec/counter.v</tt> and <tt>xUnit/counter.v</tt> with the source code shown in <a class="xref" href="#fig:counter.v_impl">Example 13: <em>Implementation of a simple up-counter with synchronous reset</em></a></p></div>
3020
+ </div>
3021
+ <div class="section">
3022
+ <h3 class="title">
3023
+ <a class="toc" id="usage.tutorial.test-design" href="#a-606269558">4.9.7</a>&nbsp;&nbsp;Verify the design
3024
+ </h3>
3025
+ <div class="content"><p>Now that we have implemented our design we are ready to verify it against our specification by running the test <a class="xref" href="#fig:test-design.RSpec">Example 14: <em>Running a test with specification in RSpec format</em></a> and <a class="xref" href="#fig:test-design.unit-test">Example 15: <em>Running a test with specification in xUnit format</em></a> illustrate this process.</p>
3026
+
3027
+
3028
+ <p>In these examples, the <code class="code"><span style="color:#036; font-weight:bold">PROTOTYPE</span></code> environment variable is <em>not</em> specified while running the test, so that our design, instead of our prototype, is verified against our specification. You can also achieve this effect by assigning an empty value to <code class="code"><span style="color:#036; font-weight:bold">PROTOTYPE</span></code>, or by using your shell&#8217;s <strong>unset</strong> command. Finally, the <a class="xref" href="#setup.reqs">GPL Cver simulator</a> denoted by <em>cver</em>, is used to run the simulation.</p>
3029
+
3030
+
3031
+ <p><div class="example">
3032
+ <p class="title"><a class="toc" id="fig:test-design.RSpec" href="#a-606307738">Example 14</a>.&nbsp;&nbsp;Running a test with specification in RSpec format</p>
3033
+ <div class="content"><pre>
3034
+ $ cd RSpec
3035
+ $ rake cver
3036
+
3037
+ ...
3038
+
3039
+ Finished in 0.041198 seconds
3040
+
3041
+ 3 examples, 0 failures
3042
+ </pre></div>
3043
+ </div>
3044
+ <div class="example">
3045
+ <p class="title"><a class="toc" id="fig:test-design.unit-test" href="#a-606325118">Example 15</a>.&nbsp;&nbsp;Running a test with specification in xUnit format</p>
3046
+ <div class="content"><pre>
3047
+ $ cd xUnit
3048
+ $ rake cver
3049
+
3050
+ Loaded suite counter
3051
+ Started
3052
+ ...
3053
+ Finished in 0.040262 seconds.
3054
+
3055
+ 3 tests, 35 assertions, 0 failures, 0 errors
3056
+ </pre></div>
3057
+ </div></p></div>
3058
+ </div>
3059
+ <div class="section">
3060
+ <h3 class="title">
3061
+ <a class="toc" id="usage.examples" href="#a-606358268">4.9.8</a>&nbsp;&nbsp;More examples
3062
+ </h3>
3063
+ <div class="content">The <tt>examples</tt> directory (<a href="http://ruby-vpi.rubyforge.org/src/examples/">browse it online</a>) contains several example tests which illustrate how Ruby-VPI can be used. Each example has an associated <tt>Rakefile</tt> which simplifies the process of running it. Therefore, simply navigate into an example directory and run the <pre>rake</pre> command to get started.</div>
3064
+ </div></p></div>
3065
+ </div></div>
3066
+ </div>
3067
+ <div class="chapter">
3068
+ <h1 class="title">
3069
+ Chapter
3070
+ <a class="toc" id="hacking" href="#a-606376468">5</a>
3071
+
3072
+ <br/>
3073
+
3074
+ <big>Hacking</big>
3075
+ </h1>
3076
+
3077
+ <div class="content"><div class="section">
3078
+ <h2 class="title">
3079
+ <a class="toc" id="hacking.build" href="#a-605850148">5.1</a>&nbsp;&nbsp;Building from source code
3080
+ </h2>
3081
+ <div class="content"><p>Obtain the source code from the project <a href="http://darcs.net">Darcs</a> repository:</p>
3082
+
3083
+
3084
+ <pre>darcs get http://ruby-vpi.rubyforge.org/src ruby-vpi</pre>
3085
+
3086
+
3087
+ <p>Go inside the obtained directory and run the following commands:</p>
3088
+
3089
+
3090
+ <pre>rake build
3091
+ ruby bin/ruby-vpi -v</pre>
3092
+
3093
+
3094
+ <p>If the commands were successful, then you will see output like this: <pre>ruby-vpi 20.0.0 (2008-01-27) http://ruby-vpi.rubyforge.org /home/sun/src/ruby-vpi
3095
+ </pre></p>
3096
+
3097
+
3098
+ <p>Otherwise, you can ask for help in the <a href="http://rubyforge.org/mailman/listinfo/ruby-vpi-discuss">project mailing list</a>.</p></div>
3099
+ </div>
3100
+ <div class="section">
3101
+ <h2 class="title">
3102
+ <a class="toc" id="Installing-without-really-installing" href="#a-605974548">5.2</a>&nbsp;&nbsp;Installing without really installing
3103
+ </h2>
3104
+ <div class="content"><p>After successfully building from source (see <a class="xref" href="#hacking.build">Section 5.1: <em>Building from source code</em></a>), set the <code class="code"><span style="color:#036; font-weight:bold">RUBYLIB</span></code> environment variable to the path where you checked out the source code <em>plus</em> the <tt>lib/</tt> directory.</p>
3105
+
3106
+
3107
+ <p>For example, if you checked out the source code into <tt>/home/foo/ruby-vpi/</tt> then you would set the value of the <code class="code"><span style="color:#036; font-weight:bold">RUBYLIB</span></code> environment variable to <tt>/home/foo/ruby-vpi/lib/</tt>. Afterwards, any Ruby-VPI tests you run will use the checked-out source code directly.</p></div>
3108
+ </div>
3109
+ <div class="section">
3110
+ <h2 class="title">
3111
+ <a class="toc" id="hacking.release-packages" href="#a-605757818">5.3</a>&nbsp;&nbsp;Building release packages
3112
+ </h2>
3113
+ <div class="content"><p>In addition to the <a class="xref" href="#setup.reqs">normal requirements</a> you need the following software to build release packages:</p>
3114
+
3115
+
3116
+ <ul>
3117
+ <li><a href="http://rubyforge.org/projects/redcloth/">RedCloth</a></li>
3118
+ <li><a href="http://rubyforge.org/projects/coderay/">CodeRay</a></li>
3119
+ </ul>
3120
+
3121
+
3122
+ <p>Once you have satisfied these requirements, you can run the following command to build the release packages: <pre>rake release</pre></p>
3123
+
3124
+
3125
+ <p>For more build options, see below:
3126
+ <pre>$ rake -T
3127
+ (in /home/sun/src/ruby-vpi)
3128
+ rake build # Builds object files for all simulators.
3129
+ rake build_cver # Builds object files for GPL Cver.
3130
+ rake build_ivl # Builds object files for Icarus Verilog.
3131
+ rake build_ncsim # Builds object files for Cadence NC-Sim.
3132
+ rake build_vcs # Builds object files for Synopsys VCS.
3133
+ rake build_vsim # Builds object files for Mentor Modelsim.
3134
+ rake clean # Remove any temporary products.
3135
+ rake clobber # Remove any generated file.
3136
+ rake clobber_doc/api/ruby # Remove rdoc products
3137
+ rake clobber_package # Remove package products
3138
+ rake dist # Build release packages.
3139
+ rake doc # Build the documentation.
3140
+ rake doc/api/c # Build API reference for C.
3141
+ rake doc/api/ruby # Build the doc/api/ruby HTML Files
3142
+ rake gem # Build the gem file ruby-vpi-20.0.0.gem
3143
+ rake gem_config_inst # Configures the gem during installation.
3144
+ rake package # Build all the packages
3145
+ rake redoc/api/ruby # Force a rebuild of the RDOC files
3146
+ rake ref # Build API reference.
3147
+ rake repackage # Force a rebuild of the package files
3148
+ rake test # Ensure that examples work with $SIMULATOR
3149
+ rake upload # Upload to project website.
3150
+ </pre></p></div>
3151
+ </div>
3152
+ <div class="section">
3153
+ <h2 class="title">
3154
+ <a class="toc" id="hacking.guide" href="#a-607050138">5.4</a>&nbsp;&nbsp;Editing this guide
3155
+ </h2>
3156
+ <div class="content">The <tt>doc/guide.erb</tt> file contains the source code of this guide. You must install <a href="http://gerbil.rubyforge.org">Gerbil</a> before you can run the <pre>rake doc</pre> command to automatically generate the HTML documentation you are currently viewing.</div>
3157
+ </div></div>
3158
+ </div>
3159
+ <div class="chapter">
3160
+ <h1 class="title">
3161
+ Chapter
3162
+ <a class="toc" id="problems" href="#a-607052618">6</a>
3163
+
3164
+ <br/>
3165
+
3166
+ <big>Known problems</big>
3167
+ </h1>
3168
+
3169
+ <div class="content"><p>This chapter presents known problems and possible solutions.</p>
3170
+
3171
+
3172
+ <p><div class="section">
3173
+ <h2 class="title">
3174
+ <a class="toc" id="problem.ivl" href="#a-607054268">6.1</a>&nbsp;&nbsp;Icarus Verilog
3175
+ </h2>
3176
+ <div class="content"><p>The following sections describe problems that occur when Icarus Verilog is used with Ruby-VPI.</p>
3177
+
3178
+
3179
+ <p><div class="section">
3180
+ <h3 class="title">
3181
+ <a class="toc" id="problems.ivl.vpi_handle_by_name.absolute-paths" href="#a-607055848">6.1.1</a>&nbsp;&nbsp;Give full paths to Verilog objects
3182
+ </h3>
3183
+ <div class="content"><p>In version 0.8 and snapshot 20061009 of Icarus Verilog, the <code class="code">vpi_handle_by_name</code> function requires an <em>absolute</em> path (including the name of the bench which instantiates the design) to a Verilog object. In addition, <code class="code">vpi_handle_by_name</code> always returns <code class="code"><span style="color:#038; font-weight:bold">nil</span></code> when its second parameter is specified.</p>
3184
+
3185
+
3186
+ <p>For example, consider <a class="xref" href="#ex:TestFoo">Example 16: <em>Part of a bench which instantiates a Verilog design</em></a>. Here, one must write <code class="code">vpi_handle_by_name(<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">TestFoo.my_foo.clk</span><span style="color:#710">&quot;</span></span>, <span style="color:#038; font-weight:bold">nil</span>)</code> instead of <code class="code">vpi_handle_by_name(<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">my_foo.clk</span><span style="color:#710">&quot;</span></span>, <span style="color:#036; font-weight:bold">TestFoo</span>)</code> in order to access the <code class="code">clk</code> input of the <code class="code">my_foo</code> module instance.</p>
3187
+
3188
+
3189
+ <p><div class="example">
3190
+ <p class="title"><a class="toc" id="ex:TestFoo" href="#a-607058828">Example 16</a>.&nbsp;&nbsp;Part of a bench which instantiates a Verilog design</p>
3191
+ <div class="content"><pre class="code" lang="verilog">
3192
+ module TestFoo;
3193
+ reg clk_reg;
3194
+ Foo my_foo(.clk(clk_reg));
3195
+ endmodule
3196
+ </pre></div>
3197
+ </div></p></div>
3198
+ </div>
3199
+ <div class="section">
3200
+ <h3 class="title">
3201
+ <a class="toc" id="problems.ivl.vpi_handle_by_name.connect-registers" href="#a-607061068">6.1.2</a>&nbsp;&nbsp;Registers must be connected
3202
+ </h3>
3203
+ <div class="content"><p>In version 0.8 of Icarus Verilog, if you want to access a register in a design, then it must be connected to something (either assigned to a wire or passed as a parameter to a module instantiation). Otherwise, you will get a <code class="code"><span style="color:#038; font-weight:bold">nil</span></code> value as the result of <code class="code">vpi_handle_by_name</code> method.</p>
3204
+
3205
+
3206
+ <p>For example, suppose you wanted to access the <code class="code">clk_reg</code> register, from the bench shown in <a class="xref" href="#ex:TestFoo_bad">Example 17: <em>Bad design with unconnected registers</em></a> If you execute the statement <code class="code">clk_reg = vpi_handle_by_name(<span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">TestFoo.clk_reg</span><span style="color:#710">&quot;</span></span>, <span style="color:#038; font-weight:bold">nil</span>)</code> in a specification, then you will discover that the <code class="code">vpi_handle_by_name</code> method returns <code class="code"><span style="color:#038; font-weight:bold">nil</span></code> instead of a handle to the <code class="code">clk_reg</code> register.</p>
3207
+
3208
+
3209
+ <p>The solution is to change the design such that it appears like the one shown in <a class="xref" href="#ex:TestFoo_fix">Example 18: <em>Fixed design with wired registers</em></a> where the register is connected to a wire, or <a class="xref" href="#ex:TestFoo">Example 16: <em>Part of a bench which instantiates a Verilog design</em></a> where the register is connected to a module instantiation.</p>
3210
+
3211
+
3212
+ <p><div class="example">
3213
+ <p class="title"><a class="toc" id="ex:TestFoo_bad" href="#a-607066798">Example 17</a>.&nbsp;&nbsp;Bad design with unconnected registers</p>
3214
+ <div class="content"><p>Here the <code class="code">clk_reg</code> register is not connected to anything.</p>
3215
+
3216
+
3217
+ <pre class="code" lang="verilog">
3218
+ module TestFoo;
3219
+ reg clk_reg;
3220
+ endmodule
3221
+ </pre></div>
3222
+ </div>
3223
+ <div class="example">
3224
+ <p class="title"><a class="toc" id="ex:TestFoo_fix" href="#a-607068638">Example 18</a>.&nbsp;&nbsp;Fixed design with wired registers</p>
3225
+ <div class="content"><p>Here the <code class="code">clk_reg</code> register is connected to the <code class="code">clk_wire</code> wire.</p>
3226
+
3227
+
3228
+ <pre class="code" lang="verilog">
3229
+ module TestFoo;
3230
+ reg clk_reg;
3231
+ wire clk_wire;
3232
+ assign clk_wire = clk_reg;
3233
+ endmodule
3234
+ </pre></div>
3235
+ </div></p></div>
3236
+ </div>
3237
+ <div class="section">
3238
+ <h3 class="title">
3239
+ <a class="toc" id="problems.ivl.vpi_reset" href="#a-607070908">6.1.3</a>&nbsp;&nbsp;VPI::reset
3240
+ </h3>
3241
+ <div class="content">In version 0.8 of Icarus Verilog, the <code class="code">vpi_control(vpiReset)</code> VPI function causes an assertion to fail inside the simulator. As a result, the simulation terminates and a core dump is produced.</div>
3242
+ </div></p></div>
3243
+ </div></p></div>
3244
+ </div>
3245
+ <div class="chapter">
3246
+ <h1 class="title">
3247
+ Chapter
3248
+ <a class="toc" id="glossary" href="#a-607073798">7</a>
3249
+
3250
+ <br/>
3251
+
3252
+ <big>Glossary</big>
3253
+ </h1>
3254
+
3255
+ <div class="content"><div class="section">
3256
+ <h2 class="title">
3257
+ <a class="toc" id="glossary.test" href="#a-607075458">7.1</a>&nbsp;&nbsp;Test
3258
+ </h2>
3259
+ <div class="content">Something that checks if a <a class="xref" href="#glossary.design">design</a> satisfies a <a class="xref" href="#glossary.specification">specification</a></div>
3260
+ </div>
3261
+ <div class="section">
3262
+ <h2 class="title">
3263
+ <a class="toc" id="glossary.design" href="#a-607080108">7.2</a>&nbsp;&nbsp;Design
3264
+ </h2>
3265
+ <div class="content">A Verilog module that is verified against a <a class="xref" href="#glossary.specification">specification</a> in order to ensure correctness or soundness of its being. In other words, it is the thing being checked: does it work or not?</div>
3266
+ </div>
3267
+ <div class="section">
3268
+ <h2 class="title">
3269
+ <a class="toc" id="glossary.specification" href="#a-607083458">7.3</a>&nbsp;&nbsp;Specification
3270
+ </h2>
3271
+ <div class="content">A set of <a class="xref" href="#glossary.expectation">expectations</a> which define the desired behavior of a <a class="xref" href="#glossary.design">design</a> when it is subjected to certain stimulus.</div>
3272
+ </div>
3273
+ <div class="section">
3274
+ <h2 class="title">
3275
+ <a class="toc" id="glossary.expectation" href="#a-607088168">7.4</a>&nbsp;&nbsp;Expectation
3276
+ </h2>
3277
+ <div class="content">The desired response to some stimulus.</div>
3278
+ </div>
3279
+ <div class="section">
3280
+ <h2 class="title">
3281
+ <a class="toc" id="glossary.handle" href="#a-607090238">7.5</a>&nbsp;&nbsp;Handle
3282
+ </h2>
3283
+ <div class="content">A reference to an object inside the Verilog simulation. See <a class="xref" href="#vpi.handles">Section 4.3.1: <em>Handles</em></a> for usage instructions.</div>
3284
+ </div>
3285
+ <div class="section">
3286
+ <h2 class="title">
3287
+ <a class="toc" id="glossary.rake" href="#a-607093668">7.6</a>&nbsp;&nbsp;Rake
3288
+ </h2>
3289
+ <div class="content"><blockquote>
3290
+ <p>Rake is a build tool, written in Ruby, using Ruby as a build language. Rake is similar to <strong>make</strong> in scope and purpose.</p>
3291
+ </blockquote>
3292
+
3293
+
3294
+ <p style="text-align:right;">&#8212;<a href="http://docs.rubyrake.org">Rake documentation</a></p></div>
3295
+ </div>
3296
+ <div class="section">
3297
+ <h2 class="title">
3298
+ <a class="toc" id="glossary.RSpec" href="#a-607095818">7.7</a>&nbsp;&nbsp;RSpec
3299
+ </h2>
3300
+ <div class="content"><p>The <a class="xref" href="#glossary.BDD">BDD</a> framework for Ruby.</p>
3301
+
3302
+
3303
+ <p>See the <a href="http://rspec.rubyforge.org">RSpec website</a> and <a href="http://rspec.rubyforge.org/documentation/index.html">tutorial</a> for more information.</p></div>
3304
+ </div>
3305
+ <div class="section">
3306
+ <h2 class="title">
3307
+ <a class="toc" id="glossary.TDD" href="#a-607099338">7.8</a>&nbsp;&nbsp;Test driven development
3308
+ </h2>
3309
+ <div class="content"><p>An <a href="http://agilemanifesto.org/">agile software development methodology</a> which emphasizes (1) testing functionality before implementing it and (2) refactoring.</p>
3310
+
3311
+
3312
+ <p>See <a href="http://www.agiledata.org/essays/tdd.html">this introductory article</a> for more information.</p></div>
3313
+ </div>
3314
+ <div class="section">
3315
+ <h2 class="title">
3316
+ <a class="toc" id="glossary.BDD" href="#a-607101548">7.9</a>&nbsp;&nbsp;Behavior driven development
3317
+ </h2>
3318
+ <div class="content"><p>An <a href="http://agilemanifesto.org/">agile software development methodology</a> which emphasizes thinking in terms of behavior when designing, implementing, and verifying software.</p>
3319
+
3320
+
3321
+ <p>See the <a href="http://behaviour-driven.org/">official wiki</a> for more information.</p></div>
3322
+ </div></div>
3323
+ </div></div>
3324
+
3325
+
3326
+ <br style="display: none"/>
3327
+ <hr style="display: none"/>
3328
+ <br style="display: none"/>
3329
+
3330
+
3331
+ <div id="footer">
3332
+
3333
+ Generated on Sun Jan 27 22:46:48 -0800 2008 by <a href="http://gerbil.rubyforge.org">Gerbil</a> 1.1.0.
3334
+
3335
+ <p>The admonition icons (<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgI
3336
+ fAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3
3337
+ Lmlua3NjYXBlLm9yZ5vuPBoAAAyOSURBVGiB1ZlrkB3Fdcf/5/Q87r1z7z7u
3338
+ vrSrXa3QC7EIyUFCSWwnJIANFiGJXdQSICRllGDni4LjqviDnQ+ufHEKx2BX
3339
+ ygg9cEwVriBcMsZOHFlEWCo/glFhrAeSxe6ifWnvPu7evc+Z6Z6ezoe7S7aU
3340
+ QO1qF5N01anpmaqZ/v/6nNMzfYaMMfj/3Pj9FrDSZq3Wg4iIPvnIX+8G2fcS
3341
+ 2R+BiTtMHGUBgNiaBfGkMeo4jPr2Nw589edm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69q7nemSr5k5YuJoPF+7srGzoSvtuTxZlueK
3375
+ fvRz1xK+Y1MgiBUxdCKZabFd975CoXzOYbKMERwLspqSdk9z0tnwT//yrYqR
3376
+ +OxyNC27KqHI3P+Tl/99LhEVM+taMykGacGkY4OgUAlGshm30WFSQpC0bAot
3377
+ QYHlkG8Ly29IJZuVil+3iSqWTaHFpFoyybbetoY79z+1P/arlQeXu71cNsAz
3378
+ Tz42pf3ybx974Xk/EVfbmtNugpk0Mel8RY3ZZFLMpGzByiaWjuDQsThIuuzH
3379
+ MsjIOD4rLAotwdKxLNPZ6N375P798fDl0T89fOArLy1XzzXVhQ4e/NpYFNRu
3380
+ /8mJY4muZq9FEDQT6WIlmC3MzrgUKVcQKWGRFMSha7EfVqtObvKKkKEcFcRS
3381
+ CFYtDcntA0OD/uWRkS89ffCx716LlmsubB08+PiF3MTEf2q/mBVCMBEMk1D5
3382
+ QqkwV8hliVhbhMh2WDmCw6HBX7UX8rMjlu34FkGxYe0w73jp+Esp24ivX6uO
3383
+ FVXmlAyfGR8doUbPTVP9O81EhmeGBy+1MyM24FgwtBCWOnfm9U4IGnSEUUKw
3384
+ ZmFiBrpzE7lzTz31pSW/ea9uK6rMCYhTA5cuJbfuuLljYLw0JaszbYh8PXz5
3385
+ 4gbvZ9V7PC+yTRxWpqcKswMD422t7cmhwC+ku9dv9710U28gQxOE/rI28asK
3386
+ cOjQl4f/8q8+NzQ5ermjwTaNuZk32i2KUglX0dTUOPr6NsC2ErgyNon16zNI
3387
+ uDN/ODY2PjYydun0H+z51Ieeff5IYCJ97H0DAIBYqo9/5/nnzv753ofaUj3b
3388
+ rOn8KLq6Q0xOXIFtJ2FbgON42LxlM7q62oUxTm8qtaX3/PkzpXPnz506dOjx
3389
+ f13J+KtSG+3/k4/8sr1j1/aPfuyjuOH6LSiWp6CjKrSuQVCIVDKNZKoJqWQW
3390
+ rtuC4y8dMz/84alAgK47ePCJyfcVYM+ezRu71mYH7rijD2fPr4FlZ7F79060
3391
+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m3aJG9Ww4o1MPnXQVe09fovEsXBC+AXO16LBK/
3408
+ 0BYggPpqs9jeBlvqCnTNAP/jIXWgBeNF/YXzBfHxIoC3z5cj+Or2X3r9Ye2F
3409
+ 1izgAAAAAElFTkSuQmCC
3410
+ " alt="tip"/> <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgI
3411
+ fAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3
3412
+ Lmlua3NjYXBlLm9yZ5vuPBoAAAmCSURBVGiB1ZltbJXlGcd/9/N+Tlssh1Ja
3413
+ hNEJaK2UFxFptqC2wGCSTWdM3DSQzWVDEzVxy4xfjNkHQ8xMnEEXviwZ62Rj
3414
+ 6siWTcVBZeJA5yBQpOWlKNZSaEvpyyk95zwv970Pp+fY5/S0tFBkXsmTc67n
3415
+ eu77+f/u6349Ryil+Cqbdq0FXKldEuClp+3nfvVz/eJLT9vPXQv/igFc13tq
3416
+ w4/ujLqu99S18C9lRr6br7zyyi2WZb2eSqUqpVSUlE5BSmW8/PLL6sv2bdtu
3417
+ TiaT9z/++ONN486AZVm/XLiw+qZlt98Wun/bsqUhf+nSJSF/ya2LQv6ixQtD
3418
+ /sJFC0L+guqqkF91S2XIr6y6idlfm1Vp2/Yz+XSOCiCEqDJMQ3ze+hm6bnC+
3419
+ sx9d1zl+vBlN1znf2Y+m6TQfa0LTvvCbmo6G/KNHj4T8Ix83hvzGI4dD/uHG
3420
+ QyG/peUElmUJIURlPp2jAkgpiwXg+R5FM9dRv3U/heXrkFJSWHZ32i/7NlJK
3421
+ CsrWUr91P9EZa5FSEildQ/3W/USmfwspJc701dRv3Y9dshopJda0VdRv3Y8V
3422
+ W4mUEjO2kvqt+zCm1iGlxCiu5fe/24defBeu6yHSkopHAxD51oEtW7bEb1++
3423
+ rLC5+ShBEKCU+uJCgWJCvlJD9/iinlw/o2O4b5omixct4fixkz2PPPJILB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6+i6jmmaGIaB4zg4joNhGKEsZ0xKyZCu
3457
+ GZcCKMnsRIf3QV3XRwBkYmUzK0JAmSsIguz3fK2t6zqapqFp2og6873Hsiw8
3458
+ z5s+JkAqlZqaycDlTKO5gsZTbjynvkwGXNedOiaA67pT8gFMBOJqxDIAqVRq
3459
+ xI+8IYBEIlE4lKoJn4evZiwDkEgkinKfyeZ748aNpuu6pmma2QzkXplKv+yY
3460
+ lBLTNEkmk86CBQus4QDZDDQ2Nl4/f/5817Isp7S0NDv3T6aNZzUfzXzfRwjh
3461
+ K6XmCCHOAoNKKWkACCEKqqurpwkhZEtLC42NjZOledKsuroaTdOU67olwACg
3462
+ CSEGDCGEBdiu6zq+75NMJkNL+v+LJRIJfN8nkUhEgAgQAK5BehzoPT098e7u
3463
+ bj2VSjFnzpxrKjafSSm5cOEC/f39KUAnrVsTgAkUAYU1NTUPx2KxjUEQTLmW
3464
+ YvOZpmnxjo6O3x48eHA76S4UB3qEUgohRBQoGLoyKTJJp+nyR97kmA1IwANS
3465
+ wODQ1auUSmYP9UNjoQBwAIv0DBUMFb6WZpNuRB9wSYsfUEr5kOdfSiGETrr1
3466
+ DUCQhrhWJkj394A0gKeUCjVo3r9Zv0r2P3yyQqPd16MPAAAAAElFTkSuQmCC
3467
+ " alt="note"/> <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABHNCSVQICAgI
3468
+ fAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3
3469
+ Lmlua3NjYXBlLm9yZ5vuPBoAAAiESURBVGiB7ZpdbBzVFcd/Z2Znd2d3vbtm
3470
+ /RWvsbEdfyauSWzq2MZWEFVD5AqBaBpRVyaKoaakEBMEBRRVBaukKiqhQF+i
3471
+ ioRU9MVUah+ChCIeEiXEIcRECShxxJflOqmxk8gmXq/Xu3v7sB84ju049oYU
3472
+ qUe6ujM7d+75/e+ZO/fMzIpSiu+zaTcbY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xeBGwWHBs
3489
+ 2wZAdGKC0OefU1xZabfC64tkuT7bLVKk2+0bc1etMhIJm5aVha2t7YrLJi0t
3490
+ LXmOa5owAPP++7GUlQEQPH0an98vhtNZtVvkRzdcgAX+tHzNGluor4/I6CgA
3491
+ 9i1b0EwzCQ/gdDqvEJAwEQFNw/XMMwCoUIjJs2cprqx0WhYRhesSsFfkB4bL
3492
+ 9eOcykp9/MiRWAe33oo9nipMH+WZEUgcTxT7unUYq1YBsRTD4/Nher35u0V+
3493
+ esMEaPDnkvp6M3jyJNFAAABz61awWK5auKaPelpaWhJ8ulD3888DoCIRgmfO
3494
+ UFRe7tDh1etJtxcs4C2RRtstt/wwo7hYxo8dA0AvKcF2331XwcOVl830OTC9
3495
+ tjY0YGtqAiDU34/L4cDt86XfBptTLkDgjdL6esfE8eOoyUkAzG3bEF2/Cn62
3496
+ CMw8nqjdzz0Xa6QUwdOnKSwtdQjs6BYxUyZgr8h6Z1ZWiTc3l8DHHwNgqarC
3497
+ ds89SZCZcNPngNPpnBUewLpqFWZLCwBT589jF+GW7GwzCFtTIyDm6fWyxkbn
3498
+ +NGjqHAYAMfTT18BMhNuoREQEdzPPgvxSAb7+sgvLjaVyPY9It4lC9gDG715
3499
+ eTkur5eJTz4BwKirw2hqmhMeoKioiPb2dtrb2yksLJwTHsBaWopzwwYAwhcu
3500
+ YASDZC1bZtFh+7X45k0lXhCxFMLAHRs35kRPnEjm+57ubow77pgTPlEPDAwA
3501
+ UFBQMCd8oo4MDnJ+zRpUKITudmOsXMnxnp6gFo0W/UKp83MxzhuBfHgko7jY
3502
+ bTcMgmfPAmC9664Fwb/88ss0NDTQ2NjIzp0754UXESx5ebja2mJixsaQ0VFy
3503
+ /X49CjvmY5wzAt0iZlBksK61NT10+DCTX34JInj37cNSWTkvvIhQU1PD0NAQ
3504
+ ADk5OfT29s4Jn6gjIyMM1tSgAgE008RaXU3vsWPBUCRS1a7UZ7NxzhmBCXgy
3505
+ p7zctExOxuABW0vLguABamtrk31VV1dfEx7AkpmJ59FHgViip0ZGyPP7DSu8
3506
+ MhfnrBHYJeIxNe3f9W1trsD+/UwNDoKuk75/P3pR0TVBRIQLFy7w9ttvA9Da
3507
+ 2kpWVtY1zxERomNjDKxeTfTSJcRqxVZdzYkTJ4KRqamGNqU+nsk6awTssD2v
3508
+ qsqQixdj8ID9gQcWDA+QkZFBZ2cnnZ2dC4YH0D0evFtjS4AKhYgODZHv99u0
3509
+ ORK9qwT8VSRbdP2xgtpa2+V4wiZWK47OzgXBTy8LETpbW29HB3p2NhB7i+FL
3510
+ TxfdZlu9R2TtvAJExKrgd/kVFUZ0aIjw8HBsVMrKkg/q1wOyWKFit2PW1QGx
3511
+ RC88NMStOTmmBn+U6YsP0z5wiIgdcBmwLnvlSmPi0KFko/CpUwwXFc0U/51Z
3512
+ +Ouv8a5Ygervr/aCR0RGVXzyagAiogN2wBGFaGRyEt3nQwzjpkEnTdPQnE7C
3513
+ U1MAwakYZzLRS0RAj29bzsE/+w4f/nVlc7PNV1MDmhZ7WasURKOoaDS5jVKx
3514
+ /dm2E22i0W+3Z2s/89gsfoKTk3zR3z9xEf4xHmNNpsCilEJiDxBuIA1I+z08
3515
+ lQP3aeBFBNHmWbBT/aV/Wn8qvh+F0Uuw73noCsEocEkpFUwKABARJ+CKFwex
3516
+ MFmBqURf37Fpcf9hIAgEgHFgDBhLzIHkJFZKjYuIAiJACJiIH79ZAhKXdSTO
3517
+ ECQGPj690VUrcfw2ZYuXhICbYRZiUUhEYFLNkjYs6s3c/5J97/9q8F/RUcwR
3518
+ 4xicOQAAAABJRU5ErkJggg==
3519
+ " alt="caution"/>) used in this document are Copyright &copy; 2005 <a href="http://tango.freedesktop.org">Tango Desktop Project</a>. They are part of the <a href="http://tango.freedesktop.org/Tango_Icon_Library">Tango Icon Theme</a> set, which is distributed under the <a href="http://creativecommons.org/licenses/by-sa/2.5/">Creative Commons Attribution-ShareAlike 2.5 License Agreement</a>.</p>
3520
+
3521
+ </div>
3522
+
3523
+ </body>
3524
+ </html>