Skip to content

Commit

Permalink
accept 20 * 16 boards and other none triad ones
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Oct 11, 2024
1 parent 0a7b4e8 commit d984fb2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
17 changes: 12 additions & 5 deletions spinn_machine/version/version_48_chips.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 4 additions & 0 deletions unittests/test_virtual_machine5.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 2 additions & 0 deletions unittests/version/test_version248.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit d984fb2

Please sign in to comment.