Skip to content

Commit

Permalink
Added a warning and more comment to RTL tasklet reading from stream.
Browse files Browse the repository at this point in the history
  • Loading branch information
carljohnsen committed Oct 19, 2023
1 parent 6292c11 commit 422f733
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions dace/codegen/targets/rtl.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.

import itertools

from typing import List, Tuple, Dict
import warnings

from dace import dtypes, config, registry, symbolic, nodes, sdfg, data
from dace.sdfg import graph, state, find_input_arraynode, find_output_arraynode
Expand Down Expand Up @@ -103,9 +103,20 @@ def copy_memory(self, sdfg: sdfg.SDFG, dfg: state.StateSubgraphView, state_id: i
line: str = "{} {} = {};".format(dst_node.in_connectors[edge.dst_conn].ctype, edge.dst_conn,
edge.src.data)
elif isinstance(arr, data.Stream):
# TODO Streams are currently unsupported, as the proper behaviour has to be implemented to avoid deadlocking.
line: str = "// Unsupported read from ({}) variable '{}' from stream '{}'".format(
dst_node.in_connectors[edge.dst_conn].ctype, edge.dst_conn, edge.src_conn)
# TODO Streams are currently unsupported, as the proper
# behaviour has to be implemented to avoid deadlocking. It
# is only a warning, as the RTL backend is partially used
# by the Xilinx backend, which may hit this case, but will
# discard the errorneous code.
warnings.warn(
'Streams are currently unsupported by the RTL backend.' \
'This may produce errors or deadlocks in the generated code.'
)
line: str = "// WARNING: Unsupported read from ({}) variable '{}' from stream '{}'." \
" This may lead to a deadlock if used in code.\n".format(
dst_node.in_connectors[edge.dst_conn].ctype, edge.dst_conn, edge.src_conn)
line += "{} {} = {}.pop();".format(
dst_node.in_connectors[edge.dst_conn].ctype, edge.dst_conn, edge.src.data)
elif isinstance(edge.src, nodes.MapEntry) and isinstance(edge.dst, nodes.Tasklet):
rtl_name = self.unique_name(edge.dst, sdfg.nodes()[state_id], sdfg)
self.n_unrolled[rtl_name] = symbolic.evaluate(edge.src.map.range[0][1] + 1, sdfg.constants)
Expand Down

0 comments on commit 422f733

Please sign in to comment.