Skip to content

Commit

Permalink
Better fpga-tool-perf error handling
Browse files Browse the repository at this point in the history
Signed-off-by: Maciej Kurc <[email protected]>
  • Loading branch information
mkurc-ant committed Jan 23, 2023
1 parent ce64c61 commit b15c398
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion fpgaperf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import signal
import sys
import yaml
import traceback
from terminaltables import AsciiTable

from toolchains.icestorm import NextpnrIcestorm
Expand Down Expand Up @@ -271,7 +272,13 @@ def run(
err = str(e)
if not verbose and len(err) > 1000:
err = f"[...]\n{err[-1000:]}"
logger.debug(f"ERROR: {err}")
logger.error(err)

if verbose:
trace = traceback.format_exc()
for line in trace.split("\n"):
logger.error(line)

err = err.split("\n")
else:
logger.debug("Printing Stats")
Expand Down

0 comments on commit b15c398

Please sign in to comment.