-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
73828ac
commit 27e58b2
Showing
8 changed files
with
644 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
RgGen.define_list_item_feature(:bit_field, :type, [:rwc, :rwhw, :rws]) do | ||
sv_ral { access 'RW' } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
rggen_bit_field #( | ||
.WIDTH (<%= width %>), | ||
.INITIAL_VALUE (<%= initial_value %>), | ||
.HW_SET_WIDTH (1) | ||
) u_bit_field ( | ||
.i_clk (<%= clock %>), | ||
.i_rst_n (<%= reset %>), | ||
.bit_field_if (<%= bit_field_if %>), | ||
.o_write_trigger (), | ||
.o_read_trigger (), | ||
.i_sw_write_enable ('1), | ||
.i_hw_write_enable ('0), | ||
.i_hw_write_data ('0), | ||
.i_hw_set (<%= set_signal %>), | ||
.i_hw_clear ('0), | ||
.i_value ('0), | ||
.i_mask ('1), | ||
.o_value (<%= value_out[loop_variables] %>), | ||
.o_value_unmasked () | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# frozen_string_literal: true | ||
|
||
RgGen.define_list_item_feature(:bit_field, :type, :rws) do | ||
sv_rtl do | ||
build do | ||
unless bit_field.reference? | ||
input :set, { | ||
name: "i_#{full_name}_set", width: 1, | ||
array_size: array_size, array_format: array_port_format | ||
} | ||
end | ||
output :value_out, { | ||
name: "o_#{full_name}", width: width, | ||
array_size: array_size, array_format: array_port_format | ||
} | ||
end | ||
|
||
main_code :bit_field, from_template: true | ||
|
||
private | ||
|
||
def set_signal | ||
reference_bit_field || set[loop_variables] | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
# frozen_string_literal: true | ||
|
||
RSpec.describe 'bit_field/type/rws' do | ||
include_context 'clean-up builder' | ||
include_context 'bit field ral common' | ||
|
||
before(:all) do | ||
RgGen.enable(:bit_field, :type, [:rw, :rws]) | ||
end | ||
|
||
specify 'アクセス属性はRW' do | ||
sv_ral = create_sv_ral do | ||
register do | ||
name 'register_0' | ||
bit_field { name 'bit_field_0'; bit_assignment lsb: 0; type :rws; initial_value 0 } | ||
bit_field { name 'bit_field_1'; bit_assignment lsb: 1; type :rws; initial_value 0; reference 'register_1.bit_field_0' } | ||
end | ||
|
||
register do | ||
name 'register_1' | ||
bit_field { name 'bit_field_0'; bit_assignment lsb: 0; type :rw; initial_value 0 } | ||
end | ||
end | ||
|
||
expect(sv_ral.bit_fields[0].access).to eq 'RW' | ||
expect(sv_ral.bit_fields[1].access).to eq 'RW' | ||
end | ||
end |
Oops, something went wrong.