Skip to content

Commit

Permalink
Merge branch 'master' into fix_shared_sdram
Browse files Browse the repository at this point in the history
  • Loading branch information
rowleya authored Nov 13, 2024
2 parents 33a502f + b6aeceb commit 655d5fe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions pacman/model/resources/iptag_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class IPtagResource(object):
"_traffic_identifier")

def __init__(
self, ip_address: Optional[str], port: Optional[int],
self, ip_address: str, port: int,
strip_sdp: bool, tag: Optional[int] = None,
traffic_identifier: str = "DEFAULT"):
"""
Expand All @@ -60,7 +60,7 @@ def __init__(
self._traffic_identifier = traffic_identifier

@property
def ip_address(self) -> Optional[str]:
def ip_address(self) -> str:
"""
The IP address to assign to the tag.
Expand All @@ -69,7 +69,7 @@ def ip_address(self) -> Optional[str]:
return self._ip_address

@property
def port(self) -> Optional[int]:
def port(self) -> int:
"""
The port of the tag.
Expand Down
7 changes: 3 additions & 4 deletions pacman/model/tags/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,12 @@ def add_reverse_ip_tag(
"reverse_ip_tag", reverse_ip_tag,
"The port has already been assigned on the given board")

board_address = reverse_ip_tag.board_address
self._reverse_ip_tags[
(reverse_ip_tag.board_address,
reverse_ip_tag.tag)] = reverse_ip_tag
(board_address, reverse_ip_tag.tag)] = reverse_ip_tag
self._reverse_ip_tags_by_vertex[vertex].append(reverse_ip_tag)
if reverse_ip_tag.port is not None:
self._ports_assigned.add(
(reverse_ip_tag.board_address, reverse_ip_tag.port))
self._ports_assigned.add((board_address, reverse_ip_tag.port))

@property
def ip_tags_vertices(self) -> Iterable[Tuple[IPTag, MachineVertex]]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ def __find_free_tag(
def __create_tag(
eth_chip: Chip, placement: Placement, iptag: IPtagResource,
tag: int) -> IPTag:
ethernet_ip = eth_chip.ip_address
assert ethernet_ip is not None
return IPTag(
eth_chip.ip_address, placement.x, placement.y,
ethernet_ip, placement.x, placement.y,
tag, iptag.ip_address, iptag.port,
iptag.strip_sdp, iptag.traffic_identifier)

Expand All @@ -135,8 +137,10 @@ def __create_reverse_tag(
eth_chip: Chip, placement: Placement,
reverse_iptag: ReverseIPtagResource, tag: int,
port: int) -> ReverseIPTag:
ethernet_ip_address = eth_chip.ip_address
assert ethernet_ip_address is not None
return ReverseIPTag(
eth_chip.ip_address, tag, port, placement.x, placement.y, placement.p,
ethernet_ip_address, tag, port, placement.x, placement.y, placement.p,
reverse_iptag.sdp_port)


Expand Down

0 comments on commit 655d5fe

Please sign in to comment.