Add 'rd_swacc' and 'wr_swacc' UDPs. #21
This commit is contained in:
@@ -193,6 +193,30 @@ class FieldLogic:
|
||||
strb = self.exp.dereferencer.get_access_strobe(field)
|
||||
return strb
|
||||
|
||||
def get_rd_swacc_identifier(self, field: 'FieldNode') -> str:
|
||||
"""
|
||||
Asserted when field is software accessed (read)
|
||||
"""
|
||||
buffer_reads = field.parent.get_property('buffer_reads')
|
||||
if buffer_reads:
|
||||
rstrb = self.exp.read_buffering.get_trigger(field.parent)
|
||||
return rstrb
|
||||
else:
|
||||
strb = self.exp.dereferencer.get_access_strobe(field)
|
||||
return f"{strb} && !decoded_req_is_wr"
|
||||
|
||||
def get_wr_swacc_identifier(self, field: 'FieldNode') -> str:
|
||||
"""
|
||||
Asserted when field is software accessed (write)
|
||||
"""
|
||||
buffer_writes = field.parent.get_property('buffer_writes')
|
||||
if buffer_writes:
|
||||
wstrb = self.exp.write_buffering.get_write_strobe(field)
|
||||
return wstrb
|
||||
else:
|
||||
strb = self.exp.dereferencer.get_access_strobe(field)
|
||||
return f"{strb} && decoded_req_is_wr"
|
||||
|
||||
def get_swmod_identifier(self, field: 'FieldNode') -> str:
|
||||
"""
|
||||
Asserted when field is modified by software (written or read with a
|
||||
|
||||
@@ -224,20 +224,33 @@ class FieldLogicGenerator(RDLForLoopGenerator):
|
||||
f"assign {output_identifier} = {value};"
|
||||
)
|
||||
|
||||
# Software access strobes
|
||||
if node.get_property('swmod'):
|
||||
output_identifier = self.exp.hwif.get_implied_prop_output_identifier(node, "swmod")
|
||||
value = self.field_logic.get_swmod_identifier(node)
|
||||
self.add_content(
|
||||
f"assign {output_identifier} = {value};"
|
||||
)
|
||||
|
||||
if node.get_property('swacc'):
|
||||
output_identifier = self.exp.hwif.get_implied_prop_output_identifier(node, "swacc")
|
||||
value = self.field_logic.get_swacc_identifier(node)
|
||||
self.add_content(
|
||||
f"assign {output_identifier} = {value};"
|
||||
)
|
||||
if node.get_property('rd_swacc'):
|
||||
output_identifier = self.exp.hwif.get_implied_prop_output_identifier(node, "rd_swacc")
|
||||
value = self.field_logic.get_rd_swacc_identifier(node)
|
||||
self.add_content(
|
||||
f"assign {output_identifier} = {value};"
|
||||
)
|
||||
if node.get_property('wr_swacc'):
|
||||
output_identifier = self.exp.hwif.get_implied_prop_output_identifier(node, "wr_swacc")
|
||||
value = self.field_logic.get_wr_swacc_identifier(node)
|
||||
self.add_content(
|
||||
f"assign {output_identifier} = {value};"
|
||||
)
|
||||
|
||||
# Counter thresholds
|
||||
if node.get_property('incrthreshold') is not False: # (explicitly not False. Not 0)
|
||||
output_identifier = self.exp.hwif.get_implied_prop_output_identifier(node, "incrthreshold")
|
||||
value = self.field_logic.get_field_combo_identifier(node, 'incrthreshold')
|
||||
@@ -251,6 +264,7 @@ class FieldLogicGenerator(RDLForLoopGenerator):
|
||||
f"assign {output_identifier} = {value};"
|
||||
)
|
||||
|
||||
# Counter events
|
||||
if node.get_property('overflow'):
|
||||
output_identifier = self.exp.hwif.get_implied_prop_output_identifier(node, "overflow")
|
||||
value = self.field_logic.get_field_combo_identifier(node, 'overflow')
|
||||
|
||||
Reference in New Issue
Block a user