Skip to content

Commit

Permalink
Added definition for logging an error shared_utils.py
Browse files Browse the repository at this point in the history
Signed-off-by: Jay Dev Jha <[email protected]>
  • Loading branch information
IIITM-Jay authored Oct 31, 2024
1 parent 723dda2 commit 6895d59
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions shared_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,3 +566,11 @@ def instr_dict_2_extensions(instr_dict):
# Returns signed interpretation of a value within a given width
def signed(value, width):
return value if 0 <= value < (1 << (width - 1)) else value - (1 << width)


# Log an error message
def log_and_exit(message):
"""Log an error message and exit the program."""
logging.error(message)
raise SystemExit(1)

0 comments on commit 6895d59

Please sign in to comment.