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
fe2b75a1
Commit
fe2b75a1
authored
2 years ago
by
Oscar Gustafsson
Browse files
Options
Downloads
Patches
Plain Diff
Add port name
parent
0c22caa5
No related branches found
No related tags found
1 merge request
!207
Add port name
Pipeline
#89945
passed
2 years ago
Stage: test
Changes
4
Pipelines
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
b_asic/port.py
+13
-8
13 additions, 8 deletions
b_asic/port.py
b_asic/schedule.py
+2
-1
2 additions, 1 deletion
b_asic/schedule.py
b_asic/signal_flow_graph.py
+66
-184
66 additions, 184 deletions
b_asic/signal_flow_graph.py
test/test_sfg.py
+66
-168
66 additions, 168 deletions
test/test_sfg.py
with
147 additions
and
361 deletions
b_asic/port.py
+
13
−
8
View file @
fe2b75a1
...
@@ -49,8 +49,7 @@ class Port(ABC):
...
@@ -49,8 +49,7 @@ class Port(ABC):
@latency_offset.setter
@latency_offset.setter
@abstractmethod
@abstractmethod
def
latency_offset
(
self
,
latency_offset
:
int
)
->
None
:
def
latency_offset
(
self
,
latency_offset
:
int
)
->
None
:
"""
Set the latency_offset of the port to the integer specified value.
"""
Set the latency_offset of the port to the integer specified value.
"""
"""
raise
NotImplementedError
raise
NotImplementedError
@property
@property
...
@@ -94,6 +93,12 @@ class Port(ABC):
...
@@ -94,6 +93,12 @@ class Port(ABC):
"""
Removes all connected signals from the Port.
"""
"""
Removes all connected signals from the Port.
"""
raise
NotImplementedError
raise
NotImplementedError
@property
@abstractmethod
def
name
(
self
)
->
str
:
"""
Return a name consisting of *graph_id* of the related operation and the port number.
"""
class
AbstractPort
(
Port
):
class
AbstractPort
(
Port
):
"""
"""
...
@@ -134,6 +139,10 @@ class AbstractPort(Port):
...
@@ -134,6 +139,10 @@ class AbstractPort(Port):
def
latency_offset
(
self
,
latency_offset
:
Optional
[
int
]):
def
latency_offset
(
self
,
latency_offset
:
Optional
[
int
]):
self
.
_latency_offset
=
latency_offset
self
.
_latency_offset
=
latency_offset
@property
def
name
(
self
):
return
f
"
{
self
.
operation
.
graph_id
}
.
{
self
.
index
}
"
class
SignalSourceProvider
(
ABC
):
class
SignalSourceProvider
(
ABC
):
"""
"""
...
@@ -196,13 +205,9 @@ class InputPort(AbstractPort):
...
@@ -196,13 +205,9 @@ class InputPort(AbstractPort):
Get the output port that is currently connected to this input port,
Get the output port that is currently connected to this input port,
or None if it is unconnected.
or None if it is unconnected.
"""
"""
return
(
return
None
if
self
.
_source_signal
is
None
else
self
.
_source_signal
.
source
None
if
self
.
_source_signal
is
None
else
self
.
_source_signal
.
source
)
def
connect
(
def
connect
(
self
,
src
:
SignalSourceProvider
,
name
:
Name
=
Name
(
""
))
->
Signal
:
self
,
src
:
SignalSourceProvider
,
name
:
Name
=
Name
(
""
)
)
->
Signal
:
"""
"""
Connect the provided signal source to this input port by creating a new signal.
Connect the provided signal source to this input port by creating a new signal.
Returns the new signal.
Returns the new signal.
...
...
This diff is collapsed.
Click to expand it.
b_asic/schedule.py
+
2
−
1
View file @
fe2b75a1
...
@@ -577,7 +577,7 @@ class Schedule:
...
@@ -577,7 +577,7 @@ class Schedule:
start_time
+
cast
(
int
,
outport
.
latency_offset
),
start_time
+
cast
(
int
,
outport
.
latency_offset
),
outport
,
outport
,
reads
,
reads
,
outport
.
operation
.
graph_id
,
outport
.
name
,
)
)
)
)
return
ret
return
ret
...
@@ -800,6 +800,7 @@ class Schedule:
...
@@ -800,6 +800,7 @@ class Schedule:
The vertical distance between operations in the schedule. The height of
The vertical distance between operations in the schedule. The height of
the operation is always 1.
the operation is always 1.
"""
"""
self
.
_plot_schedule
(
ax
,
operation_gap
=
operation_gap
)
def
plot
(
self
,
operation_gap
:
Optional
[
float
]
=
None
)
->
None
:
def
plot
(
self
,
operation_gap
:
Optional
[
float
]
=
None
)
->
None
:
"""
"""
...
...
This diff is collapsed.
Click to expand it.
b_asic/signal_flow_graph.py
+
66
−
184
View file @
fe2b75a1
This diff is collapsed.
Click to expand it.
test/test_sfg.py
+
66
−
168
View file @
fe2b75a1
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