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
62a7700c
Commit
62a7700c
authored
5 years ago
by
angloth
Browse files
Options
Downloads
Patches
Plain Diff
Remove setter for signals source and destination since they shouldn't be modified.
parent
aec6d3e0
No related branches found
No related tags found
1 merge request
!9
Resolve #1 "Port Interface", #8 "Port Coupling"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
b_asic/port.py
+3
-0
3 additions, 0 deletions
b_asic/port.py
b_asic/signal.py
+2
-24
2 additions, 24 deletions
b_asic/signal.py
with
5 additions
and
24 deletions
b_asic/port.py
+
3
−
0
View file @
62a7700c
...
...
@@ -99,6 +99,9 @@ class InputPort(Port):
return
0
if
self
.
_signal
is
None
else
1
def
connect
(
self
,
port
:
"
OutputPort
"
)
->
sig
.
Signal
:
# Remove previously connected signal if there is one
if
self
.
_signal
is
not
None
:
self
.
disconnect
()
self
.
_signal
=
sig
.
Signal
(
port
,
self
)
return
self
.
_signal
...
...
This diff is collapsed.
Click to expand it.
b_asic/signal.py
+
2
−
24
View file @
62a7700c
...
...
@@ -32,42 +32,20 @@ class Signal(AbstractGraphComponent):
"""
Returns the destination InputPort of the signal.
"""
return
self
.
_destination
@source.setter
def
source
(
self
,
src
:
OutputPort
)
->
None
:
"""
Sets the value of the source OutputPort of the signal.
Note: Does not connect the src OutputPort to the signal.
Keyword arguments:
- src: OutPort to connect as source to the signal.
"""
self
.
_source
=
src
@destination.setter
def
destination
(
self
,
dest
:
InputPort
)
->
None
:
"""
Sets the value of the destination InputPort of the signal.
Note: Does not connect the destination InputPort to the signal.
Keywords argments:
- dest: InputPort to connect as destination to the signal.
"""
self
.
_destination
=
dest
@property
def
type_name
(
self
)
->
TypeName
:
return
"
s
"
def
disconnect_source
(
self
)
->
None
:
"""
Disconnects the source OutputPort of the signal.
Note: Does not disconnect the source OutputPort from the signal.
"""
self
.
_source
=
None
def
disconnect_destination
(
self
)
->
None
:
"""
Disconnects the destination InputPort of the signal.
Note: Does not disconnect the destination OutputPort from the signal.
"""
self
.
_destination
=
None
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