rggen-verilog 0.2.0 → 0.3.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: bf021f06b55444d10dd0aac02dc945a23fa8033403719cc4bf979afaf433a120
4
- data.tar.gz: 0ac61bb02b3f6cbbbc8b7281f85ac2607ad741a9159721327eef4206c652894d
3
+ metadata.gz: eea0415f0d8ad111af37525833522c9f542d5815e56d954aa69e22f973096919
4
+ data.tar.gz: cba5ff6f30efa182b035d62698d8017f3bda815e5eca1b2e5cbe093ba525a4b3
5
5
  SHA512:
6
- metadata.gz: 3c597337180c58cceb309ee668208e292b07640a371f4fa825895af1112d200ade2d2f80e7a5969c48681a9bd9e10c45f44857498e0d2fbd4ff704773368b2dc
7
- data.tar.gz: c8066587197f7180780d705c51afb7dfc2df54e9429d989a2e65818fb3fbf9d771a269f753c77469fbdb88427c70cb51a7eff3fe00b1927f5a0d2d4da2971fd3
6
+ metadata.gz: 687b5e2c1d2cdcf72bf6808c4ffcbf8fcc730fc6efd3ed47383650564be7809bd049f2c192b3e407f6f9bf020514046acd0a8365a6d6141c2844b24fbd4de0b7
7
+ data.tar.gz: 6dcf31105b3e66e3d570e040457262e832d50e635f9ab1fdedf967ac03531655537561b4d8554fd7e36fe14c0037586e9068fa93b035fedf94e35d197d436a99
data/lib/rggen/verilog.rb CHANGED
@@ -21,14 +21,12 @@ module RgGen
21
21
  plugin.files [
22
22
  'verilog/bit_field/type',
23
23
  'verilog/bit_field/type/rc_w0c_w1c_wc_woc',
24
- 'verilog/bit_field/type/reserved',
25
24
  'verilog/bit_field/type/ro',
26
25
  'verilog/bit_field/type/rof',
27
26
  'verilog/bit_field/type/rs_w0s_w1s_ws_wos',
28
27
  'verilog/bit_field/type/rw_w1_wo_wo1',
29
28
  'verilog/bit_field/type/rwc',
30
- 'verilog/bit_field/type/rwe',
31
- 'verilog/bit_field/type/rwl',
29
+ 'verilog/bit_field/type/rwe_rwl',
32
30
  'verilog/bit_field/type/rws',
33
31
  'verilog/bit_field/type/w0crs_w0src_w1crs_w1src_wcrs_wsrc',
34
32
  'verilog/bit_field/type/w0t_w1t',
@@ -1,13 +1,13 @@
1
1
  rggen_bit_field #(
2
2
  .WIDTH (<%= width %>),
3
3
  .INITIAL_VALUE (<%= initial_value %>),
4
- .SW_WRITE_ENABLE_POLARITY (`RGGEN_ACTIVE_LOW)
4
+ .SW_WRITE_ENABLE_POLARITY (<%= control_signal_polarity %>)
5
5
  ) u_bit_field (
6
6
  .i_clk (<%= clock %>),
7
7
  .i_rst_n (<%= reset %>),
8
8
  .i_sw_valid (<%= bit_field_valid %>),
9
9
  .i_sw_read_mask (<%= bit_field_read_mask %>),
10
- .i_sw_write_enable (<%= lock_signal %>),
10
+ .i_sw_write_enable (<%= control_signal %>),
11
11
  .i_sw_write_mask (<%= bit_field_write_mask %>),
12
12
  .i_sw_write_data (<%= bit_field_write_data %>),
13
13
  .o_sw_read_data (<%= bit_field_read_data %>),
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ RgGen.define_list_item_feature(:bit_field, :type, [:rwe, :rwl]) do
4
+ verilog do
5
+ build do
6
+ unless bit_field.reference?
7
+ input :control, {
8
+ name: "i_#{full_name}_#{enable_or_lock}",
9
+ width: 1, array_size: array_size
10
+ }
11
+ end
12
+ output :value_out, {
13
+ name: "o_#{full_name}", width: width, array_size: array_size
14
+ }
15
+ end
16
+
17
+ main_code :bit_field, from_template: true
18
+
19
+ private
20
+
21
+ def enable_or_lock
22
+ { rwe: 'enable', rwl: 'lock' }[bit_field.type]
23
+ end
24
+
25
+ def control_signal_polarity
26
+ { rwe: '`RGGEN_ACTIVE_HIGH', rwl: '`RGGEN_ACTIVE_LOW' }[bit_field.type]
27
+ end
28
+
29
+ def control_signal
30
+ reference_bit_field || control[loop_variables]
31
+ end
32
+ end
33
+ end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module RgGen
4
4
  module Verilog
5
- class ComponentFactory < Core::OutputBase::ComponentFactory
5
+ class ComponentFactory < Core::OutputBase::SourceFileComponentFactory
6
6
  end
7
7
 
8
8
  class FeatureFactory < Core::OutputBase::FeatureFactory
@@ -12,12 +12,12 @@ module RgGen
12
12
  super
13
13
  end
14
14
 
15
- def create_argument(direction, attributes, &block)
15
+ def create_port(direction, attributes, &block)
16
16
  attributes =
17
17
  attributes
18
- .reject { |key, _| key == :data_type }
19
- .merge(array_format: :serialized)
20
- super
18
+ .except(:data_type)
19
+ .merge(direction: direction, array_format: :serialized)
20
+ DataObject.new(:argument, attributes, &block)
21
21
  end
22
22
 
23
23
  def create_parameter(parameter_type, attributes, &block)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RgGen
4
4
  module Verilog
5
- VERSION = '0.2.0'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rggen-verilog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.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: 2021-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rggen-systemverilog
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.24.0
19
+ version: 0.25.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.24.0
26
+ version: 0.25.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -52,8 +52,6 @@ files:
52
52
  - lib/rggen/verilog/bit_field/type.rb
53
53
  - lib/rggen/verilog/bit_field/type/rc_w0c_w1c_wc_woc.erb
54
54
  - lib/rggen/verilog/bit_field/type/rc_w0c_w1c_wc_woc.rb
55
- - lib/rggen/verilog/bit_field/type/reserved.erb
56
- - lib/rggen/verilog/bit_field/type/reserved.rb
57
55
  - lib/rggen/verilog/bit_field/type/ro.erb
58
56
  - lib/rggen/verilog/bit_field/type/ro.rb
59
57
  - lib/rggen/verilog/bit_field/type/rof.erb
@@ -64,10 +62,8 @@ files:
64
62
  - lib/rggen/verilog/bit_field/type/rw_w1_wo_wo1.rb
65
63
  - lib/rggen/verilog/bit_field/type/rwc.erb
66
64
  - lib/rggen/verilog/bit_field/type/rwc.rb
67
- - lib/rggen/verilog/bit_field/type/rwe.erb
68
- - lib/rggen/verilog/bit_field/type/rwe.rb
69
- - lib/rggen/verilog/bit_field/type/rwl.erb
70
- - lib/rggen/verilog/bit_field/type/rwl.rb
65
+ - lib/rggen/verilog/bit_field/type/rwe_rwl.erb
66
+ - lib/rggen/verilog/bit_field/type/rwe_rwl.rb
71
67
  - lib/rggen/verilog/bit_field/type/rws.erb
72
68
  - lib/rggen/verilog/bit_field/type/rws.rb
73
69
  - lib/rggen/verilog/bit_field/type/w0crs_w0src_w1crs_w1src_wcrs_wsrc.erb
@@ -117,7 +113,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
117
113
  requirements:
118
114
  - - ">="
119
115
  - !ruby/object:Gem::Version
120
- version: 2.4.0
116
+ version: '2.5'
121
117
  required_rubygems_version: !ruby/object:Gem::Requirement
122
118
  requirements:
123
119
  - - ">="
@@ -127,5 +123,5 @@ requirements: []
127
123
  rubygems_version: 3.2.3
128
124
  signing_key:
129
125
  specification_version: 4
130
- summary: rggen-verilog-0.2.0
126
+ summary: rggen-verilog-0.3.0
131
127
  test_files: []
@@ -1,23 +0,0 @@
1
- rggen_bit_field #(
2
- .WIDTH (<%= width %>),
3
- .SW_READ_ACTION (`RGGEN_READ_NONE),
4
- .STORAGE (0)
5
- ) u_bit_field (
6
- .i_clk (1'b0),
7
- .i_rst_n (1'b0),
8
- .i_sw_valid (<%= bit_field_valid %>),
9
- .i_sw_read_mask (<%= bit_field_read_mask %>),
10
- .i_sw_write_enable (1'b0),
11
- .i_sw_write_mask (<%= bit_field_write_mask %>),
12
- .i_sw_write_data (<%= bit_field_write_data %>),
13
- .o_sw_read_data (<%= bit_field_read_data %>),
14
- .o_sw_value (<%= bit_field_value %>),
15
- .i_hw_write_enable (1'b0),
16
- .i_hw_write_data (<%= fill_0(width) %>),
17
- .i_hw_set (<%= fill_0(width) %>),
18
- .i_hw_clear (<%= fill_0(width) %>),
19
- .i_value (<%= fill_0(width) %>),
20
- .i_mask (<%= fill_0(width) %>),
21
- .o_value (),
22
- .o_value_unmasked ()
23
- );
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RgGen.define_list_item_feature(:bit_field, :type, :reserved) do
4
- verilog do
5
- main_code :bit_field, from_template: true
6
- end
7
- end
@@ -1,23 +0,0 @@
1
- rggen_bit_field #(
2
- .WIDTH (<%= width %>),
3
- .INITIAL_VALUE (<%= initial_value %>),
4
- .SW_WRITE_ENABLE_POLARITY (`RGGEN_ACTIVE_HIGH)
5
- ) u_bit_field (
6
- .i_clk (<%= clock %>),
7
- .i_rst_n (<%= reset %>),
8
- .i_sw_valid (<%= bit_field_valid %>),
9
- .i_sw_read_mask (<%= bit_field_read_mask %>),
10
- .i_sw_write_enable (<%= enable_signal %>),
11
- .i_sw_write_mask (<%= bit_field_write_mask %>),
12
- .i_sw_write_data (<%= bit_field_write_data %>),
13
- .o_sw_read_data (<%= bit_field_read_data %>),
14
- .o_sw_value (<%= bit_field_value %>),
15
- .i_hw_write_enable (1'b0),
16
- .i_hw_write_data (<%= fill_0(width) %>),
17
- .i_hw_set (<%= fill_0(width) %>),
18
- .i_hw_clear (<%= fill_0(width) %>),
19
- .i_value (<%= fill_0(width) %>),
20
- .i_mask (<%= fill_1(width) %>),
21
- .o_value (<%= value_out[loop_variables] %>),
22
- .o_value_unmasked ()
23
- );
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RgGen.define_list_item_feature(:bit_field, :type, :rwe) do
4
- verilog do
5
- build do
6
- unless bit_field.reference?
7
- input :enable, {
8
- name: "i_#{full_name}_enable", width: 1, array_size: array_size
9
- }
10
- end
11
- output :value_out, {
12
- name: "o_#{full_name}", width: width, array_size: array_size
13
- }
14
- end
15
-
16
- main_code :bit_field, from_template: true
17
-
18
- private
19
-
20
- def enable_signal
21
- reference_bit_field || enable[loop_variables]
22
- end
23
- end
24
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RgGen.define_list_item_feature(:bit_field, :type, :rwl) do
4
- verilog do
5
- build do
6
- unless bit_field.reference?
7
- input :lock, {
8
- name: "i_#{full_name}_lock", width: 1, array_size: array_size
9
- }
10
- end
11
- output :value_out, {
12
- name: "o_#{full_name}", width: width, array_size: array_size
13
- }
14
- end
15
-
16
- main_code :bit_field, from_template: true
17
-
18
- private
19
-
20
- def lock_signal
21
- reference_bit_field || lock[loop_variables]
22
- end
23
- end
24
- end