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
f9e6dc7e
Commit
f9e6dc7e
authored
5 years ago
by
angloth
Browse files
Options
Downloads
Patches
Plain Diff
Fix old tests to fit with new port and signal interface
parent
4e31ca55
No related branches found
No related tags found
1 merge request
!9
Resolve #1 "Port Interface", #8 "Port Coupling"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/fixtures/operation_tree.py
+8
-8
8 additions, 8 deletions
test/fixtures/operation_tree.py
test/signal/test_signal.py
+3
-2
3 additions, 2 deletions
test/signal/test_signal.py
test/traverse/test_traverse_tree.py
+3
-2
3 additions, 2 deletions
test/traverse/test_traverse_tree.py
with
14 additions
and
12 deletions
test/fixtures/operation_tree.py
+
8
−
8
View file @
f9e6dc7e
...
...
@@ -10,9 +10,9 @@ def operation():
def
create_operation
(
_type
,
dest_oper
,
index
,
**
kwargs
):
oper
=
_type
(
**
kwargs
)
oper_signal
=
Signal
()
oper
.
_output_ports
[
0
].
connect
(
oper_signal
)
oper
.
_output_ports
[
0
].
connect
_signal
(
oper_signal
)
dest_oper
.
_input_ports
[
index
].
connect
(
oper_signal
)
dest_oper
.
_input_ports
[
index
].
connect
_signal
(
oper_signal
)
return
oper
@pytest.fixture
...
...
@@ -34,11 +34,11 @@ def large_operation_tree():
create_operation
(
Constant
,
add_oper_2
,
1
,
value
=
5
)
add_oper_3
=
Addition
()
add_oper_signal
=
Signal
(
add_oper
,
add_oper_3
)
add_oper
.
_output_ports
[
0
].
connect
(
add_oper_signal
)
add_oper_3
.
_input_ports
[
0
].
connect
(
add_oper_signal
)
add_oper_signal
=
Signal
(
add_oper
.
output
(
0
)
,
add_oper_3
.
output
(
0
)
)
add_oper
.
_output_ports
[
0
].
connect
_signal
(
add_oper_signal
)
add_oper_3
.
_input_ports
[
0
].
connect
_signal
(
add_oper_signal
)
add_oper_2_signal
=
Signal
(
add_oper_2
,
add_oper_3
)
add_oper_2
.
_output_ports
[
0
].
connect
(
add_oper_2_signal
)
add_oper_3
.
_input_ports
[
1
].
connect
(
add_oper_2_signal
)
add_oper_2_signal
=
Signal
(
add_oper_2
.
output
(
0
)
,
add_oper_3
.
output
(
0
)
)
add_oper_2
.
_output_ports
[
0
].
connect
_signal
(
add_oper_2_signal
)
add_oper_3
.
_input_ports
[
1
].
connect
_signal
(
add_oper_2_signal
)
return
const_oper
This diff is collapsed.
Click to expand it.
test/signal/test_signal.py
+
3
−
2
View file @
f9e6dc7e
...
...
@@ -6,11 +6,12 @@ import pytest
def
test_explicit_signal_creation
():
in_port
=
InputPort
(
0
,
None
)
out_port
=
OutputPort
(
1
,
None
)
s
=
Signal
(
in
_port
,
out
_port
)
s
=
Signal
(
out
_port
,
in
_port
)
assert
in_port
.
signals
==
[
s
]
assert
out_port
.
signals
==
[
s
]
assert
s
.
source
==
out_port
assert
s
.
source
is
out_port
assert
s
.
destination
is
in_port
def
test_implicit_signal_creation
():
in_port
=
InputPort
(
0
,
None
)
...
...
This diff is collapsed.
Click to expand it.
test/traverse/test_traverse_tree.py
+
3
−
2
View file @
f9e6dc7e
...
...
@@ -24,6 +24,7 @@ def test_traverse_type(large_operation_tree):
def
test_traverse_loop
(
operation_tree
):
add_oper_signal
=
Signal
()
operation_tree
.
_output_ports
[
0
].
connect
(
add_oper_signal
)
operation_tree
.
_input_ports
[
0
].
connect
(
add_oper_signal
)
operation_tree
.
_output_ports
[
0
].
connect_signal
(
add_oper_signal
)
operation_tree
.
_input_ports
[
0
].
disconnect_signal
()
operation_tree
.
_input_ports
[
0
].
connect_signal
(
add_oper_signal
)
assert
len
(
list
(
operation_tree
.
traverse
()))
==
2
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