rggen-c-header 0.3.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0a75e055ee75d542f00bca4cfddc48a8ed75ced985b5e316ab8e7f065770536
|
4
|
+
data.tar.gz: 6b09d1bc77717fb3f2147e33ed4932087d7333b428f878508da0bc47a258ccc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2a81c0e88419f1d55671e4cf469ef966b751298d5a2e14c472f28f98b523353fc62cf3fed31d6cf75e6148441fddba98dcec336acb1ce0c2b0b374fce445575
|
7
|
+
data.tar.gz: 585d5453b7bf78d6ce6878be337c80a22805148a2439ddccbd984e53e3f5aa276b20570ad5143f1a668daed4007df4ee7fa2aac8ee91e11c7d734009921ea2d1
|
@@ -6,6 +6,7 @@ RgGen.define_simple_feature(:bit_field, :c_header) do
|
|
6
6
|
define_macro("#{full_name}_bit_width", width)
|
7
7
|
define_macro("#{full_name}_bit_mask", mask)
|
8
8
|
define_offset_macro
|
9
|
+
define_label_macros
|
9
10
|
end
|
10
11
|
|
11
12
|
private
|
@@ -27,5 +28,13 @@ RgGen.define_simple_feature(:bit_field, :c_header) do
|
|
27
28
|
define_macro("#{full_name}_bit_offset", bit_field.lsb)
|
28
29
|
end
|
29
30
|
end
|
31
|
+
|
32
|
+
def define_label_macros
|
33
|
+
bit_field.labels.each do |label|
|
34
|
+
name = "#{full_name}_#{label.name}"
|
35
|
+
value = hex(label.value, bit_field.width)
|
36
|
+
define_macro(name, value)
|
37
|
+
end
|
38
|
+
end
|
30
39
|
end
|
31
40
|
end
|
@@ -10,7 +10,7 @@ RgGen.define_simple_feature(:register, :c_header) do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
export def declaration
|
13
|
-
type = "uint#{
|
13
|
+
type = "uint#{entry_width}_t"
|
14
14
|
name = register.name
|
15
15
|
size = !shared_address? && register.size || nil
|
16
16
|
create_declaration(type, name, size)
|
@@ -23,7 +23,11 @@ RgGen.define_simple_feature(:register, :c_header) do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def byte_size
|
26
|
-
register.
|
26
|
+
register.total_byte_size(hierarchical: true)
|
27
|
+
end
|
28
|
+
|
29
|
+
def entry_width
|
30
|
+
register.entry_byte_size * 8
|
27
31
|
end
|
28
32
|
|
29
33
|
def array?
|
@@ -28,9 +28,9 @@ module RgGen
|
|
28
28
|
def define_struct_member(offset)
|
29
29
|
entries = select_children_by_offset(offset)
|
30
30
|
if entries.size >= 2
|
31
|
-
[define_shared_union(offset, entries), entries.first.
|
31
|
+
[define_shared_union(offset, entries), entries.first.total_byte_size]
|
32
32
|
elsif entries.size == 1
|
33
|
-
[entries.first.declaration, entries.first.
|
33
|
+
[entries.first.declaration, entries.first.total_byte_size]
|
34
34
|
else
|
35
35
|
[reserved_member(offset), bus_byte_width]
|
36
36
|
end
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rggen-c-header
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.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-
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
11
|
+
date: 2023-12-28 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
27
13
|
description: C header file writer plugin for RgGen
|
28
14
|
email:
|
29
15
|
- rggen@googlegroups.com
|
@@ -65,15 +51,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
65
51
|
requirements:
|
66
52
|
- - ">="
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
54
|
+
version: 3.0.0
|
69
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
56
|
requirements:
|
71
57
|
- - ">="
|
72
58
|
- !ruby/object:Gem::Version
|
73
59
|
version: '0'
|
74
60
|
requirements: []
|
75
|
-
rubygems_version: 3.
|
61
|
+
rubygems_version: 3.5.3
|
76
62
|
signing_key:
|
77
63
|
specification_version: 4
|
78
|
-
summary: rggen-c-header-0.
|
64
|
+
summary: rggen-c-header-0.5.0
|
79
65
|
test_files: []
|