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
Merge requests
!447
Add set_latency_of_type
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add set_latency_of_type
setlatency
into
master
Overview
0
Commits
2
Pipelines
3
Changes
1
Merged
Robier Al Kaadi
requested to merge
setlatency
into
master
9 months ago
Overview
0
Commits
2
Pipelines
3
Changes
1
Expand
Closes
#272 (closed)
0
0
Merge request reports
Compare
master
version 2
21a59dee
9 months ago
version 1
c4efa484
9 months ago
master (base)
and
latest version
latest version
fd798617
2 commits,
9 months ago
version 2
21a59dee
1 commit,
9 months ago
version 1
c4efa484
1 commit,
9 months ago
1 file
+
31
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
b_asic/schedule.py
+
31
−
0
Options
@@ -526,6 +526,37 @@ class Schedule:
"""
self
.
_sfg
.
set_execution_time_of_type
(
type_name
,
execution_time
)
def
set_latency_of_type
(
self
,
type_name
:
TypeName
,
latency
:
int
)
->
None
:
"""
Set the latency of all operations with the given type name.
Parameters
----------
type_name : TypeName
The type name of the operation. For example, obtained as
``Addition.type_name()``.
latency : int
The latency of the operation.
"""
passed
=
True
for
op
in
self
.
_sfg
.
operations
:
if
type_name
==
op
.
type_name
()
or
type_name
==
op
.
graph_id
:
change_in_latency
=
latency
-
op
.
latency
if
change_in_latency
>
(
self
.
forward_slack
(
op
.
graph_id
)):
passed
=
False
raise
ValueError
(
f
"
Error: Can
'
t increase latency for all components. Try increassing forward slack time by rescheduling.
"
f
"
Error in:
{
op
.
graph_id
}
"
)
break
if
change_in_latency
<
0
or
passed
:
for
op
in
self
.
_sfg
.
operations
:
if
type_name
==
op
.
type_name
()
or
type_name
==
op
.
graph_id
:
cast
(
Operation
,
op
).
set_latency
(
latency
)
def
move_y_location
(
self
,
graph_id
:
GraphID
,
new_y
:
int
,
insert
:
bool
=
False
)
->
None
:
Loading