Skip to content

Commit 9e33cfc

Browse files
authored
Merge pull request #299 from krcb197/281-remove-legacy_enum_type
Remove the Legacy Enum
2 parents 875adf8 + 2905fe9 commit 9e33cfc

15 files changed

Lines changed: 50 additions & 141 deletions

.github/workflows/action.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,6 @@ jobs:
142142
sleep 10
143143
python -m generate_and_test --RDL_source_file tests/testcases/accelera-generic_example.rdl --root_node some_register_map --legacy_block_access
144144
sleep 10
145-
python -m generate_and_test --RDL_source_file tests/testcases/accelera-generic_example.rdl --root_node some_register_map --legacy_enum_type
146-
sleep 10
147145
python -m generate_and_test --RDL_source_file tests/testcases/accelera-generic_example.rdl --root_node some_register_map --copy_libraries
148146
sleep 10
149147
python -m generate_and_test --RDL_source_file tests/testcases/accelera-generic_example.rdl --root_node some_register_map --hashing_mode PYTHONHASH
@@ -221,9 +219,6 @@ jobs:
221219
222220
peakrdl python tests/testcases/basic.rdl -o peakrdl_out/no_lib/ --skip_library_copy
223221
python -m unittest discover -s peakrdl_out/no_lib
224-
225-
peakrdl python tests/testcases/enum_example.rdl -o peakrdl_out/raw_legacy_enum/ --legacy_enum_type
226-
python -m unittest discover -s peakrdl_out/raw_legacy_enum
227222
228223
# test a TOMl file that passes in overridden templates
229224
peakrdl python tests/testcases/basic.rdl -o peakrdl_out/simple_user_template/ --peakrdl-cfg tests/alternative_templates_toml/peakrdl.toml

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,13 @@ the following options were changed:
130130
This had some restrictions, so the a new methodology based on the `list` type was introduced in version 0.9.
131131
The old array based behaviour is no longer the default but can be turned on using the `legacy_block_access`
132132

133+
## 4.0.0
134+
135+
some legacy features from the early versions were removed in release 4.0.0, the following options were changed:
136+
- Version 1.2 introduced a new custom enumeration type (rather than using `IntEnum`) in order to allow
137+
the content to `name` and `desc` systemRDL properties in be accessible. Version 4.0.0 removed the option to use `IntEnum`
138+
- The first versions of PeakRDL Python used the built-in `Array` type for accessing blocks of data efficiently.
139+
This had some restrictions, so a new methodology based on the `list` type was introduced in version 0.9.
140+
The old array based behaviour was removed in this version
141+
133142

docs/generated_package.rst

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -187,24 +187,6 @@ Legacy Block Callback and Block Access
187187

188188
The ``legacy_block_access`` will now default to ``False``
189189

190-
Legacy Enumeration Types
191-
------------------------
192-
193-
.. versionchanged:: 1.2.0
194-
195-
Previous versions of PeakRDL Python used `IntEnum` for the the field encoding. This had a
196-
limitation that the metadata from the system RDL code, notably the ``name`` and ``desc``
197-
property could not be included. A new data type for the enumerations was introduced in
198-
version 1.2.0.
199-
200-
There was a small risk this may impact some users code, in the case of advanced usage of the
201-
enumeration. The old behaviour can be brought back using the ``legacy_enum_type`` build option.
202-
203-
.. versionchanged:: 3.0.0
204-
205-
The ``legacy_enum_type`` will now default to ``False``
206-
207-
208190
Using the Register Access Layer
209191
===============================
210192

