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
Commits
70f5be89
Commit
70f5be89
authored
5 years ago
by
angloth
Browse files
Options
Downloads
Patches
Plain Diff
Rename find_components_with_type_name to get
parent
933f1e77
No related branches found
No related tags found
1 merge request
!29
Resolve "Generate PG from SFG"
Pipeline
#13954
passed
5 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
b_asic/signal_flow_graph.py
+3
-3
3 additions, 3 deletions
b_asic/signal_flow_graph.py
test/test_sfg.py
+5
-5
5 additions, 5 deletions
test/test_sfg.py
with
8 additions
and
8 deletions
b_asic/signal_flow_graph.py
+
3
−
3
View file @
70f5be89
...
@@ -269,7 +269,7 @@ class SFG(AbstractOperation):
...
@@ -269,7 +269,7 @@ class SFG(AbstractOperation):
"""
Get all operations of this graph in depth-first order.
"""
"""
Get all operations of this graph in depth-first order.
"""
return
self
.
_operations_ordered
return
self
.
_operations_ordered
def
find
_components_with_type_name
(
self
,
type_name
:
TypeName
)
->
List
[
GraphComponent
]:
def
get
_components_with_type_name
(
self
,
type_name
:
TypeName
)
->
List
[
GraphComponent
]:
"""
Get a list with all components in this graph with the specified type_name.
"""
Get a list with all components in this graph with the specified type_name.
Keyword arguments:
Keyword arguments:
...
@@ -478,7 +478,7 @@ class SFG(AbstractOperation):
...
@@ -478,7 +478,7 @@ class SFG(AbstractOperation):
results
[
key
]
=
value
results
[
key
]
=
value
return
value
return
value
def
get_precedence_list
(
self
):
def
get_precedence_list
(
self
)
->
List
[
List
[
OutputPort
]]
:
"""
Returns a Precedence list of the SFG where each element in n:th the list consists
"""
Returns a Precedence list of the SFG where each element in n:th the list consists
of elements that are executed in the n:th step. If the precedence list already has been
of elements that are executed in the n:th step. If the precedence list already has been
calculated for the current SFG then returns the cached version.
"""
calculated for the current SFG then returns the cached version.
"""
...
@@ -490,7 +490,7 @@ class SFG(AbstractOperation):
...
@@ -490,7 +490,7 @@ class SFG(AbstractOperation):
# Find all operations with only outputs and no inputs.
# Find all operations with only outputs and no inputs.
no_input_ops
=
list
(
no_input_ops
=
list
(
filter
(
lambda
op
:
op
.
input_count
==
0
,
self
.
operations
))
filter
(
lambda
op
:
op
.
input_count
==
0
,
self
.
operations
))
reg_ops
=
self
.
find
_components_with_type_name
(
Register
.
type_name
())
reg_ops
=
self
.
get
_components_with_type_name
(
Register
.
type_name
())
# Find all first iter output ports for precedence
# Find all first iter output ports for precedence
curr_iter_ports
=
[
op
.
output
(
i
)
for
op
in
(
curr_iter_ports
=
[
op
.
output
(
i
)
for
op
in
(
...
...
This diff is collapsed.
Click to expand it.
test/test_sfg.py
+
5
−
5
View file @
70f5be89
...
@@ -290,19 +290,19 @@ class TestFindComponentsWithTypeName:
...
@@ -290,19 +290,19 @@ class TestFindComponentsWithTypeName:
print
(
mac_sfg
.
_components_by_id
)
print
(
mac_sfg
.
_components_by_id
)
assert
{
comp
.
name
for
comp
in
mac_sfg
.
find
_components_with_type_name
(
assert
{
comp
.
name
for
comp
in
mac_sfg
.
get
_components_with_type_name
(
inp1
.
type_name
())}
==
{
"
INP1
"
,
"
INP2
"
,
"
INP3
"
}
inp1
.
type_name
())}
==
{
"
INP1
"
,
"
INP2
"
,
"
INP3
"
}
assert
{
comp
.
name
for
comp
in
mac_sfg
.
find
_components_with_type_name
(
assert
{
comp
.
name
for
comp
in
mac_sfg
.
get
_components_with_type_name
(
add1
.
type_name
())}
==
{
"
ADD1
"
,
"
ADD2
"
}
add1
.
type_name
())}
==
{
"
ADD1
"
,
"
ADD2
"
}
assert
{
comp
.
name
for
comp
in
mac_sfg
.
find
_components_with_type_name
(
assert
{
comp
.
name
for
comp
in
mac_sfg
.
get
_components_with_type_name
(
mul1
.
type_name
())}
==
{
"
MUL1
"
}
mul1
.
type_name
())}
==
{
"
MUL1
"
}
assert
{
comp
.
name
for
comp
in
mac_sfg
.
find
_components_with_type_name
(
assert
{
comp
.
name
for
comp
in
mac_sfg
.
get
_components_with_type_name
(
out1
.
type_name
())}
==
{
"
OUT1
"
}
out1
.
type_name
())}
==
{
"
OUT1
"
}
assert
{
comp
.
name
for
comp
in
mac_sfg
.
find
_components_with_type_name
(
assert
{
comp
.
name
for
comp
in
mac_sfg
.
get
_components_with_type_name
(
Signal
.
type_name
())}
==
{
"
S1
"
,
"
S2
"
,
"
S3
"
,
"
S4
"
,
"
S5
"
,
"
S6
"
,
"
S7
"
}
Signal
.
type_name
())}
==
{
"
S1
"
,
"
S2
"
,
"
S3
"
,
"
S4
"
,
"
S5
"
,
"
S6
"
,
"
S7
"
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment