rggen-veryl 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +4 -4
- data/lib/rggen/veryl/bit_field/type/custom.rb +8 -16
- data/lib/rggen/veryl/bit_field/type/rc_w0c_w1c_wc_woc.rb +3 -6
- data/lib/rggen/veryl/bit_field/type/ro_rotrg.rb +2 -4
- data/lib/rggen/veryl/bit_field/type/rohw.rb +3 -4
- data/lib/rggen/veryl/bit_field/type/row0trg_row1trg.rb +2 -4
- data/lib/rggen/veryl/bit_field/type/rowo_rowotrg.rb +4 -8
- data/lib/rggen/veryl/bit_field/type/rs_w0s_w1s_ws_wos.rb +2 -4
- data/lib/rggen/veryl/bit_field/type/rw_rwtrg_w1.rb +3 -6
- data/lib/rggen/veryl/bit_field/type/rwc.rb +2 -4
- data/lib/rggen/veryl/bit_field/type/rwe_rwl.rb +2 -4
- data/lib/rggen/veryl/bit_field/type/rwhw.rb +3 -6
- data/lib/rggen/veryl/bit_field/type/rws.rb +2 -4
- data/lib/rggen/veryl/bit_field/type/w0crs_w0src_w1crs_w1src_wcrs_wsrc.rb +1 -2
- data/lib/rggen/veryl/bit_field/type/w0t_w1t.rb +1 -2
- data/lib/rggen/veryl/bit_field/type/w0trg_w1trg.rb +1 -2
- data/lib/rggen/veryl/bit_field/type/wo_wo1_wotrg.rb +2 -4
- data/lib/rggen/veryl/bit_field/type/wrc_wrs.rb +1 -2
- data/lib/rggen/veryl/feature.rb +13 -13
- data/lib/rggen/veryl/register/type/external.rb +1 -1
- data/lib/rggen/veryl/register_block/protocol/native.erb +18 -0
- data/lib/rggen/veryl/register_block/protocol/native.rb +17 -0
- data/lib/rggen/veryl/register_block/protocol.rb +3 -3
- data/lib/rggen/veryl/register_block/veryl_top.rb +2 -2
- data/lib/rggen/veryl/register_map/keyword_checker.rb +35 -0
- data/lib/rggen/veryl/register_map/name.rb +10 -0
- data/lib/rggen/veryl/utility.rb +4 -4
- data/lib/rggen/veryl/version.rb +1 -1
- data/lib/rggen/veryl.rb +7 -0
- metadata +12 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb3a5d509437cc431d3eff41138ff6869d2728548e295c60e1124bf808fcacaf
|
4
|
+
data.tar.gz: ae23f0f755feec61cc0b737f64d421bb0a7e33cbf1121cbba6b1672127ae816d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d2f08301a71dd2d708ea2055cf5cee06d0d250877f6b1d1f3c50bf848e607e3571471a23da885a87c6fa856b172f51b4580be4a3ed6e375086a8f618047327e
|
7
|
+
data.tar.gz: f38176b195d36a6ff56b01db642ceede79579a24dd7e9c8a5721d66f438c326bc5706b0e37465e21252d0238e0190f03fdeae1e26b3ba335827f252179f310fd
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
[![Gem Version](https://badge.fury.io/rb/rggen-veryl.svg)](https://badge.fury.io/rb/rggen-veryl)
|
2
2
|
[![CI](https://github.com/rggen/rggen-veryl/actions/workflows/ci.yml/badge.svg)](https://github.com/rggen/rggen-veryl/actions/workflows/ci.yml)
|
3
|
-
[![Maintainability](https://api.codeclimate.com/v1/badges/
|
3
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/6f93e66d558f43d0693e/maintainability)](https://codeclimate.com/github/rggen/rggen-veryl/maintainability)
|
4
4
|
[![codecov](https://codecov.io/gh/rggen/rggen-veryl/graph/badge.svg?token=iYlaqhSjat)](https://codecov.io/gh/rggen/rggen-veryl)
|
5
5
|
[![Gitter](https://badges.gitter.im/rggen/rggen.svg)](https://gitter.im/rggen/rggen?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
6
6
|
|
@@ -43,7 +43,7 @@ You need to add this repository to the `[dependencies]` section in your `Veryl.t
|
|
43
43
|
|
44
44
|
```toml
|
45
45
|
[dependencies]
|
46
|
-
"https://github.com/rggen/rggen-veryl-rtl" = "0.
|
46
|
+
"https://github.com/rggen/rggen-veryl-rtl" = "0.2.0"
|
47
47
|
```
|
48
48
|
|
49
49
|
## Contact
|
@@ -58,8 +58,8 @@ Feedbacks, bus reports, questions and etc. are welcome! You can post them by usi
|
|
58
58
|
|
59
59
|
## Copyright & License
|
60
60
|
|
61
|
-
Copyright © 2024 Taichi Ishitani. RgGen::Veryl is licensed under the [MIT License](https://opensource.org/licenses/MIT), see [LICENSE](LICENSE) for futher details.
|
61
|
+
Copyright © 2024-2025 Taichi Ishitani. RgGen::Veryl is licensed under the [MIT License](https://opensource.org/licenses/MIT), see [LICENSE](LICENSE) for futher details.
|
62
62
|
|
63
63
|
## Code of Conduct
|
64
64
|
|
65
|
-
Everyone interacting in the RgGen::Veryl project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
65
|
+
Everyone interacting in the RgGen::Veryl project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/rggen/rggen-veryl/blob/master/CODE_OF_CONDUCT.md).
|
@@ -5,47 +5,39 @@ RgGen.define_list_item_feature(:bit_field, :type, :custom) do
|
|
5
5
|
build do
|
6
6
|
if external_read_data?
|
7
7
|
input :value_in, {
|
8
|
-
name: "i_#{full_name}",
|
9
|
-
width: width, array_size: array_size
|
8
|
+
name: "i_#{full_name}", width:, array_size:
|
10
9
|
}
|
11
10
|
else
|
12
11
|
output :value_out, {
|
13
|
-
name: "o_#{full_name}",
|
14
|
-
width: width, array_size: array_size
|
12
|
+
name: "o_#{full_name}", width:, array_size:
|
15
13
|
}
|
16
14
|
end
|
17
15
|
if bit_field.hw_write?
|
18
16
|
input :hw_write_enable, {
|
19
|
-
name: "i_#{full_name}_hw_write_enable",
|
20
|
-
width: 1, array_size: array_size
|
17
|
+
name: "i_#{full_name}_hw_write_enable", width: 1, array_size:
|
21
18
|
}
|
22
19
|
input :hw_write_data, {
|
23
|
-
name: "i_#{full_name}_hw_write_data",
|
24
|
-
width: width, array_size: array_size
|
20
|
+
name: "i_#{full_name}_hw_write_data", width:, array_size:
|
25
21
|
}
|
26
22
|
end
|
27
23
|
if bit_field.hw_set?
|
28
24
|
input :hw_set, {
|
29
|
-
name: "i_#{full_name}_hw_set",
|
30
|
-
width: width, array_size: array_size
|
25
|
+
name: "i_#{full_name}_hw_set", width:, array_size:
|
31
26
|
}
|
32
27
|
end
|
33
28
|
if bit_field.hw_clear?
|
34
29
|
input :hw_clear, {
|
35
|
-
name: "i_#{full_name}_hw_clear",
|
36
|
-
width: width, array_size: array_size
|
30
|
+
name: "i_#{full_name}_hw_clear", width:, array_size:
|
37
31
|
}
|
38
32
|
end
|
39
33
|
if bit_field.write_trigger?
|
40
34
|
output :write_trigger, {
|
41
|
-
name: "o_#{full_name}_write_trigger",
|
42
|
-
width: 1, array_size: array_size
|
35
|
+
name: "o_#{full_name}_write_trigger", width: 1, array_size:
|
43
36
|
}
|
44
37
|
end
|
45
38
|
if bit_field.read_trigger?
|
46
39
|
output :read_trigger, {
|
47
|
-
name: "o_#{full_name}_read_trigger",
|
48
|
-
width: 1, array_size: array_size
|
40
|
+
name: "o_#{full_name}_read_trigger", width: 1, array_size:
|
49
41
|
}
|
50
42
|
end
|
51
43
|
end
|
@@ -4,17 +4,14 @@ RgGen.define_list_item_feature(:bit_field, :type, [:rc, :w0c, :w1c, :wc, :woc])
|
|
4
4
|
veryl do
|
5
5
|
build do
|
6
6
|
input :set, {
|
7
|
-
name: "i_#{full_name}_set",
|
8
|
-
width: width, array_size: array_size
|
7
|
+
name: "i_#{full_name}_set", width:, array_size:
|
9
8
|
}
|
10
9
|
output :value_out, {
|
11
|
-
name: "o_#{full_name}",
|
12
|
-
width: width, array_size: array_size
|
10
|
+
name: "o_#{full_name}", width:, array_size:
|
13
11
|
}
|
14
12
|
if bit_field.reference?
|
15
13
|
output :value_unmasked, {
|
16
|
-
name: "o_#{full_name}_unmasked",
|
17
|
-
width: width, array_size: array_size
|
14
|
+
name: "o_#{full_name}_unmasked", width:, array_size:
|
18
15
|
}
|
19
16
|
end
|
20
17
|
end
|
@@ -5,14 +5,12 @@ RgGen.define_list_item_feature(:bit_field, :type, [:ro, :rotrg]) do
|
|
5
5
|
build do
|
6
6
|
unless bit_field.reference?
|
7
7
|
input :value_in, {
|
8
|
-
name: "i_#{full_name}",
|
9
|
-
width: width, array_size: array_size
|
8
|
+
name: "i_#{full_name}", width:, array_size:
|
10
9
|
}
|
11
10
|
end
|
12
11
|
if rotrg?
|
13
12
|
output :read_trigger, {
|
14
|
-
name: "o_#{full_name}_read_trigger",
|
15
|
-
width: 1, array_size: array_size
|
13
|
+
name: "o_#{full_name}_read_trigger", width: 1, array_size:
|
16
14
|
}
|
17
15
|
end
|
18
16
|
end
|
@@ -5,15 +5,14 @@ RgGen.define_list_item_feature(:bit_field, :type, :rohw) do
|
|
5
5
|
build do
|
6
6
|
unless bit_field.reference?
|
7
7
|
input :valid, {
|
8
|
-
name: "i_#{full_name}_valid",
|
9
|
-
width: 1, array_size: array_size
|
8
|
+
name: "i_#{full_name}_valid", width: 1, array_size:
|
10
9
|
}
|
11
10
|
end
|
12
11
|
input :value_in, {
|
13
|
-
name: "i_#{full_name}", width
|
12
|
+
name: "i_#{full_name}", width:, array_size:
|
14
13
|
}
|
15
14
|
output :value_out, {
|
16
|
-
name: "o_#{full_name}", width
|
15
|
+
name: "o_#{full_name}", width:, array_size:
|
17
16
|
}
|
18
17
|
end
|
19
18
|
|
@@ -5,13 +5,11 @@ RgGen.define_list_item_feature(:bit_field, :type, [:row0trg, :row1trg]) do
|
|
5
5
|
build do
|
6
6
|
unless bit_field.reference?
|
7
7
|
input :value_in, {
|
8
|
-
name: "i_#{full_name}",
|
9
|
-
width: width, array_size: array_size
|
8
|
+
name: "i_#{full_name}", width:, array_size:
|
10
9
|
}
|
11
10
|
end
|
12
11
|
output :trigger, {
|
13
|
-
name: "o_#{full_name}_trigger",
|
14
|
-
width: width, array_size: array_size
|
12
|
+
name: "o_#{full_name}_trigger", width:, array_size:
|
15
13
|
}
|
16
14
|
end
|
17
15
|
|
@@ -4,23 +4,19 @@ RgGen.define_list_item_feature(:bit_field, :type, [:rowo, :rowotrg]) do
|
|
4
4
|
veryl do
|
5
5
|
build do
|
6
6
|
output :value_out, {
|
7
|
-
name: "o_#{full_name}",
|
8
|
-
width: width, array_size: array_size
|
7
|
+
name: "o_#{full_name}", width:, array_size:
|
9
8
|
}
|
10
9
|
unless bit_field.reference?
|
11
10
|
input :value_in, {
|
12
|
-
name: "i_#{full_name}",
|
13
|
-
width: width, array_size: array_size
|
11
|
+
name: "i_#{full_name}", width:, array_size:
|
14
12
|
}
|
15
13
|
end
|
16
14
|
if rowotrg?
|
17
15
|
output :write_trigger, {
|
18
|
-
name: "o_#{full_name}_write_trigger",
|
19
|
-
width: 1, array_size: array_size
|
16
|
+
name: "o_#{full_name}_write_trigger", width: 1, array_size:
|
20
17
|
}
|
21
18
|
output :read_trigger, {
|
22
|
-
name: "o_#{full_name}_read_trigger",
|
23
|
-
width: 1, array_size: array_size
|
19
|
+
name: "o_#{full_name}_read_trigger", width: 1, array_size:
|
24
20
|
}
|
25
21
|
end
|
26
22
|
end
|
@@ -4,12 +4,10 @@ RgGen.define_list_item_feature(:bit_field, :type, [:rs, :w0s, :w1s, :ws, :wos])
|
|
4
4
|
veryl do
|
5
5
|
build do
|
6
6
|
input :clear, {
|
7
|
-
name: "i_#{full_name}_clear",
|
8
|
-
width: width, array_size: array_size
|
7
|
+
name: "i_#{full_name}_clear", width:, array_size:
|
9
8
|
}
|
10
9
|
output :value_out, {
|
11
|
-
name: "o_#{full_name}",
|
12
|
-
width: width, array_size: array_size
|
10
|
+
name: "o_#{full_name}", width:, array_size:
|
13
11
|
}
|
14
12
|
end
|
15
13
|
|
@@ -4,17 +4,14 @@ RgGen.define_list_item_feature(:bit_field, :type, [:rw, :rwtrg, :w1]) do
|
|
4
4
|
veryl do
|
5
5
|
build do
|
6
6
|
output :value_out, {
|
7
|
-
name: "o_#{full_name}",
|
8
|
-
width: width, array_size: array_size
|
7
|
+
name: "o_#{full_name}", width:, array_size:
|
9
8
|
}
|
10
9
|
if rwtrg?
|
11
10
|
output :write_trigger, {
|
12
|
-
name: "o_#{full_name}_write_trigger",
|
13
|
-
width: 1, array_size: array_size
|
11
|
+
name: "o_#{full_name}_write_trigger", width: 1, array_size:
|
14
12
|
}
|
15
13
|
output :read_trigger, {
|
16
|
-
name: "o_#{full_name}_read_trigger",
|
17
|
-
width: 1, array_size: array_size
|
14
|
+
name: "o_#{full_name}_read_trigger", width: 1, array_size:
|
18
15
|
}
|
19
16
|
end
|
20
17
|
end
|
@@ -5,13 +5,11 @@ RgGen.define_list_item_feature(:bit_field, :type, :rwc) do
|
|
5
5
|
build do
|
6
6
|
unless bit_field.reference?
|
7
7
|
input :clear, {
|
8
|
-
name: "i_#{full_name}_clear",
|
9
|
-
width: 1, array_size: array_size
|
8
|
+
name: "i_#{full_name}_clear", width: 1, array_size:
|
10
9
|
}
|
11
10
|
end
|
12
11
|
output :value_out, {
|
13
|
-
name: "o_#{full_name}",
|
14
|
-
width: width, array_size: array_size
|
12
|
+
name: "o_#{full_name}", width:, array_size:
|
15
13
|
}
|
16
14
|
end
|
17
15
|
|
@@ -5,13 +5,11 @@ RgGen.define_list_item_feature(:bit_field, :type, [:rwe, :rwl]) do
|
|
5
5
|
build do
|
6
6
|
unless bit_field.reference?
|
7
7
|
input :control, {
|
8
|
-
name: "i_#{full_name}_#{enable_or_lock}",
|
9
|
-
width: 1, array_size: array_size
|
8
|
+
name: "i_#{full_name}_#{enable_or_lock}", width: 1, array_size:
|
10
9
|
}
|
11
10
|
end
|
12
11
|
output :value_out, {
|
13
|
-
name: "o_#{full_name}",
|
14
|
-
width: width, array_size: array_size
|
12
|
+
name: "o_#{full_name}", width:, array_size:
|
15
13
|
}
|
16
14
|
end
|
17
15
|
|
@@ -5,17 +5,14 @@ RgGen.define_list_item_feature(:bit_field, :type, :rwhw) do
|
|
5
5
|
build do
|
6
6
|
unless bit_field.reference?
|
7
7
|
input :valid, {
|
8
|
-
name: "i_#{full_name}_valid",
|
9
|
-
width: 1, array_size: array_size
|
8
|
+
name: "i_#{full_name}_valid", width: 1, array_size:
|
10
9
|
}
|
11
10
|
end
|
12
11
|
input :value_in, {
|
13
|
-
name: "i_#{full_name}",
|
14
|
-
width: width, array_size: array_size
|
12
|
+
name: "i_#{full_name}", width:, array_size:
|
15
13
|
}
|
16
14
|
output :value_out, {
|
17
|
-
name: "o_#{full_name}",
|
18
|
-
width: width, array_size: array_size
|
15
|
+
name: "o_#{full_name}", width:, array_size:
|
19
16
|
}
|
20
17
|
end
|
21
18
|
|
@@ -5,13 +5,11 @@ RgGen.define_list_item_feature(:bit_field, :type, :rws) do
|
|
5
5
|
build do
|
6
6
|
unless bit_field.reference?
|
7
7
|
input :set, {
|
8
|
-
name: "i_#{full_name}_set",
|
9
|
-
width: 1, array_size: array_size
|
8
|
+
name: "i_#{full_name}_set", width: 1, array_size:
|
10
9
|
}
|
11
10
|
end
|
12
11
|
output :value_out, {
|
13
|
-
name: "o_#{full_name}",
|
14
|
-
width: width, array_size: array_size
|
12
|
+
name: "o_#{full_name}", width:, array_size:
|
15
13
|
}
|
16
14
|
end
|
17
15
|
|
@@ -4,13 +4,11 @@ RgGen.define_list_item_feature(:bit_field, :type, [:wo, :wo1, :wotrg]) do
|
|
4
4
|
veryl do
|
5
5
|
build do
|
6
6
|
output :value_out, {
|
7
|
-
name: "o_#{full_name}",
|
8
|
-
width: width, array_size: array_size
|
7
|
+
name: "o_#{full_name}", width:, array_size:
|
9
8
|
}
|
10
9
|
if wotrg?
|
11
10
|
output :write_trigger, {
|
12
|
-
name: "o_#{full_name}_write_trigger",
|
13
|
-
width: 1, array_size: array_size
|
11
|
+
name: "o_#{full_name}_write_trigger", width: 1, array_size:
|
14
12
|
}
|
15
13
|
end
|
16
14
|
end
|
data/lib/rggen/veryl/feature.rb
CHANGED
@@ -7,31 +7,31 @@ module RgGen
|
|
7
7
|
|
8
8
|
private
|
9
9
|
|
10
|
-
def create_if_instance(_, attributes, &
|
11
|
-
InterfaceInstance.new(attributes, &
|
10
|
+
def create_if_instance(_, attributes, &)
|
11
|
+
InterfaceInstance.new(attributes, &)
|
12
12
|
end
|
13
13
|
|
14
|
-
def create_port(direction, attributes, &
|
14
|
+
def create_port(direction, attributes, &)
|
15
15
|
attributes =
|
16
|
-
{ direction:
|
16
|
+
{ direction: }
|
17
17
|
.merge(attributes)
|
18
|
-
DataObject.new(:port, attributes, &
|
18
|
+
DataObject.new(:port, attributes, &)
|
19
19
|
end
|
20
20
|
|
21
|
-
def create_modport(_, attributes, &
|
22
|
-
Modport.new(attributes, &
|
21
|
+
def create_modport(_, attributes, &)
|
22
|
+
Modport.new(attributes, &)
|
23
23
|
end
|
24
24
|
|
25
|
-
def create_param(_, attributes, &
|
26
|
-
DataObject.new(:param, attributes, &
|
25
|
+
def create_param(_, attributes, &)
|
26
|
+
DataObject.new(:param, attributes, &)
|
27
27
|
end
|
28
28
|
|
29
|
-
def create_const(_, attributes, &
|
30
|
-
DataObject.new(:const, attributes, &
|
29
|
+
def create_const(_, attributes, &)
|
30
|
+
DataObject.new(:const, attributes, &)
|
31
31
|
end
|
32
32
|
|
33
|
-
def create_var(_, attributes, &
|
34
|
-
DataObject.new(:var, attributes, &
|
33
|
+
def create_var(_, attributes, &)
|
34
|
+
DataObject.new(:var, attributes, &)
|
35
35
|
end
|
36
36
|
|
37
37
|
define_entity :input, :create_port, :port, -> { register_block }
|
@@ -5,7 +5,7 @@ RgGen.define_list_item_feature(:register, :type, :external) do
|
|
5
5
|
build do
|
6
6
|
param :strobe_width, {
|
7
7
|
name: "#{register.name}_strobe_width".upcase,
|
8
|
-
type: :u32, default:
|
8
|
+
type: :u32, default: register_block.byte_width
|
9
9
|
}
|
10
10
|
modport :bus_if, {
|
11
11
|
name: "#{register.name}_bus_if",
|
@@ -0,0 +1,18 @@
|
|
1
|
+
inst u_adapter: rggen::rggen_native_adapter #(
|
2
|
+
ADDRESS_WIDTH: <%= address_width %>,
|
3
|
+
LOCAL_ADDRESS_WIDTH: <%= local_address_width %>,
|
4
|
+
BUS_WIDTH: <%= bus_width %>,
|
5
|
+
STROBE_WIDTH: <%= strobe_width %>,
|
6
|
+
REGISTERS: <%= total_registers %>,
|
7
|
+
PRE_DECODE: <%= pre_decode %>,
|
8
|
+
BASE_ADDRESS: <%= base_address %>,
|
9
|
+
BYTE_SIZE: <%= byte_size %>,
|
10
|
+
ERROR_STATUS: <%= error_status %>,
|
11
|
+
DEFAULT_READ_DATA: <%= default_read_data %>,
|
12
|
+
INSERT_SLICER: <%= insert_slicer %>
|
13
|
+
)(
|
14
|
+
i_clk: <%= register_block.clock %>,
|
15
|
+
i_rst: <%= register_block.reset %>,
|
16
|
+
csrbus_if: <%= csrbus_if %>,
|
17
|
+
register_if: <%= register_block.register_if %>
|
18
|
+
);
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RgGen.define_list_item_feature(:register_block, :protocol, :native) do
|
4
|
+
veryl do
|
5
|
+
build do
|
6
|
+
param :strobe_width, {
|
7
|
+
name: 'STROBE_WIDTH', type: :u32, default: bus_width / 8
|
8
|
+
}
|
9
|
+
modport :csrbus_if, {
|
10
|
+
name: 'csrbus_if',
|
11
|
+
interface_type: 'rggen::rggen_bus_if', modport: 'slave'
|
12
|
+
}
|
13
|
+
end
|
14
|
+
|
15
|
+
main_code :register_block, from_template: true
|
16
|
+
end
|
17
|
+
end
|
@@ -29,7 +29,7 @@ RgGen.define_list_feature(:register_block, :protocol) do
|
|
29
29
|
private
|
30
30
|
|
31
31
|
def bus_width
|
32
|
-
|
32
|
+
register_block.bus_width
|
33
33
|
end
|
34
34
|
|
35
35
|
def local_address_width
|
@@ -46,8 +46,8 @@ RgGen.define_list_feature(:register_block, :protocol) do
|
|
46
46
|
end
|
47
47
|
|
48
48
|
factory do
|
49
|
-
def target_feature_key(
|
50
|
-
|
49
|
+
def target_feature_key(_configuration, register_block)
|
50
|
+
register_block.protocol
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
@@ -8,7 +8,7 @@ RgGen.define_simple_feature(:register_block, :veryl_top) do
|
|
8
8
|
|
9
9
|
interface :register_if, {
|
10
10
|
name: 'register_if', interface_type: 'rggen::rggen_register_if',
|
11
|
-
param_values
|
11
|
+
param_values:, array_size: [total_registers], variables: ['value']
|
12
12
|
}
|
13
13
|
end
|
14
14
|
|
@@ -43,7 +43,7 @@ RgGen.define_simple_feature(:register_block, :veryl_top) do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def bus_width
|
46
|
-
|
46
|
+
register_block.bus_width
|
47
47
|
end
|
48
48
|
|
49
49
|
def packages
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RgGen
|
4
|
+
module Veryl
|
5
|
+
module RegisterMap
|
6
|
+
module KeywordChecker
|
7
|
+
VERYL_KEYWORDS = [
|
8
|
+
'always_comb', 'always_ff', 'as', 'assign', 'bit', 'break', 'case', 'clock',
|
9
|
+
'clock_negedge', 'clock_posedge', 'const', 'default', 'else', 'embed', 'enum',
|
10
|
+
'export', 'f32', 'f64', 'final', 'for', 'function', 'i32', 'i64', 'if',
|
11
|
+
'if_reset', 'import', 'in', 'include', 'initial', 'inout', 'input', 'inside',
|
12
|
+
'inst', 'interface', 'let', 'local', 'logic', 'modport', 'module', 'output',
|
13
|
+
'outside', 'package', 'param', 'proto', 'pub', 'ref', 'repeat', 'reset',
|
14
|
+
'reset_async_high', 'reset_async_low', 'reset_sync_high', 'reset_sync_low',
|
15
|
+
'return', 'signed', 'step', 'struct', 'switch', 'tri', 'type', 'u32', 'u64',
|
16
|
+
'unsafe', 'var'
|
17
|
+
].freeze
|
18
|
+
|
19
|
+
def self.included(klass)
|
20
|
+
klass.class_eval do
|
21
|
+
verify(:feature, prepend: true) do
|
22
|
+
error_condition do
|
23
|
+
@name && VERYL_KEYWORDS.include?(@name)
|
24
|
+
end
|
25
|
+
message do
|
26
|
+
layer_name = component.layer.to_s.sub('_', ' ')
|
27
|
+
"veryl keyword is not allowed for #{layer_name} name: #{@name}"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
[:register_block, :register_file, :register, :bit_field].each do |layer|
|
4
|
+
RgGen.modify_simple_feature(layer, :name) do
|
5
|
+
register_map do
|
6
|
+
include RgGen::SystemVerilog::RegisterMap::KeywordChecker
|
7
|
+
include RgGen::Veryl::RegisterMap::KeywordChecker
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
data/lib/rggen/veryl/utility.rb
CHANGED
@@ -5,15 +5,15 @@ module RgGen
|
|
5
5
|
module Utility
|
6
6
|
private
|
7
7
|
|
8
|
-
def local_scope(name, attributes = {}, &
|
8
|
+
def local_scope(name, attributes = {}, &)
|
9
9
|
LocalScope
|
10
|
-
.new(attributes.merge(name:
|
10
|
+
.new(attributes.merge(name:), &)
|
11
11
|
.to_code
|
12
12
|
end
|
13
13
|
|
14
|
-
def module_definition(name, attributes = {}, &
|
14
|
+
def module_definition(name, attributes = {}, &)
|
15
15
|
ModuleDefinition
|
16
|
-
.new(attributes.merge(name:
|
16
|
+
.new(attributes.merge(name:), &)
|
17
17
|
.to_code
|
18
18
|
end
|
19
19
|
|
data/lib/rggen/veryl/version.rb
CHANGED
data/lib/rggen/veryl.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'rggen/systemverilog/rtl'
|
3
4
|
require_relative 'veryl/version'
|
4
5
|
require_relative 'veryl/utility/data_object'
|
5
6
|
require_relative 'veryl/utility/modport'
|
@@ -10,6 +11,7 @@ require_relative 'veryl/utility'
|
|
10
11
|
require_relative 'veryl/component'
|
11
12
|
require_relative 'veryl/feature'
|
12
13
|
require_relative 'veryl/factories'
|
14
|
+
require_relative 'veryl/register_map/keyword_checker'
|
13
15
|
|
14
16
|
RgGen.setup_plugin :'rggen-veryl' do |plugin|
|
15
17
|
plugin.version RgGen::Veryl::VERSION
|
@@ -27,6 +29,7 @@ RgGen.setup_plugin :'rggen-veryl' do |plugin|
|
|
27
29
|
'veryl/register_block/protocol/apb',
|
28
30
|
'veryl/register_block/protocol/axi4lite',
|
29
31
|
'veryl/register_block/protocol/wishbone',
|
32
|
+
'veryl/register_block/protocol/native',
|
30
33
|
'veryl/register_file/veryl_top',
|
31
34
|
'veryl/register/veryl_top',
|
32
35
|
'veryl/register/type',
|
@@ -54,4 +57,8 @@ RgGen.setup_plugin :'rggen-veryl' do |plugin|
|
|
54
57
|
'veryl/bit_field/type/wo_wo1_wotrg',
|
55
58
|
'veryl/bit_field/type/wrc_wrs'
|
56
59
|
]
|
60
|
+
|
61
|
+
plugin.files [
|
62
|
+
'veryl/register_map/name'
|
63
|
+
]
|
57
64
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rggen-veryl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taichi Ishitani
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-23 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: rggen-systemverilog
|
@@ -16,14 +15,14 @@ dependencies:
|
|
16
15
|
requirements:
|
17
16
|
- - ">="
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
18
|
+
version: 0.34.0
|
20
19
|
type: :runtime
|
21
20
|
prerelease: false
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
23
22
|
requirements:
|
24
23
|
- - ">="
|
25
24
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
25
|
+
version: 0.34.0
|
27
26
|
description: Veryl writer plugin for RgGen
|
28
27
|
email:
|
29
28
|
- rggen@googlegroups.com
|
@@ -91,10 +90,14 @@ files:
|
|
91
90
|
- lib/rggen/veryl/register_block/protocol/apb.rb
|
92
91
|
- lib/rggen/veryl/register_block/protocol/axi4lite.erb
|
93
92
|
- lib/rggen/veryl/register_block/protocol/axi4lite.rb
|
93
|
+
- lib/rggen/veryl/register_block/protocol/native.erb
|
94
|
+
- lib/rggen/veryl/register_block/protocol/native.rb
|
94
95
|
- lib/rggen/veryl/register_block/protocol/wishbone.erb
|
95
96
|
- lib/rggen/veryl/register_block/protocol/wishbone.rb
|
96
97
|
- lib/rggen/veryl/register_block/veryl_top.rb
|
97
98
|
- lib/rggen/veryl/register_file/veryl_top.rb
|
99
|
+
- lib/rggen/veryl/register_map/keyword_checker.rb
|
100
|
+
- lib/rggen/veryl/register_map/name.rb
|
98
101
|
- lib/rggen/veryl/utility.rb
|
99
102
|
- lib/rggen/veryl/utility/data_object.rb
|
100
103
|
- lib/rggen/veryl/utility/interface_instance.rb
|
@@ -109,9 +112,8 @@ metadata:
|
|
109
112
|
bug_tracker_uri: https://github.com/rggen/rggen/issues
|
110
113
|
mailing_list_uri: https://groups.google.com/d/forum/rggen
|
111
114
|
rubygems_mfa_required: 'true'
|
112
|
-
source_code_uri: https://github.com/rggen/rggen-
|
115
|
+
source_code_uri: https://github.com/rggen/rggen-veryl
|
113
116
|
wiki_uri: https://github.com/rggen/rggen/wiki
|
114
|
-
post_install_message:
|
115
117
|
rdoc_options: []
|
116
118
|
require_paths:
|
117
119
|
- lib
|
@@ -119,15 +121,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
119
121
|
requirements:
|
120
122
|
- - ">="
|
121
123
|
- !ruby/object:Gem::Version
|
122
|
-
version: 3.
|
124
|
+
version: '3.1'
|
123
125
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
126
|
requirements:
|
125
127
|
- - ">="
|
126
128
|
- !ruby/object:Gem::Version
|
127
129
|
version: '0'
|
128
130
|
requirements: []
|
129
|
-
rubygems_version: 3.
|
130
|
-
signing_key:
|
131
|
+
rubygems_version: 3.6.2
|
131
132
|
specification_version: 4
|
132
|
-
summary: rggen-veryl-0.
|
133
|
+
summary: rggen-veryl-0.2.0
|
133
134
|
test_files: []
|