rggen-systemverilog 0.18.0 → 0.19.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: 47c585c5655ade6c0873ea2a1ca091d3df75a64d7d8cf4a5250feb4689395828
4
- data.tar.gz: 2c43249b487d8684988d74bed9ee8566aa4199cb53fb4cff97310195b3237b4e
3
+ metadata.gz: cac7efcf96e9658b1d69d73f6450a04a39190970483471c2b87e83e7afd30c86
4
+ data.tar.gz: a1ba7672115d61f5244fae358524b26325494833dc05d331e3cc337bf4724e6d
5
5
  SHA512:
6
- metadata.gz: 71b81632625b3a9d2315eaa00e067987fc4301a27d0fe0974f896be532ffbca6594b1b7679c124e0ea5dde71643435e3462b18c57eaa31fc7fa36d292c69167f
7
- data.tar.gz: 5e2aa49b5deab5873b42b8d41e1d3290f5d42f85126d69921cf2f07f9e9312573fd344aebb9f6585194c6060a8add44dfddcd862c3fe173cfdf94381f468b417
6
+ metadata.gz: 820f20e9f832c6dc61bbde37367d391eaca1c514e47dc3ca9bef9d96198080dae031a7e45663c86bc71b7f725da1e9441d92350aa6fb388a27583a5ea7f3719a
7
+ data.tar.gz: 607e5a97958d1ab9c96ad40cfc00f2f4fc5fcdba0601206526d853f7416d7d5eb610d720257060bf32b74d97a2ca9f43977c5381e9457ea07fae141c0586f98b
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2019 Taichi Ishitani
3
+ Copyright (c) 2019-2020 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
@@ -1,5 +1,5 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/rggen-systemverilog.svg)](https://badge.fury.io/rb/rggen-systemverilog)
2
- [![Build Status](https://travis-ci.com/rggen/rggen-systemverilog.svg?branch=master)](https://travis-ci.com/rggen/rggen-systemverilog)
2
+ [![CI](https://github.com/rggen/rggen-systemverilog/workflows/CI/badge.svg)](https://github.com/rggen/rggen-systemverilog/actions?query=workflow%3ACI)
3
3
  [![Maintainability](https://api.codeclimate.com/v1/badges/88086c5be538a1564a35/maintainability)](https://codeclimate.com/github/rggen/rggen-systemverilog/maintainability)
4
4
  [![codecov](https://codecov.io/gh/rggen/rggen-systemverilog/branch/master/graph/badge.svg)](https://codecov.io/gh/rggen/rggen-systemverilog)
5
5
  [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=rggen_rggen-systemverilog&metric=alert_status)](https://sonarcloud.io/dashboard?id=rggen_rggen-systemverilog)
@@ -34,7 +34,7 @@ Feedbacks, bug reports, questions and etc. are wellcome! You can post them by us
34
34
 
35
35
  ## Copyright & License
36
36
 
37
- Copyright © 2019 Taichi Ishitani. RgGen::SystemVerilog is licensed under the [MIT License](https://opensource.org/licenses/MIT), see [LICENSE](LICENSE) for futher details.
37
+ Copyright © 2019-2020 Taichi Ishitani. RgGen::SystemVerilog is licensed under the [MIT License](https://opensource.org/licenses/MIT), see [LICENSE](LICENSE) for futher details.
38
38
 
39
39
  ## Code of Conduct
40
40
 
@@ -16,9 +16,9 @@ module RgGen
16
16
  def define_entity(entity_type, creation_method, declaration_type)
17
17
  context =
18
18
  EntityContext.new(entity_type, creation_method, declaration_type)
19
- define_method(entity_type) do |domain, name, **attributes, &block|
19
+ define_method(entity_type) do |domain, name, attributes = {}, &block|
20
20
  entity =
21
- create_entity(context, { name: name }.merge(attributes), block)
21
+ create_entity(context, { name: name }.merge(attributes), &block)
22
22
  add_entity(entity, context, domain, name)
23
23
  end
24
24
  end
@@ -42,10 +42,10 @@ module RgGen
42
42
  @package_imports = Hash.new { |h, k| h[k] = [] }
43
43
  end
44
44
 
45
- def create_entity(context, attributes, block)
45
+ def create_entity(context, attributes, &block)
46
46
  creation_method = context.creation_method
47
47
  entity_type = context.entity_type
48
- __send__(creation_method, entity_type, attributes, block)
48
+ __send__(creation_method, entity_type, attributes, &block)
49
49
  end
50
50
 
51
51
  def add_entity(entity, context, domain, name)
@@ -79,7 +79,7 @@ module RgGen
79
79
  [width, bit_length].max
80
80
  end
81
81
 
82
- def argument(name, **attribute)
82
+ def argument(name, attribute = {})
83
83
  DataObject.new(:argument, attribute.merge(name: name)).declaration
84
84
  end
85
85
 
@@ -90,7 +90,7 @@ module RgGen
90
90
  module_definition: ModuleDefinition,
91
91
  package_definition: PackageDefinition
92
92
  }.each do |method_name, definition|
93
- define_method(method_name) do |name, **attributes, &block|
93
+ define_method(method_name) do |name, attributes = {}, &block|
94
94
  definition.new(attributes.merge(name: name), &block).to_code
95
95
  end
96
96
  end
@@ -7,9 +7,9 @@ module RgGen
7
7
  class DataObject
8
8
  include Core::Utility::AttributeSetter
9
9
 
10
- def initialize(object_type, **default_attributes)
10
+ def initialize(object_type, default_attributes = {})
11
11
  @object_type = object_type
12
- apply_attributes(default_attributes)
12
+ apply_attributes(**default_attributes)
13
13
  block_given? && yield(self)
14
14
  end
15
15
 
@@ -7,8 +7,8 @@ module RgGen
7
7
  class InterfaceInstance
8
8
  include Core::Utility::AttributeSetter
9
9
 
10
- def initialize(**default_attributes)
11
- apply_attributes(default_attributes)
10
+ def initialize(default_attributes = {})
11
+ apply_attributes(**default_attributes)
12
12
  block_given? && yield(self)
13
13
  end
14
14
 
@@ -7,8 +7,8 @@ module RgGen
7
7
  class InterfacePort
8
8
  include Core::Utility::AttributeSetter
9
9
 
10
- def initialize(**default_attributes)
11
- apply_attributes(default_attributes)
10
+ def initialize(default_attributes = {})
11
+ apply_attributes(**default_attributes)
12
12
  block_given? && yield(self)
13
13
  end
14
14
 
@@ -9,8 +9,8 @@ module RgGen
9
9
 
10
10
  include Core::Utility::AttributeSetter
11
11
 
12
- def initialize(**default_attributes, &block)
13
- apply_attributes(default_attributes)
12
+ def initialize(default_attributes = {}, &block)
13
+ apply_attributes(**default_attributes)
14
14
  super(&block)
15
15
  end
16
16
 
@@ -6,16 +6,14 @@ module RgGen
6
6
  class Feature < Common::Feature
7
7
  private
8
8
 
9
- def create_variable(_, attributes, block)
9
+ def create_variable(_, attributes = {}, &block)
10
10
  DataObject.new(
11
11
  :variable, attributes.merge(array_format: :unpacked), &block
12
12
  )
13
13
  end
14
14
 
15
- def create_parameter(_, attributes, block)
16
- DataObject.new(
17
- :parameter, attributes, &block
18
- )
15
+ def create_parameter(_, attributes = {}, &block)
16
+ DataObject.new(:parameter, attributes, &block)
19
17
  end
20
18
 
21
19
  define_entity :variable, :create_variable, :variable
@@ -6,27 +6,27 @@ module RgGen
6
6
  class Feature < Common::Feature
7
7
  private
8
8
 
9
- def create_variable(data_type, attributes, block)
9
+ def create_variable(data_type, attributes = {}, &block)
10
10
  DataObject.new(
11
11
  :variable, attributes.merge(data_type: data_type), &block
12
12
  )
13
13
  end
14
14
 
15
- def create_interface(_, attributes, block)
15
+ def create_interface(_, attributes = {}, &block)
16
16
  InterfaceInstance.new(attributes, &block)
17
17
  end
18
18
 
19
- def create_argument(direction, attributes, block)
19
+ def create_argument(direction, attributes = {}, &block)
20
20
  DataObject.new(
21
21
  :argument, attributes.merge(direction: direction), &block
22
22
  )
23
23
  end
24
24
 
25
- def create_interface_port(_, attributes, block)
25
+ def create_interface_port(_, attributes = {}, &block)
26
26
  InterfacePort.new(attributes, &block)
27
27
  end
28
28
 
29
- def create_parameter(parameter_type, attributes, block)
29
+ def create_parameter(parameter_type, attributes = {}, &block)
30
30
  DataObject.new(
31
31
  :parameter, attributes.merge(parameter_type: parameter_type), &block
32
32
  )
@@ -8,7 +8,7 @@ RgGen.define_simple_feature(:register, :sv_rtl_top) do
8
8
 
9
9
  pre_build do
10
10
  @base_index =
11
- register_block.registers.map(&:count).inject(0, :+)
11
+ register_block.registers.map(&:count).sum
12
12
  end
13
13
 
14
14
  build do
@@ -34,7 +34,7 @@ RgGen.define_simple_feature(:register, :sv_rtl_top) do
34
34
  operands =
35
35
  register.array? ? [@base_index, offset || local_index] : [@base_index]
36
36
  if operands.all? { |operand| operand.is_a?(Integer) }
37
- operands.inject(:+)
37
+ operands.sum
38
38
  else
39
39
  operands.join('+')
40
40
  end
@@ -14,14 +14,14 @@ RgGen.define_list_item_feature(:register, :type, :external) do
14
14
  name: "o_#{register.name}_valid",
15
15
  data_type: :logic, width: 1
16
16
  }
17
+ output :register_block, :access, {
18
+ name: "o_#{register.name}_access",
19
+ data_type: :logic, width: '$bits(rggen_access)'
20
+ }
17
21
  output :register_block, :address, {
18
22
  name: "o_#{register.name}_address",
19
23
  data_type: :logic, width: address_width
20
24
  }
21
- output :register_block, :write, {
22
- name: "o_#{register.name}_write",
23
- data_type: :logic, width: 1
24
- }
25
25
  output :register_block, :write_data, {
26
26
  name: "o_#{register.name}_data",
27
27
  data_type: :logic, width: bus_width
@@ -46,7 +46,7 @@ RgGen.define_list_item_feature(:register, :type, :external) do
46
46
  name: 'bus_if', interface_type: 'rggen_bus_if',
47
47
  parameter_values: [address_width, bus_width],
48
48
  variables: [
49
- 'valid', 'address', 'write', 'write_data', 'strobe',
49
+ 'valid', 'access', 'address', 'write_data', 'strobe',
50
50
  'ready', 'status', 'read_data'
51
51
  ]
52
52
  }
@@ -58,8 +58,8 @@ RgGen.define_list_item_feature(:register, :type, :external) do
58
58
  unless configuration.fold_sv_interface_port?
59
59
  [
60
60
  [valid, bus_if.valid],
61
+ [access, bus_if.access],
61
62
  [address, bus_if.address],
62
- [write, bus_if.write],
63
63
  [write_data, bus_if.write_data],
64
64
  [strobe, bus_if.strobe],
65
65
  [bus_if.ready, ready],
@@ -19,7 +19,7 @@ RgGen.define_list_item_feature(:register, :type, :indirect) do
19
19
  end
20
20
 
21
21
  def index_width
22
- @index_width ||= index_fields.map(&:width).inject(:+)
22
+ @index_width ||= index_fields.map(&:width).sum
23
23
  end
24
24
 
25
25
  def index_values
@@ -82,7 +82,7 @@ RgGen.define_list_item_feature(:register_block, :protocol, :apb) do
82
82
  [pready, apb_if.pready],
83
83
  [prdata, apb_if.prdata],
84
84
  [pslverr, apb_if.pslverr]
85
- ].map { |lhs, rhs| code << assign(lhs, rhs) << nl }
85
+ ].each { |lhs, rhs| code << assign(lhs, rhs) << nl }
86
86
  end
87
87
  end
88
88
  end
@@ -24,10 +24,7 @@ RgGen.define_simple_feature(:register_block, :sv_rtl_top) do
24
24
  end
25
25
 
26
26
  def total_registers
27
- register_block
28
- .registers
29
- .map(&:count)
30
- .inject(:+)
27
+ register_block.registers.map(&:count).sum
31
28
  end
32
29
 
33
30
  private
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RgGen
4
4
  module SystemVerilog
5
- VERSION = '0.18.0'
5
+ VERSION = '0.19.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rggen-systemverilog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 0.19.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: 2019-11-19 00:00:00.000000000 Z
11
+ date: 2020-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docile
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  description: 'SystemVerilog RTL and UVM RAL model generators for RgGen.
56
56
 
57
- '
57
+ '
58
58
  email:
59
59
  - rggen@googlegroups.com
60
60
  executables: []
@@ -160,15 +160,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
160
160
  requirements:
161
161
  - - ">="
162
162
  - !ruby/object:Gem::Version
163
- version: '2.3'
163
+ version: '2.4'
164
164
  required_rubygems_version: !ruby/object:Gem::Requirement
165
165
  requirements:
166
166
  - - ">="
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0'
169
169
  requirements: []
170
- rubygems_version: 3.0.3
170
+ rubygems_version: 3.1.2
171
171
  signing_key:
172
172
  specification_version: 4
173
- summary: rggen-systemverilog-0.18.0
173
+ summary: rggen-systemverilog-0.19.0
174
174
  test_files: []