Add underflow property and checker if referenced properties exist

This commit is contained in:
Dennis Potter 2021-08-15 12:56:41 -07:00
parent 1d5bc8b75e
commit a74377bae7
Signed by: Dennis
GPG Key ID: 186A8AD440942BAF
2 changed files with 19 additions and 5 deletions

View File

@ -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)

View File

@ -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(