From 1d5bc8b75ec410463a3b51b47f489abc99b1c88d Mon Sep 17 00:00:00 2001 From: Dennis Date: Sun, 15 Aug 2021 12:28:07 -0700 Subject: [PATCH] Fix assignment of overflow to increment input of counter --- srdl2sv/components/component.py | 2 +- srdl2sv/components/field.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/srdl2sv/components/component.py b/srdl2sv/components/component.py index a3517a6..830603f 100644 --- a/srdl2sv/components/component.py +++ b/srdl2sv/components/component.py @@ -205,7 +205,7 @@ class Component(): self.ports['input'][obj.inst_name] =\ ("logic" if obj.width == 1 else 'logic [{}:0]'.format(obj.width), []) else: - name.append('__') + name.append('_') name.append(obj.name) name.append(split_name[1]) diff --git a/srdl2sv/components/field.py b/srdl2sv/components/field.py index 042878a..2437b9b 100644 --- a/srdl2sv/components/field.py +++ b/srdl2sv/components/field.py @@ -426,11 +426,15 @@ class Field(Component): ) ) - if incr.width > 0: - self.logger.error("Increment signal '{}' is wider than 1-bit. "\ - "This might result in unwanted behavior and "\ - "will also cause Lint-errors.".format( - incr.inst_name)) + try: + if incr.width > 0: + self.logger.error("Increment signal '{}' is wider than 1-bit. "\ + "This might result in unwanted behavior and "\ + "will also cause Lint-errors.".format( + incr.inst_name)) + except AttributeError: + # 'PropRef_overflow' object has no attribute 'width' + pass else: # Tie signal to 0 self.rtl_footer.append(