Skip to content

Commit

Permalink
use values from Version
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Mar 13, 2024
1 parent 8096e73 commit da908cf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions unittests/test_chip.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from spinn_utilities.ordered_set import OrderedSet
from spinn_machine import Link, Router, Chip
from spinn_machine.config_setup import unittest_setup
from spinn_machine.data import MachineDataView


class TestingChip(unittest.TestCase):
Expand All @@ -27,8 +28,8 @@ def setUp(self):
self._x = 0
self._y = 1

# create processor
self.n_processors = 18
self.n_processors = \
MachineDataView.get_machine_version().max_cores_per_chip

# create router
links = list()
Expand Down
11 changes: 6 additions & 5 deletions unittests/test_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ class SpinnMachineTestCase(unittest.TestCase):
def setUp(self):
unittest_setup()
set_config("Machine", "version", 5)

self._sdram = 123469792
version = MachineDataView.get_machine_version()
self.n_processors = version.max_cores_per_chip
self._sdram = version.max_sdram_per_chip

links = list()
links.append(Link(0, 0, 0, 1, 1))
Expand All @@ -51,10 +52,10 @@ def setUp(self):

def _create_chip(self, x, y):
if x == y == 0:
return Chip(x, y, 18, self._router, self._sdram,
return Chip(x, y, self.n_processors, self._router, self._sdram,
self._nearest_ethernet_chip[0],
self._nearest_ethernet_chip[1], self._ip)
return Chip(x, y, 18, self._router, self._sdram,
return Chip(x, y, self.n_processors, self._router, self._sdram,
self._nearest_ethernet_chip[0],
self._nearest_ethernet_chip[1], None)

Expand Down Expand Up @@ -146,7 +147,7 @@ def test_create_new_machine_with_invalid_chips(self):
machine = virtual_machine(8, 8)
with self.assertRaises(SpinnMachineAlreadyExistsException):
machine.add_chip(Chip(
0, 0, 18, self._router, self._sdram,
0, 0, self.n_processors, self._router, self._sdram,
self._nearest_ethernet_chip[0],
self._nearest_ethernet_chip[1], self._ip))

Expand Down

0 comments on commit da908cf

Please sign in to comment.