Skip to content

Commit 7c1d488

Browse files
committed
Merge branch 'release/3.0.0' of https://github.com/krcb197/PeakRDL-python into 258-optimise-test_traversal_iterators
# Conflicts: # src/peakrdl_python/lib_test/_common_base_test_class.py
2 parents 999f1a0 + a418d4c commit 7c1d488

6 files changed

Lines changed: 37 additions & 12 deletions

File tree

docs/conf.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,16 @@
4545
# The theme to use for HTML and HTML Help pages. See the documentation for
4646
# a list of builtin themes.
4747
#
48-
html_theme = "sphinx_rtd_theme"
48+
html_theme = "sphinx_book_theme"
49+
50+
html_theme_options = {
51+
"repository_url": "https://github.com/krcb197/PeakRDL-python",
52+
"path_to_docs": "docs",
53+
"use_download_button": False,
54+
"use_source_button": True,
55+
"use_repository_button": True,
56+
"use_issues_button": True,
57+
}
4958

5059
# Add any paths that contain custom static files (such as style sheets) here,
5160
# relative to this directory. They are copied after the builtin static files,

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
pygments-systemrdl
22
peakrdl-python
3-
sphinx_rtd_theme
3+
sphinx-book-theme

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ dev = [
6363
"mypy",
6464
"pylint",
6565
"coverage",
66-
"peakrdl"
66+
"peakrdl",
67+
# needed for the documentation build
68+
"sphinx-book-theme",
69+
"pygments-systemrdl"
70+
6771
]
6872
peakrdl = [
6973
"peakrdl"

src/peakrdl_python/__about__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
"""
22
peakrdl-python is a tool to generate Python Register Access Layer (RAL) from SystemRDL
3-
Copyright (C) 2021 - 2023
3+
Copyright (C) 2021 - 2025
44
55
This program is free software: you can redistribute it and/or modify
6-
it under the terms of the GNU General Public License as published by
7-
the Free Software Foundation, either version 3 of the License, or
8-
(at your option) any later version.
6+
it under the terms of the GNU Lesser General Public License as
7+
published by the Free Software Foundation, either version 3 of
8+
the License, or (at your option) any later version.
99
1010
This program is distributed in the hope that it will be useful,
1111
but WITHOUT ANY WARRANTY; without even the implied warranty of
1212
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13-
GNU General Public License for more details.
13+
GNU Lesser General Public License for more details.
1414
15-
You should have received a copy of the GNU General Public License
15+
You should have received a copy of the GNU Lesser General Public License
1616
along with this program. If not, see <https://www.gnu.org/licenses/>.
1717
1818
Variables that describes the peakrdl-python Package
1919
"""
20-
__version__ = "3.0.0rc4"
20+
__version__ = "3.0.0rc5"

src/peakrdl_python/lib_test/_common_base_test_class.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,17 @@ def _single_node_rdl_name_and_desc_test(self,
136136
else:
137137
self.assertEqual(dut.rdl_desc, rdl_desc)
138138

139+
def _test_node_inst_name(self,
140+
dut: Base,
141+
parent_full_inst_name:str,
142+
inst_name:str) -> None:
143+
"""
144+
Test the `inst_name` and `full_inst_name` attributes of a node
145+
"""
146+
self.assertEqual(dut.inst_name, inst_name)
147+
full_inst_name = parent_full_inst_name + '.' + inst_name
148+
self.assertEqual(dut.full_inst_name, full_inst_name)
149+
139150
def _test_field_iterators(self, *,
140151
rut: Union[RegReadOnly,
141152
RegReadWrite,

src/peakrdl_python/templates/addrmap_tb.py.jinja

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ class {{fq_block_name}}_single_access({{top_node.inst_name}}_TestCase): # type:
9090
"""
9191
{% for node in owned_elements.nodes -%}
9292
with self.subTest(msg='node: {{'.'.join(node.get_path_segments())}}'):
93-
self.assertEqual(self.dut.{{'.'.join(get_python_path_segments(node))}}.inst_name, '{{node.get_path_segments()[-1]}}') # type: ignore[union-attr]
94-
self.assertEqual(self.dut.{{'.'.join(get_python_path_segments(node))}}.full_inst_name, '{{'.'.join(node.get_path_segments())}}') # type: ignore[union-attr]
93+
self._test_node_inst_name(dut=self.dut.{{'.'.join(get_python_path_segments(node))}},
94+
inst_name='{{node.get_path_segments()[-1]}}',
95+
parent_full_inst_name='{{'.'.join(node.get_path_segments()[:-1])}}')
9596
{% endfor %}
9697

9798
def test_rdl_name_and_desc_property(self) -> None:

0 commit comments

Comments
 (0)