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
e8d99dd0
Commit
e8d99dd0
authored
4 years ago
by
angloth
Browse files
Options
Downloads
Patches
Plain Diff
Add deep copying with call
parent
be07babe
Branches
master
No related tags found
4 merge requests
!31
Resolve "Specify internal input/output dependencies of an Operation"
,
!25
Resolve "System tests iteration 1"
,
!24
Resolve "System tests iteration 1"
,
!23
Resolve "Simulate SFG"
Pipeline
#12278
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
+16
-11
16 additions, 11 deletions
b_asic/signal_flow_graph.py
with
16 additions
and
11 deletions
b_asic/signal_flow_graph.py
+
16
−
11
View file @
e8d99dd0
...
...
@@ -133,21 +133,23 @@ class SFG(AbstractOperation):
for
sig
,
input_index
in
self
.
_original_input_signals_indexes
.
items
():
# Check if already added destination.
new_sig
=
self
.
_added_components_mapping
[
sig
]
if
new_sig
.
destination
is
not
None
and
new_sig
.
destination
.
operation
in
output_operations_set
:
# Add directly connected input to output to dfs order list
self
.
_components_in_dfs_order
.
extend
([
new_sig
.
source
.
operation
,
new_sig
,
new_sig
.
destination
.
operation
])
elif
sig
.
destination
is
None
:
raise
ValueError
(
f
"
Input signal #
{
input_index
}
is missing destination in SFG
"
)
elif
sig
.
destination
.
operation
not
in
self
.
_added_components_mapping
:
self
.
_copy_structure_from_operation_dfs
(
sig
.
destination
.
operation
)
if
new_sig
.
destination
is
None
:
if
sig
.
destination
is
None
:
raise
ValueError
(
f
"
Input signal #
{
input_index
}
is missing destination in SFG
"
)
elif
sig
.
destination
.
operation
not
in
self
.
_added_components_mapping
:
self
.
_copy_structure_from_operation_dfs
(
sig
.
destination
.
operation
)
else
:
if
new_sig
.
destination
.
operation
in
output_operations_set
:
# Add directly connected input to output to dfs order list
self
.
_components_in_dfs_order
.
extend
([
new_sig
.
source
.
operation
,
new_sig
,
new_sig
.
destination
.
operation
])
# Search the graph inwards from each output signal.
for
sig
,
output_index
in
self
.
_original_output_signals_indexes
.
items
():
# Check if already added source.
m
ew_sig
=
self
.
_added_components_mapping
[
sig
]
n
ew_sig
=
self
.
_added_components_mapping
[
sig
]
if
new_sig
.
source
is
None
:
if
sig
.
source
is
None
:
raise
ValueError
(
...
...
@@ -156,6 +158,9 @@ class SFG(AbstractOperation):
self
.
_copy_structure_from_operation_dfs
(
sig
.
source
.
operation
)
def
__call__
(
self
):
return
self
.
deep_copy
()
@property
def
type_name
(
self
)
->
TypeName
:
return
"
sfg
"
...
...
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