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
1be223dd
Commit
1be223dd
authored
1 year ago
by
Oscar Gustafsson
Browse files
Options
Downloads
Patches
Plain Diff
Enable sorting of print_slacks
parent
aaf8003d
No related branches found
No related tags found
1 merge request
!306
Enable sorting of print_slacks
Pipeline
#95429
passed
1 year ago
Stage: test
Stage: deploy
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
b_asic/schedule.py
+15
-3
15 additions, 3 deletions
b_asic/schedule.py
with
15 additions
and
3 deletions
b_asic/schedule.py
+
15
−
3
View file @
1be223dd
...
...
@@ -262,8 +262,20 @@ class Schedule:
raise
ValueError
(
f
"
No operation with graph_id
{
graph_id
}
in schedule
"
)
return
self
.
backward_slack
(
graph_id
),
self
.
forward_slack
(
graph_id
)
def
print_slacks
(
self
)
->
None
:
"""
Print the slack times for all operations in the schedule.
"""
def
print_slacks
(
self
,
order
:
int
=
0
)
->
None
:
"""
Print the slack times for all operations in the schedule.
Parameters
----------
order : int, default: 0
Sorting order.
* 0: alphabetical on Graph ID
* 1: backward slack
* 2: forward slack
"""
res
=
[
(
op
.
graph_id
,
...
...
@@ -280,7 +292,7 @@ class Schedule:
)
for
r
in
res
]
res
.
sort
(
key
=
lambda
tup
:
tup
[
order
])
print
(
"
Graph ID | Backward | Forward
"
)
print
(
"
---------|----------|---------
"
)
for
r
in
res
:
...
...
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