rggen-duh 0.3.0 → 0.6.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: e46b2c450351b313867d6c21f413f15b07f8ccdfa956702a24ab5f428374e33f
4
- data.tar.gz: 798646f78b08e3fe38408f0728450bce7841e8972da87dd7d994a3d9df4bd04a
3
+ metadata.gz: c2274497f0e9a869276f33bdcaaab3d3bbd4201b7e0edcb81098f13845d9b2e2
4
+ data.tar.gz: 1150a46a3b04bf8507354f558477ce38de088b5b2c0b8d0db944b37dc19c1116
5
5
  SHA512:
6
- metadata.gz: d22def9cb80e2595d4861c68cb5c788be3d27180d46dcae04726524d13443b8d5e46491d519cae0a991a7ca9581e12170bd190f80df0a02a17df2639ce207b4b
7
- data.tar.gz: f076c8afcf40012c93710400d981cd5d628590b5d4a60b82a08ca52f0612790278f4157890dc8b82b302a4292b6a57c2bbfcc00496b36d46947d34a40ccdb017
6
+ metadata.gz: cddd16cdb872e0f70dba671cbcf8f7d0e97df2af46f6fedea21b2b53b75624b98adb499099f761f24fce8e58b233bddaef3f9e3d5df5422311821b0a741bd19f
7
+ data.tar.gz: 88df1e3e4db32d570ff80f6ef2db6727a0aa1d5fcb3ee77bfbc4c65b686a25718b589dc8f3a6f79e421bbd5d65931aea2a3419fe2218782fb3a504b0cb4c75e0
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2020-2021 Taichi Ishitani
3
+ Copyright (c) 2020-2022 Taichi Ishitani
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -40,9 +40,16 @@ Following table describes which RgGen bit field types are supported by DUH forma
40
40
  | RgGen bit field type | Support? | access | modifiedWriteValue | readAction | reserved |
41
41
  |:---------------------|:---------|:---------------|:-------------------|:--------------|:---------|
42
42
  | rw | yes | read-write | not specified | not specified | no |
43
+ | rwtrg | no | | | | |
43
44
  | ro | yes | read-only | don't care | not specified | no |
44
- | rof | no | | | | no |
45
+ | rotrg | no | | | | |
46
+ | row0trg | no | | | | |
47
+ | row1trg | no | | | | |
48
+ | rowo | no | | | | |
49
+ | rowotrg | no | | | | |
50
+ | rof | no | | | | |
45
51
  | wo | yes | write-only | not specified | don't care | no |
52
+ | wotrg | no | | | | |
46
53
  | wrc | yes | read-write | not specified | clear | no |
47
54
  | wrs | yes | read-write | not specified | set | no |
48
55
  | rc | yes | read-only | don't care | clear | no |
@@ -75,14 +82,15 @@ Following table describes which RgGen bit field types are supported by DUH forma
75
82
 
76
83
  Feedbacks, bug reports, questions and etc. are wellcome! You can post them by using following ways:
77
84
 
