Skip to content

Commit

Permalink
cxxrtl: don't drop backtrace on ^C.
Browse files Browse the repository at this point in the history
  • Loading branch information
kivikakk committed Sep 5, 2024
1 parent 282e444 commit 2cbed9d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions niar/cxxrtl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging
import os
import shutil
import sys
from enum import Enum, nonmember
from functools import partial
from pathlib import Path
Expand All @@ -12,9 +13,10 @@

from .build import construct_top
from .cmdrunner import CommandRunner
from .logging import logtime
from .logging import logtime, logger
from .project import Project


__all__ = ["add_arguments"]

CXXFLAGS = [
Expand Down Expand Up @@ -271,7 +273,11 @@ def rtlil_to_cc():
if args.vcd:
cmd += ["--vcd", args.vcd]
with logtime(logging.DEBUG, "run"):
cr.run_cmd(cmd, step="run")
try:
cr.run_cmd(cmd, step="run")
except KeyboardInterrupt:
print(file=sys.stderr)
logger.log(logging.INFO, "aborting on KeyboardInterrupt")


def _make_yosys_relative(path):
Expand Down

0 comments on commit 2cbed9d

Please sign in to comment.