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
2b90137b
Commit
2b90137b
authored
1 year ago
by
Oscar Gustafsson
Browse files
Options
Downloads
Patches
Plain Diff
Add test adding the output of two SFGs
parent
80b6affa
No related branches found
No related tags found
1 merge request
!268
Add test adding the output of two SFGs
Pipeline
#93486
passed
1 year ago
Stage: test
Stage: deploy
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_sfg.py
+25
-5
25 additions, 5 deletions
test/test_sfg.py
with
25 additions
and
5 deletions
test/test_sfg.py
+
25
−
5
View file @
2b90137b
...
@@ -11,15 +11,10 @@ import pytest
...
@@ -11,15 +11,10 @@ import pytest
from
b_asic
import
SFG
,
Input
,
Output
,
Signal
from
b_asic
import
SFG
,
Input
,
Output
,
Signal
from
b_asic.core_operations
import
(
from
b_asic.core_operations
import
(
Absolute
,
Addition
,
Addition
,
Butterfly
,
Butterfly
,
ComplexConjugate
,
Constant
,
Constant
,
ConstantMultiplication
,
ConstantMultiplication
,
Division
,
Max
,
Min
,
Multiplication
,
Multiplication
,
SquareRoot
,
SquareRoot
,
Subtraction
,
Subtraction
,
...
@@ -945,6 +940,31 @@ class TestConnectExternalSignalsToComponentsMultipleComp:
...
@@ -945,6 +940,31 @@ class TestConnectExternalSignalsToComponentsMultipleComp:
assert
test_sfg
.
evaluate
(
1
,
2
,
3
,
4
)
==
16
assert
test_sfg
.
evaluate
(
1
,
2
,
3
,
4
)
==
16
assert
not
test_sfg
.
connect_external_signals_to_components
()
assert
not
test_sfg
.
connect_external_signals_to_components
()
def
test_add_two_sfgs
(
self
):
c1
=
ConstantMultiplication
(
0.5
)
c1_sfg
=
c1
.
to_sfg
()
c2
=
ConstantMultiplication
(
0.5
)
c2_sfg
=
c2
.
to_sfg
()
in1
=
Input
()
in2
=
Input
()
output
=
Output
(
c1_sfg
+
c2_sfg
)
c1_sfg
<<
in1
c2_sfg
<<
in2
sfg
=
SFG
([
in1
,
in2
],
[
output
])
assert
not
sfg
.
find_by_type_name
(
ConstantMultiplication
.
type_name
())
c1_sfg
.
connect_external_signals_to_components
()
sfg
=
SFG
([
in1
,
in2
],
[
output
])
assert
len
(
sfg
.
find_by_type_name
(
ConstantMultiplication
.
type_name
()))
==
1
c2_sfg
.
connect_external_signals_to_components
()
sfg
=
SFG
([
in1
,
in2
],
[
output
])
assert
len
(
sfg
.
find_by_type_name
(
ConstantMultiplication
.
type_name
()))
==
2
class
TestTopologicalOrderOperations
:
class
TestTopologicalOrderOperations
:
def
test_feedback_sfg
(
self
,
sfg_simple_filter
):
def
test_feedback_sfg
(
self
,
sfg_simple_filter
):
...
...
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