78
- * [GitHub Issue Tracker](https://github.com/rggen/rggen-duh/issues)
85
+ * [GitHub Issue Tracker](https://github.com/rggen/rggen/issues)
86
+ * [GitHub Discussions](https://github.com/rggen/rggen/discussions)
79
87
  * [Chat Room](https://gitter.im/rggen/rggen)
80
88
  * [Mailing List](https://groups.google.com/d/forum/rggen)
81
89
  * [Mail](mailto:rggen@googlegroups.com)
82
90
 
83
91
  ## Copyright & License
84
92
 
85
- Copyright © 2020-2021 Taichi Ishitani. RgGen::DUH is licensed under the [MIT License](https://opensource.org/licenses/MIT), see [LICENSE](LICENSE) for futher details.
93
+ Copyright © 2020-2022 Taichi Ishitani. RgGen::DUH is licensed under the [MIT License](https://opensource.org/licenses/MIT), see [LICENSE](LICENSE) for futher details.
86
94
 
87
95
  ## Notice
88
96
 
@@ -42,9 +42,14 @@ module RgGen
42
42
  }.freeze
43
43
 
44
44
  def format_sub_layer_data(read_data, layer, _file)
45
- SUB_LAYERS[layer]&.each_with_object({}) do |sub_layer, sub_layer_data|
46
- data = __send__("collect_#{sub_layer}_data", read_data)
47
- data && (sub_layer_data[sub_layer] = data)
45
+ SUB_LAYERS[layer]&.each_with_object([]) do |sub_layer, sub_layer_data|
46
+ data =
47
+ if layer == :root
48
+ collect_register_block_data(read_data)
49
+ else
50
+ collect_sub_layer_data(read_data, sub_layer)
51
+ end
52
+ data && sub_layer_data.concat([sub_layer].product(data))
48
53
  end
49
54
  end
50
55
 
@@ -61,21 +66,15 @@ module RgGen
61
66
  &.compact
62
67
  end
63
68
 
64
- def collect_register_file_data(read_data)
65
- read_data['registerFiles']&.map do |data|
66
- add_parent_and_layer_properties(data, read_data, :register_file)
67
- end
68
- end
69
-
70
- def collect_register_data(read_data)
71
- read_data['registers']&.map do |data|
72
- add_parent_and_layer_properties(data, read_data, :register)
73
- end
74
- end
69
+ KEY_MAP = {
70
+ register_file: 'registerFiles',
71
+ register: 'registers',
72
+ bit_field: 'fields'
73
+ }.freeze
75
74
 
76
- def collect_bit_field_data(read_data)
77
- read_data['fields']&.map do |data|
78
- add_parent_and_layer_properties(data, read_data, :bit_field)
75
+ def collect_sub_layer_data(read_data, sub_layer)
76
+ read_data[KEY_MAP[sub_layer]]&.map do |data|
77
+ add_parent_and_layer_properties(data, read_data, sub_layer)
79
78
  end
80
79
  end
81
80
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RgGen
4
4
  module DUH
5
- VERSION = '0.3.0'
5
+ VERSION = '0.6.0'
6
6
  end
7
7
  end
data/lib/rggen/duh.rb CHANGED
@@ -9,17 +9,16 @@ require_relative 'duh/exceptions'
9
9
  require_relative 'duh/schema'
10
10
  require_relative 'duh/loader'
11
11
 
12
- module RgGen
13
- module DUH
14
- extend Core::Plugin
12
+ RgGen.setup_plugin :'rggen-duh' do |plugin|
13
+ plugin.version RgGen::DUH::VERSION
15
14
 
16
- setup_plugin :'rggen-duh' do |plugin|
17
- plugin.register_loader :register_map, :duh, Loader
18
- plugin.files [
19
- 'duh/extractor/bit_assignment',
20
- 'duh/extractor/simple_extractors',
21
- 'duh/extractor/type'
22
- ]
23
- end
15
+ plugin.setup_loader :register_map, :duh do |entry|
16
+ entry.register_loader RgGen::DUH::Loader
24
17
  end
18
+
19
+ plugin.files [
20
+ 'duh/extractor/bit_assignment',
21
+ 'duh/extractor/simple_extractors',
22
+ 'duh/extractor/type'
23
+ ]
25
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rggen-duh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.6.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: 2021-01-20 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: json_refs
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.2.12
33
+ version: 0.2.17
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.2.12
40
+ version: 0.2.17
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rb_json5
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,14 @@ files:
86
86
  - lib/rggen/duh/extractor/type.rb
87
87
  - lib/rggen/duh/loader.rb
88
88
  - lib/rggen/duh/schema.rb
89
- - lib/rggen/duh/setup.rb
90
89
  - lib/rggen/duh/version.rb
91
90
  homepage: https://github.com/rggen/rggen-duh
92
91
  licenses:
93
92
  - MIT
94
93
  metadata:
95
- bug_tracker_uri: https://github.com/rggen/rggen-duh/issues
94
+ bug_tracker_uri: https://github.com/rggen/rggen/issues
96
95
  mailing_list_uri: https://groups.google.com/d/forum/rggen
96
+ rubygems_mfa_required: 'true'
97
97
  source_code_uri: https://github.com/rggen/rggen-duh
98
98
  wiki_uri: https://github.com/rggen/rggen/wiki
99
99
  post_install_message:
@@ -104,15 +104,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
104
104
  requirements:
105
105
  - - ">="
106
106
  - !ruby/object:Gem::Version
107
- version: '2.5'
107
+ version: '2.6'
108
108
  required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  requirements:
110
110
  - - ">="
111
111
  - !ruby/object:Gem::Version
112
112
  version: '0'
113
113
  requirements: []
114
- rubygems_version: 3.2.3
114
+ rubygems_version: 3.3.3
115
115
  signing_key:
116
116
  specification_version: 4
117
- summary: rggen-dut-0.3.0
117
+ summary: rggen-dut-0.6.0
118
118
  test_files: []
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rggen/duh'
4
- RgGen.register_plugin RgGen::DUH