Skip to content

Commit cc05bbb

Browse files
committed
Remove the typecode checking in non-legacy mode
1 parent 354a367 commit cc05bbb

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/peakrdl_python/lib_test/_common_base_test_class.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,18 @@ def _single_memory_property_test(self, *,
175175
width: int,
176176
entries: int,
177177
accesswidth: Optional[int],
178-
array_typecode: str) -> None:
178+
array_typecode: Optional[str]) -> None:
179179
self.assertEqual(mut.address, address)
180180
self.assertEqual(mut.width, width)
181181
self.assertEqual(mut.entries, entries)
182182
if accesswidth is not None:
183183
self.assertEqual(mut.accesswidth, accesswidth)
184184
else:
185185
self.assertEqual(mut.accesswidth, width)
186-
self.assertEqual(mut.array_typecode, array_typecode)
186+
if self.legacy_block_access:
187+
self.assertEqual(mut.array_typecode, array_typecode)
188+
else:
189+
self.assertIsNone(array_typecode)
187190

188191
def _single_node_rdl_name_and_desc_test(self,
189192
dut: Base,

src/peakrdl_python/templates/addrmap_tb.py.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ class {{fq_block_name}}_single_access({{top_node.inst_name}}_TestCase): # type:
184184
"""
185185
{% for node in owned_elements.memories -%}
186186
with self.subTest(msg='memory: {{'.'.join(node.get_path_segments())}}'):
187-
self._single_memory_property_test(mut=self.dut.{{'.'.join(get_python_path_segments(node))}}, address={{node.absolute_address}}, width={{node.get_property('memwidth')}}, entries={{node.get_property('mementries')}}, accesswidth={% if 'accesswidth' in node.list_properties() -%}{{node.get_property('accesswidth')}}{% else %}None{%- endif %}, array_typecode='{{get_array_typecode(node.get_property('memwidth'))}}')
187+
self._single_memory_property_test(mut=self.dut.{{'.'.join(get_python_path_segments(node))}}, address={{node.absolute_address}}, width={{node.get_property('memwidth')}}, entries={{node.get_property('mementries')}}, accesswidth={% if 'accesswidth' in node.list_properties() -%}{{node.get_property('accesswidth')}}{% else %}None{%- endif %}, array_typecode={% if legacy_block_access %}'{{get_array_typecode(node.get_property('memwidth'))}}'{% else %}None{% endif %})
188188
{% if asyncoutput %}await {%endif %}self._single_memory_read_and_write_test(mut=self.dut.{{'.'.join(get_python_path_segments(node))}}, is_sw_readable={{node.is_sw_readable}}, is_sw_writable={{node.is_sw_writable}},
189189
writeable_registers=NodeIterators( {%- for child_node in node.children(unroll=False) %}{%- if not hide_node_func(child_node) %}{%- if isinstance(child_node, systemrdlRegNode) %}{% if child_node.has_sw_writable %}{{node_iterator_entry(child_node)}},{% endif %}{% endif %}{% endif %}{% endfor %}),
190190
readable_registers=NodeIterators( {%- for child_node in node.children(unroll=False) %}{%- if not hide_node_func(child_node) %}{%- if isinstance(child_node, systemrdlRegNode) %}{% if child_node.has_sw_readable %}{{node_iterator_entry(child_node)}},{% endif %}{% endif %}{% endif %}{% endfor %}))

0 commit comments

Comments
 (0)