finish counters
This commit is contained in:
@@ -177,3 +177,16 @@ class FieldLogicGenerator(RDLForLoopGenerator):
|
||||
self.add_content(
|
||||
f"assign {output_identifier} = {value};"
|
||||
)
|
||||
|
||||
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')
|
||||
self.add_content(
|
||||
f"assign {output_identifier} = {value};"
|
||||
)
|
||||
if node.get_property('underflow'):
|
||||
output_identifier = self.exp.hwif.get_implied_prop_output_identifier(node, "underflow")
|
||||
value = self.field_logic.get_field_combo_identifier(node, 'underflow')
|
||||
self.add_content(
|
||||
f"assign {output_identifier} = {value};"
|
||||
)
|
||||
|
||||
@@ -291,6 +291,9 @@ class Hwif:
|
||||
|
||||
|
||||
def get_implied_prop_output_identifier(self, field: FieldNode, prop: str) -> str:
|
||||
assert prop in {"anded", "ored", "xored", "swmod", "swacc"}
|
||||
assert prop in {
|
||||
"anded", "ored", "xored", "swmod", "swacc",
|
||||
"incrthreshold", "decrthreshold", "overflow", "underflow"
|
||||
}
|
||||
path = get_indexed_path(self.top_node, field)
|
||||
return "hwif_out." + path + "." + prop
|
||||
|
||||
Reference in New Issue
Block a user