rggen-systemverilog 0.32.0 → 0.33.1

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: c295b2c383ee9a080cf33b8faf85f81ed3946cf607be733a1a0ff44d43fdf456
4
- data.tar.gz: a38e7790669fe49a736076383a627f87e6468e38635376f2a07e79ca1a372884
3
+ metadata.gz: a3d95e17a462a9401886ea4a6923921ad4ba9aa698c2bd9133f7b513110c120b
4
+ data.tar.gz: 4d80681f90d4cb38ca782821fe9820fa6e9c4cbcc3b723c63a1ec75d87c2d35d
5
5
  SHA512:
6
- metadata.gz: '0876b350261500e1c6f9ca6614713c3a251c7c779d656150301972b1be9f4b7defd044df1a37cecd1d70860fa92a09adbcad4abad0654386f2c7416387c6710a'
7
- data.tar.gz: 7dbd42dcfa9fc6285a9d0790f92c9543007b3d472a57f2ce8f06e7fb967bff4094a55ff0ee8eb7cbcf2d050b496bbf30dbbed41f08714dc4a7976adf820b9314
6
+ metadata.gz: 38bf92bf7e6f0d27cb99ed6a6d2e3753f3bf60ff199fc876e8f99875bbdbf0da665b5f2c0dae40c44510acee6555487c56a1381ac3264f00ce6ae4f2731e34a4
7
+ data.tar.gz: d7f396a29d716c6f854bbeb2fb5c331eb67ffb85143f764b9e62a3c8f89c388367a56ef54c6a31311129229859f37452b5bee51457a76db4272360898f744ff7
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2019-2023 Taichi Ishitani
3
+ Copyright (c) 2019-2024 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
@@ -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-2023 Taichi Ishitani. RgGen::SystemVerilog is licensed under the [MIT License](https://opensource.org/licenses/MIT), see [LICENSE](LICENSE) for futher details.
37
+ Copyright © 2019-2024 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
 
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ RgGen.define_list_item_feature(:bit_field, :type, [:rof, :rohw]) do
4
+ sv_ral { access 'RO' }
5
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ RgGen.define_list_item_feature(:bit_field, :type, [:rwc, :rwhw, :rws]) do
4
+ sv_ral { access 'RW' }
5
+ end
@@ -23,11 +23,11 @@ RgGen.setup_plugin :'rggen-sv-ral' do |plugin|
23
23
  'ral/register/type/indirect',
24
24
  'ral/bit_field/type',
25
25
  'ral/bit_field/type/custom',
26
- 'ral/bit_field/type/rof_rol',
26
+ 'ral/bit_field/type/rof_rohw',
27
27
  'ral/bit_field/type/rotrg_rwtrg_wotrg',
28
28
  'ral/bit_field/type/row0trg_row1trg_w0trg_w1trg',
29
29
  'ral/bit_field/type/rowo_rowotrg',
30
- 'ral/bit_field/type/rwc_rws',
30
+ 'ral/bit_field/type/rwc_rwhw_rws',
31
31
  'ral/bit_field/type/rwe_rwl'
32
32
  ]
33
33
  end
@@ -9,7 +9,7 @@ rggen_bit_field #(
9
9
  .o_write_trigger (),
10
10
  .o_read_trigger (),
