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/manual.html DELETED
@@ -1,3061 +0,0 @@
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
- <link rel="stylesheet" type="text/css" href="screen.css" media="screen" />
6
- <link rel="stylesheet" type="text/css" href="print.css" media="print" />
7
- <link rel="alternate stylesheet" type="text/css" href="print.css" title="Print Preview" />
8
- <link rel="alternate" type="application/rss+xml" href="http://ruby-vpi.rubyforge.org/doc/rss.xml" title="RSS feed for this project." />
9
- <title>Ruby-VPI user manual</title>
10
- </head>
11
- <body>
12
- <div id="menu">
13
- <h1>Site navigation</h1>
14
- <ul id="site-links">
15
- <li><a href="readme.html">Home</a></li>
16
- <li><a href="manual.html">Manual</a></li>
17
- <li><a href="memo.html">Memo</a></li>
18
- <li><a href="history.html">History</a></li>
19
- </ul>
20
-
21
- <h1>Menu navigation</h1>
22
- <ul id="toc-links">
23
- <li><a href="#toc-contents">Contents</a></li><li><a href="#toc:tip">Tips</a></li><li><a href="#toc:note">Notes</a></li><li><a href="#toc:caution">Cautions</a></li><li><a href="#toc:figure">Figures</a></li><li><a href="#toc:table">Tables</a></li><li><a href="#toc:example">Examples</a></li>
24
- </ul>
25
-
26
- <div id="toc">
27
- <h1 id="toc-contents">Contents</h1>
28
- <ul><li>1 <a id="a-607060028" href="#Ruby-VPI_user_manual" class="ref">Ruby-VPI user manual</a><ul><li>1.1 <a id="a-607052878" href="#About_this_manual" class="ref">About this manual</a></li><li>1.2 <a id="a-607055408" href="#Legal_notice" class="ref">Legal notice</a></li></ul></li><li>2 <a id="a-607140228" href="#intro" class="ref">Welcome</a><ul><li>2.1 <a id="a-607073948" href="#resources" class="ref">Resources</a><ul><li>2.1.1 <a id="a-607063268" href="#Records" class="ref">Records</a></li><li>2.1.2 <a id="a-607065648" href="#Documentation" class="ref">Documentation</a></li><li>2.1.3 <a id="a-607068348" href="#Facilities" class="ref">Facilities</a></li></ul></li><li>2.2 <a id="a-607086258" href="#intro.features" class="ref">Features</a><ul><li>2.2.1 <a id="a-607076588" href="#Portable" class="ref">Portable</a></li><li>2.2.2 <a id="a-607078988" href="#Agile" class="ref">Agile</a></li><li>2.2.3 <a id="a-607081388" href="#Powerful" class="ref">Powerful</a></li></ul></li><li>2.3 <a id="a-607098488" href="#intro.reqs" class="ref">Requirements</a><ul><li>2.3.1 <a id="a-607088898" href="#Verilog_simulator" class="ref">Verilog simulator</a></li><li>2.3.2 <a id="a-607091338" href="#Compilers" class="ref">Compilers</a></li><li>2.3.3 <a id="a-607093658" href="#Libraries" class="ref">Libraries</a></li></ul></li><li>2.4 <a id="a-607101288" href="#intro.appetizers" class="ref">Appetizers</a></li><li>2.5 <a id="a-607103848" href="#intro.applications" class="ref">Applications</a></li><li>2.6 <a id="a-607109258" href="#intro.related-works" class="ref">Related works</a><ul><li>2.6.1 <a id="a-607106308" href="#intro.related-works.pli" class="ref">Ye olde PLI</a></li></ul></li><li>2.7 <a id="a-607112128" href="#intro.license" class="ref">License</a></li></ul></li><li>3 <a id="a-607180888" href="#setup" class="ref">Setup</a><ul><li>3.1 <a id="a-607143418" href="#setup.manifest" class="ref">Manifest</a></li><li>3.2 <a id="a-607148858" href="#setup.reqs" class="ref">Requirements</a></li><li>3.3 <a id="a-607155028" href="#setup.recom" class="ref">Recommendations</a><ul><li>3.3.1 <a id="a-607151688" href="#setup.recom.merger" class="ref">Text merging tool</a></li></ul></li><li>3.4 <a id="a-607164168" href="#setup.inst" class="ref">Installation</a><ul><li>3.4.1 <a id="a-607160108" href="#setup.inst.windows" class="ref">Installing on Windows</a></li></ul></li><li>3.5 <a id="a-607166448" href="#setup.maintenance" class="ref">Maintenance</a></li></ul></li><li>4 <a id="a-607194908" href="#organization" class="ref">Organization</a><ul><li>4.1 <a id="a-607189198" href="#organization.tests" class="ref">Tests</a></li></ul></li><li>5 <a id="a-607339858" href="#usage" class="ref">Usage</a><ul><li>5.1 <a id="a-607201128" href="#overview.relay" class="ref">Interacting with the Verilog simulator</a></li><li>5.2 <a id="a-607084798" href="#vpi" class="ref">VPI in Ruby</a><ul><li>5.2.1 <a id="a-607039078" href="#vpi.handles" class="ref">Handles</a><ul><li>5.2.1.1 <a id="a-607206178" href="#Shortcuts_for_productivity" class="ref">Shortcuts for productivity</a></li><li>5.2.1.2 <a id="a-607208738" href="#Accessing_a_handle_s_relatives" class="ref">Accessing a handle&#8217;s relatives</a></li><li>5.2.1.3 <a id="a-607211678" href="#Accessing_a_handle_s_properties" class="ref">Accessing a handle&#8217;s properties</a></li></ul></li><li>5.2.2 <a id="a-607049268" href="#vpi.callbacks" class="ref">Callbacks</a></li></ul></li><li>5.3 <a id="a-607113668" href="#usage.concurrency" class="ref">Concurrency</a><ul><li>5.3.1 <a id="a-607100498" href="#Creating_a_concurrent_process" class="ref">Creating a concurrent process</a></li></ul></li><li>5.4 <a id="a-607122918" href="#usage.prototyping" class="ref">Prototyping</a><ul><li>5.4.1 <a id="a-607117988" href="#Creating_a_prototype" class="ref">Creating a prototype</a></li></ul></li><li>5.5 <a id="a-607128648" href="#usage.debugger" class="ref">Interactive debugging</a><ul><li>5.5.1 <a id="a-607125578" href="#usage.debugger.init" class="ref">Advanced initialization</a></li></ul></li><li>5.6 <a id="a-607150648" href="#usage.runner" class="ref">Test runner</a><ul><li>5.6.1 <a id="a-607138328" href="#usage.runner.env-vars" class="ref">Environment variables</a><ul><li>5.6.1.1 <a id="a-607131748" href="#Variables_as_command-line_arguments" class="ref">Variables as command-line arguments</a></li></ul></li></ul></li><li>5.7 <a id="a-607177328" href="#usage.tools" class="ref">Tools</a><ul><li>5.7.1 <a id="a-607165778" href="#usage.tools.generate" class="ref">Automated test generation</a></li><li>5.7.2 <a id="a-607169418" href="#usage.tools.convert" class="ref">Verilog to Ruby conversion</a></li></ul></li><li>5.8 <a id="a-607179568" href="#usage.examples" class="ref">Example tests</a></li><li>5.9 <a id="a-607105538" href="#usage.tutorial" class="ref">Tutorial</a><ul><li>5.9.1 <a id="a-607192538" href="#usage.tutorial.declare-design" class="ref">Start with a Verilog design</a></li><li>5.9.2 <a id="a-607217768" href="#usage.tutorial.generate-test" class="ref">Generate a test</a></li><li>5.9.3 <a id="a-607227868" href="#usage.tutorial.specification" class="ref">Specify your expectations</a></li><li>5.9.4 <a id="a-607233858" href="#usage.tutorial.implement-proto" class="ref">Implement the prototype</a></li><li>5.9.5 <a id="a-607247108" href="#usage.tutorial.test-proto" class="ref">Verify the prototype</a></li><li>5.9.6 <a id="a-607253098" href="#usage.tutorial.implement-design" class="ref">Implement the design</a></li><li>5.9.7 <a id="a-607037508" href="#usage.tutorial.test-design" class="ref">Verify the design</a></li></ul></li></ul></li><li>6 <a id="a-607355358" href="#hacking" class="ref">Hacking</a><ul><li>6.1 <a id="a-607342188" href="#hacking.scm" class="ref">Getting the latest source code</a></li><li>6.2 <a id="a-607344708" href="#Installing_without_really_installing" class="ref">Installing without really installing</a></li><li>6.3 <a id="a-607347318" href="#hacking.release-packages" class="ref">Building release packages</a></li><li>6.4 <a id="a-607349668" href="#hacking.manual" class="ref">Editing this manual</a></li></ul></li><li>7 <a id="a-607403828" href="#problems" class="ref">Known problems</a><ul><li>7.1 <a id="a-607383948" href="#problem.ivl" class="ref">Icarus Verilog</a><ul><li>7.1.1 <a id="a-607361328" href="#problems.ivl.vpi_handle_by_name.absolute-paths" class="ref">Give full paths to Verilog objects</a></li><li>7.1.2 <a id="a-607371018" href="#problems.ivl.vpi_handle_by_name.connect-registers" class="ref">Registers must be connected</a></li><li>7.1.3 <a id="a-607373268" href="#problems.ivl.vpi_reset" class="ref">VPI::reset</a></li></ul></li></ul></li><li>8 <a id="a-607436278" href="#glossary" class="ref">Glossary</a><ul><li>8.1 <a id="a-607406658" href="#glossary.test" class="ref">Test</a></li><li>8.2 <a id="a-607409158" href="#glossary.design" class="ref">Design</a></li><li>8.3 <a id="a-607411918" href="#glossary.specification" class="ref">Specification</a></li><li>8.4 <a id="a-607414138" href="#glossary.expectation" class="ref">Expectation</a></li><li>8.5 <a id="a-607416618" href="#glossary.handle" class="ref">Handle</a></li><li>8.6 <a id="a-607418878" href="#glossary.rake" class="ref">Rake</a></li><li>8.7 <a id="a-607421418" href="#glossary.RSpec" class="ref">RSpec</a></li><li>8.8 <a id="a-607423678" href="#glossary.TDD" class="ref">Test driven development</a></li><li>8.9 <a id="a-607425938" href="#glossary.BDD" class="ref">Behavior driven development</a></li></ul></li></ul>
29
-
30
- <h1 id="toc:tip">Tips</h1>
31
- <ol>
32
- <li><a href="#Add_support_for_your_Verilog_simulator" id="a-607145888">Add support for your Verilog simulator</a></li>
33
- <li><a href="#Tuning_for_maximum_performance" id="a-607157578">Tuning for maximum performance</a></li>
34
- <li><a href="#Using__kdiff3__with_the_automated_test_generator." id="a-607159448">Using <strong>kdiff3</strong> with the automated test generator.</a></li>
35
- <li><a href="#What_can_the_test_runner_do_" id="a-607241748">What can the test runner do?</a></li>
36
- </ol>
37
- <h1 id="toc:note">Notes</h1>
38
- <ol>
39
- <li><a href="#Constants_are_capitalized_in_Ruby" id="a-607203518">Constants are capitalized in Ruby</a></li>
40
- </ol>
41
- <h1 id="toc:caution">Cautions</h1>
42
- <ol>
43
- <li><a href="#Do_not_rename_generated_files" id="a-607154698">Do not rename generated files</a></li>
44
- </ol>
45
- <h1 id="toc:figure">Figures</h1>
46
- <ol>
47
- <li><a href="#fig:organization.detail" id="a-607183488">Where does Ruby-VPI fit in?</a></li>
48
- <li><a href="#fig:organization" id="a-607186098">Organization of a test in Ruby-VPI</a></li>
49
- <li><a href="#fig:ruby_relay" id="a-607197648">Interaction between Ruby and Verilog</a></li>
50
- <li><a href="#fig:method_naming_format" id="a-607214478">Method naming format for accessing a handle&#8217;s properties</a></li>
51
- </ol>
52
- <h1 id="toc:table">Tables</h1>
53
- <ol>
54
- <li><a href="#tbl:accessors" id="a-607216908">Possible accessors and their implications</a></li>
55
- <li><a href="#ex:properties" id="a-607004748">Examples of accessing a handle&#8217;s properties</a></li>
56
- </ol>
57
- <h1 id="toc:example">Examples</h1>
58
- <ol>
59
- <li><a href="#ex:callback" id="a-607043828">Using a callback for value change notification</a></li>
60
- <li><a href="#An_edge-triggered__always__block" id="a-607088908">An edge-triggered &#8220;always&#8221; block</a></li>
61
- <li><a href="#A_change-triggered__combinational___always__block" id="a-607094288">A change-triggered (combinational) &#8220;always&#8221; block</a></li>
62
- <li><a href="#Running_a_test_with_environment_variables" id="a-607134148">Running a test with environment variables</a></li>
63
- <li><a href="#fig:counter.v_decl" id="a-607186858">Declaration of a simple up-counter with synchronous reset</a></li>
64
- <li><a href="#fig:generate-test.RSpec" id="a-607199068">Generating a test with specification in RSpec format</a></li>
65
- <li><a href="#fig:generate-test.xUnit" id="a-607205488">Generating a test with specification in xUnit format</a></li>
66
- <li><a href="#fig:RSpec_counter_spec.rb" id="a-607220678">Specification implemented in RSpec format</a></li>
67
- <li><a href="#fig:xUnit_counter_spec.rb" id="a-607223038">Specification implemented in xUnit format</a></li>
68
- <li><a href="#fig:counter_proto.rb" id="a-607230458">Ruby prototype of our Verilog design</a></li>
69
- <li><a href="#fig:test-proto.RSpec" id="a-607236978">Running a test with specification in RSpec format</a></li>
70
- <li><a href="#fig:test-proto.unit-test" id="a-607239478">Running a test with specification in xUnit format</a></li>
71
- <li><a href="#fig:counter.v_impl" id="a-607249698">Implementation of a simple up-counter with synchronous reset</a></li>
72
- <li><a href="#fig:test-design.RSpec" id="a-607000458">Running a test with specification in RSpec format</a></li>
73
- <li><a href="#fig:test-design.unit-test" id="a-607031948">Running a test with specification in xUnit format</a></li>
74
- <li><a href="#ex:TestFoo" id="a-607358168">Part of a bench which instantiates a Verilog design</a></li>
75
- <li><a href="#ex:TestFoo_bad" id="a-607364228">Bad design with unconnected registers</a></li>
76
- <li><a href="#ex:TestFoo_fix" id="a-607366668">Fixed design with wired registers</a></li>
77
- </ol>
78
- </div>
79
- </div>
80
-
81
- <div id="body">
82
-
83
- <hr style="display: none"/>
84
-
85
- <div id="Ruby-VPI_user_manual" class="front_cover">
86
- <h1 class="title"><big>Ruby-VPI user manual</big></h1>
87
-
88
- <h2 class="author">Suraj N. Kurapati</h2>
89
-
90
-
91
- <h3 class="date">27 August 2007</h3>
92
-
93
-
94
- <p style="text-align:center;"><a href="history.html#a19.0.0">Version 19.0.0</a></p>
95
-
96
-
97
- <p>
98
- <div id="About_this_manual" class="paragraph">
99
- <p class="title">About this manual</p>
100
- <p>This manual is meant to be read in conjunction with the <a href="../ref/ruby/index.html">reference documentation for Ruby-VPI</a>. In addition, if you are new to <a href="http://www.ruby-lang.org">the Ruby language</a>, you are encouraged to <a href="http://www.ruby-lang.org/en/documentation/">explore its documentation</a> as necessary.</p>
101
-
102
-
103
- <p>In this manual, you will notice that the numbers of chapters, sections, figures, admonitions, etc. are hyperlinks that take you back to the corresponding place in the table of contents. These links make it easy to navigate this manual, especially for users of text-only web browsers.</p>
104
-
105
-
106
- <p>In addition, this manual is distributed as one big HTML file so that you can easily search for a particular topic using nothing more than your web browser&#8217;s built-in text search mechanism. This facilitates offline reading, where an Internet search engine is not available.</p>
107
-
108
-
109
- <p>Finally, this manual comes equipped with a stylesheet that makes it suitable for printing. In particular, users of the <a href="http://mozilla.org">Mozilla</a> family of web browsers will be pleasantly surprised to notice that all hyperlinks have been expanded to include their target URL next to the link text. So try using the &#8220;print preview&#8221; function of a graphical web browser to see how this manual will appear when printed.</p>
110
-
111
-
112
- <p>You can give feedback about this manual and, in general, any aspect of the Ruby-VPI project on the <a href="http://ruby-vpi.rubyforge.org/forum/">project forums</a>. Furthermore, you can <a href="#hacking.manual" class="ref">edit this manual</a> yourself and contribute your improvements to the <a href="http://ruby-vpi.rubyforge.org/tracker/">project patches</a> tracker. Finally, you can find the newest version of this manual at the <a href="http://ruby-vpi.rubyforge.org/">Ruby-VPI project website</a>.</p>
113
- </div>
114
-
115
-
116
- <div id="Legal_notice" class="paragraph">
117
- <p class="title">Legal notice</p>
118
- <p>This manual is distributed under <a href="#intro.license" class="ref">the same license as Ruby-VPI</a>.</p>
119
-
120
-
121
- <p>The admonition graphics used in this manual are Copyright 2005, 2006 <a href="http://tango.freedesktop.org/Tango_Desktop_Project">Tango Desktop Project</a> and are distributed under <a href="./images/tango/LICENSE">these terms</a>.</p>
122
- </div>
123
- </p>
124
-
125
- </div>
126
-
127
-
128
- <hr style="display: none"/>
129
-
130
- <div id="intro" class="chapter">
131
- <h1 class="title">
132
- Chapter <a href="#a-607140228" class="ref">2</a>
133
-
134
- <br/><br/>
135
-
136
- <big>Welcome</big>
137
- </h1>
138
-
139
- <p>Ruby-VPI is a platform for unit testing, rapid prototyping, and systems integration of Verilog modules through the <a href="http://www.ruby-lang.org">Ruby programming language</a>. It lets you:</p>
140
-
141
-
142
- <ul>
143
- <li>Access the <em>entire</em> <a href="http://ieeexplore.ieee.org/xpl/standardstoc.jsp?isnumber=33945"><span class="caps">IEEE 1364</span>-2005 Verilog VPI</a> interface from Ruby.</li>
144
- <li>Create complex Verilog test benches easily and wholly in Ruby.</li>
145
- <li>Apply agile software development practices to develop hardware.</li>
146
- <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>
147
- </ul>
148
-
149
-
150
- <p>Ruby-VPI is <a href="http://en.wikipedia.org/wiki/Open_source_software">open source software</a> released under <a href="#intro.license">this license</a>.</p>
151
-
152
-
153
- <p>
154
- <hr style="display: none"/>
155
-
156
- <div id="resources" class="section">
157
- <h2 class="title">
158
- <a href="#a-607073948" class="ref">2.1</a>
159
-
160
- &nbsp;
161
-
162
- Resources
163
- </h2>
164
-
165
-
166
- <div id="Records" class="paragraph">
167
- <p class="title">Records</p>
168
- <ul>
169
- <li><a href="history.html#a19.0.0">What&#8217;s new</a>
170
- &#8211; release notes for version 19.0.0.
171
- <ul>
172
- <li><a href="history.html">History</a>
173
- &#8211; a record of all release notes.</li>
174
- <li><a type="application/rss+xml" href="http://ruby-vpi.rubyforge.org/doc/rss.xml"><img src="images/feed-icon-28x28.png" alt="RSS feed for release announcements" style="float: right"/></a> <a href="http://ruby-vpi.rubyforge.org/doc/rss.xml">RSS feed</a>
175
- &#8211; keep track of new releases at your leisure.</li>
176
- </ul>
177
- </li>
178
- <li><a href="memo.html">Plans</a>
179
- &#8211; pending tasks for future releases.</li>
180
- <li><a href="http://ruby-vpi.rubyforge.org/talks/">Talks</a>
181
- &#8211; materials from presentations and seminars.</li>
182
- <li><a href="http://ruby-vpi.rubyforge.org/papers/">Papers</a>
183
- &#8211; research publications.</li>
184
- </ul>
185
- </div>
186
-
187
-
188
- <div id="Documentation" class="paragraph">
189
- <p class="title">Documentation</p>
190
- <ul>
191
- <li><a href="http://ruby-vpi.rubyforge.org/papers/masters_thesis.html#tth_sEc5.2">Motivation</a>
192
- &#8211; why was Ruby-VPI developed?</li>
193
- <li><a href="manual.html">User manual</a>
194
- &#8211; complete documentation for users.
195
- <ul>
196
- <li><a href="manual.html#usage.tutorial">Tutorial</a>
197
- &#8211; learn how to use Ruby-VPI quickly.</li>
198
- </ul>
199
- </li>
200
- <li><a href="../ref/">Reference</a>
201
- &#8211; API documentation for Ruby libraries and C extension.</li>
202
- </ul>
203
- </div>
204
-
205
-
206
- <div id="Facilities" class="paragraph">
207
- <p class="title">Facilities</p>
208
- <ul>
209
- <li><a href="http://ruby-vpi.rubyforge.org/download/">Downloads</a>
210
- &#8211; obtain release packages</li>
211
- <li><a href="http://ruby-vpi.rubyforge.org/code/">Source code</a>
212
- &#8211; browse online or obtain with <a href="http://darcs.net">Darcs</a>.</li>
213
- <li><a href="http://ruby-vpi.rubyforge.org/forum/">Forums</a>
214
- &#8211; discuss things and ask questions.</li>
215
- <li><a href="http://ruby-vpi.rubyforge.org/mail/">Mailing list</a>
216
- &#8211; discuss things and ask questions.</li>
217
- <li><a href="http://ruby-vpi.rubyforge.org/tracker/">Bugs</a>
218
- &#8211; report defects in the software.</li>
219
- <li><a href="http://ruby-vpi.rubyforge.org/tracker/">Patches</a>
220
- &#8211; submit patches to source code.</li>
221
- <li><a href="http://ruby-vpi.rubyforge.org/tracker/">Requests</a>
222
- &#8211; request new features or get support.</li>
223
- <li><a href="http://ruby-vpi.rubyforge.org/portal/">Project portal</a>
224
- &#8211; hosted generously by <a href="http://rubyforge.org">RubyForge</a>.</li>
225
- </ul>
226
- </div>
227
-
228
-
229
- </div>
230
- </p>
231
-
232
-
233
- <p>
234
- <hr style="display: none"/>
235
-
236
- <div id="intro.features" class="section">
237
- <h2 class="title">
238
- <a href="#a-607086258" class="ref">2.2</a>
239
-
240
- &nbsp;
241
-
242
- Features
243
- </h2>
244
-
245
-
246
- <div id="Portable" class="paragraph">
247
- <p class="title">Portable</p>
248
- <ul>
249
- <li>Supports the <em>entire</em> <a href="http://ieeexplore.ieee.org/xpl/standardstoc.jsp?isnumber=33945"><span class="caps">IEEE 1364</span>-2005 Verilog VPI</a> standard.</li>
250
- <li>Works with all <a href="#intro.reqs" class="ref">major Verilog simulators</a> available today.</li>
251
- <li>Compiled <em>just once</em> during <a href="manual.html#setup.inst">installation</a> and used forever!</li>
252
- </ul>
253
- </div>
254
-
255
-
256
- <div id="Agile" class="paragraph">
257
- <p class="title">Agile</p>
258
- <ul>
259
- <li>Enables <a href="http://agilemanifesto.org/">agile practices</a> such as
260
- <ul>
261
- <li><a href="http://www.testdriven.com">test-driven</a> development</li>
262
- <li><a href="http://behaviour-driven.org">behavior-driven</a> development</li>
263
- <li><a href="manual.html#usage.tutorial.implement-proto">rapid prototyping</a> for design exploration</li>
264
- </ul></li>
265
- </ul>
266
-
267
-
268
- <ul>
269
- <li>Eliminates unneccesary work:
270
- <ul>
271
- <li><a href="manual.html#usage.tutorial.specification">Specifications</a> are readable, portable, and <em>executable</em>.</li>
272
- <li>The <a href="manual.html#usage.tools.generate">automated test generator</a> helps you accomodate design changes with <em>minimal</em> effort.</li>
273
- <li>There is absolutely <em>no compiling</em>!</li>
274
- </ul></li>
275
- </ul>
276
- </div>
277
-
278
-
279
- <div id="Powerful" class="paragraph">
280
- <p class="title">Powerful</p>
281
- <ul>
282
- <li>Inherits the <a href="http://www.ruby-lang.org/en/about/">power and elegance</a> of Ruby:
283
- <ul>
284
- <li>Unlimited length integers</li>
285
- <li>Regular expressions</li>
286
- <li>Multi-threading</li>
287
- <li>System calls and I/O</li>
288
- <li><a href="http://rubyforge.org"><em>ad infinitum</em></a></li>
289
- </ul></li>
290
- </ul>
291
-
292
-
293
- <ul>
294
- <li>Uses <a href="http://rubyforge.org/projects/ruby-debug/">ruby-debug</a> for <a href="manual.html#usage.debugger">interactive debugging</a>.</li>
295
- <li>Uses <a href="http://eigenclass.org/hiki.rb?rcov">rcov</a> for test <a href="manual.html#usage.test-runner.env-vars">coverage analysis and report generation</a>.</li>
296
- </ul>
297
- </div>
298
-
299
-
300
- </div>
301
- </p>
302
-
303
-
304
- <p>
305
- <hr style="display: none"/>
306
-
307
- <div id="intro.reqs" class="section">
308
- <h2 class="title">
309
- <a href="#a-607098488" class="ref">2.3</a>
310
-
311
- &nbsp;
312
-
313
- Requirements
314
- </h2>
315
-
316
- <p>The following software is necessary in order to use Ruby-VPI.</p>
317
-
318
-
319
- <p>
320
- <div id="Verilog_simulator" class="paragraph">
321
- <p class="title">Verilog simulator</p>
322
- 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.
323
-
324
-
325
- <ul>
326
- <li><a href="http://www.synopsys.com/products/simulation/simulation.html">Synopsys VCS</a>
327
- &#8211; any version that supports the <tt>-load</tt> option is acceptable.</li>
328
- </ul>
329
-
330
-
331
- <ul>
332
- <li><a href="http://www.model.com">Mentor Modelsim</a>
333
- &#8211; any version that supports the <tt>-pli</tt> option is acceptable.</li>
334
- </ul>
335
-
336
-
337
- <ul>
338
- <li><a href="http://www.cadence.com/products/functional_ver/nc-verilog/">Cadence NC-Sim</a>
339
- &#8211; any version that supports the <tt>+loadvpi</tt> option should be acceptable.</li>
340
- </ul>
341
-
342
-
343
- <ul>
344
- <li><a href="http://www.pragmatic-c.com/gpl-cver/">GPL Cver</a>
345
- &#8211; version 2.11a or newer is acceptable.</li>
346
- </ul>
347
-
348
-
349
- <ul>
350
- <li><a href="http://www.geda.seul.org/tools/icarus/index.html">Icarus Verilog</a>
351
- &#8211; version 0.8 is <em>mostly</em> acceptable because you <strong>will not</strong> be able to <a href="manual.html#Accessing_a_handle_s_relatives">access child handles through method calls</a>. The reason for this limitation is explained <a href="manual.html#problems.ivl.vpi_handle_by_name.absolute-paths">in the user manual</a>.</li>
352
- </ul>
353
- </div>
354
-
355
-
356
- <div id="Compilers" class="paragraph">
357
- <p class="title">Compilers</p>
358
- <ul>
359
- <li><a href="http://en.wikipedia.org/wiki/Make">make</a>
360
- &#8211; any flavor should be acceptable.</li>
361
- </ul>
362
-
363
-
364
- <ul>
365
- <li>C compiler
366
- &#8211; the <a href="http://www.gnu.org/software/gcc/" title="GCC">GNU Compiler Collection</a> is preferred, but any C compiler should be acceptable.</li>
367
- </ul>
368
-
369
-
370
- <ul>
371
- <li><a href="http://www.swig.org/download.html">SWIG</a>
372
- &#8211; version 1.3.29 or newer is necessary.</li>
373
- </ul>
374
-
375
-
376
- <ul>
377
- <li><a href="http://www.ruby-lang.org/en/downloads/">Ruby</a>
378
- &#8211; version 1.8 or newer, including header and linkable object files for building extensions, is necessary. You can install Ruby by following <a href="http://www.ruby-lang.org/en/downloads/">these instructions</a>.</li>
379
- </ul>
380
- </div>
381
-
382
-
383
- <div id="Libraries" class="paragraph">
384
- <p class="title">Libraries</p>
385
- <ul>
386
- <li><a href="http://en.wikipedia.org/wiki/Pthreads" title="pthreads">POSIX threads</a>
387
- &#8211; header and linkable object files, and operating system support for this library are necessary.</li>
388
- </ul>
389
-
390
-
391
- <ul>
392
- <li><a href="http://rubyforge.org/frs/?group_id=126">RubyGems</a>
393
- &#8211; any recent version should be acceptable. You can install RubyGems by following <a href="http://www.rubygems.org/read/chapter/3">these instructions</a>.</li>
394
- </ul>
395
- </div>
396
- </p>
397
-
398
- </div>
399
- </p>
400
-
401
-
402
- <p>
403
- <hr style="display: none"/>
404
-
405
- <div id="intro.appetizers" class="section">
406
- <h2 class="title">
407
- <a href="#a-607101288" class="ref">2.4</a>
408
-
409
- &nbsp;
410
-
411
- Appetizers
412
- </h2>
413
-
414
- Here is a tiny sampling of code to whet your appetite. See <a href="manual.html#usage.tutorial">the tutorial</a> for more samples.
415
-
416
-
417
- <ul>
418
- <li>Assign the value 2<sup>2048</sup> to a register:
419
- <ul>
420
- <li><code class="code">your_register.intVal = <span style="color:#00D; font-weight:bold">2</span> ** <span style="color:#00D; font-weight:bold">2048</span></code></li>
421
- <li><code class="code">your_register.put_value <span style="color:#00D; font-weight:bold">2</span> ** <span style="color:#00D; font-weight:bold">2048</span></code></li>
422
- </ul></li>
423
- </ul>
424
-
425
-
426
- <ul>
427
- <li>Check if all nets in a module are at high impedance:
428
- <ul>
429
- <li><code class="code">your_module.all_net? { |your_net| your_net.z? }</code></li>
430
- <li><pre class="code">
431
- your_nets = your_module.net_a
432
- your_nets.all? { |net| net.z? }</pre></li>
433
- </ul></li>
434
- </ul>
435
-
436
-
437
- <ul>
438
- <li>See a register&#8217;s path, width, and location (file &#38; line number):
439
- <ul>
440
- <li><code class="code">puts your_register</code></li>
441
- <li><pre class="code">
442
- p <span style="color:#A60">:path</span> =&gt; your_register.fullName
443
- p <span style="color:#A60">:width</span> =&gt; your_register.size
444
- p <span style="color:#A60">:file</span> =&gt; your_register.fileName
445
- p <span style="color:#A60">:file</span> =&gt; your_register.lineNo</pre></li>
446
- </ul></li>
447
- </ul>
448
-
449
-
450
- <ul>
451
- <li>Access the first five elements in a memory:
452
- <ul>
453
- <li><code class="code">your_memory.memoryWord_a.first(<span style="color:#00D; font-weight:bold">5</span>)</code></li>
454
- <li><code class="code">your_memory.memoryWord_a[<span style="color:#00D; font-weight:bold">0</span>..<span style="color:#00D; font-weight:bold">4</span>]</code></li>
455
- <li><code class="code">your_memory.memoryWord_a[<span style="color:#00D; font-weight:bold">0</span>, <span style="color:#00D; font-weight:bold">5</span>]</code></li>
456
- </ul></li>
457
- </ul>
458
-
459
-
460
- <ul>
461
- <li>Clear a memory by filling it with zeroes:
462
- <ul>
463
- <li><code class="code">your_memory.each_memoryWord { |w| w.zero! }</code></li>
464
- <li><code class="code">your_memory.each_memoryWord { |w| w.intVal = <span style="color:#00D; font-weight:bold">0</span> }</code></li>
465
- <li><code class="code">your_memory.each_memoryWord { |w| w.put_value <span style="color:#00D; font-weight:bold">0</span> }</code></li>
466
- </ul></li>
467
- </ul>
468
-
469
- </div>
470
- </p>
471
-
472
-
473
- <p>
474
- <hr style="display: none"/>
475
-
476
- <div id="intro.applications" class="section">
477
- <h2 class="title">
478
- <a href="#a-607103848" class="ref">2.5</a>
479
-
480
- &nbsp;
481
-
482
- Applications
483
- </h2>
484
-
485
- Examples of tasks that can be performed with Ruby-VPI are:
486
-
487
-
488
- <ul>
489
- <li>From the second edition of <a href="http://www.sutherland-hdl.com/publications.html"><em>The Verilog PLI Handbook</em></a>:
490
- <ul>
491
- <li>C language bus-functional models</li>
492
- <li>Reading test vector files</li>
493
- <li>Delay calculation</li>
494
- <li>Custom output displays</li>
495
- <li>Co-simulation</li>
496
- <li>Design debug utilities</li>
497
- <li>Simulation analysis</li>
498
- </ul></li>
499
- </ul>
500
-
501
-
502
- <ul>
503
- <li>Adapted from <a href="http://embedded.eecs.berkeley.edu/Alumni/pinhong/scriptEDA/">Pin Hong&#8217;s</a> observations:
504
- <ul>
505
- <li>Writing hardware models in Ruby</li>
506
- <li>Dumping or processing netlist data from Verilog database</li>
507
- <li>Dumping or processing simulation data</li>
508
- <li>Feeding dynamic simulation stimuli</li>
509
- <li>Back-annotating delay information</li>
510
- <li>Interactive logic simulation</li>
511
- <li>Building a distributed simulation</li>
512
- </ul></li>
513
- </ul>
514
-
515
- </div>
516
- </p>
517
-
518
-
519
- <p>
520
- <hr style="display: none"/>
521
-
522
- <div id="intro.related-works" class="section">
523
- <h2 class="title">
524
- <a href="#a-607109258" class="ref">2.6</a>
525
-
526
- &nbsp;
527
-
528
- Related works
529
- </h2>
530
-
531
- <ul>
532
- <li><a href="http://anvil.sourceforge.net">ANVIL</a> is a C++ interface to VPI.</li>
533
- <li><a href="http://teal.sourceforge.net">Teal</a> is a C++ interface to VPI.</li>
534
- <li><a href="http://jove.sourceforge.net">JOVE</a> is a Java interface to VPI.</li>
535
- <li><a href="http://embedded.eecs.berkeley.edu/Alumni/pinhong/scriptEDA/">ScriptEDA</a> is a Perl, Python, and Tcl interface to VPI.</li>
536
- <li><a href="http://rhdl.rubyforge.org">RHDL</a> is a hardware description and verification language based on Ruby.</li>
537
- <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>
538
- </ul>
539
-
540
-
541
- <p>
542
- <hr style="display: none"/>
543
-
544
- <div id="intro.related-works.pli" class="section">
545
- <h3 class="title">
546
- <a href="#a-607106308" class="ref">2.6.1</a>
547
-
548
- &nbsp;
549
-
550
- Ye olde PLI
551
- </h3>
552
-
553
- 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.
554
-
555
-
556
- <ul>
557
- <li><a href="http://www.nelsim.com">ScriptSim</a> is a Perl, Python, and Tcl/Tk interface to PLI.</li>
558
- <li><a href="http://www.veripool.com/verilog-pli.html">Verilog::Pli</a> is a Perl interface to PLI.</li>
559
- </ul>
560
-
561
- </div>
562
- </p>
563
-
564
- </div>
565
- </p>
566
-
567
-
568
- <p>
569
- <hr style="display: none"/>
570
-
571
- <div id="intro.license" class="section">
572
- <h2 class="title">
573
- <a href="#a-607112128" class="ref">2.7</a>
574
-
575
- &nbsp;
576
-
577
- License
578
- </h2>
579
-
580
- <p>Copyright 2006 Suraj N. Kurapati &lt;SNK at GNA dot ORG&gt;<br/>
581
- Copyright 1999 Kazuhiro HIWADA &lt;HIWADA at KUEE dot KYOTO-U dot AC dot JP&gt;<br/></p>
582
-
583
-
584
- <p>Permission is hereby granted, free of charge, to any person obtaining a copy of
585
- this software and associated documentation files (the &quot;Software&quot;), to deal in
586
- the Software without restriction, including without limitation the rights to
587
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
588
- the Software, and to permit persons to whom the Software is furnished to do so,
589
- subject to the following conditions:</p>
590
-
591
-
592
- <p>1. All copies and substantial portions of the Software, whether modified or
593
- unmodified, (the &quot;Derivatives&quot;) and their corresponding machine-readable
594
- source code (the &quot;Code&quot;) must include the above copyright notice and this
595
- permission notice.</p>
596
-
597
-
598
- <p>2. The Derivatives, upon distribution, must be accompanied by the Code or, if
599
- the Code is obtainable for no more than the cost of distribution plus a
600
- nominal fee, by information on how to obtain the Code.</p>
601
-
602
-
603
- <p><span class="caps">THE SOFTWARE IS PROVIDED</span> &quot;AS IS&quot;, <span class="caps">WITHOUT WARRANTY OF ANY KIND</span>, EXPRESS OR
604
- IMPLIED, INCLUDING <span class="caps">BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY</span>, FITNESS
605
- <span class="caps">FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT</span>. IN <span class="caps">NO EVENT SHALL THE AUTHORS OR</span>
606
- <span class="caps">COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM</span>, DAMAGES <span class="caps">OR OTHER LIABILITY</span>, WHETHER
607
- <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>
608
- <span class="caps">CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE</span>.</p>
609
-
610
- </div>
611
- </p>
612
- </div>
613
-
614
-
615
- <hr style="display: none"/>
616
-
617
- <div id="setup" class="chapter">
618
- <h1 class="title">
619
- Chapter <a href="#a-607180888" class="ref">3</a>
620
-
621
- <br/><br/>
622
-
623
- <big>Setup</big>
624
- </h1>
625
-
626
-
627
- <hr style="display: none"/>
628
-
629
- <div id="setup.manifest" class="section">
630
- <h2 class="title">
631
- <a href="#a-607143418" class="ref">3.1</a>
632
-
633
- &nbsp;
634
-
635
- Manifest
636
- </h2>
637
-
638
- When you extract a release package, the following is what you would expect to find.
639
-
640
-
641
- <ul>
642
- <li><tt>doc</tt> contains user documentation in various formats.</li>
643
- <li><tt>ref</tt> contains reference API documentation in HTML format.</li>
644
- <li><tt>ext</tt> contains source code, written in the C language, for the <a href="#organization" class="ref">core of Ruby-VPI</a></li>
645
- <li><tt>lib</tt> contains Ruby libraries provided by Ruby-VPI.</li>
646
- <li><tt>bin</tt> contains various tools. See <a href="#usage.tools" class="ref">Section 5.7</a> for more information.</li>
647
- <li><tt>examples</tt> contains example tests. See <a href="#usage.examples" class="ref">Section 5.8</a> for more information.</li>
648
- </ul>
649
-
650
- </div>
651
-
652
-
653
- <hr style="display: none"/>
654
-
655
- <div id="setup.reqs" class="section">
656
- <h2 class="title">
657
- <a href="#a-607148858" class="ref">3.2</a>
658
-
659
- &nbsp;
660
-
661
- Requirements
662
- </h2>
663
-
664
- <p>See <a href="#intro.reqs" class="ref">Section 2.3</a> above.</p>
665
-
666
-
667
- <p>
668
- <hr style="display: none"/>
669
-
670
- <div class="admonition">
671
- <div class="tip" id="Add_support_for_your_Verilog_simulator">
672
- <img src="images/tango/tip.png" alt="tip" class="icon"/>
673
-
674
- <p class="title"><a href="#a-607145888" class="ref">Tip 1</a>. &nbsp; Add support for your Verilog simulator</p>
675
-
676
- Write a <a href="http://rubyforge.org/tracker/?group_id=1339">support request</a> for your simulator, while providing a sample transcript of the commands you use to run a test with your simulator, and I will add support for your simulator in the next release!
677
- </div>
678
- </div>
679
- </p>
680
-
681
- </div>
682
-
683
-
684
- <hr style="display: none"/>
685
-
686
- <div id="setup.recom" class="section">
687
- <h2 class="title">
688
- <a href="#a-607155028" class="ref">3.3</a>
689
-
690
- &nbsp;
691
-
692
- Recommendations
693
- </h2>
694
-
695
- <p>The following software may make your interactions with Ruby-VPI more pleasant.</p>
696
-
697
-
698
- <p>
699
- <hr style="display: none"/>
700
-
701
- <div id="setup.recom.merger" class="section">
702
- <h3 class="title">
703
- <a href="#a-607151688" class="ref">3.3.1</a>
704
-
705
- &nbsp;
706
-
707
- Text merging tool
708
- </h3>
709
-
710
- 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 href="#usage.tools.generate" class="ref">automated test generator</a>. A handful of the currently available open-source text merging tools are listed below.
711
-
712
-
713
- <ul>
714
- <li><a href="http://kdiff3.sourceforge.net/"><strong>kdiff3</strong></a> is a graphical, three-way merging tool for KDE.</li>
715
- </ul>
716
-
717
-
718
- <ul>
719
- <li><a href="http://meld.sourceforge.net/"><strong>meld</strong></a> is a graphical, three-way merging tool for GNOME.</li>
720
- </ul>
721
-
722
-
723
- <ul>
724
- <li><a href="http://tkdiff.sourceforge.net/"><strong>tkdiff</strong></a> is a graphical, two-way merging tool that uses the cross-platform Tk windowing toolkit.</li>
725
- </ul>
726
-
727
-
728
- <ul>
729
- <li><a href="http://furius.ca/xxdiff/"><strong>xxdiff</strong></a> is a graphical, three-way merging tool.</li>
730
- </ul>
731
-
732
-
733
- <ul>
734
- <li><a href="http://elonen.iki.fi/code/imediff/"><strong>imediff2</strong></a> is a textual, fullscreen two-way merging tool. It is very useful when you are working remotely via SSH.</li>
735
- </ul>
736
-
737
- </div>
738
- </p>
739
-
740
- </div>
741
-
742
-
743
- <hr style="display: none"/>
744
-
745
- <div id="setup.inst" class="section">
746
- <h2 class="title">
747
- <a href="#a-607164168" class="ref">3.4</a>
748
-
749
- &nbsp;
750
-
751
- Installation
752
- </h2>
753
-
754
- <p>Once you have satisfied the <a href="#setup.reqs" class="ref">necessary requirements</a>, you can install Ruby-VPI by running the <pre>gem install -y ruby-vpi</pre> command. RubyGems will install Ruby-VPI into the system gem directory, whose path can be determined by running the <pre>gem env gemdir</pre> command. Within this directory, there is a <tt>gems/</tt> subdirectory which contains the Ruby-VPI installation, as illustrated below.</p>
755
-
756
-
757
- <pre>
758
- $ gem env gemdir
759
- /usr/lib/ruby/gems/1.8
760
-
761
- $ ls -d `gem env gemdir`/gems/ruby-vpi*
762
- /usr/lib/ruby/gems/1.8/gems/ruby-vpi-7.0.0/
763
- </pre>
764
-
765
-
766
- <p>
767
- <hr style="display: none"/>
768
-
769
- <div class="admonition">
770
- <div class="tip" id="Tuning_for_maximum_performance">
771
- <img src="images/tango/tip.png" alt="tip" class="icon"/>
772
-
773
- <p class="title"><a href="#a-607157578" class="ref">Tip 2</a>. &nbsp; Tuning for maximum performance</p>
774
-
775
- 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 <pre>gem install -y ruby-vpi</pre> command. 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.
776
- </div>
777
- </div>
778
-
779
-
780
- <hr style="display: none"/>
781
-
782
- <div id="setup.inst.windows" class="section">
783
- <h3 class="title">
784
- <a href="#a-607160108" class="ref">3.4.1</a>
785
-
786
- &nbsp;
787
-
788
- Installing on Windows
789
- </h3>
790
-
791
- <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, one <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>
792
-
793
-
794
- <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>
795
-
796
-
797
- <ul>
798
- <li>Install <a href="http://www.cygwin.com">Cygwin</a>, the Linux-like environment for Windows.</li>
799
- </ul>
800
-
801
-
802
- <ul>
803
- <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>
804
- </ul>
805
-
806
-
807
- <ul>
808
- <li>Determine which object files, among those found in the previous step, contain symbols whose names begin with &#8220;_vpi&#8221; by running the <pre>for x in *.{o,so,dll}; do nm $x | grep -q '[Tt] _vpi' &amp;&amp; echo $x; done</pre> command in Cygwin.
809
- <ul>
810
- <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>
811
- <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>
812
- </ul></li>
813
- </ul>
814
-
815
-
816
- <ul>
817
- <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 <pre>export LDFLAGS=/foo/bar/vpi.so</pre> command in Cygwin.</li>
818
- </ul>
819
-
820
-
821
- <ul>
822
- <li>You may now install Ruby-VPI by running the <pre>gem install ruby-vpi</pre> command in Cygwin.</li>
823
- </ul>
824
-
825
- </div>
826
- </p>
827
-
828
- </div>
829
-
830
-
831
- <hr style="display: none"/>
832
-
833
- <div id="setup.maintenance" class="section">
834
- <h2 class="title">
835
- <a href="#a-607166448" class="ref">3.5</a>
836
-
837
- &nbsp;
838
-
839
- Maintenance
840
- </h2>
841
-
842
- <ul>
843
- <li>You can upgrade to the latest release of Ruby-VPI by running the <pre>gem update ruby-vpi</pre> command.</li>
844
- <li>You can uninstall Ruby-VPI by running the <pre>gem uninstall ruby-vpi</pre> command.</li>
845
- </ul>
846
-
847
-
848
- <p>Learn more about using and manipulating RubyGems in <a href="http://www.rubygems.org">the RubyGems user manual</a>.</p>
849
-
850
- </div>
851
-
852
- </div>
853
-
854
-
855
- <hr style="display: none"/>
856
-
857
- <div id="organization" class="chapter">
858
- <h1 class="title">
859
- Chapter <a href="#a-607194908" class="ref">4</a>
860
-
861
- <br/><br/>
862
-
863
- <big>Organization</big>
864
- </h1>
865
-
866
- <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. In addition, it serves as a vehicle for the application of agile software development practices, such as <a href="#glossary.TDD" class="ref">TDD</a> and <a href="#glossary.BDD" class="ref">BDD</a> to the realm of hardware development with Verilog.</p>
867
-
868
-
869
- <p>Ruby-VPI can be used with any Verilog simulator that supports VPI. In particular, it is known to operate with (1) Synopsys VCS and Mentor Modelsim, the two <a href="http://www.eetimes.com/news/design/showArticle.jhtml?articleID=47204415">most prominent Verilog simulators</a> in the Electronic Design Automation (EDA) industry; as well as (2) GPL Cver and Icarus Verilog, the two most prevalent open source Verilog simulators today.</p>
870
-
871
-
872
- <p>
873
- <hr style="display: none"/>
874
-
875
- <div class="formal">
876
- <div class="figure" id="fig:organization.detail">
877
-
878
-
879
- <p class="title"><a href="#a-607183488" class="ref">Figure 1</a>. &nbsp; Where does Ruby-VPI fit in?</p>
880
-
881
- <img src="figures/organization_detailed.png" alt="" />
882
- </div>
883
- </div>
884
-
885
- As <a href="#fig:organization.detail" class="ref">Figure 1</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>
886
-
887
-
888
- <p>
889
- <hr style="display: none"/>
890
-
891
- <div id="organization.tests" class="section">
892
- <h2 class="title">
893
- <a href="#a-607189198" class="ref">4.1</a>
894
-
895
- &nbsp;
896
-
897
- Tests
898
- </h2>
899
-
900
- <p>In Ruby-VPI, the process of functional verification is neatly packaged into self-contained, executable tests. As <a href="#fig:organization" class="ref">Figure 2</a> illustrates, a test is composed of a <strong>bench</strong>, a <strong>design</strong>, and a <strong>specification</strong>.</p>
901
-
902
-
903
- <p>
904
- <hr style="display: none"/>
905
-
906
- <div class="formal">
907
- <div class="figure" id="fig:organization">
908
-
909
-
910
- <p class="title"><a href="#a-607186098" class="ref">Figure 2</a>. &nbsp; Organization of a test in Ruby-VPI</p>
911
-
912
- <img src="figures/organization.png" alt="" />
913
- </div>
914
- </div>
915
-
916
- <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>
917
-
918
-
919
- <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>
920
-
921
-
922
- <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>
923
-
924
- </div>
925
- </p>
926
- </div>
927
-
928
-
929
- <hr style="display: none"/>
930
-
931
- <div id="usage" class="chapter">
932
- <h1 class="title">
933
- Chapter <a href="#a-607339858" class="ref">5</a>
934
-
935
- <br/><br/>
936
-
937
- <big>Usage</big>
938
- </h1>
939
-
940
-
941
- <hr style="display: none"/>
942
-
943
- <div id="overview.relay" class="section">
944
- <h2 class="title">
945
- <a href="#a-607201128" class="ref">5.1</a>
946
-
947
- &nbsp;
948
-
949
- Interacting with the Verilog simulator
950
- </h2>
951
-
952
- <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>
953
-
954
-
955
- <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 href="#fig:ruby_relay" class="ref">Figure 3</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>
956
-
957
-
958
- <p>Ruby-VPI&#8217;s approach is the same as any software testing framework, where the <em>specification</em> drives the design under test. Whereas, the typical VPI &#38; C approach is literally <em>backwards</em> because the design under test drives the specification.</p>
959
-
960
-
961
- <p>
962
- <hr style="display: none"/>
963
-
964
- <div class="formal">
965
- <div class="figure" id="fig:ruby_relay">
966
-
967
-
968
- <p class="title"><a href="#a-607197648" class="ref">Figure 3</a>. &nbsp; Interaction between Ruby and Verilog</p>
969
-
970
- <img src="figures/ruby_relay.png" alt="" />
971
-
972
-
973
- <ol>
974
- <li>The current simulation time is <em>X</em>.</li>
975
- <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>
976
- <li>The Verilog simulator is now in control (temporarily).</li>
977
- <li>The current simulation time has <em>not</em> changed; it is still <em>X</em>.</li>
978
- <li>The Verilog simulator simulates <em>Y</em> simulation time steps.</li>
979
- <li>The current simulation time is now <em>X + Y</em>.</li>
980
- <li>The Verilog simulator returns control back to the specification.</li>
981
- </ol>
982
- </div>
983
- </div>
984
-
985
- Another means of transferring control from the specification to the Verilog simulator is the <a href="#vpi.callbacks" class="ref">VPI callback</a>.</p>
986
-
987
- </div>
988
-
989
-
990
- <hr style="display: none"/>
991
-
992
- <div id="vpi" class="section">
993
- <h2 class="title">
994
- <a href="#a-607084798" class="ref">5.2</a>
995
-
996
- &nbsp;
997
-
998
- VPI in Ruby
999
- </h2>
1000
-
1001
- <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>
1002
-
1003
-
1004
- <p>
1005
- <hr style="display: none"/>
1006
-
1007
- <div class="admonition">
1008
- <div class="note" id="Constants_are_capitalized_in_Ruby">
1009
- <img src="images/tango/note.png" alt="note" class="icon"/>
1010
-
1011
- <p class="title"><a href="#a-607203518" class="ref">Note 1</a>. &nbsp; Constants are capitalized in Ruby</p>
1012
-
1013
- <p>In the remainder of this manual, 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>
1014
-
1015
-
1016
- <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>
1017
- </div>
1018
- </div>
1019
-
1020
-
1021
- <hr style="display: none"/>
1022
-
1023
- <div id="vpi.handles" class="section">
1024
- <h3 class="title">
1025
- <a href="#a-607039078" class="ref">5.2.1</a>
1026
-
1027
- &nbsp;
1028
-
1029
- Handles
1030
- </h3>
1031
-
1032
- <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="../ref/ruby/classes/VPI/Handle.html">reference documentation</a> for details) in Ruby-VPI.</p>
1033
-
1034
-
1035
- <p>Handles have various <strong>properties</strong>, listed in the second column of <a href="#tbl:accessors" class="ref">Table 1</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 href="#tbl:accessors" class="ref">Table 1</a>.</p>
1036
-
1037
-
1038
- <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: <pre class="code">your_reg = vpi_handle( <span style="color:#036; font-weight:bold">VpiReg</span>, your_handle )</pre></p>
1039
-
1040
-
1041
- <p>
1042
- <div id="Shortcuts_for_productivity" class="paragraph">
1043
- <p class="title">Shortcuts for productivity</p>
1044
- 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.
1045
- </div>
1046
- </p>
1047
-
1048
-
1049
- <p>
1050
- <hr style="display: none"/>
1051
-
1052
- <div id="Accessing_a_handle_s_relatives" class="section">
1053
- <h4 class="title">
1054
- <a href="#a-607208738" class="ref">5.2.1.2</a>
1055
-
1056
- &nbsp;
1057
-
1058
- Accessing a handle&#8217;s relatives
1059
- </h4>
1060
-
1061
- <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>
1062
-
1063
-
1064
- <pre class="code">
1065
- 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> )
1066
- 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 )
1067
- 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 )</pre>
1068
-
1069
-
1070
- <p>or by writing:</p>
1071
-
1072
-
1073
- <pre 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> )</pre>
1074
-
1075
-
1076
- <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>
1077
-
1078
-
1079
- <pre class="code">foo.bar.baz</pre>
1080
-
1081
- </div>
1082
- </p>
1083
-
1084
-
1085
- <p>
1086
- <hr style="display: none"/>
1087
-
1088
- <div id="Accessing_a_handle_s_properties" class="section">
1089
- <h4 class="title">
1090
- <a href="#a-607211678" class="ref">5.2.1.3</a>
1091
-
1092
- &nbsp;
1093
-
1094
- Accessing a handle&#8217;s properties
1095
- </h4>
1096
-
1097
- <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>
1098
-
1099
-
1100
- <pre class="code">
1101
- wrapper = <span style="color:#036; font-weight:bold">S_vpi_value</span>.new
1102
- wrapper.format = <span style="color:#036; font-weight:bold">VpiIntVal</span>
1103
- vpi_get_value( foo.bar, wrapper )
1104
- result = wrapper.value.integer</pre>
1105
-
1106
-
1107
- <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>
1108
-
1109
-
1110
- <pre class="code">
1111
- wrapper = <span style="color:#036; font-weight:bold">S_vpi_value</span>.new
1112
- wrapper.format = <span style="color:#036; font-weight:bold">VpiHexStrVal</span>
1113
- vpi_get_value( foo.bar, wrapper )
1114
- result = wrapper.value.str.to_i( <span style="color:#00D; font-weight:bold">16</span> )</pre>
1115
-
1116
-
1117
- <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 href="#fig:method_naming_format" class="ref">Figure 4</a>, as methods on the handle:</p>
1118
-
1119
-
1120
- <pre class="code">result = foo.bar.intVal</pre>
1121
-
1122
- </div>
1123
-
1124
-
1125
- <hr style="display: none"/>
1126
-
1127
- <div class="formal">
1128
- <div class="figure" id="fig:method_naming_format">
1129
-
1130
-
1131
- <p class="title"><a href="#a-607214478" class="ref">Figure 4</a>. &nbsp; Method naming format for accessing a handle&#8217;s properties</p>
1132
-
1133
- <table>
1134
- <tr>
1135
- <th>Operation </th>
1136
- <th>_ </th>
1137
- <th>Property </th>
1138
- <th>_ </th>
1139
- <th>Accessor </th>
1140
- <th>Addendum </th>
1141
- </tr>
1142
- <tr>
1143
- <td colspan="2">optional </td>
1144
- <td> required </td>
1145
- <td colspan="3">optional </td>
1146
- </tr>
1147
- </table>
1148
-
1149
-
1150
-
1151
-
1152
- <ul>
1153
- <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>
1154
- </ul>
1155
-
1156
-
1157
- <ul>
1158
- <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>
1159
- </ul>
1160
-
1161
-
1162
- <ul>
1163
- <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.
1164
-
1165
- <p><a href="#tbl:accessors" class="ref">Table 1</a> shows a list of valid accessors and how they influence the means by which a property is accessed.</p></li>
1166
- </ul>
1167
-
1168
-
1169
- <ul>
1170
- <li>When <strong>Addendum</strong> is an equal sign (=), it suggests that the specified VPI property should be written to.
1171
-
1172
- <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>
1173
- </ul>
1174
- </div>
1175
- </div>
1176
-
1177
-
1178
- <hr style="display: none"/>
1179
-
1180
- <div class="formal">
1181
- <div class="table" id="tbl:accessors">
1182
-
1183
-
1184
- <p class="title"><a href="#a-607216908" class="ref">Table 1</a>. &nbsp; Possible accessors and their implications</p>
1185
-
1186
- <table>
1187
- <tr>
1188
- <th>Accessor </th>
1189
- <th>Kind of value accessed </th>
1190
- <th>VPI functions used to access the value </th>
1191
- </tr>
1192
- <tr>
1193
- <td> d </td>
1194
- <td> delay </td>
1195
- <td> <code class="code">vpi_get_delays</code>, <code class="code">vpi_put_delays</code> </td>
1196
- </tr>
1197
- <tr>
1198
- <td> l </td>
1199
- <td> logic </td>
1200
- <td> <code class="code">vpi_get_value</code>, <code class="code">vpi_put_value</code> </td>
1201
- </tr>
1202
- <tr>
1203
- <td> i </td>
1204
- <td> integer </td>
1205
- <td> <code class="code">vpi_get</code> </td>
1206
- </tr>
1207
- <tr>
1208
- <td> b </td>
1209
- <td> boolean </td>
1210
- <td> <code class="code">vpi_get</code> </td>
1211
- </tr>
1212
- <tr>
1213
- <td> s </td>
1214
- <td> string </td>
1215
- <td> <code class="code">vpi_get_str</code> </td>
1216
- </tr>
1217
- <tr>
1218
- <td> h </td>
1219
- <td> handle </td>
1220
- <td> <code class="code">vpi_handle</code> </td>
1221
- </tr>
1222
- <tr>
1223
- <td> a </td>
1224
- <td> array </td>
1225
- <td> <code class="code">vpi_iterate</code> </td>
1226
- </tr>
1227
- </table>
1228
- </div>
1229
- </div>
1230
-
1231
-
1232
- <hr style="display: none"/>
1233
-
1234
- <div class="formal">
1235
- <div class="table" id="ex:properties">
1236
-
1237
-
1238
- <p class="title"><a href="#a-607004748" class="ref">Table 2</a>. &nbsp; Examples of accessing a handle&#8217;s properties</p>
1239
-
1240
- <table>
1241
- <tr>
1242
- <th rowspan="2">Ruby expression </th>
1243
- <th colspan="6">Method naming format </th>
1244
- <th rowspan="2">Description </th>
1245
- </tr>
1246
- <tr>
1247
- <th>Operation </th>
1248
- <th>_ </th>
1249
- <th>Property </th>
1250
- <th>_ </th>
1251
- <th>Accessor </th>
1252
- <th>Addendum </th>
1253
- </tr>
1254
- <tr>
1255
- <td> <code class="code">handle.vpiIntVal</code> </td>
1256
- <td> &nbsp; </td>
1257
- <td> &nbsp; </td>
1258
- <td> vpiIntVal </td>
1259
- <td> &nbsp; </td>
1260
- <td> &nbsp; </td>
1261
- <td> &nbsp; </td>
1262
- <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>
1263
- </tr>
1264
- <tr>
1265
- <td> <code class="code">handle.vpiIntVal_l</code> </td>
1266
- <td> &nbsp; </td>
1267
- <td> &nbsp; </td>
1268
- <td> vpiIntVal </td>
1269
- <td> _ </td>
1270
- <td> l </td>
1271
- <td> &nbsp; </td>
1272
- </tr>
1273
- <tr>
1274
- <td> <code class="code">handle.intVal</code> </td>
1275
- <td> &nbsp; </td>
1276
- <td> &nbsp; </td>
1277
- <td> intVal </td>
1278
- <td> &nbsp; </td>
1279
- <td> &nbsp; </td>
1280
- <td> &nbsp; </td>
1281
- </tr>
1282
- <tr>
1283
- <td> <code class="code">handle.intVal_l</code> </td>
1284
- <td> &nbsp; </td>
1285
- <td> &nbsp; </td>
1286
- <td> intVal </td>
1287
- <td> _ </td>
1288
- <td> l </td>
1289
- <td> &nbsp; </td>
1290
- </tr>
1291
- <tr>
1292
- <td> <code class="code">handle.vpiIntVal = <span style="color:#00D; font-weight:bold">15</span></code> </td>
1293
- <td> &nbsp; </td>
1294
- <td> &nbsp; </td>
1295
- <td> vpiIntVal </td>
1296
- <td> &nbsp; </td>
1297
- <td> &nbsp; </td>
1298
- <td> = </td>
1299
- <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>
1300
- </tr>
1301
- <tr>
1302
- <td> <code class="code">handle.vpiIntVal_l = <span style="color:#00D; font-weight:bold">15</span></code> </td>
1303
- <td> &nbsp; </td>
1304
- <td> &nbsp; </td>
1305
- <td> vpiIntVal </td>
1306
- <td> _ </td>
1307
- <td> l </td>
1308
- <td> = </td>
1309
- </tr>
1310
- <tr>
1311
- <td> <code class="code">handle.intVal = <span style="color:#00D; font-weight:bold">15</span></code> </td>
1312
- <td> &nbsp; </td>
1313
- <td> &nbsp; </td>
1314
- <td> intVal </td>
1315
- <td> &nbsp; </td>
1316
- <td> &nbsp; </td>
1317
- <td> = </td>
1318
- </tr>
1319
- <tr>
1320
- <td> <code class="code">handle.intVal_l = <span style="color:#00D; font-weight:bold">15</span></code> </td>
1321
- <td> &nbsp; </td>
1322
- <td> &nbsp; </td>
1323
- <td> intVal </td>
1324
- <td> _ </td>
1325
- <td> l </td>
1326
- <td> = </td>
1327
- </tr>
1328
- <tr>
1329
- <td> <code class="code">handle.vpiType</code> </td>
1330
- <td> &nbsp; </td>
1331
- <td> &nbsp; </td>
1332
- <td> vpiType </td>
1333
- <td> &nbsp; </td>
1334
- <td> &nbsp; </td>
1335
- <td> &nbsp; </td>
1336
- <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>
1337
- </tr>
1338
- <tr>
1339
- <td> <code class="code">handle.vpiType_i</code> </td>
1340
- <td> &nbsp; </td>
1341
- <td> &nbsp; </td>
1342
- <td> vpiType </td>
1343
- <td> _ </td>
1344
- <td> i </td>
1345
- <td> &nbsp; </td>
1346
- </tr>
1347
- <tr>
1348
- <td> <code class="code">handle.type</code> </td>
1349
- <td> &nbsp; </td>
1350
- <td> &nbsp; </td>
1351
- <td> type </td>
1352
- <td> &nbsp; </td>
1353
- <td> &nbsp; </td>
1354
- <td> &nbsp; </td>
1355
- </tr>
1356
- <tr>
1357
- <td> <code class="code">handle.type_i</code> </td>
1358
- <td> &nbsp; </td>
1359
- <td> &nbsp; </td>
1360
- <td> type </td>
1361
- <td> _ </td>
1362
- <td> i </td>
1363
- <td> &nbsp; </td>
1364
- </tr>
1365
- <tr>
1366
- <td> <code class="code">handle.vpiProtected</code> </td>
1367
- <td> &nbsp; </td>
1368
- <td> &nbsp; </td>
1369
- <td> vpiProtected </td>
1370
- <td> &nbsp; </td>
1371
- <td> &nbsp; </td>
1372
- <td> &nbsp; </td>
1373
- <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>
1374
- </tr>
1375
- <tr>
1376
- <td> <code class="code">handle.vpiProtected_b</code> </td>
1377
- <td> &nbsp; </td>
1378
- <td> &nbsp; </td>
1379
- <td> vpiProtected </td>
1380
- <td> _ </td>
1381
- <td> b </td>
1382
- <td> &nbsp; </td>
1383
- </tr>
1384
- <tr>
1385
- <td> <code class="code">handle.vpiProtected?</code> </td>
1386
- <td> &nbsp; </td>
1387
- <td> &nbsp; </td>
1388
- <td> vpiProtected </td>
1389
- <td> &nbsp; </td>
1390
- <td> &nbsp; </td>
1391
- <td> ? </td>
1392
- </tr>
1393
- <tr>
1394
- <td> <code class="code">handle.protected</code> </td>
1395
- <td> &nbsp; </td>
1396
- <td> &nbsp; </td>
1397
- <td> protected </td>
1398
- <td> &nbsp; </td>
1399
- <td> &nbsp; </td>
1400
- <td> &nbsp; </td>
1401
- </tr>
1402
- <tr>
1403
- <td> <code class="code">handle.protected_b</code> </td>
1404
- <td> &nbsp; </td>
1405
- <td> &nbsp; </td>
1406
- <td> protected </td>
1407
- <td> _ </td>
1408
- <td> b </td>
1409
- <td> &nbsp; </td>
1410
- </tr>
1411
- <tr>
1412
- <td> <code class="code">handle.protected?</code> </td>
1413
- <td> &nbsp; </td>
1414
- <td> &nbsp; </td>
1415
- <td> protected </td>
1416
- <td> &nbsp; </td>
1417
- <td> &nbsp; </td>
1418
- <td> ? </td>
1419
- </tr>
1420
- <tr>
1421
- <td> <code class="code">handle.vpiFullName</code> </td>
1422
- <td> &nbsp; </td>
1423
- <td> &nbsp; </td>
1424
- <td> vpiFullName </td>
1425
- <td> &nbsp; </td>
1426
- <td> &nbsp; </td>
1427
- <td> &nbsp; </td>
1428
- <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>
1429
- </tr>
1430
- <tr>
1431
- <td> <code class="code">handle.vpiFullName_s</code> </td>
1432
- <td> &nbsp; </td>
1433
- <td> &nbsp; </td>
1434
- <td> vpiFullName </td>
1435
- <td> _ </td>
1436
- <td> s </td>
1437
- <td> &nbsp; </td>
1438
- </tr>
1439
- <tr>
1440
- <td> <code class="code">handle.fullName</code> </td>
1441
- <td> &nbsp; </td>
1442
- <td> &nbsp; </td>
1443
- <td> fullName </td>
1444
- <td> &nbsp; </td>
1445
- <td> &nbsp; </td>
1446
- <td> &nbsp; </td>
1447
- </tr>
1448
- <tr>
1449
- <td> <code class="code">handle.fullName_s</code> </td>
1450
- <td> &nbsp; </td>
1451
- <td> &nbsp; </td>
1452
- <td> fullName </td>
1453
- <td> _ </td>
1454
- <td> s </td>
1455
- <td> &nbsp; </td>
1456
- </tr>
1457
- <tr>
1458
- <td> <code class="code">handle.vpiParent</code> </td>
1459
- <td> &nbsp; </td>
1460
- <td> &nbsp; </td>
1461
- <td> vpiParent </td>
1462
- <td> &nbsp; </td>
1463
- <td> &nbsp; </td>
1464
- <td> &nbsp; </td>
1465
- <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>
1466
- </tr>
1467
- <tr>
1468
- <td> <code class="code">handle.vpiParent_h</code> </td>
1469
- <td> &nbsp; </td>
1470
- <td> &nbsp; </td>
1471
- <td> vpiParent </td>
1472
- <td> _ </td>
1473
- <td> h </td>
1474
- <td> &nbsp; </td>
1475
- </tr>
1476
- <tr>
1477
- <td> <code class="code">handle.parent</code> </td>
1478
- <td> &nbsp; </td>
1479
- <td> &nbsp; </td>
1480
- <td> parent </td>
1481
- <td> &nbsp; </td>
1482
- <td> &nbsp; </td>
1483
- <td> &nbsp; </td>
1484
- </tr>
1485
- <tr>
1486
- <td> <code class="code">handle.parent_h</code> </td>
1487
- <td> &nbsp; </td>
1488
- <td> &nbsp; </td>
1489
- <td> parent </td>
1490
- <td> _ </td>
1491
- <td> h </td>
1492
- <td> &nbsp; </td>
1493
- </tr>
1494
- <tr>
1495
- <td> <code class="code">handle.each_vpiNet {|net| puts net.fullName}</code> </td>
1496
- <td> each </td>
1497
- <td> _ </td>
1498
- <td> vpiNet </td>
1499
- <td> &nbsp; </td>
1500
- <td> &nbsp; </td>
1501
- <td> &nbsp; </td>
1502
- <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>
1503
- </tr>
1504
- <tr>
1505
- <td> <code class="code">handle.each_net {|net| puts net.fullName}</code> </td>
1506
- <td> each </td>
1507
- <td> _ </td>
1508
- <td> net </td>
1509
- <td> &nbsp; </td>
1510
- <td> &nbsp; </td>
1511
- <td> &nbsp; </td>
1512
- </tr>
1513
- <tr>
1514
- <td> <code class="code">handle.all_vpiReg? {|reg| reg.size == <span style="color:#00D; font-weight:bold">1</span>}</code> </td>
1515
- <td> all? </td>
1516
- <td> _ </td>
1517
- <td> vpiReg </td>
1518
- <td> &nbsp; </td>
1519
- <td> &nbsp; </td>
1520
- <td> &nbsp; </td>
1521
- <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>
1522
- </tr>
1523
- <tr>
1524
- <td> <code class="code">handle.all_reg? {|reg| reg.size == <span style="color:#00D; font-weight:bold">1</span>}</code> </td>
1525
- <td> all? </td>
1526
- <td> _ </td>
1527
- <td> reg </td>
1528
- <td> &nbsp; </td>
1529
- <td> &nbsp; </td>
1530
- <td> &nbsp; </td>
1531
- </tr>
1532
- <tr>
1533
- <td> <code class="code">handle.select_vpiNet {|net| net.x?}</code> </td>
1534
- <td> select </td>
1535
- <td> _ </td>
1536
- <td> VpiNet </td>
1537
- <td> &nbsp; </td>
1538
- <td> &nbsp; </td>
1539
- <td> &nbsp; </td>
1540
- <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>
1541
- </tr>
1542
- <tr>
1543
- <td> <code class="code">handle.select_net {|net| net.x?}</code> </td>
1544
- <td> select </td>
1545
- <td> _ </td>
1546
- <td> net </td>
1547
- <td> &nbsp; </td>
1548
- <td> &nbsp; </td>
1549
- <td> &nbsp; </td>
1550
- </tr>
1551
- </table>
1552
- </div>
1553
- </div>
1554
- </p>
1555
-
1556
- </div>
1557
-
1558
-
1559
- <hr style="display: none"/>
1560
-
1561
- <div id="vpi.callbacks" class="section">
1562
- <h3 class="title">
1563
- <a href="#a-607049268" class="ref">5.2.2</a>
1564
-
1565
- &nbsp;
1566
-
1567
- Callbacks
1568
- </h3>
1569
-
1570
- <p>A <em>callback</em> is a mechanism that makes the Verilog simuluator execute a block of code, which is known as a &#8220;callback handler&#8221;, when some prescribed event occurs in the simulation.</p>
1571
-
1572
-
1573
- <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>
1574
-
1575
-
1576
- <p>
1577
- <hr style="display: none"/>
1578
-
1579
- <div class="formal">
1580
- <div class="example" id="ex:callback">
1581
-
1582
-
1583
- <p class="title"><a href="#a-607043828" class="ref">Example 1</a>. &nbsp; Using a callback for value change notification</p>
1584
-
1585
- <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>
1586
-
1587
-
1588
- <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 href="#fig:counter.v_decl" class="ref">Example 5</a>.</p>
1589
-
1590
-
1591
- <pre class="code">
1592
- time = <span style="color:#036; font-weight:bold">S_vpi_time</span>.new
1593
- time.type = <span style="color:#036; font-weight:bold">VpiSimTime</span>
1594
- time.low = <span style="color:#00D; font-weight:bold">0</span>
1595
- time.high = <span style="color:#00D; font-weight:bold">0</span>
1596
-
1597
- value = <span style="color:#036; font-weight:bold">S_vpi_value</span>.new
1598
- value.format = <span style="color:#036; font-weight:bold">VpiIntVal</span>
1599
-
1600
- alarm = <span style="color:#036; font-weight:bold">S_cb_data</span>.new
1601
- alarm.reason = <span style="color:#036; font-weight:bold">CbValueChange</span>
1602
- alarm.obj = <span style="color:#036; font-weight:bold">Counter</span>.count
1603
- alarm.time = time
1604
- alarm.value = value
1605
- alarm.index = <span style="color:#00D; font-weight:bold">0</span>
1606
-
1607
- vpi_register_cb( alarm ) <span style="color:#080; font-weight:bold">do</span> |info|
1608
- time = info.time.integer
1609
- count = info.value.value.integer
1610
- 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>
1611
- <span style="color:#080; font-weight:bold">end</span></pre>
1612
-
1613
-
1614
- <p>Append this code to the <tt>RSpec/counter_spec.rb</tt> file (provided in <a href="#usage.examples" class="ref">Section 5.8</a> and discussed in <a href="#usage.tutorial.specification" class="ref">Section 5.9.3</a>) and run the <a href="#usage.tutorial" class="ref">counter_RSpec test</a></p>
1615
- </div>
1616
- </div>
1617
- </p>
1618
-
1619
- </div>
1620
- </p>
1621
-
1622
- </div>
1623
-
1624
-
1625
- <hr style="display: none"/>
1626
-
1627
- <div id="usage.concurrency" class="section">
1628
- <h2 class="title">
1629
- <a href="#a-607113668" class="ref">5.3</a>
1630
-
1631
- &nbsp;
1632
-
1633
- Concurrency
1634
- </h2>
1635
-
1636
- <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 represent the same idea as &#8220;initial&#8221;, &#8220;always&#8221;, and &#8220;forever&#8221; blocks do in Verilog.</p>
1637
-
1638
-
1639
- <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>
1640
-
1641
-
1642
- <p>First, <strong>all processes execute in the same 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>
1643
-
1644
-
1645
- <p>Second, <strong>all processes see the same 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>
1646
-
1647
-
1648
- <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>
1649
-
1650
-
1651
- <p>
1652
- <div id="Creating_a_concurrent_process" class="paragraph">
1653
- <p class="title">Creating a concurrent process</p>
1654
- <p>You can create a concurrent proceess by passing a block of code to the <code class="code">process</code> method.</p>
1655
-
1656
-
1657
- <p>You can also create concurrent processes that loop forever using 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. However, due to the constraints of the concurrency model (see above), there is one limitation: all assignments are treated like Verilog&#8217;s non-blocking assignments.</p>
1658
-
1659
-
1660
- <p>
1661
- <hr style="display: none"/>
1662
-
1663
- <div class="formal">
1664
- <div class="example" id="An_edge-triggered__always__block">
1665
-
1666
-
1667
- <p class="title"><a href="#a-607088908" class="ref">Example 2</a>. &nbsp; An edge-triggered &#8220;always&#8221; block</p>
1668
-
1669
- <p>Suppose you have the following Verilog code:</p>
1670
-
1671
-
1672
- <pre class="code" lang="verilog">
1673
- always @(posedge clock1 and negedge clock2) begin
1674
- foo &lt;= foo + 1;
1675
- bar = bar + 5;
1676
- end</pre>
1677
-
1678
-
1679
- <p>In Ruby-VPI, this code would be written as:</p>
1680
-
1681
-
1682
- <pre class="code">
1683
- always <span style="color:#080; font-weight:bold">do</span>
1684
- wait <span style="color:#080; font-weight:bold">until</span> clock.posedge? <span style="color:#080; font-weight:bold">and</span> clock2.negedge?
1685
-
1686
- foo.intVal += <span style="color:#00D; font-weight:bold">1</span>
1687
- bar.intVal += <span style="color:#00D; font-weight:bold">5</span> <span style="color:#888"># this is a NON-blocking assignment!</span>
1688
- <span style="color:#080; font-weight:bold">end</span></pre>
1689
- </div>
1690
- </div>
1691
-
1692
-
1693
- <hr style="display: none"/>
1694
-
1695
- <div class="formal">
1696
- <div class="example" id="A_change-triggered__combinational___always__block">
1697
-
1698
-
1699
- <p class="title"><a href="#a-607094288" class="ref">Example 3</a>. &nbsp; A change-triggered (combinational) &#8220;always&#8221; block</p>
1700
-
1701
- <p>Suppose you have the following Verilog code:</p>
1702
-
1703
-
1704
- <pre class="code" lang="verilog">
1705
- always @(apple, banana, cherry, date) begin
1706
- $display(&quot;Yum! Fruits are good for health!&quot;);
1707
- end</pre>
1708
-
1709
-
1710
- <p>In Ruby-VPI, this code would be written as:</p>
1711
-
1712
-
1713
- <pre class="code">
1714
- always <span style="color:#080; font-weight:bold">do</span>
1715
- 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">and</span> cherry.change? <span style="color:#080; font-weight:bold">or</span> date.change?
1716
- 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>
1717
- <span style="color:#080; font-weight:bold">end</span></pre>
1718
-
1719
-
1720
- <p>Or, if you are lazy like I am, you can express the sensitivity list programatically:</p>
1721
-
1722
-
1723
- <pre class="code">
1724
- always <span style="color:#080; font-weight:bold">do</span>
1725
- wait <span style="color:#080; font-weight:bold">until</span> [apple, banana, cherry, date].any? {|x| x.change?}
1726
- 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>
1727
- <span style="color:#080; font-weight:bold">end</span></pre>
1728
- </div>
1729
- </div>
1730
- </p>
1731
- </div>
1732
- </p>
1733
-
1734
- </div>
1735
-
1736
-
1737
- <hr style="display: none"/>
1738
-
1739
- <div id="usage.prototyping" class="section">
1740
- <h2 class="title">
1741
- <a href="#a-607122918" class="ref">5.4</a>
1742
-
1743
- &nbsp;
1744
-
1745
- Prototyping
1746
- </h2>
1747
-
1748
- <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>
1749
-
1750
-
1751
- <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>
1752
-
1753
-
1754
- <p>For example, compare the Verilog design shown in <a href="#fig:counter.v_impl" class="ref">Example 13</a> with its Ruby prototype shown in figure <a href="#fig:counter_proto.rb" class="ref">Example 10</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>
1755
-
1756
-
1757
- <p>
1758
- <div id="Creating_a_prototype" class="paragraph">
1759
- <p class="title">Creating a prototype</p>
1760
- <ol>
1761
- <li>Start with a <a href="#usage.tutorial.declare-design" class="ref">Verilog module declaration</a> for your design.</li>
1762
- <li><a href="#usage.tutorial.generate-test" class="ref">Generate a test</a> using that module declaration.</li>
1763
- <li><a href="#usage.tutorial.implement-proto" class="ref">Implement the prototype</a> in the generated <tt>proto.rb</tt> file.</li>
1764
- <li><a href="#usage.tutorial.test-proto" class="ref">Verify the prototype</a> against its specification.</li>
1765
- </ol>
1766
-
1767
-
1768
- <p>Once you are satisfied with your prototype, you can proceed to <a href="#usage.tutorial.implement-design" class="ref">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>
1769
-
1770
-
1771
- <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 href="#usage.runner" class="ref">Section 5.6</a> for details).</p>
1772
- </div>
1773
- </p>
1774
-
1775
- </div>
1776
-
1777
-
1778
- <hr style="display: none"/>
1779
-
1780
- <div id="usage.debugger" class="section">
1781
- <h2 class="title">
1782
- <a href="#a-607128648" class="ref">5.5</a>
1783
-
1784
- &nbsp;
1785
-
1786
- Interactive debugging
1787
- </h2>
1788
-
1789
- <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>
1790
-
1791
-
1792
- <ol>
1793
- <li>Enable the debugger by activating the <code class="code"><span style="color:#036; font-weight:bold">DEBUGGER</span></code> environment variable (see <a href="#usage.runner" class="ref">Section 5.6</a> for details).</li>
1794
- <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>
1795
- </ol>
1796
-
1797
-
1798
- <p>
1799
- <hr style="display: none"/>
1800
-
1801
- <div id="usage.debugger.init" class="section">
1802
- <h3 class="title">
1803
- <a href="#a-607125578" class="ref">5.5.1</a>
1804
-
1805
- &nbsp;
1806
-
1807
- Advanced initialization
1808
- </h3>
1809
-
1810
- 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:
1811
-
1812
-
1813
- <ol>
1814
- <li>Deactivate the <code class="code"><span style="color:#036; font-weight:bold">DEBUG</span></code> environment variable.</li>
1815
- <li>Put your own code, which initializes the debugger, at the top of your test&#8217;s <tt>spec.rb</tt> file.</li>
1816
- </ol>
1817
-
1818
- </div>
1819
- </p>
1820
-
1821
- </div>
1822
-
1823
-
1824
- <hr style="display: none"/>
1825
-
1826
- <div id="usage.runner" class="section">
1827
- <h2 class="title">
1828
- <a href="#a-607150648" class="ref">5.6</a>
1829
-
1830
- &nbsp;
1831
-
1832
- Test runner
1833
- </h2>
1834
-
1835
- <p>A test runner is a file, generated by the <a href="#usage.tools.generate" class="ref">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>
1836
-
1837
-
1838
- <p>When you invoke a test runner without any arguments, it will show you a list of available tasks:
1839
- <pre>% rake -f your_test_runner.rake
1840
-
1841
- (in /home/sun/src/ruby-vpi/doc)
1842
- rake clean # Remove any temporary products.
1843
- rake clobber # Remove any generated file.
1844
- rake cver # Simulate with GPL Cver.
1845
- rake default # Show a list of available tasks.
1846
- rake ivl # Simulate with Icarus Verilog.
1847
- rake ncsim # Simulate with Cadence NC-Sim.
1848
- rake vcs # Simulate with Synopsys VCS.
1849
- rake vsim # Simulate with Mentor Modelsim.
1850
- </pre></p>
1851
-
1852
-
1853
- <p>
1854
- <hr style="display: none"/>
1855
-
1856
- <div id="usage.runner.env-vars" class="section">
1857
- <h3 class="title">
1858
- <a href="#a-607138328" class="ref">5.6.1</a>
1859
-
1860
- &nbsp;
1861
-
1862
- Environment variables
1863
- </h3>
1864
-
1865
- <p>Test runners support the following <em>environment</em> variables, which allow you to easily change the behavior of the test runner.</p>
1866
-
1867
-
1868
- <ul>
1869
- <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>
1870
- <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>
1871
- <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>
1872
- <li><code class="code"><span style="color:#036; font-weight:bold">DEBUGGER</span></code> enables the <a href="#usage.debugger" class="ref">interactive debugger</a> in its <a href="http://www.datanoise.com/articles/2006/12/20/post-mortem-debugging">post-mortem debugging mode</a>.</li>
1873
- </ul>
1874
-
1875
-
1876
- <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>
1877
-
1878
-
1879
- <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>
1880
-
1881
-
1882
- <p>
1883
- <div id="Variables_as_command-line_arguments" class="paragraph">
1884
- <p class="title">Variables as command-line arguments</p>
1885
- You can specify variable assignments as arguments to the <strong>rake</strong> command. For example, <pre>rake DEBUGGER=1</pre> is equivalent to
1886
- <pre>
1887
- DEBUGGER=1
1888
- export DEBUGGER
1889
- rake
1890
- </pre> in Bourne shell or
1891
- <pre>
1892
- setenv DEBUGGER 1
1893
- rake
1894
- </pre> in C shell.
1895
- </div>
1896
- </p>
1897
-
1898
-
1899
- <p>
1900
- <hr style="display: none"/>
1901
-
1902
- <div class="formal">
1903
- <div class="example" id="Running_a_test_with_environment_variables">
1904
-
1905
-
1906
- <p class="title"><a href="#a-607134148" class="ref">Example 4</a>. &nbsp; Running a test with environment variables</p>
1907
-
1908
- <p>Below, we enable the prototype and code coverage analysis:
1909
- <pre>rake -f your_test_runner.rake PROTOTYPE=1 COVERAGE=1</pre></p>
1910
-
1911
-
1912
- <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.
1913
- <pre>rake -f your_test_runner.rake PROTOTYPE=0 COVERAGE=1</pre>
1914
- <pre>rake -f your_test_runner.rake PROTOTYPE= COVERAGE=1</pre>
1915
- <pre>rake -f your_test_runner.rake COVERAGE=1</pre></p>
1916
- </div>
1917
- </div>
1918
- </p>
1919
-
1920
- </div>
1921
- </p>
1922
-
1923
- </div>
1924
-
1925
-
1926
- <hr style="display: none"/>
1927
-
1928
- <div id="usage.tools" class="section">
1929
- <h2 class="title">
1930
- <a href="#a-607177328" class="ref">5.7</a>
1931
-
1932
- &nbsp;
1933
-
1934
- Tools
1935
- </h2>
1936
-
1937
- <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>
1938
-
1939
-
1940
- <pre>This is a front-end for tools provided by Ruby-VPI.
1941
-
1942
- Usage:
1943
-
1944
- ruby-vpi Show this help message
1945
- ruby-vpi TOOL --help Show help message for TOOL
1946
- ruby-vpi TOOL arguments... Run TOOL with some arguments
1947
-
1948
- Tools:
1949
- convert Converts Verilog source code into Ruby.
1950
- generate Generates Ruby-VPI tests from Verilog 2001 and Verilog 95 module declarations.
1951
-
1952
- Simulators:
1953
- ivl Icarus Verilog
1954
- vcs Synopsys VCS
1955
- vsim Mentor Modelsim
1956
- ncsim Cadence NC-Sim
1957
- cver GPL Cver
1958
- </pre>
1959
-
1960
-
1961
- <p>
1962
- <hr style="display: none"/>
1963
-
1964
- <div id="usage.tools.generate" class="section">
1965
- <h3 class="title">
1966
- <a href="#a-607165778" class="ref">5.7.1</a>
1967
-
1968
- &nbsp;
1969
-
1970
- Automated test generation
1971
- </h3>
1972
-
1973
- <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>
1974
-
1975
-
1976
- A Ruby-VPI test is composed of the following files:
1977
- <ul>
1978
- <li><tt>runner.rake</tt> runs the test by starting a Verilog simulator and loading Ruby-VPI into it.</li>
1979
- <li><tt>spec.rb</tt> is the executable specification for the design under test.</li>
1980
- <li><tt>design.rb</tt> is an optional file that provides convenience methods for controlling the design under test.</li>
1981
- <li><tt>proto.rb</tt> is an optional file that defines a Ruby prototype of the design under test.</li>
1982
- <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>
1983
- </ul>
1984
-
1985
-
1986
- <p>As <a href="#fig:generate-test.RSpec" class="ref">Example 6</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>
1987
-
1988
-
1989
- <p>
1990
- <hr style="display: none"/>
1991
-
1992
- <div class="admonition">
1993
- <div class="caution" id="Do_not_rename_generated_files">
1994
- <img src="images/tango/caution.png" alt="caution" class="icon"/>
1995
-
1996
- <p class="title"><a href="#a-607154698" class="ref">Caution 1</a>. &nbsp; Do not rename generated files</p>
1997
-
1998
- 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.
1999
- </div>
2000
- </div>
2001
-
2002
- 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>
2003
-
2004
-
2005
- <p>You can try this tool by running the <pre>ruby-vpi generate --help</pre> command.</p>
2006
-
2007
-
2008
- <p>
2009
- <hr style="display: none"/>
2010
-
2011
- <div class="admonition">
2012
- <div class="tip" id="Using__kdiff3__with_the_automated_test_generator.">
2013
- <img src="images/tango/tip.png" alt="tip" class="icon"/>
2014
-
2015
- <p class="title"><a href="#a-607159448" class="ref">Tip 3</a>. &nbsp; Using <strong>kdiff3</strong> with the automated test generator.</p>
2016
-
2017
- <ol>
2018
- <li>Create a file named <tt>merge2</tt> with the following content: <pre class="code">
2019
- <span style="color:#888">#!/bin/sh</span>
2020
- <span style="color:#888"># args: old file, new file</span>
2021
- 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></pre></li>
2022
- <li>Make the file executable by running the <pre>chmod +x merge2</pre> command.</li>
2023
- <li>Place the file somewhere accessible by your <code class="code"><span style="color:#036; font-weight:bold">PATH</span></code> environment variable.</li>
2024
- <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>
2025
- </ol>
2026
-
2027
-
2028
- <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>
2029
- </div>
2030
- </div>
2031
- </p>
2032
-
2033
- </div>
2034
-
2035
-
2036
- <hr style="display: none"/>
2037
-
2038
- <div id="usage.tools.convert" class="section">
2039
- <h3 class="title">
2040
- <a href="#a-607169418" class="ref">5.7.2</a>
2041
-
2042
- &nbsp;
2043
-
2044
- Verilog to Ruby conversion
2045
- </h3>
2046
-
2047
- <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>
2048
-
2049
-
2050
- <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>
2051
-
2052
- </div>
2053
- </p>
2054
-
2055
- </div>
2056
-
2057
-
2058
- <hr style="display: none"/>
2059
-
2060
- <div id="usage.examples" class="section">
2061
- <h2 class="title">
2062
- <a href="#a-607179568" class="ref">5.8</a>
2063
-
2064
- &nbsp;
2065
-
2066
- Example tests
2067
- </h2>
2068
-
2069
- The <tt>examples</tt> directory (<a href="http://ruby-vpi.rubyforge.org/code//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.
2070
-
2071
- </div>
2072
-
2073
-
2074
- <hr style="display: none"/>
2075
-
2076
- <div id="usage.tutorial" class="section">
2077
- <h2 class="title">
2078
- <a href="#a-607105538" class="ref">5.9</a>
2079
-
2080
- &nbsp;
2081
-
2082
- Tutorial
2083
- </h2>
2084
-
2085
- <ol>
2086
- <li><a href="#usage.tutorial.declare-design" class="ref">Declare a design</a> using Verilog 2001 syntax.</li>
2087
- <li><a href="#usage.tutorial.generate-test" class="ref">Generate a test</a> for the design using the <a href="#usage.tools.generate" class="ref">automated test generator</a> tool.</li>
2088
- <li><a href="#usage.tutorial.specification" class="ref">Identify your expectations</a> for the design and implement them in the specification.</li>
2089
- <li>(Optional) <a href="#usage.tutorial.implement-proto" class="ref">Implement the prototype</a> of the design in Ruby.</li>
2090
- <li>(Optional) <a href="#usage.tutorial.test-proto" class="ref">Verify the prototype</a> against the specification.</li>
2091
- <li><a href="#usage.tutorial.implement-design" class="ref">Implement the design</a> in Verilog once the prototype has been verified.</li>
2092
- <li><a href="#usage.tutorial.test-design" class="ref">Verify the design</a> against the specification.</li>
2093
- </ol>
2094
-
2095
-
2096
- <p>
2097
- <hr style="display: none"/>
2098
-
2099
- <div id="usage.tutorial.declare-design" class="section">
2100
- <h3 class="title">
2101
- <a href="#a-607192538" class="ref">5.9.1</a>
2102
-
2103
- &nbsp;
2104
-
2105
- Start with a Verilog design
2106
- </h3>
2107
-
2108
- <p>First, we need a Verilog design to test. In this tutorial, <a href="#fig:counter.v_decl" class="ref">Example 5</a> will serve as our design under test. Its interface is composed of the following parts:</p>
2109
-
2110
-
2111
- <ul>
2112
- <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>
2113
- <li><code class="code">clock</code> causes the <code class="code">count</code> register to increment whenever it reaches a positive edge.</li>
2114
- <li><code class="code">reset</code> causes the <code class="code">count</code> register to become zero when asserted.</li>
2115
- <li><code class="code">count</code> is a register that contains the counter&#8217;s value.</li>
2116
- </ul>
2117
-
2118
-
2119
- <p>
2120
- <hr style="display: none"/>
2121
-
2122
- <div class="formal">
2123
- <div class="example" id="fig:counter.v_decl">
2124
-
2125
-
2126
- <p class="title"><a href="#a-607186858" class="ref">Example 5</a>. &nbsp; Declaration of a simple up-counter with synchronous reset</p>
2127
-
2128
- <pre class="code" lang="verilog">
2129
- module counter #(parameter Size = 5) (
2130
- input clock,
2131
- input reset,
2132
- output reg [Size-1 : 0] count
2133
- );
2134
- endmodule</pre>
2135
- </div>
2136
- </div>
2137
-
2138
- Before we continue, save the source code shown in <a href="#fig:counter.v_decl" class="ref">Example 5</a> into a file named <tt>counter.v</tt>.</p>
2139
-
2140
- </div>
2141
- </p>
2142
-
2143
-
2144
- <p>
2145
- <hr style="display: none"/>
2146
-
2147
- <div id="usage.tutorial.generate-test" class="section">
2148
- <h3 class="title">
2149
- <a href="#a-607217768" class="ref">5.9.2</a>
2150
-
2151
- &nbsp;
2152
-
2153
- Generate a test
2154
- </h3>
2155
-
2156
- <p>Now that we have a Verilog design to test, we shall use the <a href="#usage.tools.generate" class="ref">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>
2157
-
2158
-
2159
- Each format represents a different software development methodology:
2160
- <ul>
2161
- <li>RSpec represents <a href="#glossary.BDD" class="ref">BDD</a></li>
2162
- <li>xUnit represents <a href="#glossary.TDD" class="ref">TDD</a></li>
2163
- <li>our own format can represent another methodology</li>
2164
- </ul>
2165
-
2166
-
2167
- <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:
2168
- <pre>
2169
- mkdir RSpec xUnit
2170
- cp counter.v RSpec
2171
- cp counter.v xUnit
2172
- </pre></p>
2173
-
2174
-
2175
- <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 href="#fig:generate-test.RSpec" class="ref">Example 6</a> and <a href="#fig:generate-test.xUnit" class="ref">Example 7</a>.</p>
2176
-
2177
-
2178
- <p>
2179
- <hr style="display: none"/>
2180
-
2181
- <div class="formal">
2182
- <div class="example" id="fig:generate-test.RSpec">
2183
-
2184
-
2185
- <p class="title"><a href="#a-607199068" class="ref">Example 6</a>. &nbsp; Generating a test with specification in RSpec format</p>
2186
-
2187
- <pre>
2188
- $ ruby-vpi generate counter.v --RSpec
2189
-
2190
- module counter
2191
- create counter_runner.rake
2192
- create counter_design.rb
2193
- create counter_proto.rb
2194
- create counter_spec.rb
2195
- create Rakefile
2196
- </pre>
2197
- </div>
2198
- </div>
2199
-
2200
-
2201
- <hr style="display: none"/>
2202
-
2203
- <div class="formal">
2204
- <div class="example" id="fig:generate-test.xUnit">
2205
-
2206
-
2207
- <p class="title"><a href="#a-607205488" class="ref">Example 7</a>. &nbsp; Generating a test with specification in xUnit format</p>
2208
-
2209
- <pre>
2210
- $ ruby-vpi generate counter.v --xUnit
2211
-
2212
- module counter
2213
- create counter_runner.rake
2214
- create counter_design.rb
2215
- create counter_proto.rb
2216
- create counter_spec.rb
2217
- create Rakefile
2218
- </pre>
2219
- </div>
2220
- </div>
2221
- </p>
2222
-
2223
- </div>
2224
- </p>
2225
-
2226
-
2227
- <p>
2228
- <hr style="display: none"/>
2229
-
2230
- <div id="usage.tutorial.specification" class="section">
2231
- <h3 class="title">
2232
- <a href="#a-607227868" class="ref">5.9.3</a>
2233
-
2234
- &nbsp;
2235
-
2236
- Specify your expectations
2237
- </h3>
2238
-
2239
- <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 href="#glossary.expectation" class="ref">expectation</a> of the design under test. That is, how do we expect the design to <em>behave</em> under certain conditions?</p>
2240
-
2241
-
2242
- Here are some reasonable expectations for our simple counter:
2243
- <ul>
2244
- <li>A resetted counter&#8217;s value should be zero.</li>
2245
- <li>A resetted counter&#8217;s value should increment by one count upon each rising clock edge.</li>
2246
- <li>A counter with the maximum value should overflow upon increment.</li>
2247
- </ul>
2248
-
2249
-
2250
- <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 href="#fig:RSpec_counter_spec.rb" class="ref">Example 8</a> and <a href="#fig:xUnit_counter_spec.rb" class="ref">Example 9</a>.</p>
2251
-
2252
-
2253
-
2254
- <hr style="display: none"/>
2255
-
2256
- <div class="formal">
2257
- <div class="example" id="fig:RSpec_counter_spec.rb">
2258
-
2259
-
2260
- <p class="title"><a href="#a-607220678" class="ref">Example 8</a>. &nbsp; Specification implemented in RSpec format</p>
2261
-
2262
- <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>
2263
-
2264
- <span style="color:#888"># lowest upper bound of counter's value</span>
2265
- <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">Counter</span>::<span style="color:#036; font-weight:bold">Size</span>
2266
-
2267
- <span style="color:#888"># maximum allowed value for a counter</span>
2268
- <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>
2269
-
2270
- describe <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">A resetted counter's value</span><span style="color:#710">&quot;</span></span> <span style="color:#080; font-weight:bold">do</span>
2271
- setup <span style="color:#080; font-weight:bold">do</span>
2272
- <span style="color:#036; font-weight:bold">Counter</span>.reset!
2273
- <span style="color:#080; font-weight:bold">end</span>
2274
-
2275
- 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>
2276
- <span style="color:#036; font-weight:bold">Counter</span>.count.intVal.should == <span style="color:#00D; font-weight:bold">0</span>
2277
- <span style="color:#080; font-weight:bold">end</span>
2278
-
2279
- it <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">should increment upon each rising clock edge</span><span style="color:#710">&quot;</span></span> <span style="color:#080; font-weight:bold">do</span>
2280
- <span style="color:#036; font-weight:bold">LIMIT</span>.times <span style="color:#080; font-weight:bold">do</span> |i|
2281
- <span style="color:#036; font-weight:bold">Counter</span>.count.intVal.should == i
2282
- <span style="color:#036; font-weight:bold">Counter</span>.cycle! <span style="color:#888"># increment the counter</span>
2283
- <span style="color:#080; font-weight:bold">end</span>
2284
- <span style="color:#080; font-weight:bold">end</span>
2285
- <span style="color:#080; font-weight:bold">end</span>
2286
-
2287
- describe <span style="background-color:#fff0f0"><span style="color:#710">&quot;</span><span style="color:#D20">A counter with the maximum value</span><span style="color:#710">&quot;</span></span> <span style="color:#080; font-weight:bold">do</span>
2288
- setup <span style="color:#080; font-weight:bold">do</span>
2289
- <span style="color:#036; font-weight:bold">Counter</span>.reset!
2290
-
2291
- <span style="color:#888"># increment the counter to maximum value</span>
2292
- <span style="color:#036; font-weight:bold">MAX</span>.times { <span style="color:#036; font-weight:bold">Counter</span>.cycle! }
2293
- <span style="color:#036; font-weight:bold">Counter</span>.count.intVal.should == <span style="color:#036; font-weight:bold">MAX</span>
2294
- <span style="color:#080; font-weight:bold">end</span>
2295
-
2296
- 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>
2297
- <span style="color:#036; font-weight:bold">Counter</span>.cycle! <span style="color:#888"># increment the counter</span>
2298
- <span style="color:#036; font-weight:bold">Counter</span>.count.intVal.should == <span style="color:#00D; font-weight:bold">0</span>
2299
- <span style="color:#080; font-weight:bold">end</span>
2300
- <span style="color:#080; font-weight:bold">end</span></pre>
2301
- </div>
2302
- </div>
2303
-
2304
-
2305
- <hr style="display: none"/>
2306
-
2307
- <div class="formal">
2308
- <div class="example" id="fig:xUnit_counter_spec.rb">
2309
-
2310
-
2311
- <p class="title"><a href="#a-607223038" class="ref">Example 9</a>. &nbsp; Specification implemented in xUnit format</p>
2312
-
2313
- <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>
2314
-
2315
- <span style="color:#888"># lowest upper bound of counter's value</span>
2316
- <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">Counter</span>::<span style="color:#036; font-weight:bold">Size</span>
2317
-
2318
- <span style="color:#888"># maximum allowed value for a counter</span>
2319
- <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>
2320
-
2321
- <span style="color:#080; font-weight:bold">class</span> <span style="color:#B06; font-weight:bold">ResettedCounterValue</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>
2322
- <span style="color:#080; font-weight:bold">def</span> <span style="color:#06B; font-weight:bold">setup</span>
2323
- <span style="color:#036; font-weight:bold">Counter</span>.reset!
2324
- <span style="color:#080; font-weight:bold">end</span>
2325
-
2326
- <span style="color:#080; font-weight:bold">def</span> <span style="color:#06B; font-weight:bold">test_zero</span>
2327
- assert_equal( <span style="color:#00D; font-weight:bold">0</span>, <span style="color:#036; font-weight:bold">Counter</span>.count.intVal )
2328
- <span style="color:#080; font-weight:bold">end</span>
2329
-
2330
- <span style="color:#080; font-weight:bold">def</span> <span style="color:#06B; font-weight:bold">test_increment</span>
2331
- <span style="color:#036; font-weight:bold">LIMIT</span>.times <span style="color:#080; font-weight:bold">do</span> |i|
2332
- assert_equal( i, <span style="color:#036; font-weight:bold">Counter</span>.count.intVal )
2333
- <span style="color:#036; font-weight:bold">Counter</span>.cycle! <span style="color:#888"># increment the counter</span>
2334
- <span style="color:#080; font-weight:bold">end</span>
2335
- <span style="color:#080; font-weight:bold">end</span>
2336
- <span style="color:#080; font-weight:bold">end</span>
2337
-
2338
- <span style="color:#080; font-weight:bold">class</span> <span style="color:#B06; font-weight:bold">MaximumCounterValue</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>
2339
- <span style="color:#080; font-weight:bold">def</span> <span style="color:#06B; font-weight:bold">setup</span>
2340
- <span style="color:#036; font-weight:bold">Counter</span>.reset!
2341
-
2342
- <span style="color:#888"># increment the counter to maximum value</span>
2343
- <span style="color:#036; font-weight:bold">MAX</span>.times { <span style="color:#036; font-weight:bold">Counter</span>.cycle! }
2344
- assert_equal( <span style="color:#036; font-weight:bold">MAX</span>, <span style="color:#036; font-weight:bold">Counter</span>.count.intVal )
2345
- <span style="color:#080; font-weight:bold">end</span>
2346
-
2347
- <span style="color:#080; font-weight:bold">def</span> <span style="color:#06B; font-weight:bold">test_overflow</span>
2348
- <span style="color:#036; font-weight:bold">Counter</span>.cycle! <span style="color:#888"># increment the counter</span>
2349
- assert_equal( <span style="color:#00D; font-weight:bold">0</span>, <span style="color:#036; font-weight:bold">Counter</span>.count.intVal )
2350
- <span style="color:#080; font-weight:bold">end</span>
2351
- <span style="color:#080; font-weight:bold">end</span></pre>
2352
- </div>
2353
- </div>
2354
-
2355
- Before we continue,
2356
- <ol>
2357
- <li>Replace the contents of the file named <tt>RSpec/counter_spec.rb</tt> with the source code shown in <a href="#fig:RSpec_counter_spec.rb" class="ref">Example 8</a>.</li>
2358
- <li>Replace the contents of the file named <tt>xUnit/counter_spec.rb</tt> with the source code shown in <a href="#fig:xUnit_counter_spec.rb" class="ref">Example 9</a>.</li>
2359
- </ol>
2360
-
2361
- </div>
2362
- </p>
2363
-
2364
-
2365
- <p>
2366
- <hr style="display: none"/>
2367
-
2368
- <div id="usage.tutorial.implement-proto" class="section">
2369
- <h3 class="title">
2370
- <a href="#a-607233858" class="ref">5.9.4</a>
2371
-
2372
- &nbsp;
2373
-
2374
- Implement the prototype
2375
- </h3>
2376
-
2377
- <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 href="#fig:counter_proto.rb" class="ref">Example 10</a>.</p>
2378
-
2379
-
2380
- <p>
2381
- <hr style="display: none"/>
2382
-
2383
- <div class="formal">
2384
- <div class="example" id="fig:counter_proto.rb">
2385
-
2386
-
2387
- <p class="title"><a href="#a-607230458" class="ref">Example 10</a>. &nbsp; Ruby prototype of our Verilog design</p>
2388
-
2389
- <pre class="code">always <span style="color:#080; font-weight:bold">do</span>
2390
- wait <span style="color:#080; font-weight:bold">until</span> clock.posedge?
2391
-
2392
- <span style="color:#080; font-weight:bold">if</span> reset.high?
2393
- count.intVal = <span style="color:#00D; font-weight:bold">0</span>
2394
- <span style="color:#080; font-weight:bold">else</span>
2395
- count.intVal += <span style="color:#00D; font-weight:bold">1</span>
2396
- <span style="color:#080; font-weight:bold">end</span>
2397
- <span style="color:#080; font-weight:bold">end</span></pre>
2398
- </div>
2399
- </div>
2400
-
2401
- 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 href="#fig:counter_proto.rb" class="ref">Example 10</a>.</p>
2402
-
2403
- </div>
2404
- </p>
2405
-
2406
-
2407
- <p>
2408
- <hr style="display: none"/>
2409
-
2410
- <div id="usage.tutorial.test-proto" class="section">
2411
- <h3 class="title">
2412
- <a href="#a-607247108" class="ref">5.9.5</a>
2413
-
2414
- &nbsp;
2415
-
2416
- Verify the prototype
2417
- </h3>
2418
-
2419
- <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 href="#fig:test-proto.RSpec" class="ref">Example 11</a> and <a href="#fig:test-proto.unit-test" class="ref">Example 12</a>.</p>
2420
-
2421
-
2422
- <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 href="#usage.runner.env-vars" class="ref">Section 5.6.1</a> for details). Also, the <a href="#setup.reqs" class="ref">GPL Cver simulator</a> denoted by <em>cver</em>, is used to run the simulation.</p>
2423
-
2424
-
2425
- <p>
2426
- <hr style="display: none"/>
2427
-
2428
- <div class="formal">
2429
- <div class="example" id="fig:test-proto.RSpec">
2430
-
2431
-
2432
- <p class="title"><a href="#a-607236978" class="ref">Example 11</a>. &nbsp; Running a test with specification in RSpec format</p>
2433
-
2434
- <pre>
2435
- $ cd RSpec
2436
- $ rake cver PROTOTYPE=1
2437
-
2438
- Ruby-VPI: prototype is enabled
2439
- ...
2440
-
2441
- Finished in 0.05106 seconds
2442
-
2443
- 3 examples, 0 failures
2444
- cd -
2445
- </pre>
2446
- </div>
2447
- </div>
2448
-
2449
-
2450
- <hr style="display: none"/>
2451
-
2452
- <div class="formal">
2453
- <div class="example" id="fig:test-proto.unit-test">
2454
-
2455
-
2456
- <p class="title"><a href="#a-607239478" class="ref">Example 12</a>. &nbsp; Running a test with specification in xUnit format</p>
2457
-
2458
- <pre>
2459
- $ cd xUnit
2460
- $ rake cver PROTOTYPE=1
2461
-
2462
- Ruby-VPI: prototype is enabled
2463
- Loaded suite counter
2464
- Started
2465
- ...
2466
- Finished in 0.043859 seconds.
2467
-
2468
- 3 tests, 35 assertions, 0 failures, 0 errors
2469
- </pre>
2470
- </div>
2471
- </div>
2472
-
2473
-
2474
- <hr style="display: none"/>
2475
-
2476
- <div class="admonition">
2477
- <div class="tip" id="What_can_the_test_runner_do_">
2478
- <img src="images/tango/tip.png" alt="tip" class="icon"/>
2479
-
2480
- <p class="title"><a href="#a-607241748" class="ref">Tip 4</a>. &nbsp; What can the test runner do?</p>
2481
-
2482
- 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.
2483
- </div>
2484
- </div>
2485
- </p>
2486
-
2487
- </div>
2488
- </p>
2489
-
2490
-
2491
- <p>
2492
- <hr style="display: none"/>
2493
-
2494
- <div id="usage.tutorial.implement-design" class="section">
2495
- <h3 class="title">
2496
- <a href="#a-607253098" class="ref">5.9.6</a>
2497
-
2498
- &nbsp;
2499
-
2500
- Implement the design
2501
- </h3>
2502
-
2503
- <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 href="#fig:counter.v_impl" class="ref">Example 13</a>.</p>
2504
-
2505
-
2506
- <p>
2507
- <hr style="display: none"/>
2508
-
2509
- <div class="formal">
2510
- <div class="example" id="fig:counter.v_impl">
2511
-
2512
-
2513
- <p class="title"><a href="#a-607249698" class="ref">Example 13</a>. &nbsp; Implementation of a simple up-counter with synchronous reset</p>
2514
-
2515
- <pre class="code" lang="verilog">/**
2516
- A simple up-counter with synchronous reset.
2517
-
2518
- @param Size Number of bits used to represent the counter's value.
2519
- @param clock Increments the counter's value upon each positive edge.
2520
- @param reset Zeroes the counter's value when asserted.
2521
- @param count The counter's value.
2522
- */
2523
- module counter #(parameter Size = 5) (
2524
- input clock,
2525
- input reset,
2526
- output reg [Size-1 : 0] count
2527
- );
2528
- always @(posedge clock) begin
2529
- if (reset)
2530
- count &lt;= 0;
2531
- else
2532
- count &lt;= count + 1;
2533
- end
2534
- endmodule</pre>
2535
- </div>
2536
- </div>
2537
-
2538
- 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 href="#fig:counter.v_impl" class="ref">Example 13</a></p>
2539
-
2540
- </div>
2541
- </p>
2542
-
2543
-
2544
- <p>
2545
- <hr style="display: none"/>
2546
-
2547
- <div id="usage.tutorial.test-design" class="section">
2548
- <h3 class="title">
2549
- <a href="#a-607037508" class="ref">5.9.7</a>
2550
-
2551
- &nbsp;
2552
-
2553
- Verify the design
2554
- </h3>
2555
-
2556
- <p>Now that we have implemented our design we are ready to verify it against our specification by running the test <a href="#fig:test-design.RSpec" class="ref">Example 14</a> and <a href="#fig:test-design.unit-test" class="ref">Example 15</a> illustrate this process.</p>
2557
-
2558
-
2559
- <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 href="#setup.reqs" class="ref">GPL Cver simulator</a> denoted by <em>cver</em>, is used to run the simulation.</p>
2560
-
2561
-
2562
- <p>
2563
- <hr style="display: none"/>
2564
-
2565
- <div class="formal">
2566
- <div class="example" id="fig:test-design.RSpec">
2567
-
2568
-
2569
- <p class="title"><a href="#a-607000458" class="ref">Example 14</a>. &nbsp; Running a test with specification in RSpec format</p>
2570
-
2571
- <pre>
2572
- $ cd RSpec
2573
- $ rake cver
2574
-
2575
- ...
2576
-
2577
- Finished in 0.041198 seconds
2578
-
2579
- 3 examples, 0 failures
2580
- </pre>
2581
- </div>
2582
- </div>
2583
-
2584
-
2585
- <hr style="display: none"/>
2586
-
2587
- <div class="formal">
2588
- <div class="example" id="fig:test-design.unit-test">
2589
-
2590
-
2591
- <p class="title"><a href="#a-607031948" class="ref">Example 15</a>. &nbsp; Running a test with specification in xUnit format</p>
2592
-
2593
- <pre>
2594
- $ cd xUnit
2595
- $ rake cver
2596
-
2597
- Loaded suite counter
2598
- Started
2599
- ...
2600
- Finished in 0.040262 seconds.
2601
-
2602
- 3 tests, 35 assertions, 0 failures, 0 errors
2603
- </pre>
2604
- </div>
2605
- </div>
2606
- </p>
2607
-
2608
- </div>
2609
- </p>
2610
-
2611
- </div>
2612
-
2613
- </div>
2614
-
2615
-
2616
- <hr style="display: none"/>
2617
-
2618
- <div id="hacking" class="chapter">
2619
- <h1 class="title">
2620
- Chapter <a href="#a-607355358" class="ref">6</a>
2621
-
2622
- <br/><br/>
2623
-
2624
- <big>Hacking</big>
2625
- </h1>
2626
-
2627
- <p>
2628
- <hr style="display: none"/>
2629
-
2630
- <div id="hacking.scm" class="section">
2631
- <h2 class="title">
2632
- <a href="#a-607342188" class="ref">6.1</a>
2633
-
2634
- &nbsp;
2635
-
2636
- Getting the latest source code
2637
- </h2>
2638
-
2639
- Check out the source code using <a href="http://darcs.net">Darcs</a> from the project repository:
2640
-
2641
-
2642
- <pre>darcs get http://ruby-vpi.rubyforge.org/src/ruby-vpi</pre>
2643
-
2644
- </div>
2645
- </p>
2646
-
2647
-
2648
- <p>
2649
- <hr style="display: none"/>
2650
-
2651
- <div id="Installing_without_really_installing" class="section">
2652
- <h2 class="title">
2653
- <a href="#a-607344708" class="ref">6.2</a>
2654
-
2655
- &nbsp;
2656
-
2657
- Installing without really installing
2658
- </h2>
2659
-
2660
- <p>After you&#8217;ve obtained the latest source code (see <a href="#hacking.scm" class="ref">Section 6.1</a>), you can use it immediately without having to build or install a Ruby-VPI gem. To do this, 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>
2661
-
2662
-
2663
- <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>. Henceforth, any Ruby-VPI tests you run will use the checked-out source code directly.</p>
2664
-
2665
- </div>
2666
- </p>
2667
-
2668
-
2669
- <p>
2670
- <hr style="display: none"/>
2671
-
2672
- <div id="hacking.release-packages" class="section">
2673
- <h2 class="title">
2674
- <a href="#a-607347318" class="ref">6.3</a>
2675
-
2676
- &nbsp;
2677
-
2678
- Building release packages
2679
- </h2>
2680
-
2681
- <p>In addition to the <a href="#setup.reqs" class="ref">normal requirements</a> you need the following software to build release packages:</p>
2682
-
2683
-
2684
- <ul>
2685
- <li><a href="http://rubyforge.org/projects/redcloth/">RedCloth</a></li>
2686
- <li><a href="http://rubyforge.org/projects/coderay/">CodeRay</a></li>
2687
- </ul>
2688
-
2689
-
2690
- <p>Once you have satisfied these requirements, you can run <pre>rake release</pre> to build the release packages. Also, see the output of <pre>rake -T</pre> for more build options.</p>
2691
-
2692
- </div>
2693
- </p>
2694
-
2695
-
2696
- <p>
2697
- <hr style="display: none"/>
2698
-
2699
- <div id="hacking.manual" class="section">
2700
- <h2 class="title">
2701
- <a href="#a-607349668" class="ref">6.4</a>
2702
-
2703
- &nbsp;
2704
-
2705
- Editing this manual
2706
- </h2>
2707
-
2708
- <p>The &#8220;doc&#8221; files inside the <tt>doc/</tt> directory are really <em>plain text</em> files that contain the source code of this manual. You can edit these files and run the <pre>rake</pre> command to automatically generate the HTML documentation you are currently viewing.
2709
-
2710
- <p>In addition, the <tt>doc/README</tt> file says: <blockquote>The *.doc files in this directory are plain-text files!</p>
2711
- </p>
2712
-
2713
-
2714
- <p>To transform them into XHTML, you need the following software:</p>
2715
-
2716
-
2717
- <ul>
2718
- <li>Rake: http://docs.rubyrake.org/</li>
2719
- <li>RedCloth: http://whytheluckystiff.net/ruby/redcloth/</li>
2720
- <li>Coderay: http://coderay.rubychan.de/</li>
2721
- </ul>
2722
-
2723
-
2724
- Once you have the above software, simply run the &#8220;rake&#8221; command.
2725
- </blockquote>
2726
-
2727
- </div>
2728
- </p>
2729
- </div>
2730
-
2731
-
2732
- <hr style="display: none"/>
2733
-
2734
- <div id="problems" class="chapter">
2735
- <h1 class="title">
2736
- Chapter <a href="#a-607403828" class="ref">7</a>
2737
-
2738
- <br/><br/>
2739
-
2740
- <big>Known problems</big>
2741
- </h1>
2742
-
2743
- <p>This chapter presents known problems and possible solutions.</p>
2744
-
2745
-
2746
- <p>
2747
- <hr style="display: none"/>
2748
-
2749
- <div id="problem.ivl" class="section">
2750
- <h2 class="title">
2751
- <a href="#a-607383948" class="ref">7.1</a>
2752
-
2753
- &nbsp;
2754
-
2755
- Icarus Verilog
2756
- </h2>
2757
-
2758
- <p>The following sections describe problems that occur when Icarus Verilog is used with Ruby-VPI.</p>
2759
-
2760
-
2761
- <p>
2762
- <hr style="display: none"/>
2763
-
2764
- <div id="problems.ivl.vpi_handle_by_name.absolute-paths" class="section">
2765
- <h3 class="title">
2766
- <a href="#a-607361328" class="ref">7.1.1</a>
2767
-
2768
- &nbsp;
2769
-
2770
- Give full paths to Verilog objects
2771
- </h3>
2772
-
2773
- <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>
2774
-
2775
-
2776
- <p>For example, consider <a href="#ex:TestFoo" class="ref">Example 16</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>
2777
-
2778
-
2779
- <p>
2780
- <hr style="display: none"/>
2781
-
2782
- <div class="formal">
2783
- <div class="example" id="ex:TestFoo">
2784
-
2785
-
2786
- <p class="title"><a href="#a-607358168" class="ref">Example 16</a>. &nbsp; Part of a bench which instantiates a Verilog design</p>
2787
-
2788
- <pre class="code" lang="verilog">
2789
- module TestFoo;
2790
- reg clk_reg;
2791
- Foo my_foo(.clk(clk_reg));
2792
- endmodule</pre>
2793
- </div>
2794
- </div>
2795
- </p>
2796
-
2797
- </div>
2798
-
2799
-
2800
- <hr style="display: none"/>
2801
-
2802
- <div id="problems.ivl.vpi_handle_by_name.connect-registers" class="section">
2803
- <h3 class="title">
2804
- <a href="#a-607371018" class="ref">7.1.2</a>
2805
-
2806
- &nbsp;
2807
-
2808
- Registers must be connected
2809
- </h3>
2810
-
2811
- <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>
2812
-
2813
-
2814
- <p>For example, suppose you wanted to access the <code class="code">clk_reg</code> register, from the bench shown in <a href="#ex:TestFoo_bad" class="ref">Example 17</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>
2815
-
2816
-
2817
- <p>The solution is to change the design such that it appears like the one shown in <a href="#ex:TestFoo_fix" class="ref">Example 18</a> where the register is connected to a wire, or <a href="#ex:TestFoo" class="ref">Example 16</a> where the register is connected to a module instantiation.</p>
2818
-
2819
-
2820
- <p>
2821
- <hr style="display: none"/>
2822
-
2823
- <div class="formal">
2824
- <div class="example" id="ex:TestFoo_bad">
2825
-
2826
-
2827
- <p class="title"><a href="#a-607364228" class="ref">Example 17</a>. &nbsp; Bad design with unconnected registers</p>
2828
-
2829
- Here the <code class="code">clk_reg</code> register is not connected to anything.
2830
-
2831
-
2832
- <pre class="code" lang="verilog">
2833
- module TestFoo;
2834
- reg clk_reg;
2835
- endmodule</pre>
2836
- </div>
2837
- </div>
2838
-
2839
-
2840
- <hr style="display: none"/>
2841
-
2842
- <div class="formal">
2843
- <div class="example" id="ex:TestFoo_fix">
2844
-
2845
-
2846
- <p class="title"><a href="#a-607366668" class="ref">Example 18</a>. &nbsp; Fixed design with wired registers</p>
2847
-
2848
- Here the <code class="code">clk_reg</code> register is connected to the <code class="code">clk_wire</code> wire.
2849
-
2850
-
2851
- <pre class="code" lang="verilog">
2852
- module TestFoo;
2853
- reg clk_reg;
2854
- wire clk_wire;
2855
- assign clk_wire = clk_reg;
2856
- endmodule</pre>
2857
- </div>
2858
- </div>
2859
- </p>
2860
-
2861
- </div>
2862
-
2863
-
2864
- <hr style="display: none"/>
2865
-
2866
- <div id="problems.ivl.vpi_reset" class="section">
2867
- <h3 class="title">
2868
- <a href="#a-607373268" class="ref">7.1.3</a>
2869
-
2870
- &nbsp;
2871
-
2872
- VPI::reset
2873
- </h3>
2874
-
2875
- 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.
2876
-
2877
- </div>
2878
- </p>
2879
-
2880
- </div>
2881
- </p>
2882
- </div>
2883
-
2884
-
2885
- <hr style="display: none"/>
2886
-
2887
- <div id="glossary" class="chapter">
2888
- <h1 class="title">
2889
- Chapter <a href="#a-607436278" class="ref">8</a>
2890
-
2891
- <br/><br/>
2892
-
2893
- <big>Glossary</big>
2894
- </h1>
2895
-
2896
-
2897
- <hr style="display: none"/>
2898
-
2899
- <div id="glossary.test" class="section">
2900
- <h2 class="title">
2901
- <a href="#a-607406658" class="ref">8.1</a>
2902
-
2903
- &nbsp;
2904
-
2905
- Test
2906
- </h2>
2907
-
2908
- Something that checks if a <a href="#glossary.design" class="ref">design</a> satisfies a <a href="#glossary.specification" class="ref">specification</a>
2909
-
2910
- </div>
2911
-
2912
-
2913
- <hr style="display: none"/>
2914
-
2915
- <div id="glossary.design" class="section">
2916
- <h2 class="title">
2917
- <a href="#a-607409158" class="ref">8.2</a>
2918
-
2919
- &nbsp;
2920
-
2921
- Design
2922
- </h2>
2923
-
2924
- A Verilog module that is verified against a <a href="#glossary.specification" class="ref">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?
2925
-
2926
- </div>
2927
-
2928
-
2929
- <hr style="display: none"/>
2930
-
2931
- <div id="glossary.specification" class="section">
2932
- <h2 class="title">
2933
- <a href="#a-607411918" class="ref">8.3</a>
2934
-
2935
- &nbsp;
2936
-
2937
- Specification
2938
- </h2>
2939
-
2940
- A set of <a href="#glossary.expectation" class="ref">expectations</a> which define the desired behavior of a <a href="#glossary.design" class="ref">design</a> when it is subjected to certain stimulus.
2941
-
2942
- </div>
2943
-
2944
-
2945
- <hr style="display: none"/>
2946
-
2947
- <div id="glossary.expectation" class="section">
2948
- <h2 class="title">
2949
- <a href="#a-607414138" class="ref">8.4</a>
2950
-
2951
- &nbsp;
2952
-
2953
- Expectation
2954
- </h2>
2955
-
2956
- The desired response to some stimulus.
2957
-
2958
- </div>
2959
-
2960
-
2961
- <hr style="display: none"/>
2962
-
2963
- <div id="glossary.handle" class="section">
2964
- <h2 class="title">
2965
- <a href="#a-607416618" class="ref">8.5</a>
2966
-
2967
- &nbsp;
2968
-
2969
- Handle
2970
- </h2>
2971
-
2972
- A reference to an object inside the Verilog simulation. See <a href="#vpi.handles" class="ref">Section 5.2.1</a> for usage instructions.
2973
-
2974
- </div>
2975
-
2976
-
2977
- <hr style="display: none"/>
2978
-
2979
- <div id="glossary.rake" class="section">
2980
- <h2 class="title">
2981
- <a href="#a-607418878" class="ref">8.6</a>
2982
-
2983
- &nbsp;
2984
-
2985
- Rake
2986
- </h2>
2987
-
2988
- <blockquote>
2989
- <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>
2990
- </blockquote>
2991
-
2992
-
2993
- <p style="text-align:right;">&#8212;<a href="http://docs.rubyrake.org">Rake documentation</a></p>
2994
-
2995
- </div>
2996
-
2997
-
2998
- <hr style="display: none"/>
2999
-
3000
- <div id="glossary.RSpec" class="section">
3001
- <h2 class="title">
3002
- <a href="#a-607421418" class="ref">8.7</a>
3003
-
3004
- &nbsp;
3005
-
3006
- RSpec
3007
- </h2>
3008
-
3009
- <p>The <a href="#glossary.BDD" class="ref">BDD</a> framework for Ruby.</p>
3010
-
3011
-
3012
- <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>
3013
-
3014
- </div>
3015
-
3016
-
3017
- <hr style="display: none"/>
3018
-
3019
- <div id="glossary.TDD" class="section">
3020
- <h2 class="title">
3021
- <a href="#a-607423678" class="ref">8.8</a>
3022
-
3023
- &nbsp;
3024
-
3025
- Test driven development
3026
- </h2>
3027
-
3028
- <p>An <a href="http://agilemanifesto.org/">agile software development methodology</a> which emphasizes (1) testing functionality before implementing it and (2) refactoring.</p>
3029
-
3030
-
3031
- <p>See <a href="http://www.agiledata.org/essays/tdd.html">this introductory article</a> for more information.</p>
3032
-
3033
- </div>
3034
-
3035
-
3036
- <hr style="display: none"/>
3037
-
3038
- <div id="glossary.BDD" class="section">
3039
- <h2 class="title">
3040
- <a href="#a-607425938" class="ref">8.9</a>
3041
-
3042
- &nbsp;
3043
-
3044
- Behavior driven development
3045
- </h2>
3046
-
3047
- <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>
3048
-
3049
-
3050
- <p>See the <a href="http://behaviour-driven.org/">official wiki</a> for more information.</p>
3051
-
3052
- </div>
3053
-
3054
- </div>
3055
-
3056
- <br/>
3057
- <hr/>
3058
- This website is maintained by Suraj N. Kurapati (SNK at GNA dot ORG). This particular webpage was last updated on Mon Aug 27 19:26:43 -0700 2007.
3059
- </div>
3060
- </body>
3061
- </html>