HDLRuby 2.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (224) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.travis.yml +5 -0
  4. data/.yardopts +1 -0
  5. data/Gemfile +4 -0
  6. data/HDLRuby.gemspec +36 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +2774 -0
  9. data/README.pdf +0 -0
  10. data/Rakefile +10 -0
  11. data/bin/console +14 -0
  12. data/bin/setup +8 -0
  13. data/exe/hdrcc +3 -0
  14. data/lib/HDLRuby/alcc.rb +137 -0
  15. data/lib/HDLRuby/backend/hruby_allocator.rb +69 -0
  16. data/lib/HDLRuby/backend/hruby_c_allocator.rb +76 -0
  17. data/lib/HDLRuby/hdr_samples/adder.rb +7 -0
  18. data/lib/HDLRuby/hdr_samples/adder_assign_error.rb +11 -0
  19. data/lib/HDLRuby/hdr_samples/adder_bench.rb +27 -0
  20. data/lib/HDLRuby/hdr_samples/adder_gen.rb +7 -0
  21. data/lib/HDLRuby/hdr_samples/adder_nodef_error.rb +7 -0
  22. data/lib/HDLRuby/hdr_samples/addsub.rb +19 -0
  23. data/lib/HDLRuby/hdr_samples/addsubz.rb +22 -0
  24. data/lib/HDLRuby/hdr_samples/alu.rb +47 -0
  25. data/lib/HDLRuby/hdr_samples/calculator.rb +48 -0
  26. data/lib/HDLRuby/hdr_samples/counter_bench.rb +83 -0
  27. data/lib/HDLRuby/hdr_samples/dff.rb +9 -0
  28. data/lib/HDLRuby/hdr_samples/dff_bench.rb +66 -0
  29. data/lib/HDLRuby/hdr_samples/dff_counter.rb +20 -0
  30. data/lib/HDLRuby/hdr_samples/include.rb +14 -0
  31. data/lib/HDLRuby/hdr_samples/instance_open.rb +23 -0
  32. data/lib/HDLRuby/hdr_samples/mei8.rb +256 -0
  33. data/lib/HDLRuby/hdr_samples/mei8_bench.rb +309 -0
  34. data/lib/HDLRuby/hdr_samples/multer_gen.rb +8 -0
  35. data/lib/HDLRuby/hdr_samples/multer_seq.rb +29 -0
  36. data/lib/HDLRuby/hdr_samples/neural/a.rb +9 -0
  37. data/lib/HDLRuby/hdr_samples/neural/a_sub.rb +5 -0
  38. data/lib/HDLRuby/hdr_samples/neural/bw.rb +23 -0
  39. data/lib/HDLRuby/hdr_samples/neural/counter.rb +16 -0
  40. data/lib/HDLRuby/hdr_samples/neural/dadz.rb +9 -0
  41. data/lib/HDLRuby/hdr_samples/neural/dadz_sub.rb +4 -0
  42. data/lib/HDLRuby/hdr_samples/neural/forward.rb +153 -0
  43. data/lib/HDLRuby/hdr_samples/neural/forward_sub.rb +62 -0
  44. data/lib/HDLRuby/hdr_samples/neural/forward_sub_rand.rb +41 -0
  45. data/lib/HDLRuby/hdr_samples/neural/forward_sub_rand_typedef.rb +47 -0
  46. data/lib/HDLRuby/hdr_samples/neural/mem.rb +30 -0
  47. data/lib/HDLRuby/hdr_samples/neural/random.rb +23 -0
  48. data/lib/HDLRuby/hdr_samples/neural/selector.rb +29 -0
  49. data/lib/HDLRuby/hdr_samples/neural/sigmoid.rb +20 -0
  50. data/lib/HDLRuby/hdr_samples/neural/z.rb +33 -0
  51. data/lib/HDLRuby/hdr_samples/prog.obj +256 -0
  52. data/lib/HDLRuby/hdr_samples/ram.rb +18 -0
  53. data/lib/HDLRuby/hdr_samples/register_with_code_bench.rb +98 -0
  54. data/lib/HDLRuby/hdr_samples/rom.rb +10 -0
  55. data/lib/HDLRuby/hdr_samples/struct.rb +14 -0
  56. data/lib/HDLRuby/hdr_samples/sumprod.rb +29 -0
  57. data/lib/HDLRuby/hdr_samples/sw_encrypt_bench.rb +103 -0
  58. data/lib/HDLRuby/hdr_samples/sw_encrypt_cpu_bench.rb +261 -0
  59. data/lib/HDLRuby/hdr_samples/sw_encrypt_cpusim_bench.rb +302 -0
  60. data/lib/HDLRuby/hdr_samples/system_open.rb +11 -0
  61. data/lib/HDLRuby/hdr_samples/tuple.rb +16 -0
  62. data/lib/HDLRuby/hdr_samples/with_channel.rb +118 -0
  63. data/lib/HDLRuby/hdr_samples/with_class.rb +199 -0
  64. data/lib/HDLRuby/hdr_samples/with_decoder.rb +17 -0
  65. data/lib/HDLRuby/hdr_samples/with_fsm.rb +34 -0
  66. data/lib/HDLRuby/hdr_samples/with_reconf.rb +103 -0
  67. data/lib/HDLRuby/hdrcc.rb +623 -0
  68. data/lib/HDLRuby/high_samples/_adder_fault.rb +23 -0
  69. data/lib/HDLRuby/high_samples/_generic_transmission2.rb +146 -0
  70. data/lib/HDLRuby/high_samples/adder.rb +21 -0
  71. data/lib/HDLRuby/high_samples/adder_common_errors.rb +25 -0
  72. data/lib/HDLRuby/high_samples/addsub.rb +33 -0
  73. data/lib/HDLRuby/high_samples/addsubz.rb +37 -0
  74. data/lib/HDLRuby/high_samples/after.rb +28 -0
  75. data/lib/HDLRuby/high_samples/all_signals.rb +29 -0
  76. data/lib/HDLRuby/high_samples/alu.rb +61 -0
  77. data/lib/HDLRuby/high_samples/anonymous.rb +41 -0
  78. data/lib/HDLRuby/high_samples/before.rb +28 -0
  79. data/lib/HDLRuby/high_samples/blockblock.rb +26 -0
  80. data/lib/HDLRuby/high_samples/bugs/dadz.rb +22 -0
  81. data/lib/HDLRuby/high_samples/bugs/misample_instan.rb +20 -0
  82. data/lib/HDLRuby/high_samples/bugs/misample_updown.rb +22 -0
  83. data/lib/HDLRuby/high_samples/bugs/sample_add.rb +16 -0
  84. data/lib/HDLRuby/high_samples/bugs/sample_barrel.rb +13 -0
  85. data/lib/HDLRuby/high_samples/bugs/sample_daice.rb +57 -0
  86. data/lib/HDLRuby/high_samples/bugs/sample_kumiawase.rb +52 -0
  87. data/lib/HDLRuby/high_samples/bugs/sample_multi.rb +18 -0
  88. data/lib/HDLRuby/high_samples/bugs/sample_sub.rb +14 -0
  89. data/lib/HDLRuby/high_samples/bugs/z2.rb +32 -0
  90. data/lib/HDLRuby/high_samples/case.rb +32 -0
  91. data/lib/HDLRuby/high_samples/case2.rb +30 -0
  92. data/lib/HDLRuby/high_samples/change.rb +23 -0
  93. data/lib/HDLRuby/high_samples/clocks.rb +35 -0
  94. data/lib/HDLRuby/high_samples/comparer.rb +21 -0
  95. data/lib/HDLRuby/high_samples/conditionals.rb +29 -0
  96. data/lib/HDLRuby/high_samples/dff.rb +23 -0
  97. data/lib/HDLRuby/high_samples/each.rb +28 -0
  98. data/lib/HDLRuby/high_samples/exporter.rb +42 -0
  99. data/lib/HDLRuby/high_samples/functions.rb +60 -0
  100. data/lib/HDLRuby/high_samples/if_seq.rb +26 -0
  101. data/lib/HDLRuby/high_samples/inherit_as_dff.rb +32 -0
  102. data/lib/HDLRuby/high_samples/inherit_dff.rb +36 -0
  103. data/lib/HDLRuby/high_samples/instance.rb +37 -0
  104. data/lib/HDLRuby/high_samples/memory.rb +64 -0
  105. data/lib/HDLRuby/high_samples/multi_file.rb +27 -0
  106. data/lib/HDLRuby/high_samples/overload.rb +32 -0
  107. data/lib/HDLRuby/high_samples/paper_after.rb +49 -0
  108. data/lib/HDLRuby/high_samples/ram.rb +27 -0
  109. data/lib/HDLRuby/high_samples/registers.rb +139 -0
  110. data/lib/HDLRuby/high_samples/rom.rb +23 -0
  111. data/lib/HDLRuby/high_samples/scopeblockname.rb +37 -0
  112. data/lib/HDLRuby/high_samples/scopescope.rb +26 -0
  113. data/lib/HDLRuby/high_samples/shift.rb +31 -0
  114. data/lib/HDLRuby/high_samples/shift2.rb +40 -0
  115. data/lib/HDLRuby/high_samples/simple_instance.rb +31 -0
  116. data/lib/HDLRuby/high_samples/test_all.sh +10 -0
  117. data/lib/HDLRuby/high_samples/typedef.rb +24 -0
  118. data/lib/HDLRuby/high_samples/values.rb +70 -0
  119. data/lib/HDLRuby/high_samples/vector.rb +22 -0
  120. data/lib/HDLRuby/high_samples/with_decoder.rb +30 -0
  121. data/lib/HDLRuby/high_samples/with_fsm.rb +46 -0
  122. data/lib/HDLRuby/high_samples/with_pipe.rb +43 -0
  123. data/lib/HDLRuby/high_samples/with_seq.rb +25 -0
  124. data/lib/HDLRuby/hruby_bstr.rb +1085 -0
  125. data/lib/HDLRuby/hruby_check.rb +317 -0
  126. data/lib/HDLRuby/hruby_db.rb +432 -0
  127. data/lib/HDLRuby/hruby_error.rb +44 -0
  128. data/lib/HDLRuby/hruby_high.rb +4103 -0
  129. data/lib/HDLRuby/hruby_low.rb +4735 -0
  130. data/lib/HDLRuby/hruby_low2c.rb +1986 -0
  131. data/lib/HDLRuby/hruby_low2high.rb +738 -0
  132. data/lib/HDLRuby/hruby_low2seq.rb +248 -0
  133. data/lib/HDLRuby/hruby_low2sym.rb +126 -0
  134. data/lib/HDLRuby/hruby_low2vhd.rb +1437 -0
  135. data/lib/HDLRuby/hruby_low_bool2select.rb +295 -0
  136. data/lib/HDLRuby/hruby_low_cleanup.rb +193 -0
  137. data/lib/HDLRuby/hruby_low_fix_types.rb +437 -0
  138. data/lib/HDLRuby/hruby_low_mutable.rb +1803 -0
  139. data/lib/HDLRuby/hruby_low_resolve.rb +165 -0
  140. data/lib/HDLRuby/hruby_low_skeleton.rb +129 -0
  141. data/lib/HDLRuby/hruby_low_with_bool.rb +141 -0
  142. data/lib/HDLRuby/hruby_low_with_port.rb +167 -0
  143. data/lib/HDLRuby/hruby_low_with_var.rb +302 -0
  144. data/lib/HDLRuby/hruby_low_without_bit2vector.rb +88 -0
  145. data/lib/HDLRuby/hruby_low_without_concat.rb +162 -0
  146. data/lib/HDLRuby/hruby_low_without_connection.rb +113 -0
  147. data/lib/HDLRuby/hruby_low_without_namespace.rb +718 -0
  148. data/lib/HDLRuby/hruby_low_without_outread.rb +107 -0
  149. data/lib/HDLRuby/hruby_low_without_select.rb +206 -0
  150. data/lib/HDLRuby/hruby_serializer.rb +398 -0
  151. data/lib/HDLRuby/hruby_tools.rb +37 -0
  152. data/lib/HDLRuby/hruby_types.rb +239 -0
  153. data/lib/HDLRuby/hruby_values.rb +64 -0
  154. data/lib/HDLRuby/hruby_verilog.rb +1888 -0
  155. data/lib/HDLRuby/hruby_verilog_name.rb +52 -0
  156. data/lib/HDLRuby/low_samples/adder.yaml +97 -0
  157. data/lib/HDLRuby/low_samples/after.yaml +228 -0
  158. data/lib/HDLRuby/low_samples/before.yaml +223 -0
  159. data/lib/HDLRuby/low_samples/blockblock.yaml +48 -0
  160. data/lib/HDLRuby/low_samples/bugs/sample_add.yaml +97 -0
  161. data/lib/HDLRuby/low_samples/bugs/sample_daice.yaml +444 -0
  162. data/lib/HDLRuby/low_samples/bugs/sample_kumiawase.yaml +332 -0
  163. data/lib/HDLRuby/low_samples/bugs/sample_sub.yaml +97 -0
  164. data/lib/HDLRuby/low_samples/bugs/seqpar.yaml +184 -0
  165. data/lib/HDLRuby/low_samples/case.yaml +327 -0
  166. data/lib/HDLRuby/low_samples/change.yaml +135 -0
  167. data/lib/HDLRuby/low_samples/clocks.yaml +674 -0
  168. data/lib/HDLRuby/low_samples/cloner.rb +22 -0
  169. data/lib/HDLRuby/low_samples/comparer.yaml +85 -0
  170. data/lib/HDLRuby/low_samples/conditionals.yaml +133 -0
  171. data/lib/HDLRuby/low_samples/dff.yaml +107 -0
  172. data/lib/HDLRuby/low_samples/each.yaml +1328 -0
  173. data/lib/HDLRuby/low_samples/exporter.yaml +226 -0
  174. data/lib/HDLRuby/low_samples/functions.yaml +298 -0
  175. data/lib/HDLRuby/low_samples/generic_transmission.yaml +597 -0
  176. data/lib/HDLRuby/low_samples/inherit_as_dff.yaml +125 -0
  177. data/lib/HDLRuby/low_samples/inherit_dff.yaml +107 -0
  178. data/lib/HDLRuby/low_samples/load_yaml.rb +11 -0
  179. data/lib/HDLRuby/low_samples/memory.yaml +678 -0
  180. data/lib/HDLRuby/low_samples/namespace_extractor.rb +23 -0
  181. data/lib/HDLRuby/low_samples/overload.yaml +226 -0
  182. data/lib/HDLRuby/low_samples/paper_after.yaml +431 -0
  183. data/lib/HDLRuby/low_samples/port_maker.rb +14 -0
  184. data/lib/HDLRuby/low_samples/ram.yaml +207 -0
  185. data/lib/HDLRuby/low_samples/registers.yaml +228 -0
  186. data/lib/HDLRuby/low_samples/rom.yaml +2950 -0
  187. data/lib/HDLRuby/low_samples/shift.yaml +230 -0
  188. data/lib/HDLRuby/low_samples/shift2.yaml +2095 -0
  189. data/lib/HDLRuby/low_samples/simple_instance.yaml +102 -0
  190. data/lib/HDLRuby/low_samples/test_all.sh +43 -0
  191. data/lib/HDLRuby/low_samples/typedef.yaml +115 -0
  192. data/lib/HDLRuby/low_samples/values.yaml +577 -0
  193. data/lib/HDLRuby/low_samples/variable_maker.rb +14 -0
  194. data/lib/HDLRuby/low_samples/vector.yaml +56 -0
  195. data/lib/HDLRuby/low_samples/with_seq.yaml +188 -0
  196. data/lib/HDLRuby/low_samples/yaml2hdr.rb +10 -0
  197. data/lib/HDLRuby/low_samples/yaml2vhd.rb +19 -0
  198. data/lib/HDLRuby/sim/Makefile +19 -0
  199. data/lib/HDLRuby/sim/hruby_sim.h +590 -0
  200. data/lib/HDLRuby/sim/hruby_sim_calc.c +2362 -0
  201. data/lib/HDLRuby/sim/hruby_sim_core.c +589 -0
  202. data/lib/HDLRuby/sim/hruby_sim_list.c +93 -0
  203. data/lib/HDLRuby/sim/hruby_sim_vizualize.c +91 -0
  204. data/lib/HDLRuby/sim/hruby_value_pool.c +64 -0
  205. data/lib/HDLRuby/std/channel.rb +354 -0
  206. data/lib/HDLRuby/std/clocks.rb +165 -0
  207. data/lib/HDLRuby/std/counters.rb +82 -0
  208. data/lib/HDLRuby/std/decoder.rb +214 -0
  209. data/lib/HDLRuby/std/fsm.rb +516 -0
  210. data/lib/HDLRuby/std/pipeline.rb +220 -0
  211. data/lib/HDLRuby/std/reconf.rb +309 -0
  212. data/lib/HDLRuby/test_hruby_bstr.rb +2259 -0
  213. data/lib/HDLRuby/test_hruby_high.rb +594 -0
  214. data/lib/HDLRuby/test_hruby_high_low.rb +99 -0
  215. data/lib/HDLRuby/test_hruby_low.rb +934 -0
  216. data/lib/HDLRuby/v_samples/adder.v +10 -0
  217. data/lib/HDLRuby/v_samples/dff.v +12 -0
  218. data/lib/HDLRuby/v_samples/ram.v +20 -0
  219. data/lib/HDLRuby/v_samples/rom.v +270 -0
  220. data/lib/HDLRuby/version.rb +3 -0
  221. data/lib/HDLRuby.rb +11 -0
  222. data/makedoc +1 -0
  223. data/metadata.yaml +4 -0
  224. metadata +299 -0
