rggen-vhdl 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 +1 -1
- data/lib/rggen/vhdl/bit_field/type/rc_w0c_w1c_wc_woc.erb +2 -0
- data/lib/rggen/vhdl/bit_field/type/{ro.erb → ro_rotrg.erb} +8 -4
- data/lib/rggen/vhdl/bit_field/type/ro_rotrg.rb +34 -0
- data/lib/rggen/vhdl/bit_field/type/rof.erb +5 -2
- data/lib/rggen/vhdl/bit_field/type/rowo_rowotrg.erb +28 -0
- data/lib/rggen/vhdl/bit_field/type/rowo_rowotrg.rb +44 -0
- data/lib/rggen/vhdl/bit_field/type/rs_w0s_w1s_ws_wos.erb +2 -0
- data/lib/rggen/vhdl/bit_field/type/{rw_w1_wo_wo1.erb → rw_rwtrg_w1.erb} +4 -2
- data/lib/rggen/vhdl/bit_field/type/rw_rwtrg_w1.rb +39 -0
- data/lib/rggen/vhdl/bit_field/type/rwc.erb +2 -0
- data/lib/rggen/vhdl/bit_field/type/rwe_rwl.erb +2 -0
- data/lib/rggen/vhdl/bit_field/type/rws.erb +2 -0
- data/lib/rggen/vhdl/bit_field/type/w0crs_w0src_w1crs_w1src_wcrs_wsrc.erb +2 -0
- data/lib/rggen/vhdl/bit_field/type/w0t_w1t.erb +2 -0
- data/lib/rggen/vhdl/bit_field/type/wo_wo1_wotrg.erb +29 -0
- data/lib/rggen/vhdl/bit_field/type/wo_wo1_wotrg.rb +32 -0
- data/lib/rggen/vhdl/bit_field/type/wrc_wrs.erb +2 -0
- data/lib/rggen/vhdl/feature.rb +1 -1
- data/lib/rggen/vhdl/register/type/indirect.rb +1 -1
- data/lib/rggen/vhdl/register_block/protocol/wishbone.erb +36 -0
- data/lib/rggen/vhdl/register_block/protocol/wishbone.rb +25 -0
- data/lib/rggen/vhdl/utility.rb +2 -2
- data/lib/rggen/vhdl/version.rb +1 -1
- data/lib/rggen/vhdl.rb +5 -2
- metadata +18 -11
- data/lib/rggen/vhdl/bit_field/type/ro.rb +0 -21
- data/lib/rggen/vhdl/bit_field/type/rw_w1_wo_wo1.rb +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e152dbacccc9958c0062f2c904e83f467d5d5c1e424954b14074d1bce04d20d7
|
4
|
+
data.tar.gz: fac552a7d2706f89903fdcd8e7c16c9a50927ad9925b5c1a024d38f18383ec47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f749e47e3758bbabdb8992710d5192e0c0a33620c1fd8e929249f13a188f92776d6ef57828b60ce73146e4003ec707bca572173bf09d09516e6f4b50837e1be9
|
7
|
+
data.tar.gz: b1df3e81e394b417505150dc6757be37b643dba6e42406245983d08819abcaf7202f94f09bc596aa14cd86b4b356c291a59670e306bde791d8573dfe0df94e2d
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -67,7 +67,7 @@ Feedbacks, bus reports, questions and etc. are welcome! You can post them bu usi
|
|
67
67
|
|
68
68
|
## Copyright & License
|
69
69
|
|
70
|
-
Copyright © 2021 Taichi Ishitani. RgGen::VHDL is licensed under the [MIT License](https://opensource.org/licenses/MIT), see [LICENSE](LICENSE) for futher details.
|
70
|
+
Copyright © 2021 - 2022 Taichi Ishitani. RgGen::VHDL is licensed under the [MIT License](https://opensource.org/licenses/MIT), see [LICENSE](LICENSE) for futher details.
|
71
71
|
|
72
72
|
## Code of Conduct
|
73
73
|
|
@@ -16,6 +16,8 @@ u_bit_field: entity work.rggen_bit_field
|
|
16
16
|
i_sw_write_data => <%= bit_field_write_data %>,
|
17
17
|
o_sw_read_data => <%= bit_field_read_data %>,
|
18
18
|
o_sw_value => <%= bit_field_value %>,
|
19
|
+
o_write_trigger => open,
|
20
|
+
o_read_trigger => open,
|
19
21
|
i_hw_write_enable => "0",
|
20
22
|
i_hw_write_data => (others => '0'),
|
21
23
|
i_hw_set => <%= set[loop_variables] %>,
|
@@ -1,11 +1,13 @@
|
|
1
1
|
u_bit_field: entity work.rggen_bit_field
|
2
2
|
generic map (
|
3
|
-
WIDTH
|
4
|
-
STORAGE
|
3
|
+
WIDTH => <%= width %>,
|
4
|
+
STORAGE => false,
|
5
|
+
EXTERNAL_READ_DATA => true,
|
6
|
+
TRIGGER => <%= rotrg? %>
|
5
7
|
)
|
6
8
|
port map (
|
7
|
-
i_clk =>
|
8
|
-
i_rst_n =>
|
9
|
+
i_clk => <%= clock %>,
|
10
|
+
i_rst_n => <%= reset %>,
|
9
11
|
i_sw_valid => <%= bit_field_valid %>,
|
10
12
|
i_sw_read_mask => <%= bit_field_read_mask %>,
|
11
13
|
i_sw_write_enable => "0",
|
@@ -13,6 +15,8 @@ u_bit_field: entity work.rggen_bit_field
|
|
13
15
|
i_sw_write_data => <%= bit_field_write_data %>,
|
14
16
|
o_sw_read_data => <%= bit_field_read_data %>,
|
15
17
|
o_sw_value => <%= bit_field_value %>,
|
18
|
+
o_write_trigger => open,
|
19
|
+
o_read_trigger => <%= read_trigger_signal %>,
|
16
20
|
i_hw_write_enable => "0",
|
17
21
|
i_hw_write_data => (others => '0'),
|
18
22
|
i_hw_set => (others => '0'),
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RgGen.define_list_item_feature(:bit_field, :type, [:ro, :rotrg]) do
|
4
|
+
vhdl do
|
5
|
+
build do
|
6
|
+
unless bit_field.reference?
|
7
|
+
input :value_in, {
|
8
|
+
name: "i_#{full_name}", width: width, array_size: array_size
|
9
|
+
}
|
10
|
+
end
|
11
|
+
if rotrg?
|
12
|
+
output :read_trigger, {
|
13
|
+
name: "o_#{full_name}_read_trigger", width: 1, array_size: array_size
|
14
|
+
}
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
main_code :bit_field, from_template: true
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def rotrg?
|
23
|
+
bit_field.type == :rotrg
|
24
|
+
end
|
25
|
+
|
26
|
+
def read_trigger_signal
|
27
|
+
rotrg? && read_trigger[loop_variables] || 'open'
|
28
|
+
end
|
29
|
+
|
30
|
+
def reference_or_value_in
|
31
|
+
reference_bit_field || value_in[loop_variables]
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -1,7 +1,8 @@
|
|
1
1
|
u_bit_field: entity work.rggen_bit_field
|
2
2
|
generic map (
|
3
|
-
WIDTH
|
4
|
-
STORAGE
|
3
|
+
WIDTH => <%= width %>,
|
4
|
+
STORAGE => false,
|
5
|
+
EXTERNAL_READ_DATA => true
|
5
6
|
)
|
6
7
|
port map (
|
7
8
|
i_clk => '0',
|
@@ -13,6 +14,8 @@ u_bit_field: entity work.rggen_bit_field
|
|
13
14
|
i_sw_write_data => <%= bit_field_write_data %>,
|
14
15
|
o_sw_read_data => <%= bit_field_read_data %>,
|
15
16
|
o_sw_value => <%= bit_field_value %>,
|
17
|
+
o_write_trigger => open,
|
18
|
+
o_read_trigger => open,
|
16
19
|
i_hw_write_enable => "0",
|
17
20
|
i_hw_write_data => (others => '0'),
|
18
21
|
i_hw_set => (others => '0'),
|
@@ -0,0 +1,28 @@
|
|
1
|
+
u_bit_field: entity work.rggen_bit_field
|
2
|
+
generic map (
|
3
|
+
WIDTH => <%= width %>,
|
4
|
+
INITIAL_VALUE => <%= initial_value %>,
|
5
|
+
EXTERNAL_READ_DATA => true,
|
6
|
+
TRIGGER => <%= rowotrg? %>
|
7
|
+
)
|
8
|
+
port map (
|
9
|
+
i_clk => <%= clock %>,
|
10
|
+
i_rst_n => <%= reset %>,
|
11
|
+
i_sw_valid => <%= bit_field_valid %>,
|
12
|
+
i_sw_read_mask => <%= bit_field_read_mask %>,
|
13
|
+
i_sw_write_enable => "1",
|
14
|
+
i_sw_write_mask => <%= bit_field_write_mask %>,
|
15
|
+
i_sw_write_data => <%= bit_field_write_data %>,
|
16
|
+
o_sw_read_data => <%= bit_field_read_data %>,
|
17
|
+
o_sw_value => <%= bit_field_value %>,
|
18
|
+
o_write_trigger => <%= write_trigger_signal %>,
|
19
|
+
o_read_trigger => <%= read_trigger_signal %>,
|
20
|
+
i_hw_write_enable => "0",
|
21
|
+
i_hw_write_data => (others => '0'),
|
22
|
+
i_hw_set => (others => '0'),
|
23
|
+
i_hw_clear => (others => '0'),
|
24
|
+
i_value => <%= reference_or_value_in %>,
|
25
|
+
i_mask => (others => '1'),
|
26
|
+
o_value => <%= value_out[loop_variables] %>,
|
27
|
+
o_value_unmasked => open
|
28
|
+
);
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RgGen.define_list_item_feature(:bit_field, :type, [:rowo, :rowotrg]) do
|
4
|
+
vhdl do
|
5
|
+
build do
|
6
|
+
output :value_out, {
|
7
|
+
name: "o_#{full_name}", width: width, array_size: array_size
|
8
|
+
}
|
9
|
+
unless bit_field.reference?
|
10
|
+
input :value_in, {
|
11
|
+
name: "i_#{full_name}", width: width, array_size: array_size
|
12
|
+
}
|
13
|
+
end
|
14
|
+
if rowotrg?
|
15
|
+
output :write_trigger, {
|
16
|
+
name: "o_#{full_name}_write_trigger", width: 1, array_size: array_size
|
17
|
+
}
|
18
|
+
output :read_trigger, {
|
19
|
+
name: "o_#{full_name}_read_trigger", width: 1, array_size: array_size
|
20
|
+
}
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
main_code :bit_field, from_template: true
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def rowotrg?
|
29
|
+
bit_field.type == :rowotrg
|
30
|
+
end
|
31
|
+
|
32
|
+
def write_trigger_signal
|
33
|
+
rowotrg? && write_trigger[loop_variables] || 'open'
|
34
|
+
end
|
35
|
+
|
36
|
+
def read_trigger_signal
|
37
|
+
rowotrg? && read_trigger[loop_variables] || 'open'
|
38
|
+
end
|
39
|
+
|
40
|
+
def reference_or_value_in
|
41
|
+
reference_bit_field || value_in[loop_variables]
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -16,6 +16,8 @@ u_bit_field: entity work.rggen_bit_field
|
|
16
16
|
i_sw_write_data => <%= bit_field_write_data %>,
|
17
17
|
o_sw_read_data => <%= bit_field_read_data %>,
|
18
18
|
o_sw_value => <%= bit_field_value %>,
|
19
|
+
o_write_trigger => open,
|
20
|
+
o_read_trigger => open,
|
19
21
|
i_hw_write_enable => "0",
|
20
22
|
i_hw_write_data => (others => '0'),
|
21
23
|
i_hw_set => (others => '0'),
|
@@ -2,8 +2,8 @@ u_bit_field: entity work.rggen_bit_field
|
|
2
2
|
generic map (
|
3
3
|
WIDTH => <%= width %>,
|
4
4
|
INITIAL_VALUE => <%= initial_value %>,
|
5
|
-
|
6
|
-
|
5
|
+
SW_WRITE_ONCE => <%= write_once %>,
|
6
|
+
TRIGGER => <%= rwtrg? %>
|
7
7
|
)
|
8
8
|
port map (
|
9
9
|
i_clk => <%= clock %>,
|
@@ -15,6 +15,8 @@ u_bit_field: entity work.rggen_bit_field
|
|
15
15
|
i_sw_write_data => <%= bit_field_write_data %>,
|
16
16
|
o_sw_read_data => <%= bit_field_read_data %>,
|
17
17
|
o_sw_value => <%= bit_field_value %>,
|
18
|
+
o_write_trigger => <%= write_trigger_signal %>,
|
19
|
+
o_read_trigger => <%= read_trigger_signal %>,
|
18
20
|
i_hw_write_enable => "0",
|
19
21
|
i_hw_write_data => (others => '0'),
|
20
22
|
i_hw_set => (others => '0'),
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RgGen.define_list_item_feature(:bit_field, :type, [:rw, :rwtrg, :w1]) do
|
4
|
+
vhdl do
|
5
|
+
build do
|
6
|
+
output :value_out, {
|
7
|
+
name: "o_#{full_name}", width: width, array_size: array_size
|
8
|
+
}
|
9
|
+
if rwtrg?
|
10
|
+
output :write_trigger, {
|
11
|
+
name: "o_#{full_name}_write_trigger", width: 1, array_size: array_size
|
12
|
+
}
|
13
|
+
output :read_trigger, {
|
14
|
+
name: "o_#{full_name}_read_trigger", width: 1, array_size: array_size
|
15
|
+
}
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
main_code :bit_field, from_template: true
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def rwtrg?
|
24
|
+
bit_field.type == :rwtrg
|
25
|
+
end
|
26
|
+
|
27
|
+
def write_once
|
28
|
+
bit_field.type == :w1
|
29
|
+
end
|
30
|
+
|
31
|
+
def write_trigger_signal
|
32
|
+
rwtrg? && write_trigger[loop_variables] || 'open'
|
33
|
+
end
|
34
|
+
|
35
|
+
def read_trigger_signal
|
36
|
+
rwtrg? && read_trigger[loop_variables] || 'open'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -14,6 +14,8 @@ u_bit_field: entity work.rggen_bit_field
|
|
14
14
|
i_sw_write_data => <%= bit_field_write_data %>,
|
15
15
|
o_sw_read_data => <%= bit_field_read_data %>,
|
16
16
|
o_sw_value => <%= bit_field_value %>,
|
17
|
+
o_write_trigger => open,
|
18
|
+
o_read_trigger => open,
|
17
19
|
i_hw_write_enable => "0",
|
18
20
|
i_hw_write_data => (others => '0'),
|
19
21
|
i_hw_set => (others => '0'),
|
@@ -14,6 +14,8 @@ u_bit_field: entity work.rggen_bit_field
|
|
14
14
|
i_sw_write_data => <%= bit_field_write_data %>,
|
15
15
|
o_sw_read_data => <%= bit_field_read_data %>,
|
16
16
|
o_sw_value => <%= bit_field_value %>,
|
17
|
+
o_write_trigger => open,
|
18
|
+
o_read_trigger => open,
|
17
19
|
i_hw_write_enable => "0",
|
18
20
|
i_hw_write_data => (others => '0'),
|
19
21
|
i_hw_set => (others => '0'),
|
@@ -13,6 +13,8 @@ u_bit_field: entity work.rggen_bit_field
|
|
13
13
|
i_sw_write_data => <%= bit_field_write_data %>,
|
14
14
|
o_sw_read_data => <%= bit_field_read_data %>,
|
15
15
|
o_sw_value => <%= bit_field_value %>,
|
16
|
+
o_write_trigger => open,
|
17
|
+
o_read_trigger => open,
|
16
18
|
i_hw_write_enable => <%= set_signal %>,
|
17
19
|
i_hw_write_data => <%= value_in[loop_variables] %>,
|
18
20
|
i_hw_set => (others => '0'),
|
@@ -15,6 +15,8 @@ u_bit_field: entity work.rggen_bit_field
|
|
15
15
|
i_sw_write_data => <%= bit_field_write_data %>,
|
16
16
|
o_sw_read_data => <%= bit_field_read_data %>,
|
17
17
|
o_sw_value => <%= bit_field_value %>,
|
18
|
+
o_write_trigger => open,
|
19
|
+
o_read_trigger => open,
|
18
20
|
i_hw_write_enable => "0",
|
19
21
|
i_hw_write_data => (others => '0'),
|
20
22
|
i_hw_set => (others => '0'),
|
@@ -14,6 +14,8 @@ u_bit_field: entity work.rggen_bit_field
|
|
14
14
|
i_sw_write_data => <%= bit_field_write_data %>,
|
15
15
|
o_sw_read_data => <%= bit_field_read_data %>,
|
16
16
|
o_sw_value => <%= bit_field_value %>,
|
17
|
+
o_write_trigger => open,
|
18
|
+
o_read_trigger => open,
|
17
19
|
i_hw_write_enable => "0",
|
18
20
|
i_hw_write_data => (others => '0'),
|
19
21
|
i_hw_set => (others => '0'),
|
@@ -0,0 +1,29 @@
|
|
1
|
+
u_bit_field: entity work.rggen_bit_field
|
2
|
+
generic map (
|
3
|
+
WIDTH => <%= width %>,
|
4
|
+
INITIAL_VALUE => <%= initial_value %>,
|
5
|
+
SW_READ_ACTION => RGGEN_READ_NONE,
|
6
|
+
SW_WRITE_ONCE => <%= write_once %>,
|
7
|
+
TRIGGER => <%= wotrg? %>
|
8
|
+
)
|
9
|
+
port map (
|
10
|
+
i_clk => <%= clock %>,
|
11
|
+
i_rst_n => <%= reset %>,
|
12
|
+
i_sw_valid => <%= bit_field_valid %>,
|
13
|
+
i_sw_read_mask => <%= bit_field_read_mask %>,
|
14
|
+
i_sw_write_enable => "1",
|
15
|
+
i_sw_write_mask => <%= bit_field_write_mask %>,
|
16
|
+
i_sw_write_data => <%= bit_field_write_data %>,
|
17
|
+
o_sw_read_data => <%= bit_field_read_data %>,
|
18
|
+
o_sw_value => <%= bit_field_value %>,
|
19
|
+
o_write_trigger => <%= write_trigger_signal %>,
|
20
|
+
o_read_trigger => open,
|
21
|
+
i_hw_write_enable => "0",
|
22
|
+
i_hw_write_data => (others => '0'),
|
23
|
+
i_hw_set => (others => '0'),
|
24
|
+
i_hw_clear => (others => '0'),
|
25
|
+
i_value => (others => '0'),
|
26
|
+
i_mask => (others => '1'),
|
27
|
+
o_value => <%= value_out[loop_variables] %>,
|
28
|
+
o_value_unmasked => open
|
29
|
+
);
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RgGen.define_list_item_feature(:bit_field, :type, [:wo, :wo1, :wotrg]) do
|
4
|
+
vhdl do
|
5
|
+
build do
|
6
|
+
output :value_out, {
|
7
|
+
name: "o_#{full_name}", width: width, array_size: array_size
|
8
|
+
}
|
9
|
+
if wotrg?
|
10
|
+
output :write_trigger, {
|
11
|
+
name: "o_#{full_name}_write_trigger", width: 1, array_size: array_size
|
12
|
+
}
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
main_code :bit_field, from_template: true
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def wotrg?
|
21
|
+
bit_field.type == :wotrg
|
22
|
+
end
|
23
|
+
|
24
|
+
def write_once
|
25
|
+
bit_field.type == :wo1
|
26
|
+
end
|
27
|
+
|
28
|
+
def write_trigger_signal
|
29
|
+
wotrg? && write_trigger[loop_variables] || 'open'
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -14,6 +14,8 @@ u_bit_field: entity work.rggen_bit_field
|
|
14
14
|
i_sw_write_data => <%= bit_field_write_data %>,
|
15
15
|
o_sw_read_data => <%= bit_field_read_data %>,
|
16
16
|
o_sw_value => <%= bit_field_value %>,
|
17
|
+
o_write_trigger => open,
|
18
|
+
o_read_trigger => open,
|
17
19
|
i_hw_write_enable => "0",
|
18
20
|
i_hw_write_data => (others => '0'),
|
19
21
|
i_hw_set => (others => '0'),
|
data/lib/rggen/vhdl/feature.rb
CHANGED
@@ -14,7 +14,7 @@ module RgGen
|
|
14
14
|
def create_port(direction, attributes, &block)
|
15
15
|
attributes =
|
16
16
|
attributes
|
17
|
-
.merge(direction: { input: :in, output: :out}[direction])
|
17
|
+
.merge(direction: { input: :in, output: :out }[direction])
|
18
18
|
DataObject.new(:port, attributes, &block)
|
19
19
|
end
|
20
20
|
|
@@ -0,0 +1,36 @@
|
|
1
|
+
u_adapter: entity work.rggen_wishbone_adapter
|
2
|
+
generic map (
|
3
|
+
ADDRESS_WIDTH => <%= address_width %>,
|
4
|
+
LOCAL_ADDRESS_WIDTH => <%= local_address_width %>,
|
5
|
+
BUS_WIDTH => <%= bus_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
|
+
USE_STALL => <%= use_stall %>
|
12
|
+
)
|
13
|
+
port map (
|
14
|
+
i_clk => <%= register_block.clock %>,
|
15
|
+
i_rst_n => <%= register_block.reset %>,
|
16
|
+
i_wb_cyc => <%= wb_cyc %>,
|
17
|
+
i_wb_stb => <%= wb_stb %>,
|
18
|
+
o_wb_stall => <%= wb_stall %>,
|
19
|
+
i_wb_adr => <%= wb_adr %>,
|
20
|
+
i_wb_we => <%= wb_we %>,
|
21
|
+
i_wb_dat => <%= wb_dat_i %>,
|
22
|
+
i_wb_sel => <%= wb_sel %>,
|
23
|
+
o_wb_ack => <%= wb_ack %>,
|
24
|
+
o_wb_err => <%= wb_err %>,
|
25
|
+
o_wb_rty => <%= wb_rty %>,
|
26
|
+
o_wb_dat => <%= wb_dat_o %>,
|
27
|
+
o_register_valid => <%= register_block.register_valid %>,
|
28
|
+
o_register_access => <%= register_block.register_access %>,
|
29
|
+
o_register_address => <%= register_block.register_address %>,
|
30
|
+
o_register_write_data => <%= register_block.register_write_data %>,
|
31
|
+
o_register_strobe => <%= register_block.register_strobe %>,
|
32
|
+
i_register_active => <%= register_block.register_active %>,
|
33
|
+
i_register_ready => <%= register_block.register_ready %>,
|
34
|
+
i_register_status => <%= register_block.register_status %>,
|
35
|
+
i_register_read_data => <%= register_block.register_read_data %>
|
36
|
+
);
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RgGen.define_list_item_feature(:register_block, :protocol, :wishbone) do
|
4
|
+
vhdl do
|
5
|
+
build do
|
6
|
+
generic :use_stall, {
|
7
|
+
name: 'USE_STALL', type: :boolean, default: true
|
8
|
+
}
|
9
|
+
|
10
|
+
input :wb_cyc, { name: 'i_wb_cyc' }
|
11
|
+
input :wb_stb, { name: 'i_wb_stb' }
|
12
|
+
output :wb_stall, { name: 'o_wb_stall' }
|
13
|
+
input :wb_adr, { name: 'i_wb_adr', width: address_width }
|
14
|
+
input :wb_we, { name: 'i_wb_we' }
|
15
|
+
input :wb_dat_i, { name: 'i_wb_dat', width: bus_width }
|
16
|
+
input :wb_sel, { name: 'i_wb_sel', width: bus_width / 8 }
|
17
|
+
output :wb_ack, { name: 'o_wb_ack' }
|
18
|
+
output :wb_err, { name: 'o_wb_err' }
|
19
|
+
output :wb_rty, { name: 'o_wb_rty' }
|
20
|
+
output :wb_dat_o, { name: 'o_wb_dat', width: bus_width }
|
21
|
+
end
|
22
|
+
|
23
|
+
main_code :register_block, from_template: true
|
24
|
+
end
|
25
|
+
end
|
data/lib/rggen/vhdl/utility.rb
CHANGED
@@ -12,12 +12,12 @@ module RgGen
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def bin(value, width = nil)
|
15
|
-
width && format("
|
15
|
+
width && format('"%0*b"', width, value) || "'#{value[0]}'"
|
16
16
|
end
|
17
17
|
|
18
18
|
def hex(value, width)
|
19
19
|
print_width = (width + 3) / 4
|
20
|
-
format(
|
20
|
+
format('x"%0*x"', print_width, value)
|
21
21
|
end
|
22
22
|
|
23
23
|
def local_scope(scope_name, attributes = {}, &block)
|
data/lib/rggen/vhdl/version.rb
CHANGED
data/lib/rggen/vhdl.rb
CHANGED
@@ -23,16 +23,18 @@ module RgGen
|
|
23
23
|
plugin.files [
|
24
24
|
'vhdl/bit_field/type',
|
25
25
|
'vhdl/bit_field/type/rc_w0c_w1c_wc_woc',
|
26
|
-
'vhdl/bit_field/type/
|
26
|
+
'vhdl/bit_field/type/ro_rotrg',
|
27
27
|
'vhdl/bit_field/type/rof',
|
28
|
+
'vhdl/bit_field/type/rowo_rowotrg',
|
28
29
|
'vhdl/bit_field/type/rs_w0s_w1s_ws_wos',
|
29
|
-
'vhdl/bit_field/type/
|
30
|
+
'vhdl/bit_field/type/rw_rwtrg_w1',
|
30
31
|
'vhdl/bit_field/type/rwc',
|
31
32
|
'vhdl/bit_field/type/rwe_rwl',
|
32
33
|
'vhdl/bit_field/type/rws',
|
33
34
|
'vhdl/bit_field/type/w0crs_w0src_w1crs_w1src_wcrs_wsrc',
|
34
35
|
'vhdl/bit_field/type/w0t_w1t',
|
35
36
|
'vhdl/bit_field/type/w0trg_w1trg',
|
37
|
+
'vhdl/bit_field/type/wo_wo1_wotrg',
|
36
38
|
'vhdl/bit_field/type/wrc_wrs',
|
37
39
|
'vhdl/bit_field/vhdl_top',
|
38
40
|
'vhdl/register/type',
|
@@ -42,6 +44,7 @@ module RgGen
|
|
42
44
|
'vhdl/register_block/protocol',
|
43
45
|
'vhdl/register_block/protocol/apb',
|
44
46
|
'vhdl/register_block/protocol/axi4lite',
|
47
|
+
'vhdl/register_block/protocol/wishbone',
|
45
48
|
'vhdl/register_block/vhdl_top',
|
46
49
|
'vhdl/register_file/vhdl_top'
|
47
50
|
]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rggen-vhdl
|
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
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-25 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.
|
19
|
+
version: 0.26.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.
|
26
|
+
version: 0.26.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,14 +52,16 @@ files:
|
|
52
52
|
- lib/rggen/vhdl/bit_field/type.rb
|
53
53
|
- lib/rggen/vhdl/bit_field/type/rc_w0c_w1c_wc_woc.erb
|
54
54
|
- lib/rggen/vhdl/bit_field/type/rc_w0c_w1c_wc_woc.rb
|
55
|
-
- lib/rggen/vhdl/bit_field/type/
|
56
|
-
- lib/rggen/vhdl/bit_field/type/
|
55
|
+
- lib/rggen/vhdl/bit_field/type/ro_rotrg.erb
|
56
|
+
- lib/rggen/vhdl/bit_field/type/ro_rotrg.rb
|
57
57
|
- lib/rggen/vhdl/bit_field/type/rof.erb
|
58
58
|
- lib/rggen/vhdl/bit_field/type/rof.rb
|
59
|
+
- lib/rggen/vhdl/bit_field/type/rowo_rowotrg.erb
|
60
|
+
- lib/rggen/vhdl/bit_field/type/rowo_rowotrg.rb
|
59
61
|
- lib/rggen/vhdl/bit_field/type/rs_w0s_w1s_ws_wos.erb
|
60
62
|
- lib/rggen/vhdl/bit_field/type/rs_w0s_w1s_ws_wos.rb
|
61
|
-
- lib/rggen/vhdl/bit_field/type/
|
62
|
-
- lib/rggen/vhdl/bit_field/type/
|
63
|
+
- lib/rggen/vhdl/bit_field/type/rw_rwtrg_w1.erb
|
64
|
+
- lib/rggen/vhdl/bit_field/type/rw_rwtrg_w1.rb
|
63
65
|
- lib/rggen/vhdl/bit_field/type/rwc.erb
|
64
66
|
- lib/rggen/vhdl/bit_field/type/rwc.rb
|
65
67
|
- lib/rggen/vhdl/bit_field/type/rwe_rwl.erb
|
@@ -72,6 +74,8 @@ files:
|
|
72
74
|
- lib/rggen/vhdl/bit_field/type/w0t_w1t.rb
|
73
75
|
- lib/rggen/vhdl/bit_field/type/w0trg_w1trg.erb
|
74
76
|
- lib/rggen/vhdl/bit_field/type/w0trg_w1trg.rb
|
77
|
+
- lib/rggen/vhdl/bit_field/type/wo_wo1_wotrg.erb
|
78
|
+
- lib/rggen/vhdl/bit_field/type/wo_wo1_wotrg.rb
|
75
79
|
- lib/rggen/vhdl/bit_field/type/wrc_wrs.erb
|
76
80
|
- lib/rggen/vhdl/bit_field/type/wrc_wrs.rb
|
77
81
|
- lib/rggen/vhdl/bit_field/vhdl_top.rb
|
@@ -91,6 +95,8 @@ files:
|
|
91
95
|
- lib/rggen/vhdl/register_block/protocol/apb.rb
|
92
96
|
- lib/rggen/vhdl/register_block/protocol/axi4lite.erb
|
93
97
|
- lib/rggen/vhdl/register_block/protocol/axi4lite.rb
|
98
|
+
- lib/rggen/vhdl/register_block/protocol/wishbone.erb
|
99
|
+
- lib/rggen/vhdl/register_block/protocol/wishbone.rb
|
94
100
|
- lib/rggen/vhdl/register_block/vhdl_top.erb
|
95
101
|
- lib/rggen/vhdl/register_block/vhdl_top.rb
|
96
102
|
- lib/rggen/vhdl/register_file/vhdl_top.rb
|
@@ -106,6 +112,7 @@ licenses:
|
|
106
112
|
metadata:
|
107
113
|
bug_tracker_uri: https://github.com/rggen/rggen-vhdl/issues
|
108
114
|
mailing_list_uri: https://groups.google.com/d/forum/rggen
|
115
|
+
rubygems_mfa_required: 'true'
|
109
116
|
source_code_uri: https://github.com/rggen/rggen-vhdl
|
110
117
|
wiki_uri: https://github.com/rggen/rggen/wiki
|
111
118
|
post_install_message:
|
@@ -116,15 +123,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
116
123
|
requirements:
|
117
124
|
- - ">="
|
118
125
|
- !ruby/object:Gem::Version
|
119
|
-
version: 2.
|
126
|
+
version: 2.6.0
|
120
127
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
128
|
requirements:
|
122
129
|
- - ">="
|
123
130
|
- !ruby/object:Gem::Version
|
124
131
|
version: '0'
|
125
132
|
requirements: []
|
126
|
-
rubygems_version: 3.
|
133
|
+
rubygems_version: 3.3.3
|
127
134
|
signing_key:
|
128
135
|
specification_version: 4
|
129
|
-
summary: rggen-vhdl-0.
|
136
|
+
summary: rggen-vhdl-0.2.0
|
130
137
|
test_files: []
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RgGen.define_list_item_feature(:bit_field, :type, :ro) do
|
4
|
-
vhdl do
|
5
|
-
build do
|
6
|
-
unless bit_field.reference?
|
7
|
-
input :value_in, {
|
8
|
-
name: "i_#{full_name}", width: width, array_size: array_size
|
9
|
-
}
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
main_code :bit_field, from_template: true
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
def reference_or_value_in
|
18
|
-
bit_field.reference? && reference_bit_field || value_in[loop_variables]
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RgGen.define_list_item_feature(:bit_field, :type, [:rw, :w1, :wo, :wo1]) do
|
4
|
-
vhdl do
|
5
|
-
build do
|
6
|
-
output :value_out, {
|
7
|
-
name: "o_#{full_name}", width: width, array_size: array_size
|
8
|
-
}
|
9
|
-
end
|
10
|
-
|
11
|
-
main_code :bit_field, from_template: true
|
12
|
-
|
13
|
-
private
|
14
|
-
|
15
|
-
def read_action
|
16
|
-
bit_field.readable? && 'RGGEN_READ_DEFAULT' || 'RGGEN_READ_NONE'
|
17
|
-
end
|
18
|
-
|
19
|
-
def write_once
|
20
|
-
[:w1, :wo1].include?(bit_field.type)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|