rggen 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +27 -17
- data/lib/rggen/base/component.rb +5 -1
- data/lib/rggen/base/component_factory.rb +12 -5
- data/lib/rggen/base/item.rb +19 -9
- data/lib/rggen/base/item_factory.rb +9 -5
- data/lib/rggen/builtins.rb +12 -15
- data/lib/rggen/builtins/bit_field/{field_model_creation.rb → field_model.rb} +12 -3
- data/lib/rggen/builtins/register/accessibility.rb +3 -3
- data/lib/rggen/builtins/register/address_decoder.rb +1 -1
- data/lib/rggen/builtins/register/array.rb +30 -28
- data/lib/rggen/builtins/register/bus_exporter.erb +28 -0
- data/lib/rggen/builtins/register/bus_exporter.rb +44 -0
- data/lib/rggen/builtins/register/{reg_model_constructor.rb → constructor.rb} +1 -1
- data/lib/rggen/builtins/register/external.rb +42 -0
- data/lib/rggen/builtins/register/field_model_creator.rb +5 -1
- data/lib/rggen/builtins/register/read_data.rb +4 -0
- data/lib/rggen/builtins/register/reg_model.rb +92 -0
- data/lib/rggen/builtins/register/shadow_index_configurator.rb +5 -1
- data/lib/rggen/builtins/register/sub_block_model.rb +34 -0
- data/lib/rggen/builtins/register_block/apb.erb +1 -0
- data/lib/rggen/builtins/register_block/axi4lite.erb +1 -0
- data/lib/rggen/builtins/register_block/{block_model_definition.rb → block_model.rb} +4 -2
- data/lib/rggen/builtins/register_block/{block_model_constructor.rb → constructor.rb} +1 -1
- data/lib/rggen/builtins/register_block/{block_model_default_map_creator.rb → default_map_creator.rb} +1 -1
- data/lib/rggen/builtins/register_block/host_if.rb +1 -0
- data/lib/rggen/builtins/register_block/{ral_package_definition.rb → ral_package.rb} +1 -1
- data/lib/rggen/builtins/register_block/response_mux.erb +15 -11
- data/lib/rggen/builtins/register_block/response_mux.rb +35 -4
- data/lib/rggen/builtins/register_block/sub_model_creator.rb +14 -0
- data/lib/rggen/builtins/register_block/top_module.rb +16 -0
- data/lib/rggen/core_components.rb +2 -0
- data/lib/rggen/core_components/configuration/item_factory.rb +1 -1
- data/lib/rggen/core_components/ral/component.rb +24 -0
- data/lib/rggen/core_components/ral/item.rb +50 -5
- data/lib/rggen/core_components/ral/setup.rb +1 -1
- data/lib/rggen/core_components/register_map/bit_field_factory.rb +1 -1
- data/lib/rggen/core_components/register_map/component.rb +4 -1
- data/lib/rggen/core_components/register_map/component_factory.rb +9 -0
- data/lib/rggen/core_components/register_map/item.rb +9 -7
- data/lib/rggen/core_components/register_map/item_factory.rb +2 -2
- data/lib/rggen/core_components/register_map/register_block_factory.rb +1 -1
- data/lib/rggen/core_components/register_map/register_factory.rb +1 -1
- data/lib/rggen/core_components/register_map/register_map_factory.rb +1 -1
- data/lib/rggen/core_components/rtl/item.rb +1 -1
- data/lib/rggen/input_base/component.rb +9 -0
- data/lib/rggen/output_base/code_utility.rb +6 -0
- data/lib/rggen/output_base/component.rb +1 -0
- data/lib/rggen/output_base/item_factory.rb +3 -0
- data/lib/rggen/output_base/verilog_utility/class_definition.rb +35 -0
- data/lib/rggen/output_base/verilog_utility/declaration.rb +11 -4
- data/lib/rggen/output_base/verilog_utility/identifier.rb +1 -1
- data/lib/rggen/output_base/verilog_utility/module_definition.rb +33 -7
- data/lib/rggen/version.rb +2 -2
- data/ral/rggen_ral_block.svh +3 -8
- data/ral/rggen_ral_macros.svh +9 -2
- data/rtl/register/rggen_bus_exporter.sv +96 -0
- data/rtl/register_block/rggen_host_if_apb.sv +2 -0
- data/rtl/register_block/rggen_host_if_axi4lite.sv +7 -1
- data/rtl/register_block/rggen_response_mux.sv +53 -23
- data/sample/sample.csv +15 -14
- data/sample/sample.xls +0 -0
- data/sample/sample.xlsx +0 -0
- data/sample/sample_0.sv +77 -14
- data/sample/sample_0_ral_pkg.sv +6 -2
- data/sample/sample_1.sv +17 -11
- data/sample/sample_1_ral_pkg.sv +1 -1
- data/sample/sample_setup.rb +6 -6
- data/setup/default.rb +6 -6
- metadata +20 -19
- data/lib/rggen/builtins/bit_field/field_model_declaration.rb +0 -9
- data/lib/rggen/builtins/register/field_model_declarations.rb +0 -7
- data/lib/rggen/builtins/register/reg_model_creation.rb +0 -64
- data/lib/rggen/builtins/register/reg_model_declaration.rb +0 -13
- data/lib/rggen/builtins/register/reg_model_definition.rb +0 -22
- data/lib/rggen/builtins/register_block/module_definition.rb +0 -13
- data/lib/rggen/builtins/register_block/reg_model_creator.rb +0 -14
- data/lib/rggen/builtins/register_block/reg_model_declarations.rb +0 -7
- data/lib/rggen/builtins/register_block/signal_declarations.rb +0 -9
data/sample/sample_0_ral_pkg.sv
CHANGED
@@ -70,17 +70,20 @@ package sample_0_ral_pkg;
|
|
70
70
|
set_shadow_index("register_0", "bit_field_0_1", indexes[1]);
|
71
71
|
endfunction
|
72
72
|
endclass
|
73
|
-
class sample_0_block_model
|
73
|
+
class sample_0_block_model#(
|
74
|
+
type REGISTER_6 = rggen_ral_block
|
75
|
+
) extends rggen_ral_block;
|
74
76
|
rand register_0_reg_model register_0;
|
75
77
|
rand register_1_reg_model register_1;
|
76
78
|
rand register_2_reg_model register_2;
|
77
79
|
rand register_3_reg_model register_3;
|
78
80
|
rand register_4_reg_model register_4[4];
|
79
81
|
rand register_5_reg_model register_5[2][4];
|
82
|
+
rand REGISTER_6 register_6;
|
80
83
|
function new(string name = "sample_0");
|
81
84
|
super.new(name);
|
82
85
|
endfunction
|
83
|
-
function void
|
86
|
+
function void create_sub_models();
|
84
87
|
`rggen_ral_create_reg_model(register_0, "register_0", '{}, 8'h00, "RW", 0)
|
85
88
|
`rggen_ral_create_reg_model(register_1, "register_1", '{}, 8'h04, "RW", 0)
|
86
89
|
`rggen_ral_create_reg_model(register_2, "register_2", '{}, 8'h08, "RW", 0)
|
@@ -91,6 +94,7 @@ package sample_0_ral_pkg;
|
|
91
94
|
foreach (register_5[i, j]) begin
|
92
95
|
`rggen_ral_create_reg_model(register_5[i][j], "register_5", '{i, j}, 8'h20, "RW", 1)
|
93
96
|
end
|
97
|
+
`rggen_ral_create_block_model(register_6, "register_6", 8'h80)
|
94
98
|
endfunction
|
95
99
|
function uvm_reg_map create_default_map();
|
96
100
|
return create_map("default_map", 0, 4, UVM_LITTLE_ENDIAN, 1);
|
data/sample/sample_1.sv
CHANGED
@@ -21,6 +21,7 @@ module sample_1 (
|
|
21
21
|
logic write;
|
22
22
|
logic read;
|
23
23
|
logic [6:0] address;
|
24
|
+
logic [3:0] strobe;
|
24
25
|
logic [31:0] write_data;
|
25
26
|
logic [31:0] write_mask;
|
26
27
|
logic response_ready;
|
@@ -54,6 +55,7 @@ module sample_1 (
|
|
54
55
|
.o_write (write),
|
55
56
|
.o_read (read),
|
56
57
|
.o_address (address),
|
58
|
+
.o_strobe (strobe),
|
57
59
|
.o_write_data (write_data),
|
58
60
|
.o_write_mask (write_mask),
|
59
61
|
.i_response_ready (response_ready),
|
@@ -61,18 +63,22 @@ module sample_1 (
|
|
61
63
|
.i_status (status)
|
62
64
|
);
|
63
65
|
rggen_response_mux #(
|
64
|
-
.DATA_WIDTH
|
65
|
-
.TOTAL_REGISTERS
|
66
|
+
.DATA_WIDTH (32),
|
67
|
+
.TOTAL_REGISTERS (3),
|
68
|
+
.TOTAL_EXTERNAL_REGISTERS (0)
|
66
69
|
) u_response_mux (
|
67
|
-
.clk
|
68
|
-
.rst_n
|
69
|
-
.i_command_valid
|
70
|
-
.i_read
|
71
|
-
.o_response_ready
|
72
|
-
.o_read_data
|
73
|
-
.o_status
|
74
|
-
.i_register_select
|
75
|
-
.i_register_read_data
|
70
|
+
.clk (clk),
|
71
|
+
.rst_n (rst_n),
|
72
|
+
.i_command_valid (command_valid),
|
73
|
+
.i_read (read),
|
74
|
+
.o_response_ready (response_ready),
|
75
|
+
.o_read_data (read_data),
|
76
|
+
.o_status (status),
|
77
|
+
.i_register_select (register_select),
|
78
|
+
.i_register_read_data (register_read_data),
|
79
|
+
.i_external_register_select (1'b0),
|
80
|
+
.i_external_register_ready (1'b0),
|
81
|
+
.i_external_register_status ('{2'b00})
|
76
82
|
);
|
77
83
|
rggen_address_decoder #(
|
78
84
|
.READABLE (1),
|
data/sample/sample_1_ral_pkg.sv
CHANGED
@@ -41,7 +41,7 @@ package sample_1_ral_pkg;
|
|
41
41
|
function new(string name = "sample_1");
|
42
42
|
super.new(name);
|
43
43
|
endfunction
|
44
|
-
function void
|
44
|
+
function void create_sub_models();
|
45
45
|
`rggen_ral_create_reg_model(register_0, "register_0", '{}, 7'h00, "RW", 0)
|
46
46
|
`rggen_ral_create_reg_model(register_1, "register_1", '{}, 7'h04, "RW", 0)
|
47
47
|
`rggen_ral_create_reg_model(register_2, "register_2", '{}, 7'h08, "RW", 0)
|
data/sample/sample_setup.rb
CHANGED
@@ -10,12 +10,12 @@ end
|
|
10
10
|
|
11
11
|
enable :global , [:data_width, :address_width]
|
12
12
|
enable :register_block, [:name, :base_address]
|
13
|
-
enable :register , [:offset_address, :name, :array, :shadow, :accessibility, :uniquness_validator]
|
13
|
+
enable :register , [:offset_address, :name, :array, :shadow, :external, :accessibility, :uniquness_validator]
|
14
14
|
enable :bit_field , [:bit_assignment, :name, :type, :initial_value, :reference]
|
15
15
|
enable :bit_field , :type, [:rw, :ro, :foo, :reserved]
|
16
|
-
enable :register_block, [:
|
16
|
+
enable :register_block, [:top_module, :clock_reset, :host_if, :response_mux]
|
17
17
|
enable :register_block, :host_if, [:apb, :bar]
|
18
|
-
enable :register , [:address_decoder, :read_data]
|
19
|
-
enable :register_block, [:
|
20
|
-
enable :register , [:
|
21
|
-
enable :bit_field ,
|
18
|
+
enable :register , [:address_decoder, :read_data, :bus_exporter]
|
19
|
+
enable :register_block, [:ral_package, :block_model, :constructor, :sub_model_creator, :default_map_creator]
|
20
|
+
enable :register , [:reg_model, :constructor, :field_model_creator, :shadow_index_configurator, :sub_block_model]
|
21
|
+
enable :bit_field , :field_model
|
data/setup/default.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
enable :global , [:data_width, :address_width]
|
2
2
|
enable :register_block, [:name, :byte_size]
|
3
|
-
enable :register , [:offset_address, :name, :array, :shadow, :accessibility, :uniquness_validator]
|
3
|
+
enable :register , [:offset_address, :name, :array, :shadow, :external, :accessibility, :uniquness_validator]
|
4
4
|
enable :bit_field , [:bit_assignment, :name, :type, :initial_value, :reference]
|
5
5
|
enable :bit_field , :type, [:rw, :ro, :reserved]
|
6
|
-
enable :register_block, [:
|
6
|
+
enable :register_block, [:top_module, :clock_reset, :host_if, :response_mux]
|
7
7
|
enable :register_block, :host_if, [:apb, :axi4lite]
|
8
|
-
enable :register , [:address_decoder, :read_data]
|
9
|
-
enable :register_block, [:
|
10
|
-
enable :register , [:
|
11
|
-
enable :bit_field ,
|
8
|
+
enable :register , [:address_decoder, :read_data, :bus_exporter]
|
9
|
+
enable :register_block, [:ral_package, :block_model, :constructor, :sub_model_creator, :default_map_creator]
|
10
|
+
enable :register , [:reg_model, :constructor, :field_model_creator, :shadow_index_configurator, :sub_block_model]
|
11
|
+
enable :bit_field , :field_model
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rggen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.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: 2016-
|
11
|
+
date: 2016-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: baby_erubis
|
@@ -70,14 +70,14 @@ dependencies:
|
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '10.0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '10.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
@@ -141,8 +141,7 @@ files:
|
|
141
141
|
- lib/rggen/builder/simple_item_entry.rb
|
142
142
|
- lib/rggen/builtins.rb
|
143
143
|
- lib/rggen/builtins/bit_field/bit_assignment.rb
|
144
|
-
- lib/rggen/builtins/bit_field/
|
145
|
-
- lib/rggen/builtins/bit_field/field_model_declaration.rb
|
144
|
+
- lib/rggen/builtins/bit_field/field_model.rb
|
146
145
|
- lib/rggen/builtins/bit_field/initial_value.rb
|
147
146
|
- lib/rggen/builtins/bit_field/name.rb
|
148
147
|
- lib/rggen/builtins/bit_field/reference.rb
|
@@ -163,37 +162,36 @@ files:
|
|
163
162
|
- lib/rggen/builtins/register/address_decoder.erb
|
164
163
|
- lib/rggen/builtins/register/address_decoder.rb
|
165
164
|
- lib/rggen/builtins/register/array.rb
|
165
|
+
- lib/rggen/builtins/register/bus_exporter.erb
|
166
|
+
- lib/rggen/builtins/register/bus_exporter.rb
|
167
|
+
- lib/rggen/builtins/register/constructor.rb
|
168
|
+
- lib/rggen/builtins/register/external.rb
|
166
169
|
- lib/rggen/builtins/register/field_model_creator.rb
|
167
|
-
- lib/rggen/builtins/register/field_model_declarations.rb
|
168
170
|
- lib/rggen/builtins/register/name.rb
|
169
171
|
- lib/rggen/builtins/register/offset_address.rb
|
170
172
|
- lib/rggen/builtins/register/read_data.rb
|
171
|
-
- lib/rggen/builtins/register/
|
172
|
-
- lib/rggen/builtins/register/reg_model_creation.rb
|
173
|
-
- lib/rggen/builtins/register/reg_model_declaration.rb
|
174
|
-
- lib/rggen/builtins/register/reg_model_definition.rb
|
173
|
+
- lib/rggen/builtins/register/reg_model.rb
|
175
174
|
- lib/rggen/builtins/register/shadow.rb
|
176
175
|
- lib/rggen/builtins/register/shadow_index_configurator.rb
|
176
|
+
- lib/rggen/builtins/register/sub_block_model.rb
|
177
177
|
- lib/rggen/builtins/register/uniqueness_validator.rb
|
178
178
|
- lib/rggen/builtins/register_block/apb.erb
|
179
179
|
- lib/rggen/builtins/register_block/apb.rb
|
180
180
|
- lib/rggen/builtins/register_block/axi4lite.erb
|
181
181
|
- lib/rggen/builtins/register_block/axi4lite.rb
|
182
182
|
- lib/rggen/builtins/register_block/base_address.rb
|
183
|
-
- lib/rggen/builtins/register_block/
|
184
|
-
- lib/rggen/builtins/register_block/block_model_default_map_creator.rb
|
185
|
-
- lib/rggen/builtins/register_block/block_model_definition.rb
|
183
|
+
- lib/rggen/builtins/register_block/block_model.rb
|
186
184
|
- lib/rggen/builtins/register_block/byte_size.rb
|
187
185
|
- lib/rggen/builtins/register_block/clock_reset.rb
|
186
|
+
- lib/rggen/builtins/register_block/constructor.rb
|
187
|
+
- lib/rggen/builtins/register_block/default_map_creator.rb
|
188
188
|
- lib/rggen/builtins/register_block/host_if.rb
|
189
|
-
- lib/rggen/builtins/register_block/module_definition.rb
|
190
189
|
- lib/rggen/builtins/register_block/name.rb
|
191
|
-
- lib/rggen/builtins/register_block/
|
192
|
-
- lib/rggen/builtins/register_block/reg_model_creator.rb
|
193
|
-
- lib/rggen/builtins/register_block/reg_model_declarations.rb
|
190
|
+
- lib/rggen/builtins/register_block/ral_package.rb
|
194
191
|
- lib/rggen/builtins/register_block/response_mux.erb
|
195
192
|
- lib/rggen/builtins/register_block/response_mux.rb
|
196
|
-
- lib/rggen/builtins/register_block/
|
193
|
+
- lib/rggen/builtins/register_block/sub_model_creator.rb
|
194
|
+
- lib/rggen/builtins/register_block/top_module.rb
|
197
195
|
- lib/rggen/commands.rb
|
198
196
|
- lib/rggen/core_components.rb
|
199
197
|
- lib/rggen/core_components/configuration/configuration_factory.rb
|
@@ -201,10 +199,12 @@ files:
|
|
201
199
|
- lib/rggen/core_components/configuration/item_factory.rb
|
202
200
|
- lib/rggen/core_components/configuration/raise_error.rb
|
203
201
|
- lib/rggen/core_components/configuration/setup.rb
|
202
|
+
- lib/rggen/core_components/ral/component.rb
|
204
203
|
- lib/rggen/core_components/ral/item.rb
|
205
204
|
- lib/rggen/core_components/ral/setup.rb
|
206
205
|
- lib/rggen/core_components/register_map/bit_field_factory.rb
|
207
206
|
- lib/rggen/core_components/register_map/component.rb
|
207
|
+
- lib/rggen/core_components/register_map/component_factory.rb
|
208
208
|
- lib/rggen/core_components/register_map/generic_map.rb
|
209
209
|
- lib/rggen/core_components/register_map/item.rb
|
210
210
|
- lib/rggen/core_components/register_map/item_factory.rb
|
@@ -257,6 +257,7 @@ files:
|
|
257
257
|
- rtl/bit_field/rggen_bit_field_rw.sv
|
258
258
|
- rtl/compile.f
|
259
259
|
- rtl/register/rggen_address_decoder.sv
|
260
|
+
- rtl/register/rggen_bus_exporter.sv
|
260
261
|
- rtl/register_block/rggen_host_if_apb.sv
|
261
262
|
- rtl/register_block/rggen_host_if_axi4lite.sv
|
262
263
|
- rtl/register_block/rggen_host_if_common.svh
|
@@ -1,64 +0,0 @@
|
|
1
|
-
simple_item :register, :reg_model_creation do
|
2
|
-
ral do
|
3
|
-
delegate [:byte_width] => :configuration
|
4
|
-
delegate [:local_address_width] => :register_block
|
5
|
-
delegate [:name, :dimensions, :array?, :shadow?] => :register
|
6
|
-
|
7
|
-
generate_code :reg_model_creation do |buffer|
|
8
|
-
foreach_header(buffer) if array?
|
9
|
-
model_creation(buffer)
|
10
|
-
foreach_footer(buffer) if array?
|
11
|
-
end
|
12
|
-
|
13
|
-
def foreach_header(buffer)
|
14
|
-
buffer << "foreach (#{name}[#{loop_varibles.join(', ')}]) begin" << nl
|
15
|
-
buffer.indent += 2
|
16
|
-
end
|
17
|
-
|
18
|
-
def model_creation(buffer)
|
19
|
-
buffer << "`rggen_ral_create_reg_model(#{arguments.join(', ')})" << nl
|
20
|
-
end
|
21
|
-
|
22
|
-
def foreach_footer(buffer)
|
23
|
-
buffer.indent -= 2
|
24
|
-
buffer << 'end' << nl
|
25
|
-
end
|
26
|
-
|
27
|
-
def arguments
|
28
|
-
[handle, string(name), array_index, offset_address, rights, unmapped]
|
29
|
-
end
|
30
|
-
|
31
|
-
def handle
|
32
|
-
create_identifier(name)[loop_varibles]
|
33
|
-
end
|
34
|
-
|
35
|
-
def array_index
|
36
|
-
return '\'{}' unless array?
|
37
|
-
array(*loop_varibles)
|
38
|
-
end
|
39
|
-
|
40
|
-
def offset_address
|
41
|
-
base = hex(register.start_address, local_address_width)
|
42
|
-
if !array? || shadow?
|
43
|
-
base
|
44
|
-
else
|
45
|
-
"#{base} + #{byte_width} * #{loop_varibles.first}"
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
def rights
|
50
|
-
return string(:RO) if register.read_only?
|
51
|
-
return string(:WO) if register.write_only?
|
52
|
-
string(:RW)
|
53
|
-
end
|
54
|
-
|
55
|
-
def unmapped
|
56
|
-
(shadow? && 1) || 0
|
57
|
-
end
|
58
|
-
|
59
|
-
def loop_varibles
|
60
|
-
return nil unless array?
|
61
|
-
@loop_varibles ||= Array.new(dimensions.size, &method(:loop_index))
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
simple_item :register, :reg_model_declaration do
|
2
|
-
ral do
|
3
|
-
delegate [:model_name, :name, :dimensions] => :register
|
4
|
-
|
5
|
-
generate_code :reg_model_declaration do |buffer|
|
6
|
-
buffer << declaration << semicolon << nl
|
7
|
-
end
|
8
|
-
|
9
|
-
def declaration
|
10
|
-
model_declaration(model_name, name, dimensions: dimensions)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
simple_item :register, :reg_model_definition do
|
2
|
-
ral do
|
3
|
-
export :model_name
|
4
|
-
|
5
|
-
generate_code :package_item do
|
6
|
-
class_definition model_name do |c|
|
7
|
-
c.base base_model
|
8
|
-
c.body do |buffer|
|
9
|
-
register.generate_code(:reg_model_item, :top_down, buffer)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def model_name
|
15
|
-
"#{register.name}_reg_model"
|
16
|
-
end
|
17
|
-
|
18
|
-
def base_model
|
19
|
-
(register.shadow? && :rggen_ral_shadow_reg) || :rggen_ral_reg
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
define_simple_item :register_block, :module_definition do
|
2
|
-
rtl do
|
3
|
-
write_file '<%= register_block.name %>.sv' do
|
4
|
-
module_definition register_block.name do |m|
|
5
|
-
m.parameters register_block.parameter_declarations
|
6
|
-
m.ports register_block.port_declarations
|
7
|
-
m.body do |code|
|
8
|
-
register_block.generate_code(:module_item, :top_down, code)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
simple_item :register_block, :reg_model_creator do
|
2
|
-
ral do
|
3
|
-
generate_code :block_model_item do
|
4
|
-
function_definition :create_registers do |f|
|
5
|
-
f.return_type :void
|
6
|
-
f.body { |buffer| function_body(buffer) }
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
def function_body(buffer)
|
11
|
-
register_block.generate_code(:reg_model_creation, :top_down, buffer)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|