diff --git a/srdl2sv/components/component.py b/srdl2sv/components/component.py index 830603f..fe3bf33 100644 --- a/srdl2sv/components/component.py +++ b/srdl2sv/components/component.py @@ -1,4 +1,5 @@ import re +import sys from itertools import chain from typing import NamedTuple from systemrdl import node @@ -208,6 +209,15 @@ class Component(): name.append('_') name.append(obj.name) + # This is a property. Check if the original field actually has this property + if not obj.node.get_property(obj.name): + self.logger.fatal("Reference to the property '{}' of instance '{}' found. " + "This instance does hold the reference property! Please " + "fix this if you want me to do my job properly." + .format(obj.name, obj.node.get_path())) + + sys.exit(1) + name.append(split_name[1]) return ''.join(name) diff --git a/srdl2sv/components/field.py b/srdl2sv/components/field.py index 2437b9b..e64716f 100644 --- a/srdl2sv/components/field.py +++ b/srdl2sv/components/field.py @@ -467,11 +467,15 @@ class Field(Component): ) ) - if decr.width > 0: - self.logger.error("Decrement signal '{}' is wider than 1-bit. "\ - "This might result in unwanted behavior and "\ - "will also cause Lint-errors.".format( - decr.inst_name)) + try: + if decr.width > 0: + self.logger.error("Decrement signal '{}' is wider than 1-bit. "\ + "This might result in unwanted behavior and "\ + "will also cause Lint-errors.".format( + decr.inst_name)) + except AttributeError: + # 'PropRef_underflow' object has no attribute 'width' + pass else: # Tie signal to 0 self.rtl_footer.append(