Module: RgGen::Core::Base::ComponentLayerExtension::RegisterFile
- Includes:
- Common
- Defined in:
- lib/rggen/core/base/component_layer_extension.rb
Instance Method Summary
collapse
Methods included from Common
#bit_field?, #register?, #register_block?, #register_file?, #root?
Instance Method Details
#bit_fields ⇒ Object
122
123
124
|
# File 'lib/rggen/core/base/component_layer_extension.rb', line 122
def bit_fields
registers.flat_map(&:bit_fields)
end
|
#block_or_file ⇒ Object
90
91
92
|
# File 'lib/rggen/core/base/component_layer_extension.rb', line 90
def block_or_file
parent
end
|
#files_and_registers ⇒ Object
102
103
104
|
# File 'lib/rggen/core/base/component_layer_extension.rb', line 102
def files_and_registers
children
end
|
#register_block ⇒ Object
94
95
96
|
# File 'lib/rggen/core/base/component_layer_extension.rb', line 94
def register_block
parent.register_block? && parent || parent.register_block
end
|
#register_file ⇒ Object
98
99
100
|
# File 'lib/rggen/core/base/component_layer_extension.rb', line 98
def register_file
parent.register_file? && parent || nil
end
|
#register_files(include_lower_layer = true) ⇒ Object
106
107
108
109
110
|
# File 'lib/rggen/core/base/component_layer_extension.rb', line 106
def register_files(include_lower_layer = true)
files_and_registers
.select(&:register_file?)
.flat_map { |rf| [rf, *(include_lower_layer ? rf : nil)&.register_files] }
end
|
#registers(include_lower_layer = true) ⇒ Object
112
113
114
115
116
117
118
119
120
|
# File 'lib/rggen/core/base/component_layer_extension.rb', line 112
def registers(include_lower_layer = true)
files_and_registers.flat_map do |file_or_register|
if file_or_register.register?
file_or_register
else
[*(include_lower_layer ? file_or_register : nil)&.registers]
end
end
end
|
86
87
88
|
# File 'lib/rggen/core/base/component_layer_extension.rb', line 86
def root
register_block.root
end
|