rggen-default-register-map 0.26.0 → 0.27.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: c02cb93b3a99a269265fe1d5055b921c6da88c96e907dd5472edf362cb00196e
4
- data.tar.gz: 3d712a77597e1d6d86c885dc61bfa43af18fd50011087a76ab6928adf303db54
3
+ metadata.gz: 2e1b5c8952df6d5cf956a991019f222ff1fa5789316a37b2f82b0c204fe7a30a
4
+ data.tar.gz: a2740678c7e416b435f294652fafa074b7a4090656f9c52ba8487a9866a6362c
5
5
  SHA512:
6
- metadata.gz: 1adc6f7a4ddf6bf78d4bfd0aab40abe07da96cd914e880e88c9da1ad3f4c4a9b5ef599d301ed2d38de318f34f6bfd824439fc6afa44552be8693cf889097b9cc
7
- data.tar.gz: 56c8dc0bff9d4b85761fe1f4971f151c4685cd30ae713ccfc0970a8cd0ca52de44c57e63e219f4534232821ea543888ed3797e535eac653e4f7862b10f935bab
6
+ metadata.gz: 4b562f3dda473595d8b96ab350da36654e5c75a78cd56afb25dfc4b0a45666dbf77185aa85261938cda985d72b7878b346c7b5331c8e837155a2310ebba83c0d
7
+ data.tar.gz: '09288fa36647791243feb903e3752350b66197111ac960223be51e7766af0be2848fbcd086a2035e600dce2af8ea399940e528d9ed743bd8b739a05dd2b19601'
data/README.md CHANGED
@@ -21,7 +21,7 @@ During RgGen installation, RgGen::DefaultRegisterMap will also be installed auto
21
21
  $ gem install rggen
22
22
  ```
23
23
 
24
- If you to install RgGen::DefaultRegisterMap only, use the command below:
24
+ If you want to install RgGen::DefaultRegisterMap only, use the command below:
25
25
 
26
26
  ```
27
27
  $ gem install rggen-default-register-map
@@ -31,7 +31,8 @@ $ gem install rggen-default-register-map
31
31
 
32
32
  Feedbacks, bug reports, questions and etc. are wellcome! You can post them by using following ways:
33
33
 
