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

Fixes a bug in network compilation and multiple port polling #391

Merged
merged 1 commit into from
Sep 30, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/lava/magma/compiler/compiler_graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ def is_dag(self, graph: 'DiGraphBase' = None) -> ty.Tuple[bool,
graph.annotate_digraph_by_degree()

leaves = [node for node, nodeattr in graph.nodes.items() if
nodeattr['degdef'] == NodeAnnotation.PUREOUT or nodeattr[
'degdef'] == NodeAnnotation.PUREIN]
nodeattr['degdef'] == NodeAnnotation.PUREIN]
num_leaves = len(leaves)

if num_leaves > 0:
Expand All @@ -242,6 +241,11 @@ def is_dag(self, graph: 'DiGraphBase' = None) -> ty.Tuple[bool,
_, graph = self.is_dag(graph)

if len(list(graph.nodes)) > 1:
isolated_nodes = \
[node for node, nodeattr in graph.nodes.items() if nodeattr[
'degdef'] == NodeAnnotation.ISOLATED]
if len(list(graph.nodes)) == len(isolated_nodes):
return True, graph
joyeshmishra marked this conversation as resolved.
Show resolved Hide resolved
return False, graph
else:
return True, graph
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ def poll_c_inports(self):
channel_actions = []
for cport, channel in self.c_inports_to_poll.items():
result = (cport, channel)
channel_actions.append((cport.csp_ports[0], lambda: result))
channel_actions.append((cport.csp_ports[0],
(lambda y: (lambda: y))(result)))

channel_actions.append((self.mgmt_channel.dst_port,
lambda: ('stop', None)))
Expand Down