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
ebad7458
Commit
ebad7458
authored
5 years ago
by
angloth
Browse files
Options
Downloads
Patches
Plain Diff
Add fixes to pull request comments.
parent
2a964b82
No related branches found
Branches containing commit
No related tags found
1 merge request
!9
Resolve #1 "Port Interface", #8 "Port Coupling"
Pipeline
#10304
failed
5 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
b_asic/abstract_operation.py
+1
-0
1 addition, 0 deletions
b_asic/abstract_operation.py
b_asic/core_operations.py
+0
-3
0 additions, 3 deletions
b_asic/core_operations.py
b_asic/port.py
+2
-4
2 additions, 4 deletions
b_asic/port.py
with
3 additions
and
7 deletions
b_asic/abstract_operation.py
+
1
−
0
View file @
ebad7458
...
...
@@ -15,6 +15,7 @@ from b_asic.utilities import breadth_first_search
from
b_asic.abstract_graph_component
import
AbstractGraphComponent
from
b_asic.graph_component
import
Name
class
AbstractOperation
(
Operation
,
AbstractGraphComponent
):
"""
Generic abstract operation class which most implementations will derive from.
TODO: More info.
...
...
This diff is collapsed.
Click to expand it.
b_asic/core_operations.py
+
0
−
3
View file @
ebad7458
...
...
@@ -30,7 +30,6 @@ class Constant(AbstractOperation):
"""
def
__init__
(
self
,
value
:
Number
=
0
,
name
:
Name
=
""
):
"""
Construct a Constant.
"""
super
().
__init__
(
name
)
self
.
_output_ports
=
[
OutputPort
(
0
,
self
)]
# TODO: Generate appropriate ID for ports.
...
...
@@ -50,7 +49,6 @@ class Addition(AbstractOperation):
"""
def
__init__
(
self
,
source1
:
OutputPort
=
None
,
source2
:
OutputPort
=
None
,
name
:
Name
=
""
):
"""
Construct an Addition.
"""
super
().
__init__
(
name
)
self
.
_input_ports
=
[
InputPort
(
0
,
self
),
InputPort
(
1
,
self
)]
# TODO: Generate appropriate ID for ports.
...
...
@@ -75,7 +73,6 @@ class ConstantMultiplication(AbstractOperation):
"""
def
__init__
(
self
,
coefficient
:
Number
,
source1
:
OutputPort
=
None
,
name
:
Name
=
""
):
"""
Construct a ConstantMultiplication.
"""
super
().
__init__
(
name
)
self
.
_input_ports
=
[
InputPort
(
0
,
self
)]
# TODO: Generate appropriate ID for ports.
self
.
_output_ports
=
[
OutputPort
(
0
,
self
)]
# TODO: Generate appropriate ID for ports.
...
...
This diff is collapsed.
Click to expand it.
b_asic/port.py
+
2
−
4
View file @
ebad7458
...
...
@@ -114,8 +114,7 @@ class InputPort(Port):
def
connect_port
(
self
,
port
:
"
OutputPort
"
)
->
Signal
:
assert
self
.
_signal
is
None
,
"
Connecting new port to already connected input port.
"
Signal
(
port
,
self
)
# self._signal is set by the signal constructor
return
self
.
_signal
return
Signal
(
port
,
self
)
# self._signal is set by the signal constructor
def
connect_signal
(
self
,
signal
:
Signal
)
->
None
:
assert
self
.
_signal
is
None
,
"
Connecting new port to already connected input port.
"
...
...
@@ -165,8 +164,7 @@ class OutputPort(Port):
return
len
(
self
.
_signals
)
def
connect_port
(
self
,
port
:
InputPort
)
->
Signal
:
signal
=
Signal
(
self
,
port
)
# Signal is added to self._signals in signal constructor
return
signal
return
=
Signal
(
self
,
port
)
# Signal is added to self._signals in signal constructor
def
connect_signal
(
self
,
signal
:
Signal
)
->
None
:
assert
not
self
.
is_connected_to_signal
(
signal
),
\
...
...
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