@@ -0,0 +1,674 @@
1
+ ---
2
+ Type:
3
+ name: signed
4
+ ---
5
+ TypeVector:
6
+ name: integer
7
+ base: signed
8
+ range:
9
+ - 31
10
+ - 0
11
+ ---
12
+ Type:
13
+ name: void
14
+ ---
15
+ Type:
16
+ name: bit
17
+ ---
18
+ SystemT:
19
+ name: with_clocksI::T_
20
+ inputs:
21
+ - SignalI:
22
+ name: clk
23
+ type: bit
24
+ - SignalI:
25
+ name: rst
26
+ type: bit
27
+ outputs:
28
+ - SignalI:
29
+ name: sig0
30
+ type: bit
31
+ - SignalI:
32
+ name: sig1
33
+ type: bit
34
+ inouts: []
35
+ scope:
36
+ Scope:
37
+ name: ''
38
+ scopes: []
39
+ inners:
40
+ - SignalI:
41
+ name: ":0"
42
+ type:
43
+ TypeVector:
44
+ name: ''
45
+ base: bit
46
+ range:
47
+ - 30
48
+ - 0
49
+ - SignalI:
50
+ name: ":1"
51
+ type: bit
52
+ - SignalI:
53
+ name: ":2"
54
+ type:
55
+ TypeVector:
56
+ name: ''
57
+ base: bit
58
+ range:
59
+ - 30
60
+ - 0
61
+ - SignalI:
62
+ name: ":3"
63
+ type:
64
+ TypeVector:
65
+ name: ''
66
+ base: bit
67
+ range:
68
+ - 30
69
+ - 0
70
+ - SignalI:
71
+ name: ":4"
72
+ type: bit
73
+ systemIs: []
74
+ connections:
75
+ - Connection:
76
+ left:
77
+ RefName:
78
+ type: bit
79
+ ref:
80
+ RefThis:
81
+ type: void
82
+ name: ":4"
83
+ right:
84
+ Binary:
85
+ type:
86
+ TypeVector:
87
+ name: ''
88
+ base: signed
89
+ range:
90
+ - 32
91
+ - 0
92
+ operator: "|"
93
+ left:
94
+ Binary:
95
+ type:
96
+ TypeVector:
97
+ name: ''
98
+ base: signed
99
+ range:
100
+ - 32
101
+ - 0
102
+ operator: "=="
103
+ left:
104
+ RefName:
105
+ type:
106
+ TypeVector:
107
+ name: ''
108
+ base: bit
109
+ range:
110
+ - 30
111
+ - 0
112
+ ref:
113
+ RefThis:
114
+ type: void
115
+ name: ":2"
116
+ right:
117
+ Value:
118
+ type:
119
+ TypeVector:
120
+ name: ''
121
+ base: signed
122
+ range:
123
+ - 32
124
+ - 0
125
+ content: 2
126
+ right:
127
+ Binary:
128
+ type:
129
+ TypeVector:
130
+ name: ''
131
+ base: signed
132
+ range:
133
+ - 32
134
+ - 0
135
+ operator: "=="
136
+ left:
137
+ RefName:
138
+ type:
139
+ TypeVector:
140
+ name: ''
141
+ base: bit
142
+ range:
143
+ - 30
144
+ - 0
145
+ ref:
146
+ RefThis:
147
+ type: void
148
+ name: ":3"
149
+ right:
150
+ Value:
151
+ type:
152
+ TypeVector:
153
+ name: ''
154
+ base: signed
155
+ range:
156
+ - 32
157
+ - 0
158
+ content: 2
159
+ behaviors:
160
+ - Behavior:
161
+ events:
162
+ - Event:
163
+ type: posedge
164
+ ref:
165
+ RefName:
166
+ type: bit
167
+ ref:
168
+ RefThis:
169
+ type: void
170
+ name: clk
171
+ block:
172
+ Block:
173
+ mode: par
174
+ name: ''
175
+ inners: []
176
+ statements:
177
+ - If:
178
+ condition:
179
+ RefName:
180
+ type: bit
181
+ ref:
182
+ RefThis:
183
+ type: void
184
+ name: rst
185
+ 'yes':
186
+ Block:
187
+ mode: par
188
+ name: ''
189
+ inners: []
190
+ statements:
191
+ - Transmit:
192
+ left:
193
+ RefName:
194
+ type:
195
+ TypeVector:
196
+ name: ''
197
+ base: bit
198
+ range:
199
+ - 30
200
+ - 0
201
+ ref:
202
+ RefThis:
203
+ type: void
204
+ name: ":0"
205
+ right:
206
+ Value:
207
+ type:
208
+ TypeVector:
209
+ name: ''
210
+ base: signed
211
+ range:
212
+ - 31
213
+ - 0
214
+ content: 1
215
+ - Transmit:
216
+ left:
217
+ RefName:
218
+ type: bit
219
+ ref:
220
+ RefThis:
221
+ type: void
222
+ name: ":1"
223
+ right:
224
+ Value:
225
+ type: integer
226
+ content: 0
227
+ 'no':
228
+ Block:
229
+ mode: par
230
+ name: ''
231
+ inners: []
232
+ statements:
233
+ - Transmit:
234
+ left:
235
+ RefName:
236
+ type:
237
+ TypeVector:
238
+ name: ''
239
+ base: bit
240
+ range:
241
+ - 30
242
+ - 0
243
+ ref:
244
+ RefThis:
245
+ type: void
246
+ name: ":0"
247
+ right:
248
+ Binary:
249
+ type:
250
+ TypeVector:
251
+ name: ''
252
+ base: signed
253
+ range:
254
+ - 32
255
+ - 0
256
+ operator: "+"
257
+ left:
258
+ RefName:
259
+ type:
260
+ TypeVector:
261
+ name: ''
262
+ base: bit
263
+ range:
264
+ - 30
265
+ - 0
266
+ ref:
267
+ RefThis:
268
+ type: void
269
+ name: ":0"
270
+ right:
271
+ Value:
272
+ type: integer
273
+ content: 1
274
+ noifs:
275
+ - - Binary:
276
+ type:
277
+ TypeVector:
278
+ name: ''
279
+ base: signed
280
+ range:
281
+ - 31
282
+ - 0
283
+ operator: "=="
284
+ left:
285
+ RefName:
286
+ type:
287
+ TypeVector:
288
+ name: ''
289
+ base: bit
290
+ range:
291
+ - 30
292
+ - 0
293
+ ref:
294
+ RefThis:
295
+ type: void
296
+ name: ":0"
297
+ right:
298
+ Value:
299
+ type: integer
300
+ content: 0
301
+ - Block:
302
+ mode: par
303
+ name: ''
304
+ inners: []
305
+ statements:
306
+ - Transmit:
307
+ left:
308
+ RefName:
309
+ type:
310
+ TypeVector:
311
+ name: ''
312
+ base: bit
313
+ range:
314
+ - 30
315
+ - 0
316
+ ref:
317
+ RefThis:
318
+ type: void
319
+ name: ":0"
320
+ right:
321
+ Value:
322
+ type:
323
+ TypeVector:
324
+ name: ''
325
+ base: signed
326
+ range:
327
+ - 31
328
+ - 0
329
+ content: 1
330
+ - Transmit:
331
+ left:
332
+ RefName:
333
+ type: bit
334
+ ref:
335
+ RefThis:
336
+ type: void
337
+ name: ":1"
338
+ right:
339
+ Unary:
340
+ type: bit
341
+ operator: "~"
342
+ child:
343
+ RefName:
344
+ type: bit
345
+ ref:
346
+ RefThis:
347
+ type: void
348
+ name: ":1"
349
+ - Behavior:
350
+ events:
351
+ - Event:
352
+ type: posedge
353
+ ref:
354
+ RefName:
355
+ type: bit
356
+ ref:
357
+ RefThis:
358
+ type: void
359
+ name: ":1"
360
+ block:
361
+ Block:
362
+ mode: par
363
+ name: ''
364
+ inners: []
365
+ statements:
366
+ - If:
367
+ condition:
368
+ RefName:
369
+ type: bit
370
+ ref:
371
+ RefThis:
372
+ type: void
373
+ name: rst
374
+ 'yes':
375
+ Block:
376
+ mode: par
377
+ name: ''
378
+ inners: []
379
+ statements:
380
+ - Transmit:
381
+ left:
382
+ RefName:
383
+ type: bit
384
+ ref:
385
+ RefThis:
386
+ type: void
387
+ name: sig0
388
+ right:
389
+ Value:
390
+ type: integer
391
+ content: 0
392
+ 'no':
393
+ Block:
394
+ mode: par
395
+ name: ''
396
+ inners: []
397
+ statements:
398
+ - Transmit:
399
+ left:
400
+ RefName:
401
+ type: bit
402
+ ref:
403
+ RefThis:
404
+ type: void
405
+ name: sig0
406
+ right:
407
+ Unary:
408
+ type: bit
409
+ operator: "~"
410
+ child:
411
+ RefName:
412
+ type: bit
413
+ ref:
414
+ RefThis:
415
+ type: void
416
+ name: sig0
417
+ noifs: []
418
+ - Behavior:
419
+ events:
420
+ - Event:
421
+ type: posedge
422
+ ref:
423
+ RefName:
424
+ type: bit
425
+ ref:
426
+ RefThis:
427
+ type: void
428
+ name: clk
429
+ block:
430
+ Block:
431
+ mode: par
432
+ name: ''
433
+ inners: []
434
+ statements:
435
+ - If:
436
+ condition:
437
+ Binary:
438
+ type:
439
+ TypeVector:
440
+ name: ''
441
+ base: signed
442
+ range:
443
+ - 0
444
+ - 31
445
+ operator: "=="
446
+ left:
447
+ Binary:
448
+ type:
449
+ TypeVector:
450
+ name: ''
451
+ base: bit
452
+ range:
453
+ - 0
454
+ - 30
455
+ operator: "|"
456
+ left:
457
+ RefName:
458
+ type: bit
459
+ ref:
460
+ RefThis:
461
+ type: void
462
+ name: rst
463
+ right:
464
+ RefName:
465
+ type:
466
+ TypeVector:
467
+ name: ''
468
+ base: bit
469
+ range:
470
+ - 30
471
+ - 0
472
+ ref:
473
+ RefThis:
474
+ type: void
475
+ name: ":2"
476
+ right:
477
+ Value:
478
+ type: integer
479
+ content: 0
480
+ 'yes':
481
+ Block:
482
+ mode: par
483
+ name: ''
484
+ inners: []
485
+ statements:
486
+ - Transmit:
487
+ left:
488
+ RefName:
489
+ type:
490
+ TypeVector:
491
+ name: ''
492
+ base: bit
493
+ range:
494
+ - 30
495
+ - 0
496
+ ref:
497
+ RefThis:
498
+ type: void
499
+ name: ":2"
500
+ right:
501
+ Value:
502
+ type:
503
+ TypeVector:
504
+ name: ''
505
+ base: signed
506
+ range:
507
+ - 32
508
+ - 0
509
+ content: 2
510
+ 'no':
511
+ noifs: []
512
+ - Behavior:
513
+ events:
514
+ - Event:
515
+ type: negedge
516
+ ref:
517
+ RefName:
518
+ type: bit
519
+ ref:
520
+ RefThis:
521
+ type: void
522
+ name: clk
523
+ block:
524
+ Block:
525
+ mode: par
526
+ name: ''
527
+ inners: []
528
+ statements:
529
+ - If:
530
+ condition:
531
+ Binary:
532
+ type:
533
+ TypeVector:
534
+ name: ''
535
+ base: signed
536
+ range:
537
+ - 0
538
+ - 31
539
+ operator: "=="
540
+ left:
541
+ Binary:
542
+ type:
543
+ TypeVector:
544
+ name: ''
545
+ base: bit
546
+ range:
547
+ - 0
548
+ - 30
549
+ operator: "|"
550
+ left:
551
+ RefName:
552
+ type: bit
553
+ ref:
554
+ RefThis:
555
+ type: void
556
+ name: rst
557
+ right:
558
+ RefName:
559
+ type:
560
+ TypeVector:
561
+ name: ''
562
+ base: bit
563
+ range:
564
+ - 30
565
+ - 0
566
+ ref:
567
+ RefThis:
568
+ type: void
569
+ name: ":3"
570
+ right:
571
+ Value:
572
+ type: integer
573
+ content: 0
574
+ 'yes':
575
+ Block:
576
+ mode: par
577
+ name: ''
578
+ inners: []
579
+ statements:
580
+ - Transmit:
581
+ left:
582
+ RefName:
583
+ type:
584
+ TypeVector:
585
+ name: ''
586
+ base: bit
587
+ range:
588
+ - 30
589
+ - 0
590
+ ref:
591
+ RefThis:
592
+ type: void
593
+ name: ":3"
594
+ right:
595
+ Value:
596
+ type:
597
+ TypeVector:
598
+ name: ''
599
+ base: signed
600
+ range:
601
+ - 32
602
+ - 0
603
+ content: 2
604
+ 'no':
605
+ noifs: []
606
+ - Behavior:
607
+ events:
608
+ - Event:
609
+ type: posedge
610
+ ref:
611
+ RefName:
612
+ type: bit
613
+ ref:
614
+ RefThis:
615
+ type: void
616
+ name: ":4"
617
+ block:
618
+ Block:
619
+ mode: par
620
+ name: ''
621
+ inners: []
622
+ statements:
623
+ - If:
624
+ condition:
625
+ RefName:
626
+ type: bit
627
+ ref:
628
+ RefThis:
629
+ type: void
630
+ name: rst
631
+ 'yes':
632
+ Block:
633
+ mode: par
634
+ name: ''
635
+ inners: []
636
+ statements:
637
+ - Transmit:
638
+ left:
639
+ RefName:
640
+ type: bit
641
+ ref:
642
+ RefThis:
643
+ type: void
644
+ name: sig1
645
+ right:
646
+ Value:
647
+ type: integer
648
+ content: 0
649
+ 'no':
650
+ Block:
651
+ mode: par
652
+ name: ''
653
+ inners: []
654
+ statements:
655
+ - Transmit:
656
+ left:
657
+ RefName:
658
+ type: bit
659
+ ref:
660
+ RefThis:
661
+ type: void
662
+ name: sig1
663
+ right:
664
+ Unary:
665
+ type: bit
666
+ operator: "~"
667
+ child:
668
+ RefName:
669
+ type: bit
670
+ ref:
671
+ RefThis:
672
+ type: void
673
+ name: sig1
674
+ noifs: []
@@ -0,0 +1,22 @@
1
+ # Simple program for testing the cloning of HDLRuby::Low objects.
2
+ require 'pp'
3
+ require 'HDLRuby'
4
+ include HDLRuby::Low
5
+
6
+
7
+ # Creates a transmit statement.
8
+ left = RefIndex.new(Bit, RefName.new(Bit,RefThis.new,:s), Value.new(Bit,1) )
9
+ rleft = Unary.new(Bit, :-@, RefName.new(Bit,RefThis.new,:x) )
10
+ rright = RefName.new(Bit, RefThis.new, :y)
11
+ right = Binary.new(Bit, :+, rleft, rright)
12
+ trans = Transmit.new(left, right)
13
+
14
+ # Convert it to yaml.
15
+ expected_yaml = trans.to_yaml
16
+
17
+ # Clone it.
18
+ copy = trans.clone
19
+
20
+ # Convert it to yaml and compare with the expected yaml result.
21
+ puts "Differences:"
22
+ pp expected_yaml.split(//) - copy.to_yaml.split(//)