generate_and_test.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,6 @@
9797
type=pathlib.Path, required=False,
9898
help='export a text file with a list of the all qualified instance'
9999
'names in the systemRDL')
100-
CommandLineParser.add_argument('--legacy_enum_type', action='store_true',
101-
dest='legacy_enum_type',
102-
help='peakrdl python has ways to define field encoding as enums a '
103-
'a new method and an old method based on IntEnum. Setting '
104-
'this to true will restore the old behaviour')
105100
CommandLineParser.add_argument('--skip_systemrdl_name_and_desc_properties',
106101
action='store_true',
107102
dest='skip_systemrdl_name_and_desc_properties',
@@ -224,7 +219,6 @@ def build_logging_cong(logfilepath:str):
224219
user_defined_properties_to_include=CommandLineArgs.udp,
225220
user_defined_properties_to_include_regex=CommandLineArgs.udp_regex,
226221
hidden_inst_name_regex=CommandLineArgs.hide_regex,
227-
legacy_enum_type=CommandLineArgs.legacy_enum_type,
228222
skip_systemrdl_name_and_desc_properties=
229223
CommandLineArgs.skip_systemrdl_name_and_desc_properties,
230224
skip_systemrdl_name_and_desc_in_docstring=

generate_testcases.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ def compile_rdl(infile: str,
8484
def generate(root: Node, outdir: str,
8585
asyncoutput: bool = False,
8686
legacy_block_access: bool = True,
87-
legacy_enum_type: bool = True,
8887
copy_library: bool = False,
8988
skip_systemrdl_name_and_desc_in_docstring: bool = False,
9089
hashing_mode: NodeHashingMethod = NodeHashingMethod.PYTHONHASH) -> List[str]:
@@ -96,8 +95,6 @@ def generate(root: Node, outdir: str,
9695
outdir: directory to store the result in
9796
legacy_block_access: If set to True the code build a register model the legacy array block
9897
access as opposed to the newer list based
99-
legacy_enum_type: If set to True the code with build with the old style IntEnum rather than
100-
the new style SystemRDLEnum
10198
10299
Returns:
103100
List of strings with the module names generated
@@ -108,7 +105,6 @@ def generate(root: Node, outdir: str,
108105
root, outdir, # type: ignore[no-untyped-call]
109106
asyncoutput=asyncoutput,
110107
legacy_block_access=legacy_block_access,
111-
legacy_enum_type=legacy_enum_type,
112108
skip_library_copy=not copy_library,
113109
skip_systemrdl_name_and_desc_in_docstring=
114110
skip_systemrdl_name_and_desc_in_docstring,
@@ -174,7 +170,6 @@ def generate(root: Node, outdir: str,
174170
_ = generate(root, str(output_path / folder_parts),
175171
asyncoutput=asyncoutput,
176172
legacy_block_access=legacy,
177-
legacy_enum_type=legacy,
178173
copy_library=CommandLineArgs.copy_libraries,
179174
skip_systemrdl_name_and_desc_in_docstring=skip_name_and_desc_in_docstring,
180175
hashing_mode=hashing_method)

src/peakrdl_python/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
1818
Variables that describes the peakrdl-python Package
1919
"""
20-
__version__ = "3.1.0"
20+
__version__ = "4.0.0rc1"

src/peakrdl_python/__peakrdl__.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,6 @@ def add_exporter_arguments(self, arg_group: 'argparse._ActionsContainer') -> Non
9797
'be hidden')
9898
arg_group.add_argument('--skip_library_copy', action='store_true',
9999
help='skip the copy of the library code into the generated package')
100-
arg_group.add_argument('--legacy_enum_type', action='store_true',
101-
dest='legacy_enum_type',
102-
help='peakrdl python has two ways to define field encoding as '
103-
'enums new method and an old method based on IntEnum. '
104-
'Setting this to true will restore the old behaviour.'
105-
' This option will be removed in version 4.0')
106100
arg_group.add_argument('--skip_systemrdl_name_and_desc_properties', action='store_true',
107101
dest='skip_systemrdl_name_and_desc_properties',
108102
help='peakrdl python includes the system RDL name and desc '
@@ -190,7 +184,6 @@ def do_export(self, top_node: 'AddrmapNode', options: 'argparse.Namespace') -> N
190184
user_defined_properties_to_include_regex=options.udp_regex,
191185
hidden_inst_name_regex=options.hide_regex,
192186
skip_library_copy=options.skip_library_copy,
193-
legacy_enum_type=options.legacy_enum_type,
194187
skip_systemrdl_name_and_desc_properties=
195188
options.skip_systemrdl_name_and_desc_properties,
196189
skip_systemrdl_name_and_desc_in_docstring=

0 commit comments

Comments
 (0)