Skip to content

Commit 416e2a4

Browse files
committed
Remove dangerous usage of non-public parts of the systemrdl-compiler API
1 parent a463fdf commit 416e2a4

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "peakrdl-uvm"
77
dynamic = ["version"]
88
requires-python = ">=3.7"
99
dependencies = [
10-
"systemrdl-compiler ~= 1.27",
10+
"systemrdl-compiler ~= 1.30",
1111
"jinja2 >= 2.9",
1212
]
1313

src/peakrdl_uvm/exporter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def export(self, node: Node, path: str, **kwargs):
117117
if isinstance(node, AddrmapNode) and node.get_property('bridge'):
118118
node.env.msg.warning(
119119
"UVM RAL generator does not have proper support for bridge addmaps yet. The 'bridge' property will be ignored.",
120-
node.inst.property_src_ref.get('bridge', node.inst.inst_src_ref)
120+
node.property_src_ref.get('bridge', node.inst_src_ref)
121121
)
122122

123123
# First, traverse the model and collect some information
@@ -238,7 +238,7 @@ def _class_needs_definition(self, node: Node) -> bool:
238238
obj = self.namespace_db[type_name]
239239

240240
# Sanity-check for collisions
241-
if (obj is None) or (obj is not node.inst.original_def):
241+
if (obj is None) or (obj is not node.original_def):
242242
raise RuntimeError("Namespace collision! Type-name generation is not robust enough to create unique names!")
243243

244244
# This object likely represents the existing class definition
@@ -247,7 +247,7 @@ def _class_needs_definition(self, node: Node) -> bool:
247247

248248
# Need to emit a new definition
249249
# First, register it in the namespace
250-
self.namespace_db[type_name] = node.inst.original_def
250+
self.namespace_db[type_name] = node.original_def
251251
return True
252252

253253

src/peakrdl_uvm/templates/uvm_vreg.sv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,6 @@ this.{{get_inst_name(node)}} = {{get_class_name(node)}}::type_id::create("{{get_
6565
{%- else %}
6666
this.{{get_inst_name(node)}} = new("{{get_inst_name(node)}}");
6767
{%- endif %}
68-
this.{{get_inst_name(node)}}.configure(this, this.m_mem, {{node.inst.n_elements}});
68+
this.{{get_inst_name(node)}}.configure(this, this.m_mem, {{node.n_elements}});
6969
this.{{get_inst_name(node)}}.build();
7070
{%- endmacro %}

test/generate_testcase_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
{%- if isinstance(node, RegNode) %}
8585
{%- if node.is_virtual %}
8686
`ASSERT_EQ_STR({{node.parent.get_path() + "." + node.inst_name}}.get_full_name(), "{{node.parent.get_path() + "." + node.inst_name}}");
87-
`ASSERT_EQ_INT({{node.parent.get_path() + "." + node.inst_name}}.get_size(), {{node.inst.n_elements}});
87+
`ASSERT_EQ_INT({{node.parent.get_path() + "." + node.inst_name}}.get_size(), {{node.n_elements}});
8888
{%- else %}
8989
`ASSERT_EQ_STR({{node.get_path()}}.get_full_name(), "{{node.get_path()}}");
9090
`ASSERT_EQ_INT({{node.get_path()}}.get_address(), {{"'h%x" % node.absolute_address}});

0 commit comments

Comments
 (0)