From 473edd19edb0d95735ecf01bd0a21d6737be0d40 Mon Sep 17 00:00:00 2001 From: Gus Smith Date: Sat, 29 Nov 2025 15:06:46 -0800 Subject: [PATCH] Undo formatting --- tests/functional/rkt_vcd.py | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/tests/functional/rkt_vcd.py b/tests/functional/rkt_vcd.py index f06c2dc27..c114c0e19 100644 --- a/tests/functional/rkt_vcd.py +++ b/tests/functional/rkt_vcd.py @@ -62,18 +62,15 @@ def simulate_rosette( outputs: SignalWidthMap = {} current_struct_name: str = "" - with open(rkt_file_path, "r") as rkt_file: + with open(rkt_file_path, 'r') as rkt_file: for line in rkt_file: - m = re.search(r"gold_(Inputs|Outputs|State)", line) + m = re.search(r'gold_(Inputs|Outputs|State)', line) if m: current_struct_name = m.group(1) - if current_struct_name == "State": - break - elif not current_struct_name: - continue # skip lines before structs - m = re.search(r"; (.+?)\b \(bitvector (\d+)\)", line) - if not m: - continue # skip non matching lines (probably closing the struct) + if current_struct_name == "State": break + elif not current_struct_name: continue # skip lines before structs + m = re.search(r'; (.+?)\b \(bitvector (\d+)\)', line) + if not m: continue # skip non matching lines (probably closing the struct) signal = m.group(1) width = int(m.group(2)) if current_struct_name == "Inputs": @@ -85,18 +82,16 @@ def simulate_rosette( step_list: list[int] = [] for step in range(num_steps): value = rnd.getrandbits(width) - binary_string = format(value, "0{}b".format(width)) + binary_string = format(value, '0{}b'.format(width)) step_list.append(binary_string) signals[signal] = step_list - test_rkt_file_path = rkt_file_path.with_suffix(".tst.rkt") - with open(test_rkt_file_path, "w") as test_rkt_file: - test_rkt_file.writelines( - [ - "#lang rosette\n", - f'(require "{rkt_file_path.name}")\n', - ] - ) + test_rkt_file_path = rkt_file_path.with_suffix('.tst.rkt') + with open(test_rkt_file_path, 'w') as test_rkt_file: + test_rkt_file.writelines([ + '#lang rosette\n', + f'(require "{rkt_file_path.name}")\n', + ]) for step in range(num_steps): this_step = f"step_{step}"