rggen-vhdl 0.8.0 → 0.10.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/custom.erb +1 -1
- data/lib/rggen/vhdl/bit_field/type/rc_w0c_w1c_wc_woc.erb +1 -1
- data/lib/rggen/vhdl/bit_field/type/ro_rotrg.erb +1 -1
- data/lib/rggen/vhdl/bit_field/type/rof.erb +1 -1
- data/lib/rggen/vhdl/bit_field/type/{rol.erb → rohw.erb} +2 -2
- data/lib/rggen/vhdl/bit_field/type/{rol.rb → rohw.rb} +5 -5
- data/lib/rggen/vhdl/bit_field/type/row0trg_row1trg.erb +1 -1
- data/lib/rggen/vhdl/bit_field/type/rowo_rowotrg.erb +1 -1
- data/lib/rggen/vhdl/bit_field/type/rs_w0s_w1s_ws_wos.erb +1 -1
- data/lib/rggen/vhdl/bit_field/type/rw_rwtrg_w1.erb +1 -1
- data/lib/rggen/vhdl/bit_field/type/rwc.erb +1 -1
- data/lib/rggen/vhdl/bit_field/type/rwe_rwl.erb +1 -1
- data/lib/rggen/vhdl/bit_field/type/rwhw.erb +26 -0
- data/lib/rggen/vhdl/bit_field/type/rwhw.rb +27 -0
- data/lib/rggen/vhdl/bit_field/type/rws.erb +6 -5
- data/lib/rggen/vhdl/bit_field/type/rws.rb +0 -3
- data/lib/rggen/vhdl/bit_field/type/w0crs_w0src_w1crs_w1src_wcrs_wsrc.erb +1 -1
- data/lib/rggen/vhdl/bit_field/type/w0t_w1t.erb +1 -1
- data/lib/rggen/vhdl/bit_field/type/w0trg_w1trg.erb +1 -1
- data/lib/rggen/vhdl/bit_field/type/wo_wo1_wotrg.erb +1 -1
- data/lib/rggen/vhdl/bit_field/type/wrc_wrs.erb +1 -1
- data/lib/rggen/vhdl/bit_field/type.rb +4 -0
- data/lib/rggen/vhdl/global/library_name.rb +16 -0
- data/lib/rggen/vhdl/register/type/default.erb +1 -1
- data/lib/rggen/vhdl/register/type/external.erb +1 -1
- data/lib/rggen/vhdl/register/type/indirect.erb +1 -1
- data/lib/rggen/vhdl/register/type/rw.erb +1 -1
- data/lib/rggen/vhdl/register/type.rb +12 -0
- data/lib/rggen/vhdl/register_block/protocol/apb.erb +1 -1
- data/lib/rggen/vhdl/register_block/protocol/axi4lite.erb +1 -1
- data/lib/rggen/vhdl/register_block/protocol/wishbone.erb +1 -1
- data/lib/rggen/vhdl/register_block/protocol.rb +4 -0
- data/lib/rggen/vhdl/register_block/vhdl_top.erb +4 -1
- data/lib/rggen/vhdl/register_block/vhdl_top.rb +8 -0
- data/lib/rggen/vhdl/version.rb +1 -1
- data/lib/rggen/vhdl.rb +3 -1
- metadata +11 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9872f0da195fb312788f08dd53b41e3336cc5ce3b2ad38faa8e91c20320a263
|
4
|
+
data.tar.gz: 75bcb850c0004427eb846bbc21fb44f6745a15f1e9ad3b0f31ba91e0b242fb6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0df2d72d345c9e4b81dc0955f8424d0d3706f0128fa9ea5789c2be6b5ae90dc9fb149a916fdee54a0765ab0b036bc7730fdfcd65487a6fa0b9c53b208212ffe
|
7
|
+
data.tar.gz: d84282983bf6b39be7c753fc1de6195d3f4d35457903a81896562ae759c02dd30c41fd5da637458b784aa5ee5de0bc015773f267b464f244db80036b10016e21
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2021-
|
3
|
+
Copyright (c) 2021-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
@@ -68,7 +68,7 @@ Feedbacks, bus reports, questions and etc. are welcome! You can post them bu usi
|
|
68
68
|
|
69
69
|
## Copyright & License
|
70
70
|
|
71
|
-
Copyright © 2021-
|
71
|
+
Copyright © 2021-2024 Taichi Ishitani. RgGen::VHDL is licensed under the [MIT License](https://opensource.org/licenses/MIT), see [LICENSE](LICENSE) for futher details.
|
72
72
|
|
73
73
|
## Code of Conduct
|
74
74
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
u_bit_field: entity
|
1
|
+
u_bit_field: entity <%= library_name %>.rggen_bit_field
|
2
2
|
generic map (
|
3
3
|
WIDTH => <%= width %>,
|
4
4
|
INITIAL_VALUE => <%= initial_value %>,
|
@@ -16,7 +16,7 @@ u_bit_field: entity work.rggen_bit_field
|
|
16
16
|
o_sw_value => <%= bit_field_value %>,
|
17
17
|
o_write_trigger => open,
|
18
18
|
o_read_trigger => open,
|
19
|
-
i_hw_write_enable => <%=
|
19
|
+
i_hw_write_enable => <%= valid_signal %>,
|
20
20
|
i_hw_write_data => <%= value_in[loop_variables] %>,
|
21
21
|
i_hw_set => (others => '0'),
|
22
22
|
i_hw_clear => (others => '0'),
|
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
RgGen.define_list_item_feature(:bit_field, :type, :
|
3
|
+
RgGen.define_list_item_feature(:bit_field, :type, :rohw) do
|
4
4
|
vhdl do
|
5
5
|
build do
|
6
6
|
unless bit_field.reference?
|
7
|
-
input :
|
8
|
-
name: "i_#{full_name}
|
7
|
+
input :valid, {
|
8
|
+
name: "i_#{full_name}_valid", width: 1, array_size: array_size
|
9
9
|
}
|
10
10
|
end
|
11
11
|
input :value_in, {
|
@@ -20,8 +20,8 @@ RgGen.define_list_item_feature(:bit_field, :type, :rol) do
|
|
20
20
|
|
21
21
|
private
|
22
22
|
|
23
|
-
def
|
24
|
-
reference_bit_field ||
|
23
|
+
def valid_signal
|
24
|
+
reference_bit_field || valid[loop_variables]
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
u_bit_field: entity <%= library_name %>.rggen_bit_field
|
2
|
+
generic map (
|
3
|
+
WIDTH => <%= width %>,
|
4
|
+
INITIAL_VALUE => <%= initial_value %>
|
5
|
+
)
|
6
|
+
port map (
|
7
|
+
i_clk => <%= clock %>,
|
8
|
+
i_rst_n => <%= reset %>,
|
9
|
+
i_sw_valid => <%= bit_field_valid %>,
|
10
|
+
i_sw_read_mask => <%= bit_field_read_mask %>,
|
11
|
+
i_sw_write_enable => "1",
|
12
|
+
i_sw_write_mask => <%= bit_field_write_mask %>,
|
13
|
+
i_sw_write_data => <%= bit_field_write_data %>,
|
14
|
+
o_sw_read_data => <%= bit_field_read_data %>,
|
15
|
+
o_sw_value => <%= bit_field_value %>,
|
16
|
+
o_write_trigger => open,
|
17
|
+
o_read_trigger => open,
|
18
|
+
i_hw_write_enable => <%= valid_signal %>,
|
19
|
+
i_hw_write_data => <%= value_in[loop_variables] %>,
|
20
|
+
i_hw_set => (others => '0'),
|
21
|
+
i_hw_clear => (others => '0'),
|
22
|
+
i_value => (others => '0'),
|
23
|
+
i_mask => (others => '1'),
|
24
|
+
o_value => <%= value_out[loop_variables] %>,
|
25
|
+
o_value_unmasked => open
|
26
|
+
);
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RgGen.define_list_item_feature(:bit_field, :type, :rwhw) do
|
4
|
+
vhdl do
|
5
|
+
build do
|
6
|
+
unless bit_field.reference?
|
7
|
+
input :valid, {
|
8
|
+
name: "i_#{full_name}_valid", width: 1, array_size: array_size
|
9
|
+
}
|
10
|
+
end
|
11
|
+
input :value_in, {
|
12
|
+
name: "i_#{full_name}", width: width, array_size: array_size
|
13
|
+
}
|
14
|
+
output :value_out, {
|
15
|
+
name: "o_#{full_name}", width: width, array_size: array_size
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
main_code :bit_field, from_template: true
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def valid_signal
|
24
|
+
reference_bit_field || valid[loop_variables]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -1,7 +1,8 @@
|
|
1
|
-
u_bit_field: entity
|
1
|
+
u_bit_field: entity <%= library_name %>.rggen_bit_field
|
2
2
|
generic map (
|
3
3
|
WIDTH => <%= width %>,
|
4
|
-
INITIAL_VALUE => <%= initial_value
|
4
|
+
INITIAL_VALUE => <%= initial_value %>,
|
5
|
+
HW_SET_WIDTH => 1
|
5
6
|
)
|
6
7
|
port map (
|
7
8
|
i_clk => <%= clock %>,
|
@@ -15,9 +16,9 @@ u_bit_field: entity work.rggen_bit_field
|
|
15
16
|
o_sw_value => <%= bit_field_value %>,
|
16
17
|
o_write_trigger => open,
|
17
18
|
o_read_trigger => open,
|
18
|
-
i_hw_write_enable =>
|
19
|
-
i_hw_write_data =>
|
20
|
-
i_hw_set =>
|
19
|
+
i_hw_write_enable => "0",
|
20
|
+
i_hw_write_data => (others => '0'),
|
21
|
+
i_hw_set => <%= set_signal %>,
|
21
22
|
i_hw_clear => (others => '0'),
|
22
23
|
i_value => (others => '0'),
|
23
24
|
i_mask => (others => '1'),
|
@@ -8,9 +8,6 @@ RgGen.define_list_item_feature(:bit_field, :type, :rws) do
|
|
8
8
|
name: "i_#{full_name}_set", width: 1, array_size: array_size
|
9
9
|
}
|
10
10
|
end
|
11
|
-
input :value_in, {
|
12
|
-
name: "i_#{full_name}", width: width, array_size: array_size
|
13
|
-
}
|
14
11
|
output :value_out, {
|
15
12
|
name: "o_#{full_name}", width: width, array_size: array_size
|
16
13
|
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RgGen.define_simple_feature(:global, :library_name) do
|
4
|
+
configuration do
|
5
|
+
property :library_name, default: 'work'
|
6
|
+
property :use_default_library?, body: -> { library_name.casecmp?('work') }
|
7
|
+
|
8
|
+
input_pattern variable_name
|
9
|
+
|
10
|
+
build do |value|
|
11
|
+
pattern_matched? ||
|
12
|
+
(error "illegal input value for library name: #{value.inspect}")
|
13
|
+
@library_name = match_data.to_s
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<% index_fields_and_values.each_with_index do |(field, value), i| %>
|
2
2
|
<%= indirect_match[i] %> <= '1' when unsigned(<%= field %>) = <%= value %> else '0';
|
3
3
|
<% end %>
|
4
|
-
u_register: entity
|
4
|
+
u_register: entity <%= library_name %>.rggen_indirect_register
|
5
5
|
generic map (
|
6
6
|
READABLE => <%= readable? %>,
|
7
7
|
WRITABLE => <%= writable? %>,
|
@@ -20,6 +20,10 @@ RgGen.define_list_feature(:register, :type) do
|
|
20
20
|
register.writable?
|
21
21
|
end
|
22
22
|
|
23
|
+
def library_name
|
24
|
+
configuration.library_name
|
25
|
+
end
|
26
|
+
|
23
27
|
def clock
|
24
28
|
register_block.clock
|
25
29
|
end
|
@@ -91,6 +95,14 @@ RgGen.define_list_feature(:register, :type) do
|
|
91
95
|
def bit_field_value
|
92
96
|
register.bit_field_value
|
93
97
|
end
|
98
|
+
|
99
|
+
def format_offsets(offsets)
|
100
|
+
if integer?(offsets.first)
|
101
|
+
super(offsets)
|
102
|
+
else
|
103
|
+
super([0, *offsets])
|
104
|
+
end
|
105
|
+
end
|
94
106
|
end
|
95
107
|
|
96
108
|
default_feature do
|
@@ -2,7 +2,10 @@ library ieee;
|
|
2
2
|
use ieee.std_logic_1164.all;
|
3
3
|
use ieee.numeric_std.all;
|
4
4
|
|
5
|
-
|
5
|
+
<% unless use_default_library? %>
|
6
|
+
library <%= library_name %>;
|
7
|
+
<% end %>
|
8
|
+
use <%= library_name %>.rggen_rtl.all;
|
6
9
|
|
7
10
|
entity <%= register_block.name %> is
|
8
11
|
generic (
|
@@ -42,6 +42,14 @@ RgGen.define_simple_feature(:register_block, :vhdl_top) do
|
|
42
42
|
|
43
43
|
private
|
44
44
|
|
45
|
+
def use_default_library?
|
46
|
+
configuration.use_default_library?
|
47
|
+
end
|
48
|
+
|
49
|
+
def library_name
|
50
|
+
configuration.library_name
|
51
|
+
end
|
52
|
+
|
45
53
|
def total_registers
|
46
54
|
register_block.files_and_registers.sum(&:count)
|
47
55
|
end
|
data/lib/rggen/vhdl/version.rb
CHANGED
data/lib/rggen/vhdl.rb
CHANGED
@@ -21,6 +21,7 @@ RgGen.setup_plugin :'rggen-vhdl' do |plugin|
|
|
21
21
|
end
|
22
22
|
|
23
23
|
plugin.files [
|
24
|
+
'vhdl/global/library_name',
|
24
25
|
'vhdl/register_block/vhdl_top',
|
25
26
|
'vhdl/register_block/protocol',
|
26
27
|
'vhdl/register_block/protocol/apb',
|
@@ -38,13 +39,14 @@ RgGen.setup_plugin :'rggen-vhdl' do |plugin|
|
|
38
39
|
'vhdl/bit_field/type/rc_w0c_w1c_wc_woc',
|
39
40
|
'vhdl/bit_field/type/ro_rotrg',
|
40
41
|
'vhdl/bit_field/type/rof',
|
41
|
-
'vhdl/bit_field/type/
|
42
|
+
'vhdl/bit_field/type/rohw',
|
42
43
|
'vhdl/bit_field/type/row0trg_row1trg',
|
43
44
|
'vhdl/bit_field/type/rowo_rowotrg',
|
44
45
|
'vhdl/bit_field/type/rs_w0s_w1s_ws_wos',
|
45
46
|
'vhdl/bit_field/type/rw_rwtrg_w1',
|
46
47
|
'vhdl/bit_field/type/rwc',
|
47
48
|
'vhdl/bit_field/type/rwe_rwl',
|
49
|
+
'vhdl/bit_field/type/rwhw',
|
48
50
|
'vhdl/bit_field/type/rws',
|
49
51
|
'vhdl/bit_field/type/w0crs_w0src_w1crs_w1src_wcrs_wsrc',
|
50
52
|
'vhdl/bit_field/type/w0t_w1t',
|
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.10.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: 2024-02-28 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.33.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.33.0
|
27
27
|
description: VHDL writer plugin for RgGen
|
28
28
|
email:
|
29
29
|
- rggen@googlegroups.com
|
@@ -44,8 +44,8 @@ files:
|
|
44
44
|
- lib/rggen/vhdl/bit_field/type/ro_rotrg.rb
|
45
45
|
- lib/rggen/vhdl/bit_field/type/rof.erb
|
46
46
|
- lib/rggen/vhdl/bit_field/type/rof.rb
|
47
|
-
- lib/rggen/vhdl/bit_field/type/
|
48
|
-
- lib/rggen/vhdl/bit_field/type/
|
47
|
+
- lib/rggen/vhdl/bit_field/type/rohw.erb
|
48
|
+
- lib/rggen/vhdl/bit_field/type/rohw.rb
|
49
49
|
- lib/rggen/vhdl/bit_field/type/row0trg_row1trg.erb
|
50
50
|
- lib/rggen/vhdl/bit_field/type/row0trg_row1trg.rb
|
51
51
|
- lib/rggen/vhdl/bit_field/type/rowo_rowotrg.erb
|
@@ -58,6 +58,8 @@ files:
|
|
58
58
|
- lib/rggen/vhdl/bit_field/type/rwc.rb
|
59
59
|
- lib/rggen/vhdl/bit_field/type/rwe_rwl.erb
|
60
60
|
- lib/rggen/vhdl/bit_field/type/rwe_rwl.rb
|
61
|
+
- lib/rggen/vhdl/bit_field/type/rwhw.erb
|
62
|
+
- lib/rggen/vhdl/bit_field/type/rwhw.rb
|
61
63
|
- lib/rggen/vhdl/bit_field/type/rws.erb
|
62
64
|
- lib/rggen/vhdl/bit_field/type/rws.rb
|
63
65
|
- lib/rggen/vhdl/bit_field/type/w0crs_w0src_w1crs_w1src_wcrs_wsrc.erb
|
@@ -74,6 +76,7 @@ files:
|
|
74
76
|
- lib/rggen/vhdl/component.rb
|
75
77
|
- lib/rggen/vhdl/factories.rb
|
76
78
|
- lib/rggen/vhdl/feature.rb
|
79
|
+
- lib/rggen/vhdl/global/library_name.rb
|
77
80
|
- lib/rggen/vhdl/register/tie_off_unused_signals.erb
|
78
81
|
- lib/rggen/vhdl/register/type.rb
|
79
82
|
- lib/rggen/vhdl/register/type/default.erb
|
@@ -123,8 +126,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
126
|
- !ruby/object:Gem::Version
|
124
127
|
version: '0'
|
125
128
|
requirements: []
|
126
|
-
rubygems_version: 3.5.
|
129
|
+
rubygems_version: 3.5.5
|
127
130
|
signing_key:
|
128
131
|
specification_version: 4
|
129
|
-
summary: rggen-vhdl-0.
|
132
|
+
summary: rggen-vhdl-0.10.0
|
130
133
|
test_files: []
|