Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B-ASIC - Better ASIC Toolbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computer Engineering
B-ASIC - Better ASIC Toolbox
Merge requests
!318
Add branch node, i/o number and more options to SFG digraph
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add branch node, i/o number and more options to SFG digraph
digraph
into
master
Overview
0
Commits
1
Pipelines
2
Changes
2
Merged
Oscar Gustafsson
requested to merge
digraph
into
master
1 year ago
Overview
0
Commits
1
Pipelines
2
Changes
1
Expand
Closes
#207 (closed)
0
0
Merge request reports
Compare
version 1
version 1
cab5e52d
1 year ago
master (base)
and
latest version
latest version
59bc79d9
1 commit,
1 year ago
version 1
cab5e52d
1 commit,
1 year ago
Show latest version
1 file
+
36
−
8
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
test/test_sfg.py
+
36
−
8
Options
@@ -1233,19 +1233,19 @@ class TestPrecedenceGraph:
class
TestSFGGraph
:
def
test_sfg
(
self
,
sfg_simple_filter
):
res
=
(
'
digraph {
\n\t
rankdir=LR
\n\t
in1 [shape=cds]
\n\t
in1 -> add1
\n\t
out1
'
'
[shape=cds]
\n\t
t1 -> out1
\n\t
add1
[shape=ellipse]
\n\t
cmul1 ->
'
'
add1
\n\t
cmul1
[shape=ellipse]
\n\t
add
1 ->
t1
\n\t
t
1
'
'
[shape=square]
\n\t
t1 -> cmul1
\n
}
'
'
digraph {
\n\t
rankdir=LR
splines=spline
\n\t
in1 [shape=cds]
\n\t
in1 -> add1
'
'
[headlabel=0]
\n\t
out1
[shape=cds]
\n\t
t1 -> out1
\n\t
add1
'
'
[shape=ellipse]
\n\t
cmul
1 ->
add1 [headlabel=1]
\n\t
cmul
1
'
'
[shape=ellipse]
\n\t
add1 -> t1
\n\t
t1
[shape=square]
\n\t
t1 -> cmul1
\n
}
'
)
assert
sfg_simple_filter
.
sfg_digraph
().
source
in
(
res
,
res
+
"
\n
"
)
def
test_sfg_show_id
(
self
,
sfg_simple_filter
):
res
=
(
'
digraph {
\n\t
rankdir=LR
\n\t
in1 [shape=cds]
\n\t
in1 -> add1
'
'
[label=s1]
\n\t
out1 [shape=cds]
\n\t
t1 -> out1
[label=s2]
\n\t
add1
'
'
[shape=ellipse]
\n\t
cmul1 -> add1 [label=s3
]
\n\t
cmul1
'
'
[shape=ellipse]
\n\t
add1 -> t1 [label=s4]
\n\t
t1
'
'
digraph {
\n\t
rankdir=LR
splines=spline
\n\t
in1 [shape=cds]
\n\t
in1 -> add1
'
'
[label=s1
headlabel=0
]
\n\t
out1 [shape=cds]
\n\t
t1 -> out1
'
'
[label=s2]
\n\t
add1
[shape=ellipse]
\n\t
cmul1 -> add1 [label=s3
'
'
headlabel=1]
\n\t
cmul1
[shape=ellipse]
\n\t
add1 -> t1 [label=s4]
\n\t
t1
'
'
[shape=square]
\n\t
t1 -> cmul1 [label=s5]
\n
}
'
)
@@ -1254,6 +1254,34 @@ class TestSFGGraph:
res
+
"
\n
"
,
)
def
test_sfg_branch
(
self
,
sfg_simple_filter
):
res
=
(
'
digraph {
\n\t
rankdir=LR splines=spline
\n\t
in1 [shape=cds]
\n\t
in1 -> add1
'
'
[headlabel=0]
\n\t
out1 [shape=cds]
\n\t
"
t1.0
"
-> out1
\n\t
"
t1.0
"'
'
[shape=point]
\n\t
t1 ->
"
t1.0
"
[arrowhead=none]
\n\t
add1
'
'
[shape=ellipse]
\n\t
cmul1 -> add1 [headlabel=1]
\n\t
cmul1
'
'
[shape=ellipse]
\n\t
add1 -> t1
\n\t
t1 [shape=square]
\n\t
"
t1.0
"
->
'
'
cmul1
\n
}
'
)
assert
sfg_simple_filter
.
sfg_digraph
(
branch_node
=
True
).
source
in
(
res
,
res
+
"
\n
"
,
)
def
test_sfg_no_port_numbering
(
self
,
sfg_simple_filter
):
res
=
(
'
digraph {
\n\t
rankdir=LR splines=spline
\n\t
in1 [shape=cds]
\n\t
in1 ->
'
'
add1
\n\t
out1 [shape=cds]
\n\t
t1 -> out1
\n\t
add1 [shape=ellipse]
\n\t
cmul1
'
'
-> add1
\n\t
cmul1 [shape=ellipse]
\n\t
add1 -> t1
\n\t
t1 [shape=square]
\n\t
t1
'
'
-> cmul1
\n
}
'
)
assert
sfg_simple_filter
.
sfg_digraph
(
port_numbering
=
False
).
source
in
(
res
,
res
+
"
\n
"
,
)
def
test_show_sfg_invalid_format
(
self
,
sfg_simple_filter
):
with
pytest
.
raises
(
ValueError
):
sfg_simple_filter
.
show
(
fmt
=
"
ppddff
"
)
Loading