def _load_executables(routing_tables, compressor_app_id, txrx, machine): """ Loads the router compressor onto the chips. :param routing_tables: the router tables needed to be compressed :param compressor_app_id: \ the application ID of the compressor compressor :param txrx: the spinnman interface :type txrx: :py:class:`~spinnman.Transceiver` :param machine: the SpiNNaker machine representation :return:\ the executable targets that represent all cores/chips which have\ active routing tables """ # build core subsets core_subsets = CoreSubsets() for routing_table in routing_tables: # get the first none monitor core chip = machine.get_chip_at(routing_table.x, routing_table.y) processor = chip.get_first_none_monitor_processor() # add to the core subsets core_subsets.add_processor(routing_table.x, routing_table.y, processor.processor_id) # build executable targets executable_targets = ExecutableTargets() executable_targets.add_subsets(_BINARY_PATH, core_subsets, ExecutableType.RUNNING) txrx.execute_application(executable_targets, compressor_app_id) return executable_targets
def __filter(targets, filt): binaries = [] cores = ExecutableTargets() for exe_type in targets.executable_types_in_binary_set(): if filt(exe_type): for aplx in targets.get_binaries_of_executable_type(exe_type): binaries.append(aplx) cores.add_subsets(aplx, targets.get_cores_for_binary(aplx), exe_type) return binaries, cores
extractor = ChipIOBufExtractor() executableFinder = ExecutableFinder([path]) transceiver = _PretendTransceiver([ IOBuffer(0, 0, 1, text001), IOBuffer(0, 0, 2, text002), IOBuffer(1, 1, 1, text111), IOBuffer(1, 1, 2, text112), IOBuffer(0, 0, 3, text003) ]) executable_targets = ExecutableTargets() core_subsets = CoreSubsets([CoreSubset(0, 0, [1, 2])]) fooaplx = mock_aplx("foo") executable_targets.add_subsets(fooaplx, core_subsets) core_subsets = CoreSubsets([CoreSubset(1, 1, [1, 2])]) baraplx = mock_aplx("bar") executable_targets.add_subsets(baraplx, core_subsets) core_subsets = CoreSubsets([CoreSubset(0, 0, [3])]) alphaaplx = mock_aplx("alpha") executable_targets.add_subsets(alphaaplx, core_subsets) class TestFrontEndCommonChipIOBufExtractor(unittest.TestCase): def testExectuableFinder(self): self.assertIn(fooaplx, executableFinder.get_executable_path(fooaplx)) def testCallSimple(self): folder = tempfile.mkdtemp() error_entries, warn_entries = extractor(