-
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.
Redefine rws bit field type (#101, rggen/rggen#184)
* rename bit field types * rol -> rohw * rws -> rwhw * redefine rws bit field type
- Loading branch information
1 parent
1ce5f81
commit f127675
Showing
17 changed files
with
866 additions
and
228 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 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, [:rof, :rohw]) do | ||
sv_ral { access 'RO' } | ||
end |
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 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
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
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,19 @@ | ||
rggen_bit_field #( | ||
.WIDTH (<%= width %>), | ||
.INITIAL_VALUE (<%= initial_value %>) | ||
) 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 (<%= valid_signal %>), | ||
.i_hw_write_data (<%= value_in[loop_variables] %>), | ||
.i_hw_set ('0), | ||
.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,30 @@ | ||
# frozen_string_literal: true | ||
|
||
RgGen.define_list_item_feature(:bit_field, :type, :rwhw) do | ||
sv_rtl do | ||
build do | ||
unless bit_field.reference? | ||
input :valid, { | ||
name: "i_#{full_name}_valid", width: 1, | ||
array_size: array_size, array_format: array_port_format | ||
} | ||
end | ||
input :value_in, { | ||
name: "i_#{full_name}", width: width, | ||
array_size: array_size, array_format: array_port_format | ||
} | ||
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 valid_signal | ||
reference_bit_field || valid[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
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
8 changes: 4 additions & 4 deletions
8
...temverilog/ral/bit_field/type/rol_spec.rb → ...emverilog/ral/bit_field/type/rohw_spec.rb
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,29 @@ | ||
|
||
# frozen_string_literal: true | ||
|
||
RSpec.describe 'bit_field/type/rwhw' do | ||
include_context 'clean-up builder' | ||
include_context 'bit field ral common' | ||
|
||
before(:all) do | ||
RgGen.enable(:bit_field, :type, [:rw, :rwhw]) | ||
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 :rwhw; initial_value 0 } | ||
bit_field { name 'bit_field_1'; bit_assignment lsb: 1; type :rwhw; 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.