CMSIS-DSP: Update to graphivz generation in SDF

pull/19/head
Christophe Favergeon 4 years ago
parent 168d055297
commit 6bbbb81486

@ -65,6 +65,9 @@ class Configuration:
# the index of functions to call in another array
self.codeArray = False
# True for an horizontal graphviz layout
self.horizontal = True
@property
def debug(self):
return (self.debugLimit > 0)

@ -657,9 +657,9 @@ class Schedule:
"""Write graphviz into file f"""
sdf.schedule.pythoncode.gencode(self,directory,config)
def graphviz(self,f):
def graphviz(self,f,config=Configuration()):
"""Write graphviz into file f"""
sdf.schedule.graphviz.gengraph(self,f)
sdf.schedule.graphviz.gengraph(self,f,config)

@ -27,7 +27,7 @@
############################################
from jinja2 import Environment, PackageLoader, select_autoescape
def gengraph(sched,f):
def gengraph(sched,f,config):
env = Environment(
loader=PackageLoader("sdf"),
autoescape=select_autoescape(),
@ -46,5 +46,6 @@ def gengraph(sched,f):
nbFifos=nbFifos,
constEdges=sched.constantEdges,
nbConstEdges=len(sched.constantEdges),
constObjs=constObjs
constObjs=constObjs,
config=config
),file=f)

@ -21,7 +21,9 @@
digraph structs {
node [shape=plaintext]
{% if config.horizontal %}
rankdir=LR
{% endif %}
edge [arrowsize=0.5]
fontname="times"
@ -51,28 +53,24 @@ digraph structs {
<TD></TD>
{% endif %}
</TR>
<TR>
{% if item.hasManyInputs %}
{% for input in item.inputNames[1:] -%}
<TD PORT="{{input}}"><FONT POINT-SIZE="9.0">{{input}}</FONT></TD>
{% endfor -%}
{% for output in range(item.nbEmptyInputs) %}
<TD></TD>
{% endfor %}
{% for id in range(1,item.maxNbIOs) -%}
<TR>
{% if item.inputNames[id] -%}
{% set input %}{{item.inputNames[id]}}{% endset %}
<TD PORT="{{input}}"><FONT POINT-SIZE="9.0">{{input}}</FONT></TD>
{% else %}
<TD></TD>
{% endif %}
{% if item.hasManyOutputs %}
{% for output in item.outputNames[1:] -%}
{%- endif %}
{% if item.outputNames[id] -%}
{% set output %}{{item.outputNames[id]}}{% endset %}
<TD PORT="{{output}}"><FONT POINT-SIZE="9.0">{{output}}</FONT></TD>
{% endfor -%}
{% for output in range(item.nbEmptyOutputs) %}
<TD></TD>
{% endfor %}
{% else %}
<TD></TD>
{% endif %}
{%- endif %}
</TR>
{%- endfor %}
</TABLE>>];

Loading…
Cancel
Save