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
a0621925
Commit
a0621925
authored
2 years ago
by
Oscar Gustafsson
Browse files
Options
Downloads
Patches
Plain Diff
Add documentation
parent
7adb32c2
No related branches found
Branches containing commit
No related tags found
1 merge request
!161
Add documentation
Pipeline
#88827
passed
2 years ago
Stage: test
Stage: deploy
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
b_asic/schedule.py
+51
-2
51 additions, 2 deletions
b_asic/schedule.py
with
51 additions
and
2 deletions
b_asic/schedule.py
+
51
−
2
View file @
a0621925
...
...
@@ -119,14 +119,21 @@ class Schedule:
def
forward_slack
(
self
,
graph_id
:
GraphID
)
->
int
:
"""
Return how much an operation can be moved forward in time.
Parameters
----------
graph_id
graph_id : GraphID
The graph id of the operation.
Returns
-------
The number of time steps the operation with *graph_id* can ba moved forward in time.
See also
--------
backward_slack
slacks
"""
if
graph_id
not
in
self
.
_start_times
:
raise
ValueError
(
...
...
@@ -163,14 +170,24 @@ class Schedule:
def
backward_slack
(
self
,
graph_id
:
GraphID
)
->
int
:
"""
Return how much an operation can be moved backward in time.
Parameters
----------
graph_id
graph_id : GraphID
The graph id of the operation.
Returns
-------
The number of time steps the operation with *graph_id* can ba moved backward in time.
.. note:: The backward slack is positive, but a call to :func:`move_operation` should be negative to move
the operation backward.
See also
--------
forward_slack
slacks
"""
if
graph_id
not
in
self
.
_start_times
:
raise
ValueError
(
...
...
@@ -206,6 +223,28 @@ class Schedule:
return
ret
def
slacks
(
self
,
graph_id
:
GraphID
)
->
Tuple
[
int
,
int
]:
"""
Return the backward and forward slacks of operation *graph_id*. That is, how much
the operation can be moved backward and forward in time.
Parameters
----------
graph_id : GraphID
The graph id of the operation.
Returns
-------
A tuple as ``(backward_slack, forward_slack)``.
.. note:: The backward slack is positive, but a call to :func:`move_operation` should be negative to move
the operation backward.
See also
--------
backward_slack
forward_slack
"""
if
graph_id
not
in
self
.
_start_times
:
raise
ValueError
(
f
"
No operation with graph_id
{
graph_id
}
in schedule
"
...
...
@@ -330,6 +369,16 @@ class Schedule:
return
self
def
move_operation
(
self
,
graph_id
:
GraphID
,
time
:
int
)
->
"
Schedule
"
:
"""
Move an operation in the schedule.
Parameters
----------
graph_id : GraphID
The graph id of the operation to move.
time : int
The time to move. If positive move forward, if negative move backward.
"""
if
graph_id
not
in
self
.
_start_times
:
raise
ValueError
(
f
"
No operation with graph_id
{
graph_id
}
in schedule
"
...
...
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