Skip to content
Snippets Groups Projects
Commit dc630d82 authored by Oscar Gustafsson's avatar Oscar Gustafsson :bicyclist:
Browse files

Change shape of input and output in SFG graph

parent 5afbe98d
No related branches found
No related tags found
1 merge request!181Firtesting
Pipeline #89613 passed
......@@ -1416,8 +1416,10 @@ class SFG(AbstractOperation):
destination.operation.graph_id,
)
else:
if op.type_name() == Delay.type_name():
if isinstance(op, Delay):
dg.node(op.graph_id, shape="square")
elif isinstance(op, (Input, Output)):
dg.node(op.graph_id, shape="cds")
else:
dg.node(op.graph_id)
return dg
......
......@@ -1398,18 +1398,18 @@ class TestPrecedenceGraph:
class TestSFGGraph:
def test_sfg(self, sfg_simple_filter):
res = (
"digraph {\n\trankdir=LR\n\tin1\n\tin1 -> "
"add1\n\tout1\n\tt1 -> out1\n\tadd1\n\tcmul1 -> "
"digraph {\n\trankdir=LR\n\tin1 [shape=cds]\n\tin1 -> "
"add1\n\tout1 [shape=cds]\n\tt1 -> out1\n\tadd1\n\tcmul1 -> "
"add1\n\tcmul1\n\tadd1 -> t1\n\tt1 [shape=square]\n\tt1 "
"-> cmul1\n}"
)
print(sfg_simple_filter.sfg().source)
assert sfg_simple_filter.sfg().source in (res, res + "\n")
def test_sfg_show_id(self, sfg_simple_filter):
res = (
"digraph {\n\trankdir=LR\n\tin1\n\tin1 -> add1 "
"[label=s1]\n\tout1\n\tt1 -> out1 [label=s2]\n\tadd1"
"digraph {\n\trankdir=LR\n\tin1 [shape=cds]\n\tin1 -> add1 "
"[label=s1]\n\tout1 [shape=cds]\n\tt1 -> out1 [label=s2]\n\tadd1"
"\n\tcmul1 -> add1 [label=s3]\n\tcmul1\n\tadd1 -> t1 "
"[label=s4]\n\tt1 [shape=square]\n\tt1 -> cmul1 [label=s5]\n}"
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment