diff --git a/spinnman/processes/get_machine_process.py b/spinnman/processes/get_machine_process.py index cb2db1797..3a87f572e 100644 --- a/spinnman/processes/get_machine_process.py +++ b/spinnman/processes/get_machine_process.py @@ -21,12 +21,12 @@ get_config_bool, get_config_int, get_config_str) from spinn_utilities.data import UtilsDataView from spinn_utilities.log import FormatAdapter -from spinn_machine import (Router, Chip, Link, machine_from_size) +from spinn_machine import (Router, Chip, Link) from spinn_machine.ignores import IgnoreChip, IgnoreCore, IgnoreLink -from spinn_machine import Machine from spinn_machine.machine_factory import machine_repair from spinnman.constants import ( ROUTER_REGISTER_P2P_ADDRESS, SYSTEM_VARIABLE_BASE_ADDRESS) +from spinnman.data import SpiNNManDataView from spinnman.messages.spinnaker_boot import ( SystemVariableDefinition) from spinnman.exceptions import SpinnmanUnexpectedResponseCodeException @@ -94,7 +94,9 @@ def _make_chip(self, chip_info, machine): :rtype: ~spinn_machine.Chip """ # Create the down cores set if any - n_cores = min(chip_info.n_cores, Machine.max_cores_per_chip()) + n_cores = \ + SpiNNManDataView.get_machine_version().max_cores_per_chip + n_cores = min(chip_info.n_cores, n_cores) core_states = chip_info.core_states down_cores = self._ignore_cores_map.get( (chip_info.x, chip_info.y), None) @@ -233,7 +235,8 @@ def get_machine_details(self, boot_x, boot_y, width, height): logger.warning( "Chip {}, {} was expected but didn't reply", x, y) - machine = machine_from_size(width, height) + version = SpiNNManDataView.get_machine_version() + machine = version.create_machine(width, height) self._preprocess_ignore_chips(machine) self._process_ignore_links(machine) self._preprocess_ignore_cores(machine) diff --git a/spinnman/transceiver.py b/spinnman/transceiver.py index 72cd35886..ec62af2a4 100644 --- a/spinnman/transceiver.py +++ b/spinnman/transceiver.py @@ -28,7 +28,6 @@ from spinn_utilities.log import FormatAdapter from spinn_utilities.logger_utils import warn_once from spinn_machine import CoreSubsets -from spinn_machine.spinnaker_triad_geometry import SpiNNakerTriadGeometry from spinnman.constants import ( BMP_POST_POWER_ON_SLEEP_TIME, BMP_POWER_ON_TIMEOUT, BMP_TIMEOUT, CPU_MAX_USER, CPU_USER_OFFSET, CPU_USER_START_ADDRESS, @@ -532,8 +531,8 @@ def discover_scamp_connections(self): dims = self.get_machine_dimensions() # Find all the new connections via the machine Ethernet-connected chips - geometry = SpiNNakerTriadGeometry.get_spinn5_geometry() - for x, y in geometry.get_potential_ethernet_chips( + version = SpiNNManDataView.get_machine_version() + for x, y in version.get_potential_ethernet_chips( dims.width, dims.height): ip_addr_item = SystemVariableDefinition.ethernet_ip_address try: @@ -644,9 +643,7 @@ def get_machine_details(self): machine.add_fpga_links() if self._boot_send_connection: - logger.info("Detected a machine on IP address {} which has {}", - machine.boot_chip.ip_address, - machine.cores_and_link_output_string()) + logger.info(f"Detected {machine.summary_string()}") return machine def is_connected(self, connection=None): diff --git a/unittests/data/test_data.py b/unittests/data/test_data.py index 1fb042ffb..ab4fa0652 100644 --- a/unittests/data/test_data.py +++ b/unittests/data/test_data.py @@ -13,6 +13,7 @@ # limitations under the License. import unittest +from spinn_utilities.config_holder import set_config from spinn_utilities.exceptions import (DataNotYetAvialable) from spinnman.config_setup import unittest_setup from spinnman.data import SpiNNManDataView @@ -42,6 +43,7 @@ def test_setup(self): def test_mock(self): SpiNNManDataWriter.mock() + set_config("Machine", "version", 5) # check there is a # value not what it is SpiNNManDataView.get_machine() diff --git a/unittests/model_tests/test_abstract_process.py b/unittests/model_tests/test_abstract_process.py index e5aebecb3..2aea5ed39 100644 --- a/unittests/model_tests/test_abstract_process.py +++ b/unittests/model_tests/test_abstract_process.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +from spinn_utilities.config_holder import set_config from spinnman.processes.abstract_multi_connection_process import ( AbstractMultiConnectionProcess) from spinnman.messages.scp.impl import ReadMemory @@ -42,6 +43,7 @@ def receive_scp_response(self, timeout=1.0): def test_error_print(): unittest_setup() + set_config("Machine", "version", 5) connection = MockConnection(0, 0) process = MockProcess(RoundRobinConnectionSelector([connection])) with pytest.raises(SpinnmanGenericProcessException): diff --git a/unittests/test_transceiver.py b/unittests/test_transceiver.py index 620413af7..0aa55c7f1 100644 --- a/unittests/test_transceiver.py +++ b/unittests/test_transceiver.py @@ -14,6 +14,7 @@ import unittest import struct +from spinn_utilities.config_holder import set_config from spinn_machine import virtual_machine from spinnman.config_setup import unittest_setup from spinnman.data.spinnman_data_writer import SpiNNManDataWriter @@ -38,7 +39,7 @@ def __init__( self.written_memory = list() def get_machine_details(self): - return virtual_machine(2, 2) + return virtual_machine(8, 8) def _update_machine(self): self._machine = self.get_machine_details() @@ -58,6 +59,7 @@ class TestTransceiver(unittest.TestCase): def setUp(self): unittest_setup() + set_config("Machine", "version", 5) def test_create_new_transceiver_to_board(self): board_config.set_up_remote_board()