Skip to content

Commit

Permalink
tools.py: Refactor debug file generation and import order
Browse files Browse the repository at this point in the history
- Reorganize import statements for better readability
- Standardize string quotes to single quotes
- Minor formatting improvements in debug file logging
  • Loading branch information
Stevengre committed Feb 14, 2025
1 parent e0eed85 commit d704300
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/kriscv/tools.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

from pathlib import Path
from subprocess import CalledProcessError
from typing import TYPE_CHECKING

Expand All @@ -8,7 +9,6 @@
from pyk.kast.manip import split_config_from
from pyk.kore.match import kore_int
from pyk.ktool.krun import KRun
from pathlib import Path
from pyk.prelude.k import GENERATED_TOP_CELL

from kriscv import elf_parser, term_builder
Expand Down Expand Up @@ -54,18 +54,18 @@ def run_config(self, config: KInner) -> KInner:
stdout_path = path / 'krun_stdout.txt'
stderr_path = path / 'krun_stderr.txt'
input_path = path / 'krun_input.txt'

with open(stdout_path, 'w') as f:
f.write(e.stdout)
with open(stderr_path, 'w') as f:
f.write(e.stderr)
with open(input_path, 'w') as f:
config_kore.write(f)
print("Generated debug files:")
print(f"- {stdout_path.resolve()}: KRun standard output")
print(f"- {stderr_path.resolve()}: KRun error output")
print(f"- {input_path.resolve()}: Input configuration in Kore format")

print('Generated debug files:')
print(f'- {stdout_path.resolve()}: KRun standard output')
print(f'- {stderr_path.resolve()}: KRun error output')
print(f'- {input_path.resolve()}: Input configuration in Kore format')
raise
return self.krun.kore_to_kast(final_config_kore)

Expand Down

0 comments on commit d704300

Please sign in to comment.