From 1784f29d4a29930ab01213453c9c1f0840dd42f1 Mon Sep 17 00:00:00 2001 From: Alex Mykyta Date: Thu, 8 Jun 2023 21:14:10 -0700 Subject: [PATCH] Bypass irrelevant storage-related rule checks for alias registers. #173 --- systemrdl/__about__.py | 2 +- systemrdl/core/validate.py | 3 ++- systemrdl/properties/builtin.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/systemrdl/__about__.py b/systemrdl/__about__.py index 46aee91..d00934f 100644 --- a/systemrdl/__about__.py +++ b/systemrdl/__about__.py @@ -1 +1 @@ -__version__ = "1.25.7" +__version__ = "1.26.0" diff --git a/systemrdl/core/validate.py b/systemrdl/core/validate.py index d1b167f..5df82b4 100644 --- a/systemrdl/core/validate.py +++ b/systemrdl/core/validate.py @@ -410,7 +410,8 @@ def enter_Field(self, node: FieldNode) -> None: # but the user never specified its value, so its readback value is # ambiguous. if ( - not node.implements_storage and node.is_sw_readable and (node.get_property('reset') is None) + not node.is_alias + and not node.implements_storage and node.is_sw_readable and (node.get_property('reset') is None) and (node.get_property('hw') in {rdltypes.AccessType.na, rdltypes.AccessType.r}) ): node.env.msg.message( diff --git a/systemrdl/properties/builtin.py b/systemrdl/properties/builtin.py index 6dd8602..e0b16aa 100644 --- a/systemrdl/properties/builtin.py +++ b/systemrdl/properties/builtin.py @@ -881,7 +881,7 @@ def validate(self, node: m_node.Node, value: Any) -> None: self.get_src_ref(node) ) - if uses_we and not node.implements_storage: + if uses_we and not node.implements_storage and not node.is_alias: self.env.msg.error( "Use of 'we' property on field '%s' that does not implement storage does not make sense" % (node.inst_name), @@ -914,7 +914,7 @@ def validate(self, node: m_node.Node, value: Any) -> None: self.get_src_ref(node) ) - if uses_we and not node.implements_storage: + if uses_we and not node.implements_storage and not node.is_alias: self.env.msg.error( "Use of 'wel' property on field '%s' that does not implement storage does not make sense" % (node.inst_name),