mirror of
https://github.com/Silicon1602/srdl2sv.git
synced 2024-12-22 06:58:41 +00:00
Fix regression in OnRead and OnWrite properties
The following tests were failing: - test_swacc_properties.test_rclr_rset - test_swacc_properties.test_rclr_rset_hw_precedence The reason for this failure was incorrect usage of the assignment expression. Due to the lack of parentheses, the onread/onwrite variable would mostly evaluate to False.
This commit is contained in:
parent
0dba725fd3
commit
33b6e2e946
@ -86,20 +86,21 @@ class Field(Component):
|
|||||||
def add_sw_access(self, obj, alias = False):
|
def add_sw_access(self, obj, alias = False):
|
||||||
|
|
||||||
# Perform some basic checks
|
# Perform some basic checks
|
||||||
if onwrite := obj.get_property('onwrite') \
|
onwrite = obj.get_property('onwrite')
|
||||||
and not self.properties['sw_wr']:
|
onread = obj.get_property('onread')
|
||||||
|
|
||||||
|
if onwrite and not self.properties['sw_wr']:
|
||||||
self.logger.fatal("An onwrite property '%s' is defined but "\
|
self.logger.fatal("An onwrite property '%s' is defined but "\
|
||||||
"software does not have write-access. This is not "\
|
"software does not have write-access. This is not "\
|
||||||
"legal.", onwrite)
|
"legal.", onwrite)
|
||||||
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
elif onread := obj.get_property('onread') \
|
elif onread and self.storage_type is not StorageType.FLOPS:
|
||||||
and self.storage_type is not StorageType.FLOPS:
|
self.logger.warning("Field has an onread property '%s' but does not "
|
||||||
self.logger.warning("Field has an onread property but does not "
|
|
||||||
"implement a flop. Since the flop itself is "
|
"implement a flop. Since the flop itself is "
|
||||||
"implemented outside of the register block it is "
|
"implemented outside of the register block it is "
|
||||||
"advised to remove the property and notify the external "
|
"advised to remove the property and notify the external "
|
||||||
"hardware by using the 'swacc' property.")
|
"hardware by using the 'swacc' property.", onread)
|
||||||
|
|
||||||
access_rtl = {}
|
access_rtl = {}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user