Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow odd RTE values, as crashes can cause oddities! #418

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions spinnman/model/cpu_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class CPUInfo(object):
"__processor_state_register",
"__registers",
"__run_time_error",
"__run_time_error_value",
"__software_error_count",
"__filename_address",
"__line_number",
Expand Down Expand Up @@ -102,7 +103,11 @@ def __init__(self, x: int, y: int, p: int, cpu_data: _vcpu_t):
self.__application_name = app_name.decode('ascii')

self.__registers: Sequence[int] = _REGISTERS_PATTERN.unpack(registers)
self.__run_time_error = RunTimeError(run_time_error)
self.__run_time_error_value = run_time_error
try:
self.__run_time_error = RunTimeError(run_time_error)
except ValueError:
self.__run_time_error = RunTimeError.UNRECOGNISED
self.__state = CPUState(state)

self.__application_mailbox_command = MailboxCommand(app_mailbox_cmd)
Expand Down Expand Up @@ -353,10 +358,13 @@ def get_status_string(self) -> str:
:rtype: str
"""
if self.state == CPUState.RUN_TIME_EXCEPTION:
rte_string = f"{self.run_time_error.name}"
if self.run_time_error == RunTimeError.UNRECOGNISED:
rte_string += f" ({self.__run_time_error_value})"
return (
f"{self.__x}:{self.__y}:{self.__p} "
f"(ph: {self.__physical_cpu_id}) "
f"in state {self.__state.name}:{self.__run_time_error.name}\n"
f"in state {self.__state.name}:{rte_string}\n"
f" r0={self.__registers[0]}, r1={self.__registers[1]}, "
f"r2={self.__registers[2]}, r3={self.__registers[3]}\n"
f" r4={self.__registers[4]}, r5={self.__registers[5]}, "
Expand Down
2 changes: 2 additions & 0 deletions spinnman/model/enums/run_time_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,5 @@ class RunTimeError(Enum):
API = 19
#: Sark software version conflict
SARK_VERSRION_INCORRECT = 20
#: Unhandled exception
UNRECOGNISED = 99999