HDLRuby 2.11.10 → 2.11.12
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.md +55 -18
- data/ext/hruby_sim/hruby_rcsim_build.c +110 -83
- data/ext/hruby_sim/hruby_sim.h +3 -0
- data/ext/hruby_sim/hruby_sim_calc.c +14 -6
- data/ext/hruby_sim/hruby_sim_core.c +20 -7
- data/ext/hruby_sim/hruby_sim_list.c +1 -1
- data/ext/hruby_sim/hruby_sim_stack_calc.c +3 -2
- 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/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 +11 -11
- 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_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_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 +14 -1
- data/lib/HDLRuby/hruby_bstr.rb +10 -5
- data/lib/HDLRuby/hruby_high.rb +114 -27
- data/lib/HDLRuby/hruby_low.rb +187 -16
- data/lib/HDLRuby/hruby_low2c.rb +71 -11
- data/lib/HDLRuby/hruby_low2vhd.rb +2 -1
- data/lib/HDLRuby/hruby_low_fix_types.rb +1 -0
- data/lib/HDLRuby/hruby_low_mutable.rb +30 -1
- data/lib/HDLRuby/hruby_low_resolve.rb +15 -2
- data/lib/HDLRuby/hruby_low_without_concat.rb +28 -8
- data/lib/HDLRuby/hruby_low_without_parinseq.rb +14 -4
- data/lib/HDLRuby/hruby_low_without_select.rb +2 -2
- data/lib/HDLRuby/hruby_low_without_subsignals.rb +279 -0
- data/lib/HDLRuby/hruby_rcsim.rb +99 -87
- data/lib/HDLRuby/hruby_rsim.rb +132 -7
- data/lib/HDLRuby/hruby_rsim_vcd.rb +99 -27
- data/lib/HDLRuby/hruby_values.rb +35 -31
- data/lib/HDLRuby/std/bram.rb +22 -0
- data/lib/HDLRuby/std/fixpoint.rb +2 -2
- data/lib/HDLRuby/std/fsm.rb +20 -3
- data/lib/HDLRuby/std/function_generator.rb +2 -2
- data/lib/HDLRuby/version.rb +1 -1
- metadata +7 -3
- data/lib/HDLRuby/hdr_samples/sumprod.rb +0 -29
|
@@ -33,6 +33,7 @@ module HDLRuby::Low
|
|
|
33
33
|
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
+
|
|
36
37
|
## Extends the Scope class with functionality for breaking assingments
|
|
37
38
|
# to concats.
|
|
38
39
|
class Scope
|
|
@@ -42,7 +43,8 @@ module HDLRuby::Low
|
|
|
42
43
|
self.each_scope(&:break_concat_assigns!)
|
|
43
44
|
# Recurse on the statements.
|
|
44
45
|
self.each_behavior do |behavior|
|
|
45
|
-
behavior.block.each_block_deep(&:break_concat_assigns!)
|
|
46
|
+
# behavior.block.each_block_deep(&:break_concat_assigns!)
|
|
47
|
+
behavior.break_concat_assigns!
|
|
46
48
|
end
|
|
47
49
|
# Work on the connections.
|
|
48
50
|
self.each_connection.to_a.each do |connection|
|
|
@@ -100,6 +102,18 @@ module HDLRuby::Low
|
|
|
100
102
|
end
|
|
101
103
|
end
|
|
102
104
|
|
|
105
|
+
## Extends the Behavior class with functionality for breaking assingments
|
|
106
|
+
# to concats.
|
|
107
|
+
class Behavior
|
|
108
|
+
# Breaks the assignments to concats.
|
|
109
|
+
def break_concat_assigns!
|
|
110
|
+
# Recruse on the block.
|
|
111
|
+
self.block.each_block_deep(&:break_concat_assigns!)
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
103
117
|
## Extends the Block class with functionality for breaking assingments
|
|
104
118
|
# to concats.
|
|
105
119
|
class Block
|
|
@@ -107,18 +121,23 @@ module HDLRuby::Low
|
|
|
107
121
|
#
|
|
108
122
|
# NOTE: work on the direct sub statement only, not deeply.
|
|
109
123
|
def break_concat_assigns!
|
|
124
|
+
# puts "breack_concat_assigns! with block=#{self} with #{self.each_statement.count} statements"
|
|
110
125
|
# Check each transmit.
|
|
111
|
-
self.each_statement.
|
|
126
|
+
self.each_statement.to_a.each_with_index do |stmnt|
|
|
127
|
+
# puts "stmnt=#{stmnt}"
|
|
112
128
|
if stmnt.is_a?(Transmit) then
|
|
113
129
|
# Transmit, breaking may be necessary.
|
|
114
130
|
nstmnt = stmnt.break_concat_assigns
|
|
115
131
|
if nstmnt.is_a?(Block) then
|
|
116
132
|
# The transmit has been broken, remove the former
|
|
117
133
|
# version and add the generated block as a behavior.
|
|
118
|
-
self.set_statement!(i,nstmnt)
|
|
134
|
+
# self.set_statement!(i,nstmnt)
|
|
135
|
+
self.replace_statement!(stmnt,nstmnt)
|
|
136
|
+
# puts "nstmnt.parent=#{nstmnt.parent}"
|
|
119
137
|
end
|
|
120
138
|
end
|
|
121
139
|
end
|
|
140
|
+
return self
|
|
122
141
|
end
|
|
123
142
|
end
|
|
124
143
|
|
|
@@ -144,11 +163,12 @@ module HDLRuby::Low
|
|
|
144
163
|
top_scope = top_block.top_scope
|
|
145
164
|
aux = top_scope.add_inner(
|
|
146
165
|
SignalI.new(HDLRuby.uniq_name,self.right.type) )
|
|
147
|
-
# puts "new signal: #{aux.name}"
|
|
148
166
|
aux = RefName.new(aux.type,RefThis.new,aux.name)
|
|
149
167
|
# Is a default value required to avoid latch generation?
|
|
150
|
-
unless top_block.
|
|
151
|
-
|
|
168
|
+
unless top_block.is_a?(TimeBlock) ||
|
|
169
|
+
top_block.parent.each_event.
|
|
170
|
+
# find {|ev| ev.type!=:change} then
|
|
171
|
+
find {|ev| ev.type!=:anyedge} then
|
|
152
172
|
# Yes, generate it.
|
|
153
173
|
top_block.insert_statement!(0,
|
|
154
174
|
Transmit.new(aux.clone,Value.new(aux.type,0)))
|
|
@@ -204,8 +224,8 @@ module HDLRuby::Low
|
|
|
204
224
|
end
|
|
205
225
|
pos += ref.type.width
|
|
206
226
|
end
|
|
207
|
-
# puts "Resulting block=#{block.to_vhdl}"
|
|
208
227
|
# Return the resulting block
|
|
228
|
+
# puts "new block=#{block}"
|
|
209
229
|
return block
|
|
210
230
|
end
|
|
211
231
|
end
|
|
@@ -229,7 +249,7 @@ module HDLRuby::Low
|
|
|
229
249
|
if node.is_a?(RefConcat) then
|
|
230
250
|
# Yes, must break. Create the resulting sequential
|
|
231
251
|
# block that will contain the new assignements.
|
|
232
|
-
block = Block.new(:
|
|
252
|
+
block = Block.new(:par)
|
|
233
253
|
# Create an intermediate signal for storing the
|
|
234
254
|
# right value. Put it in the top scope.
|
|
235
255
|
top_scope = self.top_scope
|
|
@@ -122,6 +122,9 @@ module HDLRuby::Low
|
|
|
122
122
|
def to_seq!
|
|
123
123
|
if self.mode == :par then
|
|
124
124
|
# Need to convert.
|
|
125
|
+
# Get which module is it.
|
|
126
|
+
modul = self.is_a?(HDLRuby::High::Block) ? HDLRuby::High :
|
|
127
|
+
HDLRuby::Low
|
|
125
128
|
# First recurse on the sub blocks.
|
|
126
129
|
self.each_statement(&:to_seq!)
|
|
127
130
|
# Now replace each left value by a new signal for
|
|
@@ -130,16 +133,23 @@ module HDLRuby::Low
|
|
|
130
133
|
self.each_statement do |statement|
|
|
131
134
|
left = statement.left
|
|
132
135
|
if statement.is_a?(Transmit) then
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
+
if modul == HDLRuby::High then
|
|
137
|
+
sig = modul::SignalI.new(HDLRuby.uniq_name,left.type,:inner)
|
|
138
|
+
self.add_inner(sig)
|
|
139
|
+
puts "sig.parent=#{sig.parent}"
|
|
140
|
+
diff = modul::RefObject.new(modul::RefThis.new,sig)
|
|
141
|
+
else
|
|
142
|
+
sig = modul::SignalI.new(HDLRuby.uniq_name,left.type)
|
|
143
|
+
self.add_inner(sig)
|
|
144
|
+
diff = modul::RefName.new(left.type,modul::RefThis.new,sig.name)
|
|
145
|
+
end
|
|
136
146
|
differeds << [left,diff]
|
|
137
147
|
statement.set_left!(diff)
|
|
138
148
|
end
|
|
139
149
|
end
|
|
140
150
|
# Adds the differed assignments.
|
|
141
151
|
differeds.each do |left,diff|
|
|
142
|
-
self.add_statement(Transmit.new(left.clone,diff.clone))
|
|
152
|
+
self.add_statement(modul::Transmit.new(left.clone,diff.clone))
|
|
143
153
|
end
|
|
144
154
|
# Change the mode.
|
|
145
155
|
self.set_mode!(:seq)
|
|
@@ -82,7 +82,7 @@ module HDLRuby::Low
|
|
|
82
82
|
selects = connection.extract_selects!
|
|
83
83
|
if selects.any? then
|
|
84
84
|
# Selects have been extract, replace the connection
|
|
85
|
-
#
|
|
85
|
+
# by a behavior.
|
|
86
86
|
# Generate the block with cases.
|
|
87
87
|
blk = LowWithoutSelect.selects2block(selects)
|
|
88
88
|
# Add a transmit replacing the connection.
|
|
@@ -214,7 +214,7 @@ module HDLRuby::Low
|
|
|
214
214
|
end
|
|
215
215
|
end
|
|
216
216
|
|
|
217
|
-
## Extends the
|
|
217
|
+
## Extends the Case class with functionality for converting select
|
|
218
218
|
# expressions to case statements.
|
|
219
219
|
class Case
|
|
220
220
|
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
require 'HDLRuby'
|
|
2
|
+
require 'HDLRuby/hruby_tools'
|
|
3
|
+
require 'HDLRuby/hruby_low_mutable'
|
|
4
|
+
require 'HDLRuby/hruby_low_resolve'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module HDLRuby::Low
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
##
|
|
11
|
+
# Replace hierachical signals by the list of their sub signals.
|
|
12
|
+
# Makes handling by some synthesis tools easier.
|
|
13
|
+
#
|
|
14
|
+
########################################################################
|
|
15
|
+
|
|
16
|
+
## Extends the SystemT class with functionality for decomposing the
|
|
17
|
+
# hierachical signals in the statements.
|
|
18
|
+
class SystemT
|
|
19
|
+
|
|
20
|
+
# Decompose the hierarchical signals in the statements.
|
|
21
|
+
def signal2subs!
|
|
22
|
+
self.scope.signal2subs!
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## Extends the Scope class with functionality for decomposing the
|
|
28
|
+
# hierachical signals in the statements.
|
|
29
|
+
class Scope
|
|
30
|
+
|
|
31
|
+
# Decompose the hierarchical signals in the statements.
|
|
32
|
+
def signal2subs!
|
|
33
|
+
# Recruse on the sub scopes.
|
|
34
|
+
self.each_scope(&:signal2subs!)
|
|
35
|
+
|
|
36
|
+
# Recurse on the blocks.
|
|
37
|
+
self.each_behavior do |behavior|
|
|
38
|
+
# behavior.block.each_block_deep(&:signal2subs!)
|
|
39
|
+
behavior.signal2subs!
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Work on the connections.
|
|
43
|
+
self.each_connection.to_a.each do |connection|
|
|
44
|
+
# Recurse on the left and right.
|
|
45
|
+
connection.set_left!(connection.left.signal2subs!)
|
|
46
|
+
connection.set_right!(connection.right.signal2subs!)
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
## Extends the Behavior class with functionality for decomposing the
|
|
53
|
+
# hierachical signals in the statements.
|
|
54
|
+
class Behavior
|
|
55
|
+
|
|
56
|
+
# Decompose the hierarchical signals in the statements.
|
|
57
|
+
def signal2subs!
|
|
58
|
+
# Process the events.
|
|
59
|
+
self.each_event.to_a.each do |ev|
|
|
60
|
+
subrefs = ev.ref.flatten
|
|
61
|
+
if subrefs.any? then
|
|
62
|
+
# The refence have been flattend, remove the event.
|
|
63
|
+
self.delete_event!(ev)
|
|
64
|
+
# And add instead new events for the sub references.
|
|
65
|
+
subrefs.each do |subref|
|
|
66
|
+
nev = Event.new(ev.type,subref)
|
|
67
|
+
self.add_event(nev)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
# Recurse on the blocks.
|
|
72
|
+
self.block.each_block_deep(&:signal2subs!)
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
## Extends the Block class with functionality for decomposing the
|
|
78
|
+
# hierachical signals in the statements.
|
|
79
|
+
class Block
|
|
80
|
+
|
|
81
|
+
# Decompose the hierarchical signals in the statements.
|
|
82
|
+
def signal2subs!
|
|
83
|
+
# Recurse on the statments.
|
|
84
|
+
self.map_statements! do |stmnt|
|
|
85
|
+
stmnt.signal2subs!
|
|
86
|
+
end
|
|
87
|
+
return self
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
## Extends the TimeWait class with functionality for decomposing the
|
|
93
|
+
# hierachical signals in the statements.
|
|
94
|
+
class TimeWait
|
|
95
|
+
|
|
96
|
+
# Decompose the hierarchical signals in the statements.
|
|
97
|
+
def signal2subs!
|
|
98
|
+
# Nothing to do.
|
|
99
|
+
return self
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
## Extends the TimeRepeat class with functionality for decomposing the
|
|
105
|
+
# hierachical signals in the statements.
|
|
106
|
+
class TimeRepeat
|
|
107
|
+
|
|
108
|
+
# Decompose the hierarchical signals in the statements.
|
|
109
|
+
def signal2subs!
|
|
110
|
+
# Recurse on the statement.
|
|
111
|
+
self.set_statement!(self.statement.signal2subs!)
|
|
112
|
+
return self
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
## Extends the Transmit class with functionality for decomposing the
|
|
118
|
+
# hierachical signals in the statements.
|
|
119
|
+
class Transmit
|
|
120
|
+
|
|
121
|
+
# Decompose the hierarchical signals in the statements.
|
|
122
|
+
def signal2subs!
|
|
123
|
+
# Recurse on the left and right.
|
|
124
|
+
self.set_left!(self.left.signal2subs!)
|
|
125
|
+
self.set_right!(self.right.signal2subs!)
|
|
126
|
+
return self
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
## Extends the Print class with functionality for decomposing the
|
|
132
|
+
# hierachical signals in the statements.
|
|
133
|
+
class Print
|
|
134
|
+
|
|
135
|
+
# Decompose the hierarchical signals in the statements.
|
|
136
|
+
def signal2subs!
|
|
137
|
+
# Recurse on the arguments.
|
|
138
|
+
self.map_args! { |arg| arg.signal2subs! }
|
|
139
|
+
return self
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
## Extends the Print class with functionality for decomposing the
|
|
145
|
+
# hierachical signals in the statements.
|
|
146
|
+
class TimeTerminate
|
|
147
|
+
|
|
148
|
+
# Decompose the hierarchical signals in the statements.
|
|
149
|
+
def signal2subs!
|
|
150
|
+
# Nothing to do.
|
|
151
|
+
return self
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
## Extends the If class with functionality for decomposing the
|
|
157
|
+
# hierachical signals in the statements.
|
|
158
|
+
class If
|
|
159
|
+
|
|
160
|
+
# Decompose the hierarchical signals in the statements.
|
|
161
|
+
def signal2subs!
|
|
162
|
+
# Recurse on the condition.
|
|
163
|
+
self.set_condition!(self.condition.signal2subs!)
|
|
164
|
+
# Recurse on the yes block.
|
|
165
|
+
self.yes.signal2subs!
|
|
166
|
+
# Recurse on the no block if any.
|
|
167
|
+
self.no.signal2subs! if self.no
|
|
168
|
+
# Recurse on the alternate ifs.
|
|
169
|
+
self.map_noifs! do |cond,stmnt|
|
|
170
|
+
[cond.signal2subs!,stmnt.signal2subs!]
|
|
171
|
+
end
|
|
172
|
+
return self
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
## Extends the When class with functionality for decomposing the
|
|
178
|
+
# hierachical signals in the statements.
|
|
179
|
+
class When
|
|
180
|
+
|
|
181
|
+
# Decompose the hierarchical signals in the statements.
|
|
182
|
+
def signal2subs!
|
|
183
|
+
# Recurse on the match.
|
|
184
|
+
self.set_match!(self.match.signal2subs!)
|
|
185
|
+
# Recurse on the statement.
|
|
186
|
+
self.set_statement!(self.statement.signal2subs!)
|
|
187
|
+
return self
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
## Extends the Case class with functionality for decomposing the
|
|
194
|
+
# hierachical signals in the statements.
|
|
195
|
+
class Case
|
|
196
|
+
|
|
197
|
+
# Decompose the hierarchical signals in the statements.
|
|
198
|
+
def signal2subs!
|
|
199
|
+
# Recurse on the case value.
|
|
200
|
+
self.set_value!(self.value.signal2subs!)
|
|
201
|
+
# Recurse on the whens.
|
|
202
|
+
self.each_when(&:signal2subs!)
|
|
203
|
+
# Recurse on the default.
|
|
204
|
+
self.set_default!(self.default.signal2subs!) if self.default
|
|
205
|
+
return self
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
## Extends the Expression class with functionality for decomposing the
|
|
211
|
+
# hierachical signals in the statements.
|
|
212
|
+
class Expression
|
|
213
|
+
|
|
214
|
+
# Decompose the hierarchical signals in the statements.
|
|
215
|
+
def signal2subs!
|
|
216
|
+
# puts "signal2subs! for expr=#{self}"
|
|
217
|
+
# Recurse on the subexpressions.
|
|
218
|
+
self.map_expressions!(&:signal2subs!)
|
|
219
|
+
return self
|
|
220
|
+
end
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
## Extends the RefName class with functionality for decomposing the
|
|
225
|
+
# hierachical signals in the statements.
|
|
226
|
+
class RefName
|
|
227
|
+
|
|
228
|
+
# Flatten a reference to a list of reference to leaf signals
|
|
229
|
+
# from signal +sig+ and add to result to +subrefs+
|
|
230
|
+
def flatten_to(sig,subrefs)
|
|
231
|
+
# puts "flatten_to with sig name=#{sig.name}"
|
|
232
|
+
# Work on the sub signals if any.
|
|
233
|
+
sig.each_signal do |sub|
|
|
234
|
+
# Create a reference for the sub.
|
|
235
|
+
subref = RefName.new(sub.type,self.clone,sub.name)
|
|
236
|
+
# Recruse on it.
|
|
237
|
+
subref.flatten_to(sub,subrefs)
|
|
238
|
+
# Was it a leaf?
|
|
239
|
+
unless sub.each_signal.any? then
|
|
240
|
+
# Yes, add its new ref to the list of subs.
|
|
241
|
+
subrefs << subref
|
|
242
|
+
end
|
|
243
|
+
end
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# Flatten the current ref to a list of references.
|
|
247
|
+
# If the reference is not heirachical, returns an empty list.
|
|
248
|
+
def flatten
|
|
249
|
+
subrefs = []
|
|
250
|
+
self.flatten_to(self.resolve,subrefs)
|
|
251
|
+
return subrefs
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# Decompose the hierarchical signals in the statements.
|
|
255
|
+
def signal2subs!
|
|
256
|
+
# puts "signal2subs! for RefName: #{self.name}"
|
|
257
|
+
# Decompose it to a list of reference to each leaf sub signal.
|
|
258
|
+
subrefs = []
|
|
259
|
+
self.flatten_to(self.resolve,subrefs)
|
|
260
|
+
# puts "subrefs=#{subrefs.map{|subref| subref.name}}"
|
|
261
|
+
# Has it sub signals?
|
|
262
|
+
if (subrefs.any?) then
|
|
263
|
+
# Yes, convert it to a Concat.
|
|
264
|
+
if self.leftvalue? then
|
|
265
|
+
return RefConcat.new(self.type,subrefs)
|
|
266
|
+
else
|
|
267
|
+
return Concat.new(self.type,subrefs)
|
|
268
|
+
end
|
|
269
|
+
else
|
|
270
|
+
# Nothing to do.
|
|
271
|
+
return self
|
|
272
|
+
end
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
end
|