34
- * [GitHub Issue Tracker](https://github.com/rggen/rggen-default-register-map/issues)
34
+ * [GitHub Issue Tracker](https://github.com/rggen/rggen/issues)
35
+ * [GitHub Discussions](https://github.com/rggen/rggen/discussions)
35
36
  * [Chat Room](https://gitter.im/rggen/rggen)
36
37
  * [Mailing List](https://groups.google.com/d/forum/rggen)
37
38
  * [Mail](mailto:rggen@googlegroups.com)
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ RgGen.define_simple_feature(:bit_field, :comment) do
4
+ register_map(&RgGen::DefaultRegisterMap::COMMENT)
5
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ RgGen.define_list_item_feature(:bit_field, :type, [:row0trg, :row1trg]) do
4
+ register_map do
5
+ read_write
6
+ reference use: true
7
+ end
8
+ end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- [:register_block, :register_file, :register, :bit_field].each do |layer|
4
- RgGen.define_simple_feature(layer, :comment) do
5
- register_map do
3
+ module RgGen
4
+ module DefaultRegisterMap
5
+ COMMENT = proc do
6
6
  property :comment, initial: -> { '' }
7
7
 
8
8
  build do |value|
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ RgGen.define_simple_feature(:global, :enable_wide_register) do
4
+ configuration do
5
+ property :enable_wide_register?, default: false
6
+
7
+ input_pattern [/true|on|yes/i, /false|off|no/i],
8
+ match_automatically: false
9
+
10
+ ignore_empty_value false
11
+
12
+ build do |value|
13
+ @enable_wide_register =
14
+ if [true, false].include?(value)
15
+ value
16
+ elsif match_pattern(value)
17
+ [true, false][match_index]
18
+ else
19
+ error "cannot convert #{value.inspect} into boolean"
20
+ end
21
+ end
22
+
23
+ printable :enable_wide_register do
24
+ enable_wide_register?
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ RgGen.define_simple_feature(:register, :comment) do
4
+ register_map(&RgGen::DefaultRegisterMap::COMMENT)
5
+ end
@@ -93,9 +93,9 @@ RgGen.define_simple_feature(:register, :offset_address) do
93
93
  configuration.byte_width
94
94
  end
95
95
 
96
- def overlap_address_range?(other, sharable)
96
+ def overlap_address_range?(other, shareable)
97
97
  overlap_range?(other) &&
98
- (exclusive_range?(other) || competitive_access?(other, sharable))
98
+ (exclusive_range?(other) || !shareable_access?(other, shareable))
99
99
  end
100
100
 
101
101
  def overlap_range?(other)
@@ -108,13 +108,21 @@ RgGen.define_simple_feature(:register, :offset_address) do
108
108
  other.register_file? || other.reserved? || register.reserved?
109
109
  end
110
110
 
111
- def competitive_access?(other, sharable)
112
- !sharable_range?(other, sharable) &&
113
- [:writable?, :readable?].any? { |access| [register, other].all?(&access) }
111
+ def shareable_access?(other, shareable)
112
+ match_range?(other) &&
113
+ (alternate_access?(other) || shareable_range?(other, shareable))
114
114
  end
115
115
 
116
- def sharable_range?(other, sharable)
117
- sharable && shared_address? && register.match_type?(other)
116
+ def match_range?(other)
117
+ address_range == other.address_range
118
+ end
119
+
120
+ def alternate_access?(other)
121
+ [:writable?, :readable?].all? { |access| [register, other].one?(&access) }
122
+ end
123
+
124
+ def shareable_range?(other, shareable)
125
+ shareable && shared_address? && register.match_type?(other)
118
126
  end
119
127
 
120
128
  def shared_address?
@@ -26,6 +26,15 @@ RgGen.define_simple_feature(:register, :size) do
26
26
  end
27
27
  end
28
28
 
29
+ verify(:component) do
30
+ error_condition do
31
+ !configuration.enable_wide_register? && byte_width > 8
32
+ end
33
+ message do
34
+ "register width wider than 8 bytes is not allowed: #{byte_width} bytes"
35
+ end
36
+ end
37
+
29
38
  private
30
39
 
31
40
  def parse_values(values)
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ RgGen.define_simple_feature(:register_block, :comment) do
4
+ register_map(&RgGen::DefaultRegisterMap::COMMENT)
5
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ RgGen.define_simple_feature(:register_file, :comment) do
4
+ register_map(&RgGen::DefaultRegisterMap::COMMENT)
5
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RgGen
4
4
  module DefaultRegisterMap
5
- VERSION = '0.26.0'
5
+ VERSION = '0.27.0'
6
6
  end
7
7
  end
@@ -1,52 +1,53 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'default_register_map/version'
4
+ require_relative 'default_register_map/comment'
4
5
 
5
- module RgGen
6
- module DefaultRegisterMap
7
- extend Core::Plugin
8
-
9
- setup_plugin :'rggen-default-register-map' do |plugin|
10
- plugin.files [
11
- 'default_register_map/bit_field/bit_assignment',
12
- 'default_register_map/bit_field/initial_value',
13
- 'default_register_map/bit_field/name',
14
- 'default_register_map/bit_field/reference',
15
- 'default_register_map/bit_field/type',
16
- 'default_register_map/bit_field/type/rc',
17
- 'default_register_map/bit_field/type/reserved',
18
- 'default_register_map/bit_field/type/ro_rotrg',
19
- 'default_register_map/bit_field/type/rof',
20
- 'default_register_map/bit_field/type/rowo_rowotrg',
21
- 'default_register_map/bit_field/type/rs',
22
- 'default_register_map/bit_field/type/rw_rwtrg_w1_wrc_wrs',
23
- 'default_register_map/bit_field/type/rwc_rws',
24
- 'default_register_map/bit_field/type/rwe_rwl',
25
- 'default_register_map/bit_field/type/w0c_w1c_wc',
26
- 'default_register_map/bit_field/type/w0crs_w1crs_wcrs',
27
- 'default_register_map/bit_field/type/w0s_w1s_ws',
28
- 'default_register_map/bit_field/type/w0src_w1src_wsrc',
29
- 'default_register_map/bit_field/type/w0t_w1t',
30
- 'default_register_map/bit_field/type/w0trg_w1trg',
31
- 'default_register_map/bit_field/type/wo_wo1_wotrg',
32
- 'default_register_map/bit_field/type/woc',
33
- 'default_register_map/bit_field/type/wos',
34
- 'default_register_map/common/comment',
35
- 'default_register_map/global/address_width',
36
- 'default_register_map/global/bus_width',
37
- 'default_register_map/register/name',
38
- 'default_register_map/register/offset_address',
39
- 'default_register_map/register/size',
40
- 'default_register_map/register/type',
41
- 'default_register_map/register/type/external',
42
- 'default_register_map/register/type/indirect',
43
- 'default_register_map/register/type/reserved',
44
- 'default_register_map/register_block/byte_size',
45
- 'default_register_map/register_block/name',
46
- 'default_register_map/register_file/name',
47
- 'default_register_map/register_file/offset_address',
48
- 'default_register_map/register_file/size'
49
- ]
50
- end
51
- end
6
+ RgGen.setup_plugin :'rggen-default-register-map' do |plugin|
7
+ plugin.version RgGen::DefaultRegisterMap::VERSION
8
+ plugin.files [
9
+ 'default_register_map/global/address_width',
10
+ 'default_register_map/global/bus_width',
11
+ 'default_register_map/global/enable_wide_register',
12
+ 'default_register_map/register_block/name',
13
+ 'default_register_map/register_block/byte_size',
14
+ 'default_register_map/register_block/comment',
15
+ 'default_register_map/register_file/name',
16
+ 'default_register_map/register_file/offset_address',
17
+ 'default_register_map/register_file/size',
18
+ 'default_register_map/register_file/comment',
19
+ 'default_register_map/register/name',
20
+ 'default_register_map/register/offset_address',
21
+ 'default_register_map/register/size',
22
+ 'default_register_map/register/type',
23
+ 'default_register_map/register/type/external',
24
+ 'default_register_map/register/type/indirect',
25
+ 'default_register_map/register/type/reserved',
26
+ 'default_register_map/register/comment',
27
+ 'default_register_map/bit_field/name',
28
+ 'default_register_map/bit_field/bit_assignment',
29
+ 'default_register_map/bit_field/type',
30
+ 'default_register_map/bit_field/type/rc',
31
+ 'default_register_map/bit_field/type/reserved',
32
+ 'default_register_map/bit_field/type/ro_rotrg',
33
+ 'default_register_map/bit_field/type/rof',
34
+ 'default_register_map/bit_field/type/row0trg_row1trg',
35
+ 'default_register_map/bit_field/type/rowo_rowotrg',
36
+ 'default_register_map/bit_field/type/rs',
37
+ 'default_register_map/bit_field/type/rw_rwtrg_w1_wrc_wrs',
38
+ 'default_register_map/bit_field/type/rwc_rws',
39
+ 'default_register_map/bit_field/type/rwe_rwl',
40
+ 'default_register_map/bit_field/type/w0c_w1c_wc',
41
+ 'default_register_map/bit_field/type/w0crs_w1crs_wcrs',
42
+ 'default_register_map/bit_field/type/w0s_w1s_ws',
43
+ 'default_register_map/bit_field/type/w0src_w1src_wsrc',
44
+ 'default_register_map/bit_field/type/w0t_w1t',
45
+ 'default_register_map/bit_field/type/w0trg_w1trg',
46
+ 'default_register_map/bit_field/type/wo_wo1_wotrg',
47
+ 'default_register_map/bit_field/type/woc',
48
+ 'default_register_map/bit_field/type/wos',
49
+ 'default_register_map/bit_field/initial_value',
50
+ 'default_register_map/bit_field/reference',
51
+ 'default_register_map/bit_field/comment'
52
+ ]
52
53
  end
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.26.0
4
+ version: 0.27.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: 2022-03-25 00:00:00.000000000 Z
11
+ date: 2022-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -36,6 +36,7 @@ files:
36
36
  - README.md
37
37
  - lib/rggen/default_register_map.rb
38
38
  - lib/rggen/default_register_map/bit_field/bit_assignment.rb
39
+ - lib/rggen/default_register_map/bit_field/comment.rb
39
40
  - lib/rggen/default_register_map/bit_field/initial_value.rb
40
41
  - lib/rggen/default_register_map/bit_field/name.rb
41
42
  - lib/rggen/default_register_map/bit_field/reference.rb
@@ -44,6 +45,7 @@ files:
44
45
  - lib/rggen/default_register_map/bit_field/type/reserved.rb
45
46
  - lib/rggen/default_register_map/bit_field/type/ro_rotrg.rb
46
47
  - lib/rggen/default_register_map/bit_field/type/rof.rb
48
+ - lib/rggen/default_register_map/bit_field/type/row0trg_row1trg.rb
47
49
  - lib/rggen/default_register_map/bit_field/type/rowo_rowotrg.rb
48
50
  - lib/rggen/default_register_map/bit_field/type/rs.rb
49
51
  - lib/rggen/default_register_map/bit_field/type/rw_rwtrg_w1_wrc_wrs.rb
@@ -58,9 +60,11 @@ files:
58
60
  - lib/rggen/default_register_map/bit_field/type/wo_wo1_wotrg.rb
59
61
  - lib/rggen/default_register_map/bit_field/type/woc.rb
60
62
  - lib/rggen/default_register_map/bit_field/type/wos.rb
61
- - lib/rggen/default_register_map/common/comment.rb
63
+ - lib/rggen/default_register_map/comment.rb
62
64
  - lib/rggen/default_register_map/global/address_width.rb
63
65
  - lib/rggen/default_register_map/global/bus_width.rb
66
+ - lib/rggen/default_register_map/global/enable_wide_register.rb
67
+ - lib/rggen/default_register_map/register/comment.rb
64
68
  - lib/rggen/default_register_map/register/name.rb
65
69
  - lib/rggen/default_register_map/register/offset_address.rb
66
70
  - lib/rggen/default_register_map/register/size.rb
@@ -69,17 +73,18 @@ files:
69
73
  - lib/rggen/default_register_map/register/type/indirect.rb
70
74
  - lib/rggen/default_register_map/register/type/reserved.rb
71
75
  - lib/rggen/default_register_map/register_block/byte_size.rb
76
+ - lib/rggen/default_register_map/register_block/comment.rb
72
77
  - lib/rggen/default_register_map/register_block/name.rb
78
+ - lib/rggen/default_register_map/register_file/comment.rb
73
79
  - lib/rggen/default_register_map/register_file/name.rb
74
80
  - lib/rggen/default_register_map/register_file/offset_address.rb
75
81
  - lib/rggen/default_register_map/register_file/size.rb
76
- - lib/rggen/default_register_map/setup.rb
77
82
  - lib/rggen/default_register_map/version.rb
78
83
  homepage: https://github.com/rggen/rggen-default-register-map
79
84
  licenses:
80
85
  - MIT
81
86
  metadata:
82
- bug_tracker_uri: https://github.com/rggen/rggen-default-register-map/issues
87
+ bug_tracker_uri: https://github.com/rggen/rggen/issues
83
88
  mailing_list_uri: https://groups.google.com/d/forum/rggen
84
89
  rubygems_mfa_required: 'true'
85
90
  source_code_uri: https://github.com/rggen/rggen-default-register-map
@@ -102,5 +107,5 @@ requirements: []
102
107
  rubygems_version: 3.3.3
103
108
  signing_key:
104
109
  specification_version: 4
105
- summary: rggen-default-register-map-0.26.0
110
+ summary: rggen-default-register-map-0.27.0
106
111
  test_files: []
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rggen/default_register_map'
4
-
5
- RgGen.register_plugin RgGen::DefaultRegisterMap do |builder|
6
- builder.enable :global, [:bus_width, :address_width]
7
- builder.enable :register_block, [
8
- :name, :byte_size, :comment
9
- ]
10
- builder.enable :register_file, [
11
- :name, :offset_address, :size, :comment
12
- ]
13
- builder.enable :register, [
14
- :name, :offset_address, :size, :type, :comment
15
- ]
16
- builder.enable :register, :type, [:external, :indirect, :reserved]
17
- builder.enable :bit_field, [
18
- :name, :bit_assignment, :type, :initial_value, :reference, :comment
19
- ]
20
- builder.enable :bit_field, :type, [
21
- :rc, :reserved, :ro, :rotrg, :rof, :rowo, :rowotrg, :rs,
22
- :rw, :rwc, :rwe, :rwl, :rws, :rwtrg,
23
- :w0c, :w0crs, :w0s, :w0src, :w0t, :w0trg,
24
- :w1, :w1c, :w1crs, :w1s, :w1src, :w1t, :w1trg, :wo, :wo1,
25
- :woc, :wos, :wotrg, :wc, :wcrs, :wrc, :wrs, :ws, :wsrc
26
- ]
27
- end