rggen-systemverilog 0.26.0 → 0.26.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: 6093eea4b475c6dddb948d2b0bb5053705cc64f38a5603c925d0ab04029e0978
4
- data.tar.gz: e2c07ce7eb68f15c9e4d2dbd0f83d7a74dbcb92ba292ba1fae8830c4ca147cb0
3
+ metadata.gz: 37662ce6857eb9237c7747e58b21d0dad5230a4879f88800b772cff8c5bb5b17
4
+ data.tar.gz: f9334ba40018bf2c057f5e9dfb97611958141ca19d776b95495cdf5ea1c18e64
5
5
  SHA512:
6
- metadata.gz: 2d460b5eecdc50fbae20514b7f814fd98774b6dcb05ab72df2936301a9218870609eb1236b13f9a305d1882f001360eb84537b083c5323d2fde475fe170ffaed
7
- data.tar.gz: 4ea6fb47189ec224f30701198d9a51de4ab68cbc2a601b048ad23b1edcda1308214218fd456550c2e8d085c3575ab2aeec7e58c43d6337dba81111c0e8f0b07f
6
+ metadata.gz: 14a6a6540f7ed433b53e48692942dc01ff684c1ad85497ce245c9d92cb3a75b2905ede3b81987e14596e7e5887b90bb8aed8dd7dd02deefbcce549eb5d5eb605
7
+ data.tar.gz: c62ebc166dafb2ef593a2b27f5bac1897071078d6ccb68f666a61d8bb793bcd57f10063b894426b987573907a0e85f85825bb1de58fb9566f4a95cd59ca2805f
@@ -36,10 +36,6 @@ RgGen.define_simple_feature(:bit_field, :sv_rtl_top) do
36
36
  end
37
37
  end
38
38
 
39
- pre_code :bit_field do |code|
40
- code << bit_field_if_connection << nl
41
- end
42
-
43
39
  def value(offsets = nil, width = nil)
44
40
  value_lsb = bit_field.lsb(offsets&.last || local_index)
45
41
  value_width = width || bit_field.width
@@ -113,17 +109,5 @@ RgGen.define_simple_feature(:bit_field, :sv_rtl_top) do
113
109
  def body_code(code)
114
110
  bit_field.generate_code(code, :bit_field, :top_down)
115
111
  end
116
-
117
- def bit_field_if_connection
118
- macro_call(
119
- 'rggen_connect_bit_field_if',
120
- [
121
- register.bit_field_if,
122
- bit_field.bit_field_sub_if,
123
- bit_field.lsb(local_index),
124
- bit_field.width
125
- ]
126
- )
127
- end
128
112
  end
129
113
  end
@@ -3,6 +3,10 @@
3
3
  RgGen.define_list_feature(:bit_field, :type) do
4
4
  sv_rtl do
5
5
  base_feature do
6
+ pre_code :bit_field do |code|
7
+ code << bit_field_if_connection << nl
8
+ end
9
+
6
10
  private
7
11
 
8
12
  def array_port_format
@@ -17,6 +21,10 @@ RgGen.define_list_feature(:bit_field, :type) do
17
21
  bit_field.width
18
22
  end
19
23
 
24
+ def lsb
25
+ bit_field.lsb(bit_field.local_index)
26
+ end
27
+
20
28
  def clock
21
29
  register_block.clock
22
30
  end
@@ -52,6 +60,13 @@ RgGen.define_list_feature(:bit_field, :type) do
52
60
  def loop_variables
53
61
  bit_field.loop_variables
54
62
  end
63
+
64
+ def bit_field_if_connection
65
+ macro_call(
66
+ 'rggen_connect_bit_field_if',
67
+ [register.bit_field_if, bit_field_if, lsb, width]
68
+ )
69
+ end
55
70
  end
56
71
 
57
72
  factory do
@@ -5,7 +5,6 @@ rggen_default_register #(
5
5
  .OFFSET_ADDRESS (<%= offset_address %>),
6
6
  .BUS_WIDTH (<%= bus_width %>),
7
7
  .DATA_WIDTH (<%= width %>),
8
- .VALID_BITS (<%= valid_bits %>),
9
8
  .REGISTER_INDEX (<%= register_index %>)
10
9
  ) u_register (
11
10
  .i_clk (<%= register_block.clock %>),
@@ -5,7 +5,6 @@ rggen_indirect_register #(
5
5
  .OFFSET_ADDRESS (<%= offset_address %>),
6
6
  .BUS_WIDTH (<%= bus_width %>),
7
7
  .DATA_WIDTH (<%= width %>),
8
- .VALID_BITS (<%= valid_bits %>),
9
8
  .INDIRECT_INDEX_WIDTH (<%= index_width %>),
10
9
  .INDIRECT_INDEX_VALUE (<%= concat(index_values) %>)
11
10
  ) u_register (
@@ -5,6 +5,11 @@ RgGen.define_list_feature(:register, :type) do
5
5
  base_feature do
6
6
  include RgGen::SystemVerilog::RTL::RegisterType
7
7
 
8
+ pre_code :register do |code|
9
+ register.bit_fields.empty? ||
10
+ (code << tie_off_unused_signals << nl)
11
+ end
12
+
8
13
  private
9
14
 
10
15
  def register_if
@@ -14,6 +19,13 @@ RgGen.define_list_feature(:register, :type) do
14
19
  def bit_field_if
15
20
  register.bit_field_if
16
21
  end
22
+
23
+ def tie_off_unused_signals
24
+ macro_call(
25
+ 'rggen_tie_off_unused_signals',
26
+ [width, valid_bits, bit_field_if]
27
+ )
28
+ end
17
29
  end
18
30
 
19
31
  default_feature do
@@ -7,3 +7,15 @@
7
7
  assign RIF.read_data[LSB+:WIDTH] = FIF.read_data; \
8
8
  assign RIF.value[LSB+:WIDTH] = FIF.value;
9
9
  `endif
10
+ `ifndef rggen_tie_off_unused_signals
11
+ `define rggen_tie_off_unused_signals(WIDTH, VALID_BITS, RIF) \
12
+ if (1) begin : __g_tie_off \
13
+ genvar __i; \
14
+ for (__i = 0;__i < WIDTH;++__i) begin : g \
15
+ if (!(((VALID_BITS) >> __i) & 1'b1)) begin : g \
16
+ assign RIF.read_data[__i] = 1'b0; \
17
+ assign RIF.value[__i] = 1'b0; \
18
+ end \
19
+ end \
20
+ end
21
+ `endif
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RgGen
4
4
  module SystemVerilog
5
- VERSION = '0.26.0'
5
+ VERSION = '0.26.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.26.0
4
+ version: 0.26.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: 2022-03-25 00:00:00.000000000 Z
11
+ date: 2022-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -158,5 +158,5 @@ requirements: []
158
158
  rubygems_version: 3.3.3
159
159
  signing_key:
160
160
  specification_version: 4
161
- summary: rggen-systemverilog-0.26.0
161
+ summary: rggen-systemverilog-0.26.1
162
162
  test_files: []