rggen-systemverilog 0.33.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3d95e17a462a9401886ea4a6923921ad4ba9aa698c2bd9133f7b513110c120b
|
4
|
+
data.tar.gz: 4d80681f90d4cb38ca782821fe9820fa6e9c4cbcc3b723c63a1ec75d87c2d35d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38bf92bf7e6f0d27cb99ed6a6d2e3753f3bf60ff199fc876e8f99875bbdbf0da665b5f2c0dae40c44510acee6555487c56a1381ac3264f00ce6ae4f2731e34a4
|
7
|
+
data.tar.gz: d7f396a29d716c6f854bbeb2fb5c331eb67ffb85143f764b9e62a3c8f89c388367a56ef54c6a31311129229859f37452b5bee51457a76db4272360898f744ff7
|
@@ -8,26 +8,55 @@ module RgGen
|
|
8
8
|
|
9
9
|
def index_fields
|
10
10
|
@index_fields ||=
|
11
|
-
register
|
11
|
+
register
|
12
|
+
.collect_index_fields(register_block.bit_fields)
|
12
13
|
end
|
13
14
|
|
14
|
-
def
|
15
|
-
|
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
|
27
|
+
array_index_value(loop_variables.shift, field.width)
|
23
28
|
else
|
24
|
-
|
29
|
+
fixed_index_value(entry.value, field.width)
|
25
30
|
end
|
26
31
|
end
|
27
32
|
end
|
28
33
|
|
29
|
-
def
|
30
|
-
|
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
|
-
.
|
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
|
-
.
|
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 :
|
8
|
+
logic :indirect_match, { width: index_match_width }
|
9
9
|
end
|
10
10
|
|
11
11
|
main_code :register do |code|
|
12
|
-
code
|
12
|
+
indirect_index_matches(code)
|
13
13
|
code << process_template
|
14
14
|
end
|
15
15
|
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.33.
|
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: 2024-
|
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
|
|
@@ -154,8 +154,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
- !ruby/object:Gem::Version
|
155
155
|
version: '0'
|
156
156
|
requirements: []
|
157
|
-
rubygems_version: 3.5.
|
157
|
+
rubygems_version: 3.5.16
|
158
158
|
signing_key:
|
159
159
|
specification_version: 4
|
160
|
-
summary: rggen-systemverilog-0.33.
|
160
|
+
summary: rggen-systemverilog-0.33.1
|
161
161
|
test_files: []
|