HDLRuby 2.11.11 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.html +3274 -0
- data/README.md +608 -99
- data/ext/hruby_sim/hruby_rcsim_build.c +27 -0
- data/ext/hruby_sim/hruby_sim.h +3 -0
- data/ext/hruby_sim/hruby_sim_calc.c +2 -0
- data/ext/hruby_sim/hruby_sim_core.c +17 -5
- data/ext/hruby_sim/hruby_sim_stack_calc.c +1 -1
- data/ext/hruby_sim/hruby_sim_tree_calc.c +8 -1
- data/ext/hruby_sim/hruby_sim_vcd.c +24 -7
- data/ext/hruby_sim/hruby_sim_vizualize.c +9 -1
- data/lib/HDLRuby/backend/hruby_allocator.rb +2 -2
- data/lib/HDLRuby/backend/hruby_c_allocator.rb +7 -7
- data/lib/HDLRuby/hdr_samples/constant_in_function.rb +3 -1
- data/lib/HDLRuby/hdr_samples/counter_dff_bench.rb +3 -1
- data/lib/HDLRuby/hdr_samples/huge_rom.rb +1 -1
- data/lib/HDLRuby/hdr_samples/mei8.rb +11 -11
- data/lib/HDLRuby/hdr_samples/mei8_bench.rb +12 -12
- data/lib/HDLRuby/hdr_samples/neg_arith_bench.rb +4 -4
- data/lib/HDLRuby/hdr_samples/rom_nest.rb +1 -1
- data/lib/HDLRuby/hdr_samples/ruby_fir_hw.rb +4 -4
- data/lib/HDLRuby/hdr_samples/struct.rb +44 -10
- data/lib/HDLRuby/hdr_samples/with_bram.rb +45 -0
- data/lib/HDLRuby/hdr_samples/with_bram_frame_stack.rb +105 -0
- data/lib/HDLRuby/hdr_samples/with_bram_stack.rb +69 -0
- data/lib/HDLRuby/hdr_samples/with_casts.rb +3 -3
- data/lib/HDLRuby/hdr_samples/with_concat.rb +6 -6
- data/lib/HDLRuby/hdr_samples/with_connector_memory.rb +2 -2
- data/lib/HDLRuby/hdr_samples/with_def.rb +10 -3
- data/lib/HDLRuby/hdr_samples/with_define_operator.rb +44 -0
- data/lib/HDLRuby/hdr_samples/with_fixpoint.rb +12 -12
- data/lib/HDLRuby/hdr_samples/with_init.rb +3 -3
- data/lib/HDLRuby/hdr_samples/with_leftright.rb +21 -0
- data/lib/HDLRuby/hdr_samples/with_reduce.rb +13 -13
- data/lib/HDLRuby/hdr_samples/with_ref_array.rb +6 -6
- data/lib/HDLRuby/hdr_samples/with_register_stack.rb +150 -0
- data/lib/HDLRuby/hdr_samples/with_sequencer.rb +190 -0
- data/lib/HDLRuby/hdr_samples/with_sequencer_deep.rb +91 -0
- data/lib/HDLRuby/hdr_samples/with_sequencer_enumerable.rb +405 -0
- data/lib/HDLRuby/hdr_samples/with_sequencer_enumerator.rb +89 -0
- data/lib/HDLRuby/hdr_samples/with_sequencer_sync.rb +120 -0
- data/lib/HDLRuby/hdr_samples/with_subsums.rb +3 -3
- data/lib/HDLRuby/hdr_samples/with_terminate.rb +3 -3
- data/lib/HDLRuby/hdr_samples/with_to_a.rb +10 -10
- data/lib/HDLRuby/hdr_samples/with_values.rb +3 -3
- data/lib/HDLRuby/hdrcc.rb +29 -3
- data/lib/HDLRuby/hdrlib.rb +1 -1
- data/lib/HDLRuby/hruby_bstr.rb +10 -5
- data/lib/HDLRuby/hruby_db.rb +2 -2
- data/lib/HDLRuby/hruby_high.rb +152 -47
- data/lib/HDLRuby/hruby_high_fullname.rb +3 -1
- data/lib/HDLRuby/hruby_low.rb +189 -18
- data/lib/HDLRuby/hruby_low2c.rb +129 -54
- data/lib/HDLRuby/hruby_low2hdr.rb +66 -40
- data/lib/HDLRuby/hruby_low2high.rb +86 -44
- data/lib/HDLRuby/hruby_low2seq.rb +26 -18
- data/lib/HDLRuby/hruby_low2sym.rb +14 -13
- data/lib/HDLRuby/hruby_low2vhd.rb +80 -44
- data/lib/HDLRuby/hruby_low_bool2select.rb +61 -46
- data/lib/HDLRuby/hruby_low_casts_without_expression.rb +56 -44
- data/lib/HDLRuby/hruby_low_cleanup.rb +18 -16
- data/lib/HDLRuby/hruby_low_fix_types.rb +65 -32
- data/lib/HDLRuby/hruby_low_mutable.rb +83 -119
- data/lib/HDLRuby/hruby_low_resolve.rb +38 -30
- data/lib/HDLRuby/hruby_low_with_bool.rb +33 -16
- data/lib/HDLRuby/hruby_low_with_port.rb +3 -3
- data/lib/HDLRuby/hruby_low_with_var.rb +23 -9
- data/lib/HDLRuby/hruby_low_without_concat.rb +45 -19
- data/lib/HDLRuby/hruby_low_without_namespace.rb +47 -32
- data/lib/HDLRuby/hruby_low_without_parinseq.rb +32 -16
- data/lib/HDLRuby/hruby_low_without_select.rb +37 -24
- data/lib/HDLRuby/hruby_low_without_subsignals.rb +280 -0
- data/lib/HDLRuby/hruby_rcsim.rb +158 -134
- data/lib/HDLRuby/hruby_rsim.rb +194 -20
- data/lib/HDLRuby/hruby_rsim_mute.rb +2 -3
- data/lib/HDLRuby/hruby_rsim_vcd.rb +125 -50
- data/lib/HDLRuby/hruby_values.rb +48 -33
- data/lib/HDLRuby/hruby_verilog.rb +90 -48
- data/lib/HDLRuby/soft/stacks.rb +219 -0
- data/lib/HDLRuby/std/bram.rb +26 -0
- data/lib/HDLRuby/std/clocks.rb +1 -1
- data/lib/HDLRuby/std/fixpoint.rb +2 -2
- data/lib/HDLRuby/std/fsm.rb +48 -11
- data/lib/HDLRuby/std/function_generator.rb +2 -2
- data/lib/HDLRuby/std/sequencer.rb +1857 -0
- data/lib/HDLRuby/std/sequencer_sync.rb +400 -0
- data/lib/HDLRuby/std/std.rb +12 -0
- data/lib/HDLRuby/version.rb +1 -1
- data/tuto/adder_sat_flags_vcd.png +0 -0
- data/tuto/addsub_vcd.png +0 -0
- data/tuto/alu_vcd.png +0 -0
- data/tuto/bit_pong_vcd.png +0 -0
- data/tuto/checksum_vcd.png +0 -0
- data/tuto/circuit_hdr.odg +0 -0
- data/tuto/circuit_hdr.png +0 -0
- data/tuto/circuit_hie.odg +0 -0
- data/tuto/circuit_hie.png +0 -0
- data/tuto/circuit_view.odg +0 -0
- data/tuto/circuit_view.png +0 -0
- data/tuto/clock_counter_vcd.png +0 -0
- data/tuto/counter_ext_vcd.png +0 -0
- data/tuto/fact_vcd.png +0 -0
- data/tuto/hw_flow.odg +0 -0
- data/tuto/hw_flow.png +0 -0
- data/tuto/maxxer_vcd.png +0 -0
- data/tuto/pingpong0_vcd.png +0 -0
- data/tuto/pingpong1_vcd.png +0 -0
- data/tuto/pingpong2_vcd.png +0 -0
- data/tuto/ram_vcd.png +0 -0
- data/tuto/serializer_vcd.png +0 -0
- data/tuto/sw_flow.odg +0 -0
- data/tuto/sw_flow.png +0 -0
- data/tuto/the_counter_vcd.png +0 -0
- data/tuto/tutorial_sw.html +2359 -0
- data/tuto/tutorial_sw.md +2684 -0
- data/tuto/tutorial_sw.pdf +0 -0
- data/tuto/tutorial_sw_jp.md +417 -0
- metadata +49 -3
- data/lib/HDLRuby/hdr_samples/sumprod.rb +0 -29
@@ -12,8 +12,9 @@ module HDLRuby::Low
|
|
12
12
|
########################################################################
|
13
13
|
|
14
14
|
|
15
|
-
## Extends the SystemT class with fixing of types and constants.
|
16
15
|
class SystemT
|
16
|
+
## Extends the SystemT class with fixing of types and constants.
|
17
|
+
|
17
18
|
# Explicit the types conversions in the system.
|
18
19
|
def explicit_types!
|
19
20
|
# No direct fix required in the system, recurse on the scope.
|
@@ -23,8 +24,9 @@ module HDLRuby::Low
|
|
23
24
|
end
|
24
25
|
|
25
26
|
|
26
|
-
## Extends the Scope class with fixing of types and constants.
|
27
27
|
class Scope
|
28
|
+
## Extends the Scope class with fixing of types and constants.
|
29
|
+
|
28
30
|
# Explicit the types conversions in the scope.
|
29
31
|
def explicit_types!
|
30
32
|
# Recurse on the sub scopes.
|
@@ -40,8 +42,9 @@ module HDLRuby::Low
|
|
40
42
|
end
|
41
43
|
|
42
44
|
|
43
|
-
## Extends the Behavior class with fixing of types and constants.
|
44
45
|
class Behavior
|
46
|
+
## Extends the Behavior class with fixing of types and constants.
|
47
|
+
|
45
48
|
# Explicit the types conversions in the scope.
|
46
49
|
def explicit_types!
|
47
50
|
# Fix the types of the block.
|
@@ -51,8 +54,9 @@ module HDLRuby::Low
|
|
51
54
|
end
|
52
55
|
|
53
56
|
|
54
|
-
## Extends the SignalI class with fixing of types and constants.
|
55
57
|
class SignalI
|
58
|
+
## Extends the SignalI class with fixing of types and constants.
|
59
|
+
|
56
60
|
# Explicit the types conversions in the signal.
|
57
61
|
def explicit_types!
|
58
62
|
# Is there a value?
|
@@ -67,8 +71,9 @@ module HDLRuby::Low
|
|
67
71
|
end
|
68
72
|
|
69
73
|
|
70
|
-
## Extends the Statement class with fixing of types and constants.
|
71
74
|
class Statement
|
75
|
+
## Extends the Statement class with fixing of types and constants.
|
76
|
+
|
72
77
|
# Explicit the types conversions in the statement.
|
73
78
|
def explicit_types!
|
74
79
|
raise "Should implement explicit_types! for class #{self.class}."
|
@@ -76,8 +81,9 @@ module HDLRuby::Low
|
|
76
81
|
end
|
77
82
|
|
78
83
|
|
79
|
-
## Extends the Transmit class with fixing of types and constants.
|
80
84
|
class Transmit
|
85
|
+
## Extends the Transmit class with fixing of types and constants.
|
86
|
+
|
81
87
|
# Explicit the types conversions in the statement.
|
82
88
|
def explicit_types!
|
83
89
|
# Recurse on the left and the right.
|
@@ -90,8 +96,9 @@ module HDLRuby::Low
|
|
90
96
|
end
|
91
97
|
|
92
98
|
|
93
|
-
## Extends the Print class with fixing of types and constants.
|
94
99
|
class Print
|
100
|
+
## Extends the Print class with fixing of types and constants.
|
101
|
+
|
95
102
|
# Explicit the types conversions in the statement.
|
96
103
|
def explicit_types!
|
97
104
|
# Recurse on the arguments.
|
@@ -101,8 +108,9 @@ module HDLRuby::Low
|
|
101
108
|
end
|
102
109
|
|
103
110
|
|
104
|
-
## Extends the Configure class with fixing of types and constants.
|
105
111
|
class Configure
|
112
|
+
## Extends the Configure class with fixing of types and constants.
|
113
|
+
|
106
114
|
# Explicit the types conversions in the statement.
|
107
115
|
def explicit_types!
|
108
116
|
# Nothing to do.
|
@@ -111,8 +119,9 @@ module HDLRuby::Low
|
|
111
119
|
end
|
112
120
|
|
113
121
|
|
114
|
-
## Extends the TimeTerminate class with fixing of types and constants.
|
115
122
|
class TimeTerminate
|
123
|
+
## Extends the TimeTerminate class with fixing of types and constants.
|
124
|
+
|
116
125
|
# Explicit the types conversions in the statement.
|
117
126
|
def explicit_types!
|
118
127
|
# Nothing to do.
|
@@ -123,8 +132,9 @@ module HDLRuby::Low
|
|
123
132
|
|
124
133
|
|
125
134
|
|
126
|
-
## Extends the If class with fixing of types and constants.
|
127
135
|
class If
|
136
|
+
## Extends the If class with fixing of types and constants.
|
137
|
+
|
128
138
|
# Explicit the types conversions in the if.
|
129
139
|
def explicit_types!
|
130
140
|
# Recurse on the condition: it must be a Bit.
|
@@ -142,8 +152,9 @@ module HDLRuby::Low
|
|
142
152
|
end
|
143
153
|
|
144
154
|
|
145
|
-
## Extends the When class with fixing of types and constants.
|
146
155
|
class When
|
156
|
+
## Extends the When class with fixing of types and constants.
|
157
|
+
|
147
158
|
# Explicit the types conversions in the when where +type+ is the
|
148
159
|
# type of the selecting value.
|
149
160
|
def explicit_types!(type)
|
@@ -156,8 +167,9 @@ module HDLRuby::Low
|
|
156
167
|
end
|
157
168
|
|
158
169
|
|
159
|
-
## Extends the Case class with fixing of types and constants.
|
160
170
|
class Case
|
171
|
+
## Extends the Case class with fixing of types and constants.
|
172
|
+
|
161
173
|
# Explicit the types conversions in the case.
|
162
174
|
def explicit_types!
|
163
175
|
# Recurse on the value.
|
@@ -169,9 +181,10 @@ module HDLRuby::Low
|
|
169
181
|
end
|
170
182
|
end
|
171
183
|
|
172
|
-
|
173
|
-
# Describes a wait statement: not synthesizable!
|
184
|
+
|
174
185
|
class TimeWait
|
186
|
+
## Extends the TimeWait class with fixing of types and constants.
|
187
|
+
|
175
188
|
# Explicit the types conversions in the time wait.
|
176
189
|
def explicit_types!
|
177
190
|
# Nothing to do.
|
@@ -179,8 +192,10 @@ module HDLRuby::Low
|
|
179
192
|
end
|
180
193
|
end
|
181
194
|
|
182
|
-
|
195
|
+
|
183
196
|
class TimeRepeat
|
197
|
+
## Extends the TimeRepeat class with fixing of types and constants.
|
198
|
+
|
184
199
|
# Explicit the types conversions in the time repeat.
|
185
200
|
def explicit_types!
|
186
201
|
# Recurse on the statement.
|
@@ -190,8 +205,9 @@ module HDLRuby::Low
|
|
190
205
|
end
|
191
206
|
|
192
207
|
|
193
|
-
## Extends the Block class with fixing of types and constants.
|
194
208
|
class Block
|
209
|
+
## Extends the Block class with fixing of types and constants.
|
210
|
+
|
195
211
|
# Explicit the types conversions in the block.
|
196
212
|
def explicit_types!
|
197
213
|
# Recurse on the statements.
|
@@ -201,14 +217,16 @@ module HDLRuby::Low
|
|
201
217
|
end
|
202
218
|
|
203
219
|
|
204
|
-
## Extends the Connection class with fixing of types and constants.
|
205
220
|
class Connection
|
221
|
+
## Extends the Connection class with fixing of types and constants.
|
222
|
+
|
206
223
|
# Nothing required, Transmit is generated identically.
|
207
224
|
end
|
208
225
|
|
209
226
|
|
210
|
-
## Extends the Expression class with fixing of types and constants.
|
211
227
|
class Expression
|
228
|
+
## Extends the Expression class with fixing of types and constants.
|
229
|
+
|
212
230
|
# Explicit the types conversions in the expression where
|
213
231
|
# +type+ is the expected type of the condition if any.
|
214
232
|
def explicit_types(type = nil)
|
@@ -217,8 +235,9 @@ module HDLRuby::Low
|
|
217
235
|
end
|
218
236
|
|
219
237
|
|
220
|
-
## Extends the Value class with fixing of types and constants.
|
221
238
|
class Value
|
239
|
+
## Extends the Value class with fixing of types and constants.
|
240
|
+
|
222
241
|
# Explicit the types conversions in the value where
|
223
242
|
# +type+ is the expected type of the condition if any.
|
224
243
|
def explicit_types(type = nil)
|
@@ -234,8 +253,9 @@ module HDLRuby::Low
|
|
234
253
|
end
|
235
254
|
|
236
255
|
|
237
|
-
## Extends the Cast class with fixing of types and constants.
|
238
256
|
class Cast
|
257
|
+
## Extends the Cast class with fixing of types and constants.
|
258
|
+
|
239
259
|
# Explicit the types conversions in the cast where
|
240
260
|
# +type+ is the expected type of the condition if any.
|
241
261
|
def explicit_types(type = nil)
|
@@ -251,8 +271,9 @@ module HDLRuby::Low
|
|
251
271
|
end
|
252
272
|
|
253
273
|
|
254
|
-
## Extends the Operation class with fixing of types and constants.
|
255
274
|
class Operation
|
275
|
+
## Extends the Operation class with fixing of types and constants.
|
276
|
+
|
256
277
|
# Explicit the types conversions in the operation where
|
257
278
|
# +type+ is the expected type of the condition if any.
|
258
279
|
def explicit_types(type = nil)
|
@@ -261,8 +282,9 @@ module HDLRuby::Low
|
|
261
282
|
end
|
262
283
|
|
263
284
|
|
264
|
-
## Extends the Unary class with fixing of types and constants.
|
265
285
|
class Unary
|
286
|
+
## Extends the Unary class with fixing of types and constants.
|
287
|
+
|
266
288
|
# Explicit the types conversions in the unary operation where
|
267
289
|
# +type+ is the expected type of the condition if any.
|
268
290
|
def explicit_types(type = nil)
|
@@ -281,8 +303,9 @@ module HDLRuby::Low
|
|
281
303
|
end
|
282
304
|
|
283
305
|
|
284
|
-
## Extends the Binary class with fixing of types and constants.
|
285
306
|
class Binary
|
307
|
+
## Extends the Binary class with fixing of types and constants.
|
308
|
+
|
286
309
|
# Explicit the types conversions in the binary operation where
|
287
310
|
# +type+ is the expected type of the condition if any.
|
288
311
|
def explicit_types(type = nil)
|
@@ -305,8 +328,9 @@ module HDLRuby::Low
|
|
305
328
|
end
|
306
329
|
|
307
330
|
|
308
|
-
## Extends the Select class with fixing of types and constants.
|
309
331
|
class Select
|
332
|
+
## Extends the Select class with fixing of types and constants.
|
333
|
+
|
310
334
|
# Explicit the types conversions in the selection where
|
311
335
|
# +type+ is the expected type of the condition if any.
|
312
336
|
def explicit_types(type = nil)
|
@@ -319,8 +343,9 @@ module HDLRuby::Low
|
|
319
343
|
end
|
320
344
|
|
321
345
|
|
322
|
-
## Extends the Concat class with fixing of types and constants.
|
323
346
|
class Concat
|
347
|
+
## Extends the Concat class with fixing of types and constants.
|
348
|
+
|
324
349
|
# Explicit the types conversions in the concat where
|
325
350
|
# +type+ is the expected type of the condition if any.
|
326
351
|
def explicit_types(type = nil)
|
@@ -354,8 +379,9 @@ module HDLRuby::Low
|
|
354
379
|
end
|
355
380
|
|
356
381
|
|
357
|
-
## Extends the Ref class with fixing of types and constants.
|
358
382
|
class Ref
|
383
|
+
## Extends the Ref class with fixing of types and constants.
|
384
|
+
|
359
385
|
# Explicit the types conversions in the reference where
|
360
386
|
# +type+ is the expected type of the condition if any.
|
361
387
|
def explicit_types(type = nil)
|
@@ -364,8 +390,9 @@ module HDLRuby::Low
|
|
364
390
|
end
|
365
391
|
|
366
392
|
|
367
|
-
## Extends the RefConcat class with fixing of types and constants.
|
368
393
|
class RefConcat
|
394
|
+
## Extends the RefConcat class with fixing of types and constants.
|
395
|
+
|
369
396
|
# Explicit the types conversions in the concat ref where
|
370
397
|
# +type+ is the expected type of the condition if any.
|
371
398
|
def explicit_types(type = nil)
|
@@ -389,6 +416,7 @@ module HDLRuby::Low
|
|
389
416
|
# No, recurse on the sub expressions.
|
390
417
|
return RefConcat.new(self.type,self.each_ref.map.with_index do
|
391
418
|
|ref,i|
|
419
|
+
puts "self.type=#{self.type}"
|
392
420
|
ref.explicit_types(self.type.get_type(i))
|
393
421
|
end)
|
394
422
|
end
|
@@ -396,8 +424,9 @@ module HDLRuby::Low
|
|
396
424
|
end
|
397
425
|
|
398
426
|
|
399
|
-
## Extends the RefIndex class with fixing of types and constants.
|
400
427
|
class RefIndex
|
428
|
+
## Extends the RefIndex class with fixing of types and constants.
|
429
|
+
|
401
430
|
# Explicit the types conversions in the index ref where
|
402
431
|
# +type+ is the expected type of the condition if any.
|
403
432
|
def explicit_types(type = nil)
|
@@ -417,8 +446,9 @@ module HDLRuby::Low
|
|
417
446
|
end
|
418
447
|
|
419
448
|
|
420
|
-
## Extends the RefRange class with fixing of types and constants.
|
421
449
|
class RefRange
|
450
|
+
## Extends the RefRange class with fixing of types and constants.
|
451
|
+
|
422
452
|
# Explicit the types conversions in the range ref where
|
423
453
|
# +type+ is the expected type of the condition if any.
|
424
454
|
def explicit_types(type = nil)
|
@@ -440,8 +470,9 @@ module HDLRuby::Low
|
|
440
470
|
end
|
441
471
|
|
442
472
|
|
443
|
-
## Extends the RefName class with fixing of types and constants.
|
444
473
|
class RefName
|
474
|
+
## Extends the RefName class with fixing of types and constants.
|
475
|
+
|
445
476
|
# Explicit the types conversions in the index ref where
|
446
477
|
# +type+ is the expected type of the condition if any.
|
447
478
|
def explicit_types(type = nil)
|
@@ -460,8 +491,9 @@ module HDLRuby::Low
|
|
460
491
|
end
|
461
492
|
|
462
493
|
|
463
|
-
## Extends the RefThis class with fixing of types and constants.
|
464
494
|
class RefThis
|
495
|
+
## Extends the RefThis class with fixing of types and constants.
|
496
|
+
|
465
497
|
# Explicit the types conversions in the index ref where
|
466
498
|
# +type+ is the expected type of the condition if any.
|
467
499
|
def explicit_types(type = nil)
|
@@ -471,8 +503,9 @@ module HDLRuby::Low
|
|
471
503
|
end
|
472
504
|
|
473
505
|
|
474
|
-
## Extends the stringE class with fixing of types and constants.
|
475
506
|
class StringE
|
507
|
+
## Extends the stringE class with fixing of types and constants.
|
508
|
+
|
476
509
|
# Explicit the types conversions in the concat where
|
477
510
|
# +type+ is the expected type of the condition if any.
|
478
511
|
def explicit_types(type = nil)
|