Skip to content

Commit

Permalink
Merge pull request #218 from SpiNNakerManchester/version_fix
Browse files Browse the repository at this point in the history
number and board_shape properties
  • Loading branch information
rowleya authored Aug 3, 2023
2 parents 17f47d4 + f351ede commit 933f4e1
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spinn_machine/version/abstract_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,22 @@ def name(self):
:rtype: str
"""

@abstractproperty
def number(self):
"""
The version number that produced this Version
:rtype: int
"""

@abstractproperty
def board_shape(self):
"""
The width and heigth of a single board of this type
:return:
"""

@property
def max_cores_per_chip(self):
"""
Expand Down
10 changes: 10 additions & 0 deletions spinn_machine/version/version_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ class Version3(VersionSpin1):
def name(self):
return "Spin1 4 Chip"

@property
@overrides(VersionSpin1.number)
def number(self):
return 3

@property
@overrides(VersionSpin1.board_shape)
def board_shape(self):
return (2, 2)

@property
@overrides(VersionSpin1.chip_core_map)
def chip_core_map(self):
Expand Down
10 changes: 10 additions & 0 deletions spinn_machine/version/version_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ class Version5(VersionSpin1):
def name(self):
return "Spin1 48 Chip"

@property
@overrides(VersionSpin1.number)
def number(self):
return 5

@property
@overrides(VersionSpin1.board_shape)
def board_shape(self):
return (8, 8)

@property
@overrides(VersionSpin1.chip_core_map)
def chip_core_map(self):
Expand Down
2 changes: 2 additions & 0 deletions unittests/version/test_version3.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def test_attributes(self):
self.assertEqual(123469792, version.max_sdram_per_chip)
self.assertEqual(1, version.n_non_user_cores)
self.assertEqual("Spin1 4 Chip", version.name)
self.assertEqual(3, version.number)
self.assertEqual((2, 2), version.board_shape)
self.assertEqual(4, version.n_chips_per_board)
self.assertEqual(1023, version.n_router_entries)

Expand Down
2 changes: 2 additions & 0 deletions unittests/version/test_version5.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ def test_attributes(self):
self.assertEqual(123469792, version.max_sdram_per_chip)
self.assertEqual(1, version.n_non_user_cores)
self.assertEqual("Spin1 48 Chip", version.name)
self.assertEqual(5, version.number)
self.assertEqual((8, 8), version.board_shape)
self.assertEqual(48, version.n_chips_per_board)
self.assertEqual(1023, version.n_router_entries)

Expand Down

0 comments on commit 933f4e1

Please sign in to comment.