diff --git a/spinn_machine/version/version_48_chips.py b/spinn_machine/version/version_48_chips.py index 2ce94bc9..5c7a5d29 100644 --- a/spinn_machine/version/version_48_chips.py +++ b/spinn_machine/version/version_48_chips.py @@ -48,14 +48,21 @@ def get_potential_ethernet_chips( @overrides(AbstractVersion._verify_size) def _verify_size(self, width: int, height: int): - if width == height == 8: - # 1 board - return - if width % 12 not in [0, 4]: + if width == 8: + if height == 8: + # 1 board + return + else: + raise SpinnMachineException( + f"{width=} and {height=} not supported") + elif height == 8: + raise SpinnMachineException( + f"{width=} and {height=} not supported") + if width % 4 != 0: raise SpinnMachineException( f"{width=} must be a multiple of 12 " f"or a multiple of 12 plus 4") - if height % 12 not in [0, 4]: + if height % 4 != 0: raise SpinnMachineException( f"{height=} must be a multiple of 12 " f"or a multiple of 12 plus 4") diff --git a/unittests/test_virtual_machine5.py b/unittests/test_virtual_machine5.py index 9dad23c1..5536f96b 100644 --- a/unittests/test_virtual_machine5.py +++ b/unittests/test_virtual_machine5.py @@ -286,6 +286,10 @@ def test_fpga_links_3_board(self): for ip, fpga, fpga_link, x, y, link in fpga_links: self._assert_fpga_link(machine, fpga, fpga_link, x, y, link, ip) + def test_none_triad(self): + set_config("Machine", "version", FIVE) + virtual_machine(width=20, height=16) + virtual_machine(width=12, height=16) if __name__ == '__main__': unittest.main() diff --git a/unittests/version/test_version248.py b/unittests/version/test_version248.py index dc6031ae..9b0ddd99 100644 --- a/unittests/version/test_version248.py +++ b/unittests/version/test_version248.py @@ -124,6 +124,8 @@ def test_verify_size(self): version.verify_size(12, 16) version.verify_size(16, 12) version.verify_size(16, 16) + version.verify_size(16, 20) + version.verify_size(20, 16) def test_create_machine(self): version = Version248()