peakrdl-python 3.1.2__py3-none-any.whl → 4.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- peakrdl_python/__about__.py +2 -2
- peakrdl_python/__init__.py +3 -4
- peakrdl_python/__peakrdl__.py +9 -20
- peakrdl_python/_deploy_package.py +4 -3
- peakrdl_python/_node_walkers.py +4 -3
- peakrdl_python/class_names.py +4 -5
- peakrdl_python/compiler_udp.py +8 -6
- peakrdl_python/exporter.py +32 -113
- peakrdl_python/lib/__init__.py +43 -100
- peakrdl_python/lib/async_memory.py +30 -320
- peakrdl_python/lib/async_register_and_field.py +385 -256
- peakrdl_python/lib/base.py +10 -9
- peakrdl_python/lib/base_field.py +40 -31
- peakrdl_python/lib/base_register.py +51 -7
- peakrdl_python/lib/callbacks.py +18 -166
- peakrdl_python/lib/field_encoding.py +3 -3
- peakrdl_python/lib/memory.py +25 -341
- peakrdl_python/lib/register_and_field.py +319 -218
- peakrdl_python/lib/sections.py +33 -41
- peakrdl_python/lib/utility_functions.py +1 -29
- peakrdl_python/lib_test/__init__.py +3 -5
- peakrdl_python/lib_test/_async_base_test_class.py +2 -1
- peakrdl_python/lib_test/_base_test_class.py +1 -1
- peakrdl_python/lib_test/_common_base_test_class.py +38 -54
- peakrdl_python/lib_test/async_field_test_class.py +14 -15
- peakrdl_python/lib_test/async_mem_test_class.py +36 -128
- peakrdl_python/lib_test/async_reg_test_class.py +78 -21
- peakrdl_python/lib_test/async_test_class.py +3 -2
- peakrdl_python/lib_test/field_test_class.py +14 -16
- peakrdl_python/lib_test/mem_test_class.py +28 -126
- peakrdl_python/lib_test/reg_test_class.py +89 -35
- peakrdl_python/lib_test/test_class.py +3 -2
- peakrdl_python/lib_test/utilities.py +13 -14
- peakrdl_python/safe_name_utility.py +6 -19
- peakrdl_python/sim_lib/_callbacks.py +1 -1
- peakrdl_python/sim_lib/base.py +1 -1
- peakrdl_python/sim_lib/dummy_callbacks.py +1 -87
- peakrdl_python/sim_lib/field.py +2 -5
- peakrdl_python/sim_lib/memory.py +2 -2
- peakrdl_python/sim_lib/register.py +7 -6
- peakrdl_python/sim_lib/simulator.py +5 -106
- peakrdl_python/systemrdl_node_hashes.py +20 -20
- peakrdl_python/systemrdl_node_utility_functions.py +6 -12
- peakrdl_python/templates/__init__.py +1 -1
- peakrdl_python/templates/addrmap.py.jinja +11 -13
- peakrdl_python/templates/addrmap_field.py.jinja +1 -1
- peakrdl_python/templates/addrmap_memory.py.jinja +8 -9
- peakrdl_python/templates/addrmap_register.py.jinja +35 -19
- peakrdl_python/templates/addrmap_simulation.py.jinja +4 -4
- peakrdl_python/templates/addrmap_simulation_tb.py.jinja +5 -20
- peakrdl_python/templates/addrmap_system_rdl_name_mapping.py.jinja +1 -1
- peakrdl_python/templates/addrmap_tb.py.jinja +16 -175
- peakrdl_python/templates/addrmap_udp_property.py.jinja +1 -1
- peakrdl_python/templates/addrmap_universal_property.py.jinja +1 -1
- peakrdl_python/templates/baseclass_simulation_tb.py.jinja +4 -5
- peakrdl_python/templates/baseclass_tb.py.jinja +15 -49
- peakrdl_python/templates/child_definitions.py.jinja +1 -1
- peakrdl_python/templates/example.py.jinja +3 -3
- peakrdl_python/templates/field_enums.py.jinja +3 -9
- peakrdl_python/templates/header.py.jinja +1 -1
- peakrdl_python/templates/header_tb.py.jinja +1 -1
- peakrdl_python/templates/property_enums.py.jinja +3 -8
- peakrdl_python/templates/reg_definitions.py.jinja +1 -1
- peakrdl_python/templates/template_ultilities.py.jinja +1 -1
- peakrdl_python/unique_component_iterator.py +46 -18
- {peakrdl_python-3.1.2.dist-info → peakrdl_python-4.0.0.dist-info}/METADATA +21 -1
- peakrdl_python-4.0.0.dist-info/RECORD +76 -0
- {peakrdl_python-3.1.2.dist-info → peakrdl_python-4.0.0.dist-info}/WHEEL +1 -1
- peakrdl_python-3.1.2.dist-info/RECORD +0 -76
- {peakrdl_python-3.1.2.dist-info → peakrdl_python-4.0.0.dist-info}/entry_points.txt +0 -0
- {peakrdl_python-3.1.2.dist-info → peakrdl_python-4.0.0.dist-info}/licenses/LICENSE +0 -0
- {peakrdl_python-3.1.2.dist-info → peakrdl_python-4.0.0.dist-info}/top_level.txt +0 -0
peakrdl_python/__about__.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""
|
|
2
2
|
peakrdl-python is a tool to generate Python Register Access Layer (RAL) from SystemRDL
|
|
3
|
-
Copyright (C) 2021 -
|
|
3
|
+
Copyright (C) 2021 - 2026
|
|
4
4
|
|
|
5
5
|
This program is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU Lesser General Public License as
|
|
@@ -17,4 +17,4 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
17
17
|
|
|
18
18
|
Variables that describes the peakrdl-python Package
|
|
19
19
|
"""
|
|
20
|
-
__version__ = "
|
|
20
|
+
__version__ = "4.0.0"
|
peakrdl_python/__init__.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""
|
|
2
2
|
peakrdl-python is a tool to generate Python Register Access Layer (RAL) from SystemRDL
|
|
3
|
-
Copyright (C) 2021 -
|
|
3
|
+
Copyright (C) 2021 - 2026
|
|
4
4
|
|
|
5
5
|
This program is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU Lesser General Public License as
|
|
@@ -16,8 +16,7 @@ You should have received a copy of the GNU Lesser General Public License
|
|
|
16
16
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
17
|
|
|
18
18
|
"""
|
|
19
|
+
from .compiler_udp import (PythonHideUDP, PythonInstNameUDP,
|
|
20
|
+
compiler_with_udp_registers)
|
|
19
21
|
from .exporter import PythonExporter
|
|
20
22
|
from .systemrdl_node_hashes import NodeHashingMethod
|
|
21
|
-
|
|
22
|
-
from .compiler_udp import PythonHideUDP, PythonInstNameUDP
|
|
23
|
-
from .compiler_udp import compiler_with_udp_registers
|
peakrdl_python/__peakrdl__.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""
|
|
2
2
|
peakrdl-python is a tool to generate Python Register Access Layer (RAL) from SystemRDL
|
|
3
|
-
Copyright (C) 2021 -
|
|
3
|
+
Copyright (C) 2021 - 2026
|
|
4
4
|
|
|
5
5
|
This program is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU Lesser General Public License as
|
|
@@ -23,20 +23,22 @@ from typing import TYPE_CHECKING
|
|
|
23
23
|
# depending on whether peakrdl is installed or not you get a slightly different pylint error
|
|
24
24
|
# from the following line, therefore two errors have to be suppressed
|
|
25
25
|
#pylint: disable=no-name-in-module,import-error
|
|
26
|
-
from peakrdl.plugins.exporter import ExporterSubcommandPlugin # type: ignore[import]
|
|
27
26
|
from peakrdl.config import schema # type: ignore[import]
|
|
27
|
+
from peakrdl.plugins.exporter import ExporterSubcommandPlugin # type: ignore[import]
|
|
28
28
|
#pylint: enable=no-name-in-module,import-error
|
|
29
29
|
|
|
30
|
-
from .exporter import PythonExporter
|
|
31
|
-
from .exporter import DEFAULT_REGISTER_CLASS_PER_GENERATED_FILE
|
|
32
|
-
from .exporter import DEFAULT_FIELD_CLASS_PER_GENERATED_FILE
|
|
33
|
-
from .exporter import DEFAULT_ENUM_FIELD_CLASS_PER_GENERATED_FILE
|
|
34
|
-
from .exporter import DEFAULT_MEMORY_CLASS_PER_GENERATED_FILE
|
|
35
30
|
from .compiler_udp import PythonHideUDP, PythonInstNameUDP
|
|
31
|
+
from .exporter import (DEFAULT_ENUM_FIELD_CLASS_PER_GENERATED_FILE,
|
|
32
|
+
DEFAULT_FIELD_CLASS_PER_GENERATED_FILE,
|
|
33
|
+
DEFAULT_MEMORY_CLASS_PER_GENERATED_FILE,
|
|
34
|
+
DEFAULT_REGISTER_CLASS_PER_GENERATED_FILE,
|
|
35
|
+
PythonExporter)
|
|
36
36
|
from .systemrdl_node_hashes import NodeHashingMethod
|
|
37
37
|
|
|
38
|
+
|
|
38
39
|
if TYPE_CHECKING:
|
|
39
40
|
import argparse
|
|
41
|
+
|
|
40
42
|
from systemrdl.node import AddrmapNode
|
|
41
43
|
|
|
42
44
|
|
|
@@ -77,11 +79,6 @@ class Exporter(ExporterSubcommandPlugin):
|
|
|
77
79
|
'However, if additional python files are added by the user '
|
|
78
80
|
'(not recommended) this cleanup will need to be suppressed '
|
|
79
81
|
'and managed by the user')
|
|
80
|
-
arg_group.add_argument('--legacy_block_access', action='store_true',
|
|
81
|
-
dest='legacy_block_access',
|
|
82
|
-
help='peakrdl python has two methods to hold blocks of data, the '
|
|
83
|
-
'legacy mode based on array.array or the new mode using '
|
|
84
|
-
'lists. This option will be removed in version 4.0')
|
|
85
82
|
arg_group.add_argument('--show_hidden', action='store_true',
|
|
86
83
|
dest='show_hidden',
|
|
87
84
|
help='show addrmap, regfile, memory, register and fields that '
|
|
@@ -97,12 +94,6 @@ class Exporter(ExporterSubcommandPlugin):
|
|
|
97
94
|
'be hidden')
|
|
98
95
|
arg_group.add_argument('--skip_library_copy', action='store_true',
|
|
99
96
|
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')
|
|
106
97
|
arg_group.add_argument('--skip_systemrdl_name_and_desc_properties', action='store_true',
|
|
107
98
|
dest='skip_systemrdl_name_and_desc_properties',
|
|
108
99
|
help='peakrdl python includes the system RDL name and desc '
|
|
@@ -184,13 +175,11 @@ class Exporter(ExporterSubcommandPlugin):
|
|
|
184
175
|
asyncoutput=options.is_async,
|
|
185
176
|
skip_test_case_generation=options.skip_test_case_generation,
|
|
186
177
|
delete_existing_package_content=not options.suppress_cleanup,
|
|
187
|
-
legacy_block_access=options.legacy_block_access,
|
|
188
178
|
show_hidden=options.show_hidden,
|
|
189
179
|
user_defined_properties_to_include=options.udp,
|
|
190
180
|
user_defined_properties_to_include_regex=options.udp_regex,
|
|
191
181
|
hidden_inst_name_regex=options.hide_regex,
|
|
192
182
|
skip_library_copy=options.skip_library_copy,
|
|
193
|
-
legacy_enum_type=options.legacy_enum_type,
|
|
194
183
|
skip_systemrdl_name_and_desc_properties=
|
|
195
184
|
options.skip_systemrdl_name_and_desc_properties,
|
|
196
185
|
skip_systemrdl_name_and_desc_in_docstring=
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""
|
|
2
2
|
peakrdl-python is a tool to generate Python Register Access Layer (RAL) from SystemRDL
|
|
3
|
-
Copyright (C) 2021 -
|
|
3
|
+
Copyright (C) 2021 - 2026
|
|
4
4
|
|
|
5
5
|
This program is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU Lesser General Public License as
|
|
@@ -18,11 +18,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
18
18
|
Classes to represent the package that is generated
|
|
19
19
|
"""
|
|
20
20
|
import os
|
|
21
|
+
from collections.abc import Generator
|
|
22
|
+
from contextlib import contextmanager
|
|
21
23
|
from pathlib import Path
|
|
22
24
|
from shutil import copy
|
|
23
25
|
from typing import TextIO
|
|
24
|
-
|
|
25
|
-
from collections.abc import Generator
|
|
26
|
+
|
|
26
27
|
|
|
27
28
|
class PythonPackage:
|
|
28
29
|
"""
|
peakrdl_python/_node_walkers.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""
|
|
2
2
|
peakrdl-python is a tool to generate Python Register Access Layer (RAL) from SystemRDL
|
|
3
|
-
Copyright (C) 2021 -
|
|
3
|
+
Copyright (C) 2021 - 2026
|
|
4
4
|
|
|
5
5
|
This program is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU Lesser General Public License as
|
|
@@ -17,11 +17,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
17
17
|
|
|
18
18
|
Node walkers to be used in the generated of the output code
|
|
19
19
|
"""
|
|
20
|
-
from typing import Optional, Union
|
|
21
20
|
from collections.abc import Iterator
|
|
21
|
+
from typing import Optional, Union
|
|
22
22
|
|
|
23
23
|
from systemrdl import RDLListener, WalkerAction
|
|
24
|
-
from systemrdl.node import
|
|
24
|
+
from systemrdl.node import (AddrmapNode, FieldNode, MemNode, RegfileNode,
|
|
25
|
+
RegNode)
|
|
25
26
|
|
|
26
27
|
from .systemrdl_node_utility_functions import HideNodeCallback
|
|
27
28
|
|
peakrdl_python/class_names.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""
|
|
2
2
|
peakrdl-python is a tool to generate Python Register Access Layer (RAL) from SystemRDL
|
|
3
|
-
Copyright (C) 2021 -
|
|
3
|
+
Copyright (C) 2021 - 2026
|
|
4
4
|
|
|
5
5
|
This program is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU Lesser General Public License as
|
|
@@ -17,12 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
17
17
|
|
|
18
18
|
A module for determining the classes names to use
|
|
19
19
|
"""
|
|
20
|
-
from systemrdl.node import Node
|
|
21
|
-
|
|
22
|
-
from systemrdl.node import RegNode
|
|
23
|
-
from systemrdl.node import MemNode
|
|
20
|
+
from systemrdl.node import FieldNode, MemNode, Node, RegNode
|
|
21
|
+
|
|
24
22
|
from .systemrdl_node_utility_functions import is_encoded_field
|
|
25
23
|
|
|
24
|
+
|
|
26
25
|
def get_field_get_base_class_name(node: FieldNode, async_library_classes: bool) -> str:
|
|
27
26
|
"""
|
|
28
27
|
Provide the library base class name (as a string) for a System RDL Field Node. This takes
|
peakrdl_python/compiler_udp.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""
|
|
2
2
|
peakrdl-python is a tool to generate Python Register Access Layer (RAL) from SystemRDL
|
|
3
|
-
Copyright (C) 2021 -
|
|
3
|
+
Copyright (C) 2021 - 2026
|
|
4
4
|
|
|
5
5
|
This program is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU Lesser General Public License as
|
|
@@ -18,14 +18,16 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
18
18
|
Defined the compiler classes that are used
|
|
19
19
|
"""
|
|
20
20
|
from typing import Any
|
|
21
|
+
|
|
21
22
|
from systemrdl import RDLCompiler
|
|
23
|
+
from systemrdl.component import Addrmap, Field, Mem, Reg, Regfile
|
|
24
|
+
from systemrdl.node import (AddrmapNode, FieldNode, MemNode, Node, RegfileNode,
|
|
25
|
+
RegNode)
|
|
22
26
|
from systemrdl.udp import UDPDefinition
|
|
23
|
-
from systemrdl.component import Field, Reg, Regfile, Mem, Addrmap
|
|
24
|
-
from systemrdl.node import FieldNode, RegNode, RegfileNode, MemNode, AddrmapNode
|
|
25
|
-
from systemrdl.node import Node
|
|
26
27
|
|
|
27
|
-
from .safe_name_utility import
|
|
28
|
-
|
|
28
|
+
from .safe_name_utility import (is_safe_addrmap_name, is_safe_field_name,
|
|
29
|
+
is_safe_memory_name, is_safe_regfile_name,
|
|
30
|
+
is_safe_register_name)
|
|
29
31
|
|
|
30
32
|
|
|
31
33
|
def compiler_with_udp_registers(**kwargs: Any) -> RDLCompiler:
|
peakrdl_python/exporter.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""
|
|
2
2
|
peakrdl-python is a tool to generate Python Register Access Layer (RAL) from SystemRDL
|
|
3
|
-
Copyright (C) 2021 -
|
|
3
|
+
Copyright (C) 2021 - 2026
|
|
4
4
|
|
|
5
5
|
This program is free software: you can redistribute it and/or modify
|
|
6
6
|
it under the terms of the GNU Lesser General Public License as
|
|
@@ -20,50 +20,38 @@ Main Classes for the peakrdl-python
|
|
|
20
20
|
# pylint:disable=too-many-lines
|
|
21
21
|
import os
|
|
22
22
|
import re
|
|
23
|
-
|
|
24
|
-
from typing import NoReturn, Any, Optional, Union, TextIO
|
|
25
|
-
from collections.abc import Callable
|
|
26
|
-
|
|
27
|
-
from functools import partial
|
|
28
23
|
import sys
|
|
29
|
-
from itertools import filterfalse, chain
|
|
30
24
|
import warnings
|
|
25
|
+
from collections.abc import Callable
|
|
26
|
+
from functools import partial
|
|
27
|
+
from itertools import chain, filterfalse
|
|
28
|
+
from typing import Any, NoReturn, Optional, TextIO, Union
|
|
31
29
|
|
|
32
30
|
import jinja2 as jj
|
|
33
31
|
from systemrdl import RDLWalker
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
from systemrdl.node import FieldNode, MemNode, AddressableNode
|
|
37
|
-
from systemrdl.node import SignalNode
|
|
32
|
+
from systemrdl.node import (AddressableNode, AddrmapNode, FieldNode, MemNode,
|
|
33
|
+
Node, RegfileNode, RegNode, RootNode, SignalNode)
|
|
38
34
|
from systemrdl.rdltypes.user_enum import UserEnum, UserEnumMeta
|
|
39
35
|
from systemrdl.rdltypes.user_struct import UserStruct
|
|
40
36
|
|
|
41
|
-
from .
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
get_field_max_value_hex_string, get_reg_max_value_hex_string, \
|
|
45
|
-
uses_enum, uses_memory, \
|
|
46
|
-
get_memory_max_entry_value_hex_string, get_memory_width_bytes, \
|
|
47
|
-
get_field_default_value, get_enum_values, get_properties_to_include, \
|
|
48
|
-
HideNodeCallback, hide_based_on_property, \
|
|
49
|
-
full_slice_accessor, ShowUDPCallback, \
|
|
50
|
-
node_iterator_entry, simulator_field_definition
|
|
51
|
-
from .unique_component_iterator import UniqueComponents
|
|
52
|
-
from .unique_component_iterator import PeakRDLPythonUniqueRegisterComponents
|
|
53
|
-
from .unique_component_iterator import PeakRDLPythonUniqueMemoryComponents
|
|
54
|
-
from .unique_component_iterator import PeakRDLPythonUniqueFieldEnum
|
|
37
|
+
from .__about__ import __version__
|
|
38
|
+
from ._deploy_package import GeneratedPackage, PythonPackage
|
|
39
|
+
from ._node_walkers import AddressMaps, OwnedbyAddressMap
|
|
55
40
|
from .class_names import get_field_get_base_class_name
|
|
56
|
-
from .systemrdl_node_hashes import NodeHashingMethod
|
|
57
|
-
|
|
58
|
-
from .lib import get_array_typecode
|
|
59
|
-
|
|
60
41
|
from .safe_name_utility import get_python_path_segments, safe_node_name
|
|
61
|
-
|
|
62
|
-
from .
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
42
|
+
from .systemrdl_node_hashes import NodeHashingMethod
|
|
43
|
+
from .systemrdl_node_utility_functions import (
|
|
44
|
+
HideNodeCallback, ShowUDPCallback, full_slice_accessor, get_enum_values,
|
|
45
|
+
get_field_bitmask_hex_string, get_field_default_value,
|
|
46
|
+
get_field_inv_bitmask_hex_string, get_field_max_value_hex_string,
|
|
47
|
+
get_memory_max_entry_value_hex_string, get_memory_width_bytes,
|
|
48
|
+
get_properties_to_include, get_reg_max_value_hex_string,
|
|
49
|
+
get_reg_writable_fields, get_table_block, hide_based_on_property,
|
|
50
|
+
node_iterator_entry, simulator_field_definition, uses_enum, uses_memory)
|
|
51
|
+
from .unique_component_iterator import (PeakRDLPythonUniqueFieldEnum,
|
|
52
|
+
PeakRDLPythonUniqueMemoryComponents,
|
|
53
|
+
PeakRDLPythonUniqueRegisterComponents,
|
|
54
|
+
UniqueComponents)
|
|
67
55
|
|
|
68
56
|
file_path = os.path.dirname(__file__)
|
|
69
57
|
|
|
@@ -191,10 +179,8 @@ class PythonExporter:
|
|
|
191
179
|
package: GeneratedPackage,
|
|
192
180
|
skip_lib_copy: bool,
|
|
193
181
|
asyncoutput: bool,
|
|
194
|
-
legacy_block_access: bool,
|
|
195
182
|
udp_include_func: ShowUDPCallback,
|
|
196
183
|
hide_node_func: HideNodeCallback,
|
|
197
|
-
legacy_enum_type: bool,
|
|
198
184
|
skip_systemrdl_name_and_desc_properties: bool,
|
|
199
185
|
skip_systemrdl_name_and_desc_in_docstring: bool,
|
|
200
186
|
register_class_per_generated_file: int,
|
|
@@ -258,17 +244,13 @@ class PythonExporter:
|
|
|
258
244
|
'raise_template_error': self._raise_template_error,
|
|
259
245
|
'safe_node_name': safe_node_name,
|
|
260
246
|
'skip_lib_copy': skip_lib_copy,
|
|
261
|
-
'legacy_block_access': legacy_block_access,
|
|
262
247
|
'get_properties_to_include': get_properties_to_include,
|
|
263
248
|
'unique_property_enums':
|
|
264
249
|
self._get_dependent_property_enum(unique_component_walker),
|
|
265
250
|
'hide_node_func': hide_node_func,
|
|
266
251
|
'visible_nonsignal_node' : visible_nonsignal_node,
|
|
267
|
-
'legacy_enum_type': legacy_enum_type,
|
|
268
252
|
'skip_systemrdl_name_and_desc_properties': skip_systemrdl_name_and_desc_properties,
|
|
269
253
|
}
|
|
270
|
-
if legacy_block_access is True:
|
|
271
|
-
context['get_array_typecode'] = get_array_typecode
|
|
272
254
|
|
|
273
255
|
module_name = top_block.inst_name
|
|
274
256
|
self.__stream_jinja_template(template_name="addrmap.py.jinja",
|
|
@@ -289,9 +271,7 @@ class PythonExporter:
|
|
|
289
271
|
package=package,
|
|
290
272
|
skip_lib_copy=skip_lib_copy,
|
|
291
273
|
asyncoutput=asyncoutput,
|
|
292
|
-
legacy_block_access=legacy_block_access,
|
|
293
274
|
hide_node_func=hide_node_func,
|
|
294
|
-
legacy_enum_type=legacy_enum_type,
|
|
295
275
|
skip_systemrdl_name_and_desc_properties=skip_systemrdl_name_and_desc_properties,
|
|
296
276
|
skip_systemrdl_name_and_desc_in_docstring=
|
|
297
277
|
skip_systemrdl_name_and_desc_in_docstring,
|
|
@@ -305,9 +285,7 @@ class PythonExporter:
|
|
|
305
285
|
package=package,
|
|
306
286
|
skip_lib_copy=skip_lib_copy,
|
|
307
287
|
asyncoutput=asyncoutput,
|
|
308
|
-
legacy_block_access=legacy_block_access,
|
|
309
288
|
hide_node_func=hide_node_func,
|
|
310
|
-
legacy_enum_type=legacy_enum_type,
|
|
311
289
|
skip_systemrdl_name_and_desc_properties=skip_systemrdl_name_and_desc_properties,
|
|
312
290
|
skip_systemrdl_name_and_desc_in_docstring=skip_systemrdl_name_and_desc_in_docstring,
|
|
313
291
|
unique_component_walker=unique_component_walker,
|
|
@@ -320,7 +298,6 @@ class PythonExporter:
|
|
|
320
298
|
package=package,
|
|
321
299
|
skip_lib_copy=skip_lib_copy,
|
|
322
300
|
asyncoutput=asyncoutput,
|
|
323
|
-
legacy_enum_type=legacy_enum_type,
|
|
324
301
|
skip_systemrdl_name_and_desc_properties=skip_systemrdl_name_and_desc_properties,
|
|
325
302
|
skip_systemrdl_name_and_desc_in_docstring=skip_systemrdl_name_and_desc_in_docstring,
|
|
326
303
|
unique_component_walker=unique_component_walker,
|
|
@@ -332,7 +309,6 @@ class PythonExporter:
|
|
|
332
309
|
top_block=top_block,
|
|
333
310
|
package=package,
|
|
334
311
|
skip_lib_copy=skip_lib_copy,
|
|
335
|
-
legacy_enum_type=legacy_enum_type,
|
|
336
312
|
skip_systemrdl_name_and_desc_properties=skip_systemrdl_name_and_desc_properties,
|
|
337
313
|
unique_component_walker=unique_component_walker,
|
|
338
314
|
enum_field_class_per_generated_file=enum_field_class_per_generated_file)
|
|
@@ -342,8 +318,7 @@ class PythonExporter:
|
|
|
342
318
|
'top_node': top_block,
|
|
343
319
|
'unique_property_enums':
|
|
344
320
|
self._get_dependent_property_enum(unique_component_walker),
|
|
345
|
-
'skip_lib_copy': skip_lib_copy
|
|
346
|
-
'legacy_enum_type': legacy_enum_type,
|
|
321
|
+
'skip_lib_copy': skip_lib_copy
|
|
347
322
|
}
|
|
348
323
|
|
|
349
324
|
self.__stream_jinja_template(template_name="property_enums.py.jinja",
|
|
@@ -357,9 +332,7 @@ class PythonExporter:
|
|
|
357
332
|
package: GeneratedPackage,
|
|
358
333
|
skip_lib_copy: bool,
|
|
359
334
|
asyncoutput: bool,
|
|
360
|
-
legacy_block_access: bool,
|
|
361
335
|
hide_node_func: HideNodeCallback,
|
|
362
|
-
legacy_enum_type: bool,
|
|
363
336
|
skip_systemrdl_name_and_desc_properties: bool,
|
|
364
337
|
skip_systemrdl_name_and_desc_in_docstring: bool,
|
|
365
338
|
unique_component_walker: UniqueComponents,
|
|
@@ -440,8 +413,6 @@ class PythonExporter:
|
|
|
440
413
|
'get_field_default_value': get_field_default_value,
|
|
441
414
|
'skip_lib_copy': skip_lib_copy,
|
|
442
415
|
'uses_enum': uses_enum(top_block),
|
|
443
|
-
'legacy_enum_type': legacy_enum_type,
|
|
444
|
-
'legacy_block_access': legacy_block_access,
|
|
445
416
|
'skip_systemrdl_name_and_desc_properties':
|
|
446
417
|
skip_systemrdl_name_and_desc_properties,
|
|
447
418
|
'raise_template_error': self._raise_template_error,
|
|
@@ -467,9 +438,7 @@ class PythonExporter:
|
|
|
467
438
|
package: GeneratedPackage,
|
|
468
439
|
skip_lib_copy: bool,
|
|
469
440
|
asyncoutput: bool,
|
|
470
|
-
legacy_block_access: bool,
|
|
471
441
|
hide_node_func: HideNodeCallback,
|
|
472
|
-
legacy_enum_type: bool,
|
|
473
442
|
skip_systemrdl_name_and_desc_properties: bool,
|
|
474
443
|
skip_systemrdl_name_and_desc_in_docstring: bool,
|
|
475
444
|
unique_component_walker: UniqueComponents,
|
|
@@ -541,8 +510,6 @@ class PythonExporter:
|
|
|
541
510
|
'get_field_default_value': get_field_default_value,
|
|
542
511
|
'skip_lib_copy': skip_lib_copy,
|
|
543
512
|
'uses_enum': uses_enum(top_block),
|
|
544
|
-
'legacy_enum_type': legacy_enum_type,
|
|
545
|
-
'legacy_block_access': legacy_block_access,
|
|
546
513
|
'skip_systemrdl_name_and_desc_properties':
|
|
547
514
|
skip_systemrdl_name_and_desc_properties,
|
|
548
515
|
'raise_template_error': self._raise_template_error,
|
|
@@ -567,7 +534,6 @@ class PythonExporter:
|
|
|
567
534
|
package: GeneratedPackage,
|
|
568
535
|
skip_lib_copy: bool,
|
|
569
536
|
asyncoutput: bool,
|
|
570
|
-
legacy_enum_type: bool,
|
|
571
537
|
skip_systemrdl_name_and_desc_properties: bool,
|
|
572
538
|
skip_systemrdl_name_and_desc_in_docstring: bool,
|
|
573
539
|
unique_component_walker: UniqueComponents,
|
|
@@ -612,7 +578,6 @@ class PythonExporter:
|
|
|
612
578
|
skip_systemrdl_name_and_desc_in_docstring),
|
|
613
579
|
'skip_lib_copy': skip_lib_copy,
|
|
614
580
|
'uses_enum': uses_enum(top_block),
|
|
615
|
-
'legacy_enum_type': legacy_enum_type,
|
|
616
581
|
'skip_systemrdl_name_and_desc_properties':
|
|
617
582
|
skip_systemrdl_name_and_desc_properties,
|
|
618
583
|
'raise_template_error': self._raise_template_error,
|
|
@@ -632,7 +597,6 @@ class PythonExporter:
|
|
|
632
597
|
top_block: AddrmapNode,
|
|
633
598
|
package: GeneratedPackage,
|
|
634
599
|
skip_lib_copy: bool,
|
|
635
|
-
legacy_enum_type: bool,
|
|
636
600
|
skip_systemrdl_name_and_desc_properties: bool,
|
|
637
601
|
unique_component_walker: UniqueComponents,
|
|
638
602
|
enum_field_class_per_generated_file: int) -> None:
|
|
@@ -658,7 +622,6 @@ class PythonExporter:
|
|
|
658
622
|
'top_node': top_block,
|
|
659
623
|
'unique_enums': unique_enums_subset,
|
|
660
624
|
'skip_lib_copy': skip_lib_copy,
|
|
661
|
-
'legacy_enum_type': legacy_enum_type,
|
|
662
625
|
'skip_systemrdl_name_and_desc_properties':
|
|
663
626
|
skip_systemrdl_name_and_desc_properties
|
|
664
627
|
}
|
|
@@ -677,8 +640,7 @@ class PythonExporter:
|
|
|
677
640
|
top_block: AddrmapNode,
|
|
678
641
|
package: GeneratedPackage,
|
|
679
642
|
skip_lib_copy: bool,
|
|
680
|
-
asyncoutput: bool
|
|
681
|
-
legacy_block_access: bool) -> None:
|
|
643
|
+
asyncoutput: bool) -> None:
|
|
682
644
|
|
|
683
645
|
# as a result of issue 202, where two registers existed at that same address,
|
|
684
646
|
# rather than iterating through the registers within the Jinja template
|
|
@@ -711,7 +673,6 @@ class PythonExporter:
|
|
|
711
673
|
'isinstance': isinstance,
|
|
712
674
|
'asyncoutput': asyncoutput,
|
|
713
675
|
'skip_lib_copy': skip_lib_copy,
|
|
714
|
-
'legacy_block_access': legacy_block_access,
|
|
715
676
|
'list': list,
|
|
716
677
|
'simulator_field_definition': simulator_field_definition,
|
|
717
678
|
}
|
|
@@ -733,8 +694,7 @@ class PythonExporter:
|
|
|
733
694
|
top_block: AddrmapNode,
|
|
734
695
|
package: GeneratedPackage,
|
|
735
696
|
skip_lib_copy: bool,
|
|
736
|
-
asyncoutput: bool
|
|
737
|
-
legacy_block_access: bool) -> None:
|
|
697
|
+
asyncoutput: bool) -> None:
|
|
738
698
|
|
|
739
699
|
context = {
|
|
740
700
|
'top_node': top_block,
|
|
@@ -742,8 +702,7 @@ class PythonExporter:
|
|
|
742
702
|
'systemrdlMemNode': MemNode,
|
|
743
703
|
'isinstance': isinstance,
|
|
744
704
|
'asyncoutput': asyncoutput,
|
|
745
|
-
'skip_lib_copy': skip_lib_copy
|
|
746
|
-
'legacy_block_access': legacy_block_access,
|
|
705
|
+
'skip_lib_copy': skip_lib_copy
|
|
747
706
|
}
|
|
748
707
|
|
|
749
708
|
self.__stream_jinja_template(template_name="example.py.jinja",
|
|
@@ -756,16 +715,12 @@ class PythonExporter:
|
|
|
756
715
|
top_block: AddrmapNode,
|
|
757
716
|
package: GeneratedPackage,
|
|
758
717
|
skip_lib_copy: bool,
|
|
759
|
-
asyncoutput: bool
|
|
760
|
-
legacy_block_access: bool,
|
|
761
|
-
legacy_enum_type: bool) -> None:
|
|
718
|
+
asyncoutput: bool) -> None:
|
|
762
719
|
|
|
763
720
|
context = {
|
|
764
721
|
'top_node': top_block,
|
|
765
722
|
'asyncoutput': asyncoutput,
|
|
766
|
-
'skip_lib_copy': skip_lib_copy
|
|
767
|
-
'legacy_block_access': legacy_block_access,
|
|
768
|
-
'legacy_enum_type': legacy_enum_type
|
|
723
|
+
'skip_lib_copy': skip_lib_copy
|
|
769
724
|
}
|
|
770
725
|
|
|
771
726
|
self.__stream_jinja_template(template_name="baseclass_tb.py.jinja",
|
|
@@ -784,10 +739,8 @@ class PythonExporter:
|
|
|
784
739
|
package: GeneratedPackage,
|
|
785
740
|
skip_lib_copy: bool,
|
|
786
741
|
asyncoutput: bool,
|
|
787
|
-
legacy_block_access: bool,
|
|
788
742
|
udp_include_func: ShowUDPCallback,
|
|
789
743
|
hide_node_func: HideNodeCallback,
|
|
790
|
-
legacy_enum_type: bool,
|
|
791
744
|
skip_systemrdl_name_and_desc_properties: bool,
|
|
792
745
|
) -> None:
|
|
793
746
|
|
|
@@ -877,12 +830,9 @@ class PythonExporter:
|
|
|
877
830
|
'asyncoutput': asyncoutput,
|
|
878
831
|
'uses_enum': uses_enum(block),
|
|
879
832
|
'skip_lib_copy': skip_lib_copy,
|
|
880
|
-
'get_array_typecode': get_array_typecode,
|
|
881
|
-
'legacy_block_access': legacy_block_access,
|
|
882
833
|
'udp_include_func': udp_include_func,
|
|
883
834
|
'get_properties_to_include': get_properties_to_include,
|
|
884
835
|
'hide_node_func': hide_node_func,
|
|
885
|
-
'legacy_enum_type': legacy_enum_type,
|
|
886
836
|
'skip_systemrdl_name_and_desc_properties': skip_systemrdl_name_and_desc_properties,
|
|
887
837
|
'node_iterator_entry': node_iterator_entry,
|
|
888
838
|
}
|
|
@@ -968,12 +918,10 @@ class PythonExporter:
|
|
|
968
918
|
skip_test_case_generation: bool = False,
|
|
969
919
|
delete_existing_package_content: bool = True,
|
|
970
920
|
skip_library_copy: bool = False,
|
|
971
|
-
legacy_block_access: bool = False,
|
|
972
921
|
show_hidden: bool = False,
|
|
973
922
|
user_defined_properties_to_include: Optional[list[str]] = None,
|
|
974
923
|
user_defined_properties_to_include_regex: Optional[str] = None,
|
|
975
924
|
hidden_inst_name_regex: Optional[str] = None,
|
|
976
|
-
legacy_enum_type: bool = False,
|
|
977
925
|
skip_systemrdl_name_and_desc_properties: bool = False,
|
|
978
926
|
skip_systemrdl_name_and_desc_in_docstring: bool = False,
|
|
979
927
|
register_class_per_generated_file: int =
|
|
@@ -1004,12 +952,6 @@ class PythonExporter:
|
|
|
1004
952
|
potential licensing implications of package distribution,
|
|
1005
953
|
However, this means the end-user is responsible for
|
|
1006
954
|
installing the libraries.
|
|
1007
|
-
legacy_block_access: version 0.8 changed the block access methods from using
|
|
1008
|
-
arrays to lists. This allows memory widths of other
|
|
1009
|
-
than 8, 16, 32, 64 to be supported which are legal in
|
|
1010
|
-
systemRDL. The legacy mode with Arrays is still in
|
|
1011
|
-
the tool and will be turned on by default for a few
|
|
1012
|
-
releases.
|
|
1013
955
|
show_hidden: By default any item (Address Map, Regfile, Register, Memory or
|
|
1014
956
|
Field) with the systemRDL User Defined Property (UDP)
|
|
1015
957
|
``python_hide`` set to true will not be included in the generated
|
|
@@ -1025,10 +967,6 @@ class PythonExporter:
|
|
|
1025
967
|
hidden_inst_name_regex: A regular expression which will hide any fully
|
|
1026
968
|
qualified instance name that matches, set to None to
|
|
1027
969
|
for this to have no effect
|
|
1028
|
-
legacy_enum_type: version 1.2 introduced a new Enum type that allows system
|
|
1029
|
-
rdl ``name`` and ``desc`` properties on field encoding
|
|
1030
|
-
to be included. The legacy mode uses python IntEnum.
|
|
1031
|
-
.. version-deprecated:: 3.0
|
|
1032
970
|
skip_systemrdl_name_and_desc_properties (bool) : version 1.2 introduced new properties
|
|
1033
971
|
that include the systemRDL name and
|
|
1034
972
|
desc as properties of the built
|
|
@@ -1071,17 +1009,6 @@ class PythonExporter:
|
|
|
1071
1009
|
Returns:
|
|
1072
1010
|
modules that have been exported:
|
|
1073
1011
|
"""
|
|
1074
|
-
if legacy_enum_type:
|
|
1075
|
-
warnings.warn('legacy_enum_type is deprecated and '
|
|
1076
|
-
'will be removed from a future version please try the new mode',
|
|
1077
|
-
category=DeprecationWarning)
|
|
1078
|
-
|
|
1079
|
-
if legacy_block_access:
|
|
1080
|
-
warnings.warn('legacy_block_access is deprecated and '
|
|
1081
|
-
'will be removed from a future version please try the new mode',
|
|
1082
|
-
category=DeprecationWarning)
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
1012
|
# If it is the root node, skip to top addrmap
|
|
1086
1013
|
if isinstance(node, RootNode):
|
|
1087
1014
|
top_block = node.top
|
|
@@ -1122,10 +1049,8 @@ class PythonExporter:
|
|
|
1122
1049
|
self.__export_reg_model(
|
|
1123
1050
|
top_block=top_block, package=package, asyncoutput=asyncoutput,
|
|
1124
1051
|
skip_lib_copy=skip_library_copy,
|
|
1125
|
-
legacy_block_access=legacy_block_access,
|
|
1126
1052
|
udp_include_func=udp_include_func,
|
|
1127
1053
|
hide_node_func=hide_node_func,
|
|
1128
|
-
legacy_enum_type=legacy_enum_type,
|
|
1129
1054
|
skip_systemrdl_name_and_desc_properties=skip_systemrdl_name_and_desc_properties,
|
|
1130
1055
|
skip_systemrdl_name_and_desc_in_docstring=skip_systemrdl_name_and_desc_in_docstring,
|
|
1131
1056
|
register_class_per_generated_file=register_class_per_generated_file,
|
|
@@ -1136,27 +1061,21 @@ class PythonExporter:
|
|
|
1136
1061
|
)
|
|
1137
1062
|
|
|
1138
1063
|
self.__export_simulator(top_block=top_block, package=package, asyncoutput=asyncoutput,
|
|
1139
|
-
skip_lib_copy=skip_library_copy
|
|
1140
|
-
legacy_block_access=legacy_block_access)
|
|
1064
|
+
skip_lib_copy=skip_library_copy)
|
|
1141
1065
|
|
|
1142
1066
|
self.__export_example(top_block=top_block, package=package, asyncoutput=asyncoutput,
|
|
1143
|
-
skip_lib_copy=skip_library_copy
|
|
1144
|
-
legacy_block_access=legacy_block_access)
|
|
1067
|
+
skip_lib_copy=skip_library_copy)
|
|
1145
1068
|
|
|
1146
1069
|
if not skip_test_case_generation:
|
|
1147
1070
|
# export the baseclasses for the tests
|
|
1148
1071
|
self.__export_base_tests(top_block=top_block, package=package, asyncoutput=asyncoutput,
|
|
1149
|
-
skip_lib_copy=skip_library_copy
|
|
1150
|
-
legacy_block_access=legacy_block_access,
|
|
1151
|
-
legacy_enum_type=legacy_enum_type)
|
|
1072
|
+
skip_lib_copy=skip_library_copy)
|
|
1152
1073
|
# export the tests themselves, these are broken down to one file per addressmap
|
|
1153
1074
|
self.__export_tests(
|
|
1154
1075
|
top_block=top_block, package=package, asyncoutput=asyncoutput,
|
|
1155
1076
|
skip_lib_copy=skip_library_copy,
|
|
1156
|
-
legacy_block_access=legacy_block_access,
|
|
1157
1077
|
udp_include_func=udp_include_func,
|
|
1158
1078
|
hide_node_func=hide_node_func,
|
|
1159
|
-
legacy_enum_type=legacy_enum_type,
|
|
1160
1079
|
skip_systemrdl_name_and_desc_properties=skip_systemrdl_name_and_desc_properties)
|
|
1161
1080
|
|
|
1162
1081
|
return top_block.inst_name
|