11
11
  .i_sw_write_enable ('1),
12
- .i_hw_write_enable (<%= latch_signal %>),
12
+ .i_hw_write_enable (<%= valid_signal %>),
13
13
  .i_hw_write_data (<%= value_in[loop_variables] %>),
14
14
  .i_hw_set ('0),
15
15
  .i_hw_clear ('0),
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- RgGen.define_list_item_feature(:bit_field, :type, :rol) do
3
+ RgGen.define_list_item_feature(:bit_field, :type, :rohw) do
4
4
  sv_rtl do
5
5
  build do
6
6
  unless bit_field.reference?
7
- input :latch, {
8
- name: "i_#{full_name}_latch", width: 1,
7
+ input :valid, {
8
+ name: "i_#{full_name}_valid", width: 1,
9
9
  array_size: array_size, array_format: array_port_format
10
10
  }
11
11
  end
@@ -23,8 +23,8 @@ RgGen.define_list_item_feature(:bit_field, :type, :rol) do
23
23
 
24
24
  private
25
25
 
26
- def latch_signal
27
- reference_bit_field || latch[loop_variables]
26
+ def valid_signal
27
+ reference_bit_field || valid[loop_variables]
28
28
  end
29
29
  end
30
30
  end
@@ -0,0 +1,19 @@
1
+ rggen_bit_field #(
2
+ .WIDTH (<%= width %>),
3
+ .INITIAL_VALUE (<%= initial_value %>)
4
+ ) u_bit_field (
5
+ .i_clk (<%= clock %>),
6
+ .i_rst_n (<%= reset %>),
7
+ .bit_field_if (<%= bit_field_if %>),
8
+ .o_write_trigger (),
9
+ .o_read_trigger (),
10
+ .i_sw_write_enable ('1),
11
+ .i_hw_write_enable (<%= valid_signal %>),
12
+ .i_hw_write_data (<%= value_in[loop_variables] %>),
13
+ .i_hw_set ('0),
14
+ .i_hw_clear ('0),
15
+ .i_value ('0),
16
+ .i_mask ('1),
17
+ .o_value (<%= value_out[loop_variables] %>),
18
+ .o_value_unmasked ()
19
+ );
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ RgGen.define_list_item_feature(:bit_field, :type, :rwhw) do
4
+ sv_rtl do
5
+ build do
6
+ unless bit_field.reference?
7
+ input :valid, {
8
+ name: "i_#{full_name}_valid", width: 1,
9
+ array_size: array_size, array_format: array_port_format
10
+ }
11
+ end
12
+ input :value_in, {
13
+ name: "i_#{full_name}", width: width,
14
+ array_size: array_size, array_format: array_port_format
15
+ }
16
+ output :value_out, {
17
+ name: "o_#{full_name}", width: width,
18
+ array_size: array_size, array_format: array_port_format
19
+ }
20
+ end
21
+
22
+ main_code :bit_field, from_template: true
23
+
24
+ private
25
+
26
+ def valid_signal
27
+ reference_bit_field || valid[loop_variables]
28
+ end
29
+ end
30
+ end
@@ -1,6 +1,7 @@
1
1
  rggen_bit_field #(
2
2
  .WIDTH (<%= width %>),
3
- .INITIAL_VALUE (<%= initial_value %>)
3
+ .INITIAL_VALUE (<%= initial_value %>),
4
+ .HW_SET_WIDTH (1)
4
5
  ) u_bit_field (
5
6
  .i_clk (<%= clock %>),
6
7
  .i_rst_n (<%= reset %>),
@@ -8,9 +9,9 @@ rggen_bit_field #(
8
9
  .o_write_trigger (),
9
10
  .o_read_trigger (),
10
11
  .i_sw_write_enable ('1),
11
- .i_hw_write_enable (<%= set_signal %>),
12
- .i_hw_write_data (<%= value_in[loop_variables] %>),
13
- .i_hw_set ('0),
12
+ .i_hw_write_enable ('0),
13
+ .i_hw_write_data ('0),
14
+ .i_hw_set (<%= set_signal %>),
14
15
  .i_hw_clear ('0),
15
16
  .i_value ('0),
16
17
  .i_mask ('1),
@@ -9,10 +9,6 @@ RgGen.define_list_item_feature(:bit_field, :type, :rws) do
9
9
  array_size: array_size, array_format: array_port_format
10
10
  }
11
11
  end
12
- input :value_in, {
13
- name: "i_#{full_name}", width: width,
14
- array_size: array_size, array_format: array_port_format
15
- }
16
12
  output :value_out, {
17
13
  name: "o_#{full_name}", width: width,
18
14
  array_size: array_size, array_format: array_port_format
@@ -8,26 +8,55 @@ module RgGen
8
8
 
9
9
  def index_fields
10
10
  @index_fields ||=
11
- register.collect_index_fields(register_block.bit_fields)
11
+ register
12
+ .collect_index_fields(register_block.bit_fields)
12
13
  end
13
14
 
14
- def index_width
15
- @index_width ||= index_fields.sum(&:width)
15
+ def index_match_width
16
+ index_fields.size
16
17
  end
17
18
 
18
19
  def index_values
20
+ @index_values ||= collect_index_values
21
+ end
22
+
23
+ def collect_index_values
19
24
  loop_variables = register.local_loop_variables
20
25
  register.index_entries.zip(index_fields).map do |entry, field|
21
26
  if entry.array_index?
22
- loop_variables.shift[0, field.width]
27
+ array_index_value(loop_variables.shift, field.width)
23
28
  else
24
- hex(entry.value, field.width)
29
+ fixed_index_value(entry.value, field.width)
25
30
  end
26
31
  end
27
32
  end
28
33
 
29
- def indirect_index_assignment
30
- assign(indirect_index, concat(index_fields.map(&:value)))
34
+ def array_index_value(value, width)
35
+ "#{width}'(#{value})"
36
+ end
37
+
38
+ def fixed_index_value(value, width)
39
+ hex(value, width)
40
+ end
41
+
42
+ def indirect_index_matches(code)
43
+ index_fields.each_with_index do |field, i|
44
+ rhs = index_match_rhs(i)
45
+ lhs = index_match_lhs(field.value, index_values[i])
46
+ code << assign(rhs, lhs) << nl
47
+ end
48
+ end
49
+
50
+ def index_match_rhs(index)
51
+ if index_match_width == 1
52
+ indirect_match
53
+ else
54
+ indirect_match[index]
55
+ end
56
+ end
57
+
58
+ def index_match_lhs(field, value)
59
+ "#{field} == #{value}"
31
60
  end
32
61
  end
33
62
  end
@@ -6,12 +6,11 @@ rggen_indirect_register #(
6
6
  .BUS_WIDTH (<%= bus_width %>),
7
7
  .DATA_WIDTH (<%= width %>),
8
8
  .VALUE_WIDTH (<%= value_width %>),
9
- .INDIRECT_INDEX_WIDTH (<%= index_width %>),
10
- .INDIRECT_INDEX_VALUE (<%= concat(index_values) %>)
9
+ .INDIRECT_MATCH_WIDTH (<%= index_match_width %>)
11
10
  ) u_register (
12
11
  .i_clk (<%= register_block.clock %>),
13
12
  .i_rst_n (<%= register_block.reset %>),
14
13
  .register_if (<%= register_if %>),
15
- .i_indirect_index (<%= indirect_index %>),
14
+ .i_indirect_match (<%= indirect_match %>),
16
15
  .bit_field_if (<%= bit_field_if %>)
17
16
  );
@@ -5,11 +5,11 @@ RgGen.define_list_item_feature(:register, :type, :indirect) do
5
5
  include RgGen::SystemVerilog::RTL::IndirectIndex
6
6
 
7
7
  build do
8
- logic :indirect_index, { width: index_width }
8
+ logic :indirect_match, { width: index_match_width }
9
9
  end
10
10
 
11
11
  main_code :register do |code|
12
- code << indirect_index_assignment << nl
12
+ indirect_index_matches(code)
13
13
  code << process_template
14
14
  end
15
15
  end
@@ -38,13 +38,14 @@ RgGen.setup_plugin :'rggen-sv-rtl' do |plugin|
38
38
  'rtl/bit_field/type/rc_w0c_w1c_wc_woc',
39
39
  'rtl/bit_field/type/ro_rotrg',
40
40
  'rtl/bit_field/type/rof',
41
- 'rtl/bit_field/type/rol',
41
+ 'rtl/bit_field/type/rohw',
42
42
  'rtl/bit_field/type/row0trg_row1trg',
43
43
  'rtl/bit_field/type/rowo_rowotrg',
44
44
  'rtl/bit_field/type/rs_w0s_w1s_ws_wos',
45
45
  'rtl/bit_field/type/rw_rwtrg_w1',
46
46
  'rtl/bit_field/type/rwc',
47
47
  'rtl/bit_field/type/rwe_rwl',
48
+ 'rtl/bit_field/type/rwhw',
48
49
  'rtl/bit_field/type/rws',
49
50
  'rtl/bit_field/type/w0crs_w0src_w1crs_w1src_wcrs_wsrc',
50
51
  'rtl/bit_field/type/w0t_w1t',
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RgGen
4
4
  module SystemVerilog
5
- VERSION = '0.32.0'
5
+ VERSION = '0.33.1'
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.32.0
4
+ version: 0.33.1
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-28 00:00:00.000000000 Z
11
+ date: 2024-11-28 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'SystemVerilog RTL and UVM RAL model generators for RgGen.
14
14
 
@@ -42,11 +42,11 @@ files:
42
42
  - lib/rggen/systemverilog/ral.rb
43
43
  - lib/rggen/systemverilog/ral/bit_field/type.rb
44
44
  - lib/rggen/systemverilog/ral/bit_field/type/custom.rb
45
- - lib/rggen/systemverilog/ral/bit_field/type/rof_rol.rb
45
+ - lib/rggen/systemverilog/ral/bit_field/type/rof_rohw.rb
46
46
  - lib/rggen/systemverilog/ral/bit_field/type/rotrg_rwtrg_wotrg.rb
47
47
  - lib/rggen/systemverilog/ral/bit_field/type/row0trg_row1trg_w0trg_w1trg.rb
48
48
  - lib/rggen/systemverilog/ral/bit_field/type/rowo_rowotrg.rb
49
- - lib/rggen/systemverilog/ral/bit_field/type/rwc_rws.rb
49
+ - lib/rggen/systemverilog/ral/bit_field/type/rwc_rwhw_rws.rb
50
50
  - lib/rggen/systemverilog/ral/bit_field/type/rwe_rwl.rb
51
51
  - lib/rggen/systemverilog/ral/feature.rb
52
52
  - lib/rggen/systemverilog/ral/register/type.rb
@@ -71,8 +71,8 @@ files:
71
71
  - lib/rggen/systemverilog/rtl/bit_field/type/ro_rotrg.rb
72
72
  - lib/rggen/systemverilog/rtl/bit_field/type/rof.erb
73
73
  - lib/rggen/systemverilog/rtl/bit_field/type/rof.rb
74
- - lib/rggen/systemverilog/rtl/bit_field/type/rol.erb
75
- - lib/rggen/systemverilog/rtl/bit_field/type/rol.rb
74
+ - lib/rggen/systemverilog/rtl/bit_field/type/rohw.erb
75
+ - lib/rggen/systemverilog/rtl/bit_field/type/rohw.rb
76
76
  - lib/rggen/systemverilog/rtl/bit_field/type/row0trg_row1trg.erb
77
77
  - lib/rggen/systemverilog/rtl/bit_field/type/row0trg_row1trg.rb
78
78
  - lib/rggen/systemverilog/rtl/bit_field/type/rowo_rowotrg.erb
@@ -85,6 +85,8 @@ files:
85
85
  - lib/rggen/systemverilog/rtl/bit_field/type/rwc.rb
86
86
  - lib/rggen/systemverilog/rtl/bit_field/type/rwe_rwl.erb
87
87
  - lib/rggen/systemverilog/rtl/bit_field/type/rwe_rwl.rb
88
+ - lib/rggen/systemverilog/rtl/bit_field/type/rwhw.erb
89
+ - lib/rggen/systemverilog/rtl/bit_field/type/rwhw.rb
88
90
  - lib/rggen/systemverilog/rtl/bit_field/type/rws.erb
89
91
  - lib/rggen/systemverilog/rtl/bit_field/type/rws.rb
90
92
  - lib/rggen/systemverilog/rtl/bit_field/type/w0crs_w0src_w1crs_w1src_wcrs_wsrc.erb
@@ -152,8 +154,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
154
  - !ruby/object:Gem::Version
153
155
  version: '0'
154
156
  requirements: []
155
- rubygems_version: 3.5.3
157
+ rubygems_version: 3.5.16
156
158
  signing_key:
157
159
  specification_version: 4
158
- summary: rggen-systemverilog-0.32.0
160
+ summary: rggen-systemverilog-0.33.1
159
161
  test_files: []
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RgGen.define_list_item_feature(:bit_field, :type, [:rof, :rol]) do
4
- sv_ral { access 'RO' }
5
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RgGen.define_list_item_feature(:bit_field, :type, [:rwc, :rws]) do
4
- sv_ral { access 'RW' }
5
- end