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
5843bf7f
Commit
5843bf7f
authored
4 years ago
by
Kevin
Browse files
Options
Downloads
Patches
Plain Diff
Changed replace operations method
parent
311f41f5
No related branches found
Branches containing commit
No related tags found
1 merge request
!44
Resolve "Operation Replacement in a SFG"
Pipeline
#16380
passed
4 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
b_asic/signal_flow_graph.py
+11
-21
11 additions, 21 deletions
b_asic/signal_flow_graph.py
with
11 additions
and
21 deletions
b_asic/signal_flow_graph.py
+
11
−
21
View file @
5843bf7f
...
...
@@ -416,34 +416,24 @@ class SFG(AbstractOperation):
_sfg
=
self
()
inputs
=
[]
outputs
=
[]
input
_signal
s
=
[]
output
_signal
s
=
[]
for
_operation
in
[
_sfg
.
find_by_id
(
_id
)
for
_id
in
operation_ids
]:
# Retrive input operations
for
_signal
in
_operation
.
input_signals
:
if
_signal
.
source
.
operation
.
graph_id
not
in
operation_ids
:
inputs
.
append
(
_signal
.
source
.
operation
)
# Retrive output operations
for
_signal
in
_operation
.
output_signals
:
if
_signal
.
destination
.
operation
.
graph_id
not
in
operation_ids
:
outputs
.
append
(
_signal
.
destination
.
operation
)
assert
len
(
inputs
)
==
operation
.
input_count
,
"
The input count must match
"
assert
len
(
outputs
)
==
operation
.
output_count
,
"
The output count must match
"
for
index_in
,
_input
in
enumerate
(
inputs
):
for
_signal
in
_input
.
output_signals
:
input_signals
.
extend
(
filter
(
lambda
s
:
s
.
source
.
operation
.
graph_id
not
in
operation_ids
,
_operation
.
input_signals
))
output_signals
.
extend
(
filter
(
lambda
s
:
s
.
destination
.
operation
.
graph_id
not
in
operation_ids
,
_operation
.
output_signals
))
assert
len
(
input_signals
)
==
operation
.
input_count
,
"
The input count must match
"
assert
len
(
output_signals
)
==
operation
.
output_count
,
"
The output count must match
"
for
index_in
,
_signal
in
enumerate
(
input_signals
):
_signal
.
remove_destination
()
_signal
.
set_destination
(
operation
.
input
(
index_in
))
for
index_out
,
_output
in
enumerate
(
outputs
):
for
_signal
in
_output
.
input_signals
:
for
index_out
,
_signal
in
enumerate
(
output_signals
):
_signal
.
remove_source
()
_signal
.
set_source
(
operation
.
output
(
index_out
))
return
_sfg
()
def
_evaluate_source
(
self
,
src
:
OutputPort
,
results
:
MutableResultMap
,
registers
:
MutableRegisterMap
,
prefix
:
str
)
->
Number
:
...
...
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