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
bdccb4a7
Commit
bdccb4a7
authored
2 years ago
by
Oscar Gustafsson
Browse files
Options
Downloads
Patches
Plain Diff
Fix typing
parent
2de96576
No related branches found
No related tags found
1 merge request
!124
Fix typing
Pipeline
#88412
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
+21
-17
21 additions, 17 deletions
b_asic/schedule.py
with
21 additions
and
17 deletions
b_asic/schedule.py
+
21
−
17
View file @
bdccb4a7
...
@@ -309,7 +309,7 @@ class Schedule:
...
@@ -309,7 +309,7 @@ class Schedule:
# Update output laps
# Update output laps
output_slacks
=
self
.
_forward_slacks
(
op_id
)
output_slacks
=
self
.
_forward_slacks
(
op_id
)
for
out_port
,
signal_slacks
in
output_slacks
.
items
():
for
out_port
,
signal_slacks
in
output_slacks
.
items
():
tmp_available
=
tmp_start
+
out_port
.
latency_offset
tmp_available
=
tmp_start
+
cast
(
int
,
out_port
.
latency_offset
)
new_available
=
tmp_available
%
self
.
_schedule_time
new_available
=
tmp_available
%
self
.
_schedule_time
for
signal
,
signal_slack
in
signal_slacks
.
items
():
for
signal
,
signal_slack
in
signal_slacks
.
items
():
new_slack
=
signal_slack
-
time
new_slack
=
signal_slack
-
time
...
@@ -329,12 +329,14 @@ class Schedule:
...
@@ -329,12 +329,14 @@ class Schedule:
def
_remove_delays
(
self
)
->
None
:
def
_remove_delays
(
self
)
->
None
:
delay_list
=
self
.
_sfg
.
find_by_type_name
(
Delay
.
type_name
())
delay_list
=
self
.
_sfg
.
find_by_type_name
(
Delay
.
type_name
())
while
delay_list
:
while
delay_list
:
delay_op
=
delay_list
[
0
]
delay_op
=
cast
(
Delay
,
delay_list
[
0
]
)
delay_input_id
=
delay_op
.
input
(
0
).
signals
[
0
].
graph_id
delay_input_id
=
delay_op
.
input
(
0
).
signals
[
0
].
graph_id
delay_output_ids
=
[
delay_output_ids
=
[
sig
.
graph_id
for
sig
in
delay_op
.
output
(
0
).
signals
sig
.
graph_id
for
sig
in
delay_op
.
output
(
0
).
signals
]
]
self
.
_sfg
=
self
.
_sfg
.
remove_operation
(
delay_op
.
graph_id
)
self
.
_sfg
=
cast
(
SFG
,
self
.
_sfg
.
remove_operation
(
delay_op
.
graph_id
)
)
for
output_id
in
delay_output_ids
:
for
output_id
in
delay_output_ids
:
self
.
_laps
[
output_id
]
+=
1
+
self
.
_laps
[
delay_input_id
]
self
.
_laps
[
output_id
]
+=
1
+
self
.
_laps
[
delay_input_id
]
del
self
.
_laps
[
delay_input_id
]
del
self
.
_laps
[
delay_input_id
]
...
@@ -396,17 +398,17 @@ class Schedule:
...
@@ -396,17 +398,17 @@ class Schedule:
f
"
{
source_port
.
operation
.
graph_id
}
has no
"
f
"
{
source_port
.
operation
.
graph_id
}
has no
"
"
latency-offset.
"
"
latency-offset.
"
)
)
assert
inport
.
latency_offset
is
not
None
,
(
f
"
Input port:
{
inport
.
index
}
of operation:
"
"
"
f
"
{
inport
.
operation
.
graph_id
}
has no
"
"
latency-offset.
"
)
source_end_time
=
(
source_end_time
=
(
source_op_time
+
source_port
.
latency_offset
source_op_time
+
source_port
.
latency_offset
)
)
assert
inport
.
latency_offset
is
not
None
,
(
f
"
Input port:
{
inport
.
index
}
of operation:
"
"
"
f
"
{
inport
.
operation
.
graph_id
}
has no
"
"
latency-offset.
"
)
op_start_time_from_in
=
(
op_start_time_from_in
=
(
source_end_time
-
inport
.
latency_offset
source_end_time
-
inport
.
latency_offset
)
)
...
@@ -416,28 +418,30 @@ class Schedule:
...
@@ -416,28 +418,30 @@ class Schedule:
self
.
_start_times
[
op
.
graph_id
]
=
op_start_time
self
.
_start_times
[
op
.
graph_id
]
=
op_start_time
for
output
in
self
.
_sfg
.
find_by_type_name
(
Output
.
type_name
()):
for
output
in
self
.
_sfg
.
find_by_type_name
(
Output
.
type_name
()):
source_port
=
output
.
inputs
[
0
].
signals
[
0
].
source
output
=
cast
(
Output
,
output
)
source_port
=
cast
(
OutputPort
,
output
.
inputs
[
0
].
signals
[
0
].
source
)
if
source_port
.
operation
.
graph_id
in
non_schedulable_ops
:
if
source_port
.
operation
.
graph_id
in
non_schedulable_ops
:
self
.
_start_times
[
output
.
graph_id
]
=
0
self
.
_start_times
[
output
.
graph_id
]
=
0
else
:
else
:
self
.
_start_times
[
output
.
graph_id
]
=
(
self
.
_start_times
[
output
.
graph_id
]
=
self
.
_start_times
[
self
.
_start_times
[
source_port
.
operation
.
graph_id
]
source_port
.
operation
.
graph_id
+
source_port
.
latency_offset
]
+
cast
(
int
,
source_port
.
latency_offset
)
)
self
.
_remove_delays
()
self
.
_remove_delays
()
def
_get_memory_variables_list
(
self
)
->
List
[
'
Process
'
]:
def
_get_memory_variables_list
(
self
)
->
List
[
'
Process
'
]:
ret
=
[]
ret
:
List
[
'
Process
'
]
=
[]
for
op_id
,
start_time
in
self
.
_start_times
.
items
():
for
op_id
,
start_time
in
self
.
_start_times
.
items
():
slacks
=
self
.
_forward_slacks
(
op_id
)
slacks
=
self
.
_forward_slacks
(
op_id
)
for
outport
,
signals
in
slacks
.
items
():
for
outport
,
signals
in
slacks
.
items
():
reads
=
{
reads
=
{
signal
.
destination
:
slack
cast
(
InputPort
,
signal
.
destination
)
:
slack
for
signal
,
slack
in
signals
.
items
()
for
signal
,
slack
in
signals
.
items
()
}
}
ret
.
append
(
ret
.
append
(
MemoryVariable
(
MemoryVariable
(
start_time
+
outport
.
latency_offset
,
outport
,
reads
start_time
+
cast
(
int
,
outport
.
latency_offset
),
outport
,
reads
,
)
)
)
)
return
ret
return
ret
...
...
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