Skip to content

Commit

Permalink
Linting checks and removed main
Browse files Browse the repository at this point in the history
  • Loading branch information
NikosDelijohn committed Oct 8, 2024
1 parent 0a363fa commit 55a5e99
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 38 deletions.
38 changes: 0 additions & 38 deletions src/testcrush/grammars/transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class FaultListTransformer(lark.Transformer):
_prev_prime: Fault = None
_is_prime: bool = False


@staticmethod
def filter_out_discards(container: Iterable) -> filter:

Expand Down Expand Up @@ -313,40 +312,3 @@ def reg_and_mem(self, *reg_val_pairs: str) -> str:
"""
reg_and_mem = f"\"{', '.join([ str(pair).strip() for pair in reg_val_pairs])}\""
return reg_and_mem

if __name__ == "__main__":

# Get the original STL statistics
parser = lark.Lark(grammar=open("fault_list.lark").read(),
start="start",
parser="lalr",
transformer=FaultListTransformer())
fault_list = parser.parse(open("../../../sandbox/logfiles/test_primes.rpt").read())
for fault in fault_list:
print(repr(fault), f"{'prime' if fault.is_prime() else 'equivalent'}")
exit(0)
pc_vals = []
time_stamps = []

for fault in fault_list:

if hasattr(fault, "Fault_Attributes"):

pc_vals.append(fault.Fault_Attributes["PC_ID"])
time_stamps.append(fault.Fault_Attributes["sim_time"])

from collections import Counter

ccs = Counter(pc_vals)
ccs_times = Counter(time_stamps)

parser = lark.Lark(grammar=open("trace_cv32e40p.lark").read(),
start="start",
parser="lalr",
transformer=TraceTransformerCV32E40P())
# trace_core_00000000.log

tracetext = parser.parse(open("../../../sandbox/logfiles/trace_core_00000000.log").read())

print(ccs)
print(ccs_times)
1 change: 1 addition & 0 deletions src/testcrush/zoix.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def cast_attribute(self, attribute: str, func: callable) -> None:
def is_prime(self):
return self.equivalent_to is None


class CSVFaultReport():
"""
Manipulates the VC-Z01X summary and report **CSV** files.
Expand Down

0 comments on commit 55a5e99

Please sign in to comment.