Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

number and board_shape properties #218

Merged
merged 1 commit into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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