mirror of
https://github.com/Silicon1602/srdl2sv.git
synced 2024-11-14 11:03:36 +00:00
Add underflow property and checker if referenced properties exist
This commit is contained in:
parent
1d5bc8b75e
commit
a74377bae7
@ -1,4 +1,5 @@
|
|||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
from itertools import chain
|
from itertools import chain
|
||||||
from typing import NamedTuple
|
from typing import NamedTuple
|
||||||
from systemrdl import node
|
from systemrdl import node
|
||||||
@ -208,6 +209,15 @@ class Component():
|
|||||||
name.append('_')
|
name.append('_')
|
||||||
name.append(obj.name)
|
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])
|
name.append(split_name[1])
|
||||||
|
|
||||||
return ''.join(name)
|
return ''.join(name)
|
||||||
|
@ -467,11 +467,15 @@ class Field(Component):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if decr.width > 0:
|
try:
|
||||||
self.logger.error("Decrement signal '{}' is wider than 1-bit. "\
|
if decr.width > 0:
|
||||||
"This might result in unwanted behavior and "\
|
self.logger.error("Decrement signal '{}' is wider than 1-bit. "\
|
||||||
"will also cause Lint-errors.".format(
|
"This might result in unwanted behavior and "\
|
||||||
decr.inst_name))
|
"will also cause Lint-errors.".format(
|
||||||
|
decr.inst_name))
|
||||||
|
except AttributeError:
|
||||||
|
# 'PropRef_underflow' object has no attribute 'width'
|
||||||
|
pass
|
||||||
else:
|
else:
|
||||||
# Tie signal to 0
|
# Tie signal to 0
|
||||||
self.rtl_footer.append(
|
self.rtl_footer.append(
|
||||||
|
Loading…
Reference in New Issue
Block a user