Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Oct 10, 2023
2 parents 4684d4a + 9b83424 commit 1610ed6
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 20 deletions.
5 changes: 1 addition & 4 deletions spinn_front_end_common/interface/abstract_spinnaker_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2270,11 +2270,8 @@ def __recover_from_error(self, exception):
if not unsuccessful_cores:
for executable_type, core_subsets in \
self._data_writer.get_executable_types().items():
failed_cores = transceiver.get_cpu_infos(
unsuccessful_cores = transceiver.get_cpu_infos(
core_subsets, executable_type.end_state, False)
for (x, y, p) in failed_cores:
unsuccessful_cores.add_processor(
x, y, p, failed_cores.get_cpu_info(x, y, p))

# Print the details of error cores
logger.error(unsuccessful_cores.get_status_string())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ def _get_provenance_region_address(self, transceiver, placement):
:rtype: int
"""
# Get the App Data for the core
region_table_address = transceiver.get_cpu_information_from_core(
placement.x, placement.y, placement.p).user[0]
region_table_address = transceiver.get_region_base_address(
placement.x, placement.y, placement.p)

# Get the provenance region base address
prov_region_entry_address = get_region_base_address_offset(
Expand Down
8 changes: 3 additions & 5 deletions spinn_front_end_common/utilities/emergency_recovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@ def _emergency_state_check():
for chip in machine.chips:
for p in chip.processors:
try:
info = txrx.get_cpu_information_from_core(
chip.x, chip.y, p)
if info.state in (
CPUState.RUN_TIME_EXCEPTION, CPUState.WATCHDOG):
infos.add_processor(chip.x, chip.y, p, info)
txrx.add_cpu_information_from_core(
chip.x, chip.y, p,
[CPUState.RUN_TIME_EXCEPTION, CPUState.WATCHDOG])
except Exception:
errors.append((chip.x, chip.y, p))
if len(infos):
Expand Down
4 changes: 2 additions & 2 deletions spinn_front_end_common/utilities/helpful_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def locate_memory_region_for_placement(placement, region):
:rtype: int
"""
transceiver = FecDataView.get_transceiver()
regions_base_address = transceiver.get_cpu_information_from_core(
placement.x, placement.y, placement.p).user[0]
regions_base_address = transceiver.get_region_base_address(
placement.x, placement.y, placement.p)

# Get the position of the region in the pointer table
element_addr = get_region_base_address_offset(regions_base_address, region)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1471,8 +1471,8 @@ def _print_packet_num_being_sent(packet_count, n_packets):
def get_provenance_data_from_machine(self, placement):
# Get the App Data for the core
transceiver = FecDataView.get_transceiver()
region_table_address = transceiver.get_cpu_information_from_core(
placement.x, placement.y, placement.p).user[0]
region_table_address = transceiver.get_region_base_address(
placement.x, placement.y, placement.p)

# Get the provenance region base address
prov_region_entry_address = get_region_base_address_offset(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ def __get_provenance_region_address(self, txrx, place):
:rtype: int
"""
if self._prov_region is None:
region_table_addr = txrx.get_cpu_information_from_core(
place.x, place.y, place.p).user[0]
region_table_addr = txrx.get_region_base_address(
place.x, place.y, place.p)
region_entry_addr = get_region_base_address_offset(
region_table_addr, _DSG_REGIONS.PROVENANCE_AREA)
self._prov_region, = _ONE_WORD.unpack(txrx.read_memory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
from spinn_front_end_common.interface.config_setup import unittest_setup
from spinn_front_end_common.interface.interface_functions import (
application_finisher)
from spinnman.model.cpu_infos import CPUInfos
from spinnman.transceiver.version5transceiver import Version5Transceiver
from spinnman.model import CPUInfo, CPUInfos


class _MockTransceiver(Version5Transceiver):
Expand Down Expand Up @@ -55,9 +55,11 @@ def get_cpu_infos(
if (x, y, p) in core_states:
if hasattr(states, "__iter__"):
if core_states[x, y, p] in states:
cores_in_state.add_processor(x, y, p, None)
cores_in_state.add_info(CPUInfo.mock_info(
x, y, p, p, core_states[x, y, p]))
elif core_states[x, y, p] == states:
cores_in_state.add_processor(x, y, p, None)
cores_in_state.add_info(CPUInfo.mock_info(
x, y, p, p, core_states[x, y, p]))

self._current_state += 1
return cores_in_state
Expand Down

0 comments on commit 1610ed6

Please sign in to comment.