rggen-default-register-map 0.29.0 → 0.31.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rggen/default_register_map/bit_field/bit_assignment.rb +26 -15
- data/lib/rggen/default_register_map/bit_field/initial_value.rb +1 -3
- data/lib/rggen/default_register_map/bit_field/labels.rb +1 -3
- data/lib/rggen/default_register_map/bit_field/type/custom.rb +3 -13
- data/lib/rggen/default_register_map/bit_field/type.rb +1 -1
- data/lib/rggen/default_register_map/global/address_width.rb +2 -3
- data/lib/rggen/default_register_map/global/bus_width.rb +2 -3
- data/lib/rggen/default_register_map/register/offset_address.rb +7 -8
- data/lib/rggen/default_register_map/register/size.rb +104 -92
- data/lib/rggen/default_register_map/register/type/external.rb +1 -1
- data/lib/rggen/default_register_map/register/type/indirect.rb +1 -3
- data/lib/rggen/default_register_map/register/type/rw.rb +9 -0
- data/lib/rggen/default_register_map/register/type.rb +1 -1
- data/lib/rggen/default_register_map/register_block/byte_size.rb +2 -3
- data/lib/rggen/default_register_map/register_file/offset_address.rb +7 -8
- data/lib/rggen/default_register_map/register_file/size.rb +67 -44
- data/lib/rggen/default_register_map/version.rb +1 -1
- data/lib/rggen/default_register_map.rb +1 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '096c64fcca6cd793439076e3d9c1c453cb936224698a9d59674eaf0d216945fc'
|
4
|
+
data.tar.gz: 2ff4dcdb1f202d3fde23a4a2856caf865201258684d736a3827b84869d657506
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97d25fb253e1dc48ce3c96b5a50eb10c37d4b84eb7546cd1531c3e1e4842b7a754cdad2423f7a824f0d3be1d7c1233e0c3573cd3a895c376ca0ba7d65df96b3c
|
7
|
+
data.tar.gz: c5f8aca4a7e382e370b04cd29ad9ae31f90aa436f785697bd9d3eb7dfa606eb1f209dd7002a69e4b75dbcd7ff40e21b7efcd9044ca9b70993059188c8c5a3c69
|
@@ -122,11 +122,14 @@ RgGen.define_simple_feature(:bit_field, :bit_assignment) do
|
|
122
122
|
end
|
123
123
|
|
124
124
|
def parse_value(input_value, key, variable_name)
|
125
|
-
input_value.key?(key)
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
125
|
+
return unless input_value.key?(key)
|
126
|
+
|
127
|
+
value =
|
128
|
+
to_int(input_value[key]) do
|
129
|
+
"cannot convert #{input_value[key].inspect} into " \
|
130
|
+
"bit assignment(#{key.to_s.tr('_', ' ')})"
|
131
|
+
end
|
132
|
+
instance_variable_set(variable_name, value)
|
130
133
|
end
|
131
134
|
|
132
135
|
def lsb_base
|
@@ -150,25 +153,33 @@ RgGen.define_simple_feature(:bit_field, :bit_assignment) do
|
|
150
153
|
end
|
151
154
|
|
152
155
|
def lsb_bit(index = 0)
|
153
|
-
lsb_msb_bit(index,
|
156
|
+
lsb_msb_bit(index, 0)
|
154
157
|
end
|
155
158
|
|
156
159
|
def msb_bit(index = 0)
|
157
|
-
lsb_msb_bit(index,
|
160
|
+
lsb_msb_bit(index, width - 1)
|
158
161
|
end
|
159
162
|
|
160
|
-
def lsb_msb_bit(index,
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
if integer?(index)
|
166
|
-
base + step * index
|
167
|
-
else
|
163
|
+
def lsb_msb_bit(index, offset)
|
164
|
+
base = lsb_base + offset
|
165
|
+
if base_lsb_msb?(index)
|
166
|
+
base
|
167
|
+
elsif !integer?(index)
|
168
168
|
"#{base}+#{step}*#{index}"
|
169
|
+
else
|
170
|
+
sequential_lsb_list[index]&.+(offset)
|
169
171
|
end
|
170
172
|
end
|
171
173
|
|
174
|
+
def base_lsb_msb?(index)
|
175
|
+
!sequential? || integer?(index) && index.zero?
|
176
|
+
end
|
177
|
+
|
178
|
+
def sequential_lsb_list
|
179
|
+
@sequential_lsb_list ||=
|
180
|
+
Array.new(sequence_size) { |i| lsb_base + step * i }
|
181
|
+
end
|
182
|
+
|
172
183
|
def calc_bit_map
|
173
184
|
Array.new(sequence_size || 1) { |i| (2**width - 1) << lsb(i) }.inject(:|)
|
174
185
|
end
|
@@ -153,9 +153,7 @@ RgGen.define_simple_feature(:bit_field, :initial_value) do
|
|
153
153
|
end
|
154
154
|
|
155
155
|
def parse_value(value)
|
156
|
-
|
157
|
-
rescue ArgumentError, TypeError
|
158
|
-
error "cannot convert #{value.inspect} into initial value"
|
156
|
+
to_int(value) { |v| "cannot convert #{v.inspect} into initial value" }
|
159
157
|
end
|
160
158
|
|
161
159
|
def verify_initial_value(value)
|
@@ -92,9 +92,7 @@ RgGen.define_feature(:bit_field, :labels) do
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def convert_label_value(value)
|
95
|
-
|
96
|
-
rescue ArgumentError, TypeError
|
97
|
-
error "cannot convert #{value.inspect} into label value", value
|
95
|
+
to_int(value) { |v| "cannot convert #{v.inspect} into label value" }
|
98
96
|
end
|
99
97
|
|
100
98
|
def unique_value?(value)
|
@@ -86,20 +86,10 @@ RgGen.define_list_item_feature(:bit_field, :type, :custom) do
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def parse_options(options)
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
option_hash[option_name] = parse_option(option_name, key, value)
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
def merge_options(options)
|
97
|
-
options.each_with_object({}) do |option, merged_options|
|
98
|
-
option_hash = hash?(option) && option || [option].to_h
|
99
|
-
merged_options.update(option_hash)
|
89
|
+
options.each_with_object({}) do |(key, value), optin_hash|
|
90
|
+
name = convert_to_option_name(key)
|
91
|
+
optin_hash[name] = parse_option(name, key, value)
|
100
92
|
end
|
101
|
-
rescue ArgumentError, TypeError
|
102
|
-
error "invalid options are given: #{options.inspect}"
|
103
93
|
end
|
104
94
|
|
105
95
|
def convert_to_option_name(key)
|
@@ -5,9 +5,8 @@ RgGen.define_simple_feature(:global, :address_width) do
|
|
5
5
|
property :address_width, default: 32
|
6
6
|
|
7
7
|
build do |value|
|
8
|
-
@address_width =
|
9
|
-
|
10
|
-
error "cannot convert #{value.inspect} into address width"
|
8
|
+
@address_width =
|
9
|
+
to_int(value) { |v| "cannot convert #{v.inspect} into address width" }
|
11
10
|
end
|
12
11
|
|
13
12
|
verify(:component) do
|
@@ -6,9 +6,8 @@ RgGen.define_simple_feature(:global, :bus_width) do
|
|
6
6
|
property :byte_width, initial: -> { bus_width / 8 }
|
7
7
|
|
8
8
|
build do |value|
|
9
|
-
@bus_width =
|
10
|
-
|
11
|
-
error "cannot convert #{value.inspect} into bus width"
|
9
|
+
@bus_width =
|
10
|
+
to_int(value) { |v| "cannot convert #{v.inspect} into bus width" }
|
12
11
|
end
|
13
12
|
|
14
13
|
verify(:feature) do
|
@@ -8,9 +8,8 @@ RgGen.define_simple_feature(:register, :offset_address) do
|
|
8
8
|
property :overlap?, body: ->(other) { overlap_address_range?(other, false) }
|
9
9
|
|
10
10
|
build do |value|
|
11
|
-
@offset_address =
|
12
|
-
|
13
|
-
error "cannot convert #{value.inspect} into offset address"
|
11
|
+
@offset_address =
|
12
|
+
to_int(value) { |v| "cannot convert #{v.inspect} into offset address" }
|
14
13
|
end
|
15
14
|
|
16
15
|
verify(:feature) do
|
@@ -58,7 +57,7 @@ RgGen.define_simple_feature(:register, :offset_address) do
|
|
58
57
|
|
59
58
|
def default_offset_address
|
60
59
|
register.component_index.zero? && 0 ||
|
61
|
-
(previous_component.offset_address + previous_component.
|
60
|
+
(previous_component.offset_address + previous_component.total_byte_size)
|
62
61
|
end
|
63
62
|
|
64
63
|
def start_address(full = false)
|
@@ -66,16 +65,16 @@ RgGen.define_simple_feature(:register, :offset_address) do
|
|
66
65
|
end
|
67
66
|
|
68
67
|
def end_address(full = false)
|
69
|
-
start_address(full) + register.
|
68
|
+
start_address(full) + register.total_byte_size - 1
|
70
69
|
end
|
71
70
|
|
72
71
|
def expand_addresses
|
73
|
-
|
74
|
-
|
72
|
+
(register_file&.expanded_offset_addresses || [0])
|
73
|
+
.product(expand_local_addresses).map(&:sum)
|
75
74
|
end
|
76
75
|
|
77
76
|
def expand_local_addresses
|
78
|
-
width = shared_address? && 0 || register.
|
77
|
+
width = shared_address? && 0 || register.entry_byte_size
|
79
78
|
Array.new(register.count) { |i| offset_address + width * i }
|
80
79
|
end
|
81
80
|
|
@@ -1,122 +1,134 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
RgGen.
|
3
|
+
RgGen.define_feature(:register, :size) do
|
4
4
|
register_map do
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
@size = parse_values(values)
|
20
|
-
end
|
5
|
+
feature do
|
6
|
+
property :size
|
7
|
+
property :width, initial: -> { calc_width }
|
8
|
+
property :byte_width, initial: -> { width / 8 }
|
9
|
+
property :entry_byte_size, body: -> { @step || byte_width }
|
10
|
+
property :total_byte_size, forward_to: :calc_total_byte_size
|
11
|
+
property :array?, forward_to: :array_register?
|
12
|
+
property :array_size, forward_to: :array_registers
|
13
|
+
property :count, forward_to: :calc_count
|
14
|
+
|
15
|
+
build do |values, options|
|
16
|
+
@size = parse_register_size(values)
|
17
|
+
@step = parse_step_size(options)
|
18
|
+
end
|
21
19
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
20
|
+
verify(:feature) do
|
21
|
+
error_condition { size && !size.all?(&:positive?) }
|
22
|
+
message do
|
23
|
+
"non positive value(s) are not allowed for register size: #{size}"
|
24
|
+
end
|
26
25
|
end
|
27
|
-
end
|
28
26
|
|
29
|
-
|
30
|
-
|
31
|
-
|
27
|
+
verify(:component) do
|
28
|
+
error_condition { @step && !array_register? }
|
29
|
+
message do
|
30
|
+
'step size cannot be specified for non-array register'
|
31
|
+
end
|
32
32
|
end
|
33
|
-
|
34
|
-
|
33
|
+
|
34
|
+
verify(:component) do
|
35
|
+
error_condition { @step && @step < byte_width }
|
36
|
+
message do
|
37
|
+
"step size is less than register width: #{@step}"
|
38
|
+
end
|
35
39
|
end
|
36
|
-
end
|
37
40
|
|
38
|
-
|
41
|
+
verify(:component) do
|
42
|
+
error_condition { @step && (@step % configuration.byte_width).positive? }
|
43
|
+
message do
|
44
|
+
"step size is not multiple of bus width: #{@step}"
|
45
|
+
end
|
46
|
+
end
|
39
47
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
48
|
+
verify(:component) do
|
49
|
+
error_condition do
|
50
|
+
!configuration.enable_wide_register? && entry_byte_size > 8
|
51
|
+
end
|
52
|
+
message do
|
53
|
+
"register width wider than 8 bytes is not allowed: #{entry_byte_size} bytes"
|
54
|
+
end
|
55
|
+
end
|
45
56
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
57
|
+
private
|
58
|
+
|
59
|
+
def parse_register_size(values)
|
60
|
+
values.map do |value|
|
61
|
+
to_int(value) { |v| "cannot convert #{v.inspect} into register size" }
|
62
|
+
end
|
51
63
|
end
|
52
|
-
end
|
53
64
|
|
54
|
-
|
55
|
-
|
56
|
-
end
|
65
|
+
def parse_step_size(options)
|
66
|
+
return unless options.key?(:step)
|
57
67
|
|
58
|
-
|
59
|
-
|
60
|
-
rescue ArgumentError, TypeError
|
61
|
-
error "cannot convert #{value.inspect} into register size"
|
62
|
-
end
|
68
|
+
to_int(options[:step]) { |v| "cannot convert #{v.inspect} into step size" }
|
69
|
+
end
|
63
70
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
71
|
+
def calc_width
|
72
|
+
bus_width = configuration.bus_width
|
73
|
+
if register.bit_fields.empty?
|
74
|
+
bus_width
|
75
|
+
else
|
76
|
+
((max_msb + bus_width) / bus_width) * bus_width
|
77
|
+
end
|
70
78
|
end
|
71
|
-
end
|
72
79
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
80
|
+
def max_msb
|
81
|
+
register
|
82
|
+
.bit_fields
|
83
|
+
.map { |bit_field| bit_field.msb(-1) }
|
84
|
+
.max
|
85
|
+
end
|
79
86
|
|
80
|
-
|
81
|
-
|
87
|
+
def calc_total_byte_size(hierarchical: false)
|
88
|
+
include_register = !register.settings[:support_shared_address]
|
89
|
+
byte_size = entry_byte_size
|
90
|
+
collect_size(hierarchical, include_register, false).reduce(1, :*) * byte_size
|
91
|
+
end
|
82
92
|
|
83
|
-
|
84
|
-
|
85
|
-
|
93
|
+
def array_register?(hierarchical: false)
|
94
|
+
return true if hierarchical && register_files.any?(&:array?)
|
95
|
+
register.settings.fetch(:support_array, false) && !@size.nil?
|
96
|
+
end
|
86
97
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
98
|
+
def array_registers(hierarchical: false)
|
99
|
+
size = collect_size(hierarchical, true, true)
|
100
|
+
!size.empty? && size || nil
|
101
|
+
end
|
91
102
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
end
|
103
|
+
def calc_count(whole_count = true)
|
104
|
+
whole_count && (@count ||= calc_whole_count) || 1
|
105
|
+
end
|
96
106
|
|
97
|
-
|
98
|
-
|
99
|
-
@count ||= collect_size(false, true, true).reduce(1, :*)
|
100
|
-
else
|
101
|
-
1
|
107
|
+
def calc_whole_count
|
108
|
+
collect_size(false, true, true).reduce(1, :*)
|
102
109
|
end
|
103
|
-
end
|
104
110
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
+
def collect_size(inculde_register_file, include_register, array_only)
|
112
|
+
size = []
|
113
|
+
collect_register_file_size(size, inculde_register_file)
|
114
|
+
collect_register_size(size, include_register, array_only)
|
115
|
+
size.compact
|
116
|
+
end
|
111
117
|
|
112
|
-
|
113
|
-
|
114
|
-
|
118
|
+
def collect_register_file_size(size, inculde_register_file)
|
119
|
+
inculde_register_file &&
|
120
|
+
size.concat(register_files.flat_map(&:array_size))
|
121
|
+
end
|
122
|
+
|
123
|
+
def collect_register_size(size, include_register, array_only)
|
124
|
+
@size && include_register && (!array_only || array_register?) &&
|
125
|
+
size.concat(@size)
|
126
|
+
end
|
115
127
|
end
|
116
128
|
|
117
|
-
|
118
|
-
|
119
|
-
|
129
|
+
factory do
|
130
|
+
value_format :option_hash,
|
131
|
+
multiple_values: true, allowed_options: [:step]
|
120
132
|
end
|
121
133
|
end
|
122
134
|
end
|
@@ -204,9 +204,7 @@ RgGen.define_list_item_feature(:register, :type, :indirect) do
|
|
204
204
|
end
|
205
205
|
|
206
206
|
def convert_index_value(value)
|
207
|
-
|
208
|
-
rescue ArgumentError, TypeError
|
209
|
-
error "cannot convert #{value.inspect} into indirect index value"
|
207
|
+
to_int(value) { |v| "cannot convert #{v.inspect} into indirect index value" }
|
210
208
|
end
|
211
209
|
|
212
210
|
def verify_indirect_index(index)
|
@@ -6,10 +6,9 @@ RgGen.define_simple_feature(:register_block, :byte_size) do
|
|
6
6
|
property :local_address_width
|
7
7
|
|
8
8
|
build do |value|
|
9
|
-
@byte_size =
|
9
|
+
@byte_size =
|
10
|
+
to_int(value) { |v| "cannot convert #{v.inspect} into byte size" }
|
10
11
|
@local_address_width = (@byte_size - 1).bit_length
|
11
|
-
rescue ArgumentError, TypeError
|
12
|
-
error "cannot convert #{value.inspect} into byte size"
|
13
12
|
end
|
14
13
|
|
15
14
|
verify(:feature) do
|
@@ -7,9 +7,8 @@ RgGen.define_simple_feature(:register_file, :offset_address) do
|
|
7
7
|
property :address_range, initial: -> { start_address..end_address }
|
8
8
|
|
9
9
|
build do |value|
|
10
|
-
@offset_address =
|
11
|
-
|
12
|
-
error "cannot convert #{value.inspect} into offset address"
|
10
|
+
@offset_address =
|
11
|
+
to_int(value) { |v| "cannot convert #{v.inspect} into offset address" }
|
13
12
|
end
|
14
13
|
|
15
14
|
verify(:feature) do
|
@@ -55,7 +54,7 @@ RgGen.define_simple_feature(:register_file, :offset_address) do
|
|
55
54
|
|
56
55
|
def defalt_offset_address
|
57
56
|
register_file.component_index.zero? && 0 ||
|
58
|
-
(previous_component.offset_address + previous_component.
|
57
|
+
(previous_component.offset_address + previous_component.total_byte_size)
|
59
58
|
end
|
60
59
|
|
61
60
|
def previous_component
|
@@ -68,17 +67,17 @@ RgGen.define_simple_feature(:register_file, :offset_address) do
|
|
68
67
|
end
|
69
68
|
|
70
69
|
def end_address(full = false)
|
71
|
-
start_address(full) + register_file.
|
70
|
+
start_address(full) + register_file.total_byte_size - 1
|
72
71
|
end
|
73
72
|
|
74
73
|
def expand_addresses
|
75
|
-
|
76
|
-
|
74
|
+
(register_file(:upper)&.expanded_offset_addresses || [0])
|
75
|
+
.product(expand_local_addresses).map(&:sum)
|
77
76
|
end
|
78
77
|
|
79
78
|
def expand_local_addresses
|
80
79
|
Array.new(register_file.array_size&.inject(:*) || 1) do |i|
|
81
|
-
offset_address + register_file.
|
80
|
+
offset_address + register_file.entry_byte_size * i
|
82
81
|
end
|
83
82
|
end
|
84
83
|
|
@@ -1,60 +1,83 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
RgGen.
|
3
|
+
RgGen.define_feature(:register_file, :size) do
|
4
4
|
register_map do
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
/(#{integer}(:?,#{integer})*)/,
|
13
|
-
/\[(#{integer}(:?,#{integer})*)\]/
|
14
|
-
], match_automatically: false
|
15
|
-
|
16
|
-
build do |values|
|
17
|
-
@size =
|
18
|
-
(string?(values) && parse_string_value(values) || Array(values))
|
19
|
-
.map(&method(:convert_value))
|
20
|
-
end
|
5
|
+
feature do
|
6
|
+
property :size
|
7
|
+
property :entry_byte_size, forward_to: :calc_entry_byte_size
|
8
|
+
property :total_byte_size, forward_to: :calc_total_byte_size
|
9
|
+
property :array?, body: -> { !@size.nil? }
|
10
|
+
property :array_size, forward_to: :size
|
11
|
+
property :count, forward_to: :calc_count
|
21
12
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
"non positive value(s) are not allowed for register file size: #{size}"
|
13
|
+
build do |values, options|
|
14
|
+
@size = parse_register_file_size(values)
|
15
|
+
@step = parse_step_size(options)
|
26
16
|
end
|
27
|
-
end
|
28
17
|
|
29
|
-
|
18
|
+
verify(:feature) do
|
19
|
+
error_condition { array? && !size.all?(&:positive?) }
|
20
|
+
message do
|
21
|
+
"non positive value(s) are not allowed for register file size: #{size}"
|
22
|
+
end
|
23
|
+
end
|
30
24
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
25
|
+
verify(:component) do
|
26
|
+
error_condition { @step && @step < actual_byte_size }
|
27
|
+
message do
|
28
|
+
"step size is less than actual byte size: #{@step}"
|
29
|
+
end
|
30
|
+
end
|
35
31
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
32
|
+
verify(:component) do
|
33
|
+
error_condition { @step && (@step % configuration.byte_width).positive? }
|
34
|
+
message do
|
35
|
+
"step size is not multiple of bus width: #{@step}"
|
36
|
+
end
|
37
|
+
end
|
41
38
|
|
42
|
-
|
43
|
-
(whole_size ? total_entries : 1) * entry_byte_size
|
44
|
-
end
|
39
|
+
private
|
45
40
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
41
|
+
def parse_register_file_size(values)
|
42
|
+
values.map do |value|
|
43
|
+
to_int(value) do |v|
|
44
|
+
"cannot convert #{v.inspect} into register file size"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def parse_step_size(options)
|
50
|
+
return unless options.key?(:step)
|
50
51
|
|
51
|
-
|
52
|
-
|
53
|
-
|
52
|
+
to_int(options[:step]) { |v| "cannot convert #{v.inspect} into step size" }
|
53
|
+
end
|
54
|
+
|
55
|
+
def calc_entry_byte_size
|
56
|
+
@step || actual_byte_size
|
57
|
+
end
|
58
|
+
|
59
|
+
def actual_byte_size
|
60
|
+
register_file.files_and_registers
|
61
|
+
.map { |r| r.offset_address + r.total_byte_size }.max
|
62
|
+
end
|
63
|
+
|
64
|
+
def calc_total_byte_size
|
65
|
+
total_entries * calc_entry_byte_size
|
66
|
+
end
|
67
|
+
|
68
|
+
def calc_count(whole_count = true)
|
69
|
+
(whole_count ? total_entries : 1) *
|
70
|
+
register_file.files_and_registers.sum(&:count)
|
71
|
+
end
|
72
|
+
|
73
|
+
def total_entries
|
74
|
+
size&.inject(:*) || 1
|
75
|
+
end
|
54
76
|
end
|
55
77
|
|
56
|
-
|
57
|
-
|
78
|
+
factory do
|
79
|
+
value_format :option_hash,
|
80
|
+
multiple_values: true, allowed_options: [:step]
|
58
81
|
end
|
59
82
|
end
|
60
83
|
end
|
@@ -23,6 +23,7 @@ RgGen.setup_plugin :'rggen-default-register-map' do |plugin|
|
|
23
23
|
'default_register_map/register/type/external',
|
24
24
|
'default_register_map/register/type/indirect',
|
25
25
|
'default_register_map/register/type/reserved',
|
26
|
+
'default_register_map/register/type/rw',
|
26
27
|
'default_register_map/register/comment',
|
27
28
|
'default_register_map/bit_field/name',
|
28
29
|
'default_register_map/bit_field/bit_assignment',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rggen-default-register-map
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.31.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taichi Ishitani
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -75,6 +75,7 @@ files:
|
|
75
75
|
- lib/rggen/default_register_map/register/type/external.rb
|
76
76
|
- lib/rggen/default_register_map/register/type/indirect.rb
|
77
77
|
- lib/rggen/default_register_map/register/type/reserved.rb
|
78
|
+
- lib/rggen/default_register_map/register/type/rw.rb
|
78
79
|
- lib/rggen/default_register_map/register_block/byte_size.rb
|
79
80
|
- lib/rggen/default_register_map/register_block/comment.rb
|
80
81
|
- lib/rggen/default_register_map/register_block/name.rb
|
@@ -107,8 +108,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
108
|
- !ruby/object:Gem::Version
|
108
109
|
version: '0'
|
109
110
|
requirements: []
|
110
|
-
rubygems_version: 3.4.
|
111
|
+
rubygems_version: 3.4.17
|
111
112
|
signing_key:
|
112
113
|
specification_version: 4
|
113
|
-
summary: rggen-default-register-map-0.
|
114
|
+
summary: rggen-default-register-map-0.31.0
|
114
115
|
test_files: []
|