Skip to content

Commit

Permalink
Make remaining interrupt conditional predicates single-bit. #54
Browse files Browse the repository at this point in the history
  • Loading branch information
amykyta3 committed Jul 20, 2023
1 parent 18f8f35 commit da8ff4a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/peakrdl_regblock/field_logic/hw_interrupts.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def is_match(self, field: 'FieldNode') -> bool:
)

def get_predicate(self, field: 'FieldNode') -> str:
return self.exp.hwif.get_input_identifier(field)
F = self.exp.hwif.get_input_identifier(field)
return f"{F} != '0"

def get_assignments(self, field: 'FieldNode') -> List[str]:
I = self.exp.hwif.get_input_identifier(field)
Expand All @@ -69,7 +70,7 @@ def is_match(self, field: 'FieldNode') -> bool:
def get_predicate(self, field: 'FieldNode') -> str:
I = self.exp.hwif.get_input_identifier(field)
Iq = self.exp.field_logic.get_next_q_identifier(field)
return f"~{Iq} & {I}"
return f"(~{Iq} & {I}) != '0"

def get_assignments(self, field: 'FieldNode') -> List[str]:
I = self.exp.hwif.get_input_identifier(field)
Expand All @@ -95,7 +96,7 @@ def is_match(self, field: 'FieldNode') -> bool:
def get_predicate(self, field: 'FieldNode') -> str:
I = self.exp.hwif.get_input_identifier(field)
Iq = self.exp.field_logic.get_next_q_identifier(field)
return f"{Iq} & ~{I}"
return f"({Iq} & ~{I}) != '0"

def get_assignments(self, field: 'FieldNode') -> List[str]:
I = self.exp.hwif.get_input_identifier(field)
Expand Down

0 comments on commit da8ff4a

Please sign in to comment.