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
8a4e239e
Commit
8a4e239e
authored
4 years ago
by
Oscar Gustafsson
Browse files
Options
Downloads
Plain Diff
Merge branch 'schedulerenaming' into 'master'
Renamed Schema to Schedule See merge request
!74
parents
bdf79a16
c7f6fb8f
No related branches found
No related tags found
1 merge request
!74
Renamed Schema to Schedule
Pipeline
#31073
passed
4 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
b_asic/__init__.py
+1
-1
1 addition, 1 deletion
b_asic/__init__.py
b_asic/schedule.py
+14
-14
14 additions, 14 deletions
b_asic/schedule.py
test/test_schedule.py
+38
-38
38 additions, 38 deletions
test/test_schedule.py
with
53 additions
and
53 deletions
b_asic/__init__.py
+
1
−
1
View file @
8a4e239e
...
@@ -16,4 +16,4 @@ from b_asic.signal import *
...
@@ -16,4 +16,4 @@ from b_asic.signal import *
from
b_asic.simulation
import
*
from
b_asic.simulation
import
*
from
b_asic.special_operations
import
*
from
b_asic.special_operations
import
*
from
b_asic.save_load_structure
import
*
from
b_asic.save_load_structure
import
*
from
b_asic.sche
ma
import
*
from
b_asic.sche
dule
import
*
This diff is collapsed.
Click to expand it.
b_asic/sche
ma
.py
→
b_asic/sche
dule
.py
+
14
−
14
View file @
8a4e239e
"""
B-ASIC Sche
ma
Module.
"""
B-ASIC Sche
dule
Module.
Contains the sche
ma
class for scheduling operations in an SFG.
Contains the sche
dule
class for scheduling operations in an SFG.
"""
"""
from
collections
import
defaultdict
from
collections
import
defaultdict
...
@@ -17,8 +17,8 @@ from b_asic.graph_component import GraphID
...
@@ -17,8 +17,8 @@ from b_asic.graph_component import GraphID
from
b_asic.special_operations
import
Delay
,
Output
from
b_asic.special_operations
import
Delay
,
Output
class
Sche
ma
:
class
Sche
dule
:
"""
Sche
ma
of an SFG with scheduled Operations.
"""
"""
Sche
dule
of an SFG with scheduled Operations.
"""
_sfg
:
SFG
_sfg
:
SFG
_start_times
:
Dict
[
GraphID
,
int
]
_start_times
:
Dict
[
GraphID
,
int
]
...
@@ -28,7 +28,7 @@ class Schema:
...
@@ -28,7 +28,7 @@ class Schema:
_resolution
:
int
_resolution
:
int
def
__init__
(
self
,
sfg
:
SFG
,
schedule_time
:
Optional
[
int
]
=
None
,
cyclic
:
bool
=
False
,
resolution
:
int
=
1
,
scheduling_alg
:
str
=
"
ASAP
"
):
def
__init__
(
self
,
sfg
:
SFG
,
schedule_time
:
Optional
[
int
]
=
None
,
cyclic
:
bool
=
False
,
resolution
:
int
=
1
,
scheduling_alg
:
str
=
"
ASAP
"
):
"""
Construct a Sche
ma
from an SFG.
"""
"""
Construct a Sche
dule
from an SFG.
"""
self
.
_sfg
=
sfg
self
.
_sfg
=
sfg
self
.
_start_times
=
dict
()
self
.
_start_times
=
dict
()
self
.
_laps
=
defaultdict
(
lambda
:
0
)
self
.
_laps
=
defaultdict
(
lambda
:
0
)
...
@@ -54,7 +54,7 @@ class Schema:
...
@@ -54,7 +54,7 @@ class Schema:
def
start_time_of_operation
(
self
,
op_id
:
GraphID
)
->
int
:
def
start_time_of_operation
(
self
,
op_id
:
GraphID
)
->
int
:
"""
Get the start time of the operation with the specified by the op_id.
"""
"""
Get the start time of the operation with the specified by the op_id.
"""
assert
op_id
in
self
.
_start_times
,
"
No operation with the specified op_id in this sche
ma
.
"
assert
op_id
in
self
.
_start_times
,
"
No operation with the specified op_id in this sche
dule
.
"
return
self
.
_start_times
[
op_id
]
return
self
.
_start_times
[
op_id
]
def
_get_max_end_time
(
self
)
->
int
:
def
_get_max_end_time
(
self
)
->
int
:
...
@@ -67,7 +67,7 @@ class Schema:
...
@@ -67,7 +67,7 @@ class Schema:
return
max_end_time
return
max_end_time
def
forward_slack
(
self
,
op_id
:
GraphID
)
->
int
:
def
forward_slack
(
self
,
op_id
:
GraphID
)
->
int
:
assert
op_id
in
self
.
_start_times
,
"
No operation with the specified op_id in this sche
ma
.
"
assert
op_id
in
self
.
_start_times
,
"
No operation with the specified op_id in this sche
dule
.
"
slack
=
sys
.
maxsize
slack
=
sys
.
maxsize
output_slacks
=
self
.
_forward_slacks
(
op_id
)
output_slacks
=
self
.
_forward_slacks
(
op_id
)
# Make more pythonic
# Make more pythonic
...
@@ -93,7 +93,7 @@ class Schema:
...
@@ -93,7 +93,7 @@ class Schema:
return
ret
return
ret
def
backward_slack
(
self
,
op_id
:
GraphID
)
->
int
:
def
backward_slack
(
self
,
op_id
:
GraphID
)
->
int
:
assert
op_id
in
self
.
_start_times
,
"
No operation with the specified op_id in this sche
ma
.
"
assert
op_id
in
self
.
_start_times
,
"
No operation with the specified op_id in this sche
dule
.
"
slack
=
sys
.
maxsize
slack
=
sys
.
maxsize
input_slacks
=
self
.
_backward_slacks
(
op_id
)
input_slacks
=
self
.
_backward_slacks
(
op_id
)
# Make more pythonic
# Make more pythonic
...
@@ -120,13 +120,13 @@ class Schema:
...
@@ -120,13 +120,13 @@ class Schema:
def
slacks
(
self
,
op_id
:
GraphID
)
->
Tuple
[
int
,
int
]:
def
slacks
(
self
,
op_id
:
GraphID
)
->
Tuple
[
int
,
int
]:
assert
op_id
in
self
.
_start_times
,
"
No operation with the specified op_id in this sche
ma
.
"
assert
op_id
in
self
.
_start_times
,
"
No operation with the specified op_id in this sche
dule
.
"
return
(
self
.
backward_slack
(
op_id
),
self
.
forward_slack
(
op_id
))
return
(
self
.
backward_slack
(
op_id
),
self
.
forward_slack
(
op_id
))
def
print_slacks
(
self
)
->
None
:
def
print_slacks
(
self
)
->
None
:
raise
NotImplementedError
raise
NotImplementedError
def
set_schedule_time
(
self
,
time
:
int
)
->
"
Sche
ma
"
:
def
set_schedule_time
(
self
,
time
:
int
)
->
"
Sche
dule
"
:
assert
self
.
_get_max_end_time
()
<
time
,
"
New schedule time to short.
"
assert
self
.
_get_max_end_time
()
<
time
,
"
New schedule time to short.
"
self
.
_schedule_time
=
time
self
.
_schedule_time
=
time
return
self
return
self
...
@@ -135,14 +135,14 @@ class Schema:
...
@@ -135,14 +135,14 @@ class Schema:
def
schedule_time
(
self
)
->
int
:
def
schedule_time
(
self
)
->
int
:
return
self
.
_schedule_time
return
self
.
_schedule_time
def
increase_time_resolution
(
self
,
factor
:
int
)
->
"
Sche
ma
"
:
def
increase_time_resolution
(
self
,
factor
:
int
)
->
"
Sche
dule
"
:
raise
NotImplementedError
raise
NotImplementedError
def
decrease_time_resolution
(
self
,
factor
:
int
)
->
"
Sche
ma
"
:
def
decrease_time_resolution
(
self
,
factor
:
int
)
->
"
Sche
dule
"
:
raise
NotImplementedError
raise
NotImplementedError
def
move_operation
(
self
,
op_id
:
GraphID
,
time
:
int
)
->
"
Sche
ma
"
:
def
move_operation
(
self
,
op_id
:
GraphID
,
time
:
int
)
->
"
Sche
dule
"
:
assert
op_id
in
self
.
_start_times
,
"
No operation with the specified op_id in this sche
ma
.
"
assert
op_id
in
self
.
_start_times
,
"
No operation with the specified op_id in this sche
dule
.
"
(
backward_slack
,
forward_slack
)
=
self
.
slacks
(
op_id
)
(
backward_slack
,
forward_slack
)
=
self
.
slacks
(
op_id
)
if
time
<
0
:
if
time
<
0
:
...
...
This diff is collapsed.
Click to expand it.
test/test_sche
ma
.py
→
test/test_sche
dule
.py
+
38
−
38
View file @
8a4e239e
"""
"""
B-ASIC test suite for the sche
ma
module and Sche
ma
class.
B-ASIC test suite for the sche
dule
module and Sche
dule
class.
"""
"""
import
pytest
import
pytest
from
b_asic
import
Sche
ma
,
Addition
,
ConstantMultiplication
from
b_asic
import
Sche
dule
,
Addition
,
ConstantMultiplication
class
TestInit
:
class
TestInit
:
...
@@ -11,21 +11,21 @@ class TestInit:
...
@@ -11,21 +11,21 @@ class TestInit:
sfg_simple_filter
.
set_latency_of_type
(
Addition
.
type_name
(),
5
)
sfg_simple_filter
.
set_latency_of_type
(
Addition
.
type_name
(),
5
)
sfg_simple_filter
.
set_latency_of_type
(
ConstantMultiplication
.
type_name
(),
4
)
sfg_simple_filter
.
set_latency_of_type
(
ConstantMultiplication
.
type_name
(),
4
)
sche
ma
=
Sche
ma
(
sfg_simple_filter
)
sche
dule
=
Sche
dule
(
sfg_simple_filter
)
assert
sche
ma
.
_start_times
==
{
"
in1
"
:
0
,
"
add1
"
:
4
,
"
cmul1
"
:
0
,
"
out1
"
:
0
}
assert
sche
dule
.
_start_times
==
{
"
in1
"
:
0
,
"
add1
"
:
4
,
"
cmul1
"
:
0
,
"
out1
"
:
0
}
def
test_complicated_single_outputs_normal_latency
(
self
,
precedence_sfg_delays
):
def
test_complicated_single_outputs_normal_latency
(
self
,
precedence_sfg_delays
):
precedence_sfg_delays
.
set_latency_of_type
(
Addition
.
type_name
(),
4
)
precedence_sfg_delays
.
set_latency_of_type
(
Addition
.
type_name
(),
4
)
precedence_sfg_delays
.
set_latency_of_type
(
ConstantMultiplication
.
type_name
(),
3
)
precedence_sfg_delays
.
set_latency_of_type
(
ConstantMultiplication
.
type_name
(),
3
)
sche
ma
=
Sche
ma
(
precedence_sfg_delays
,
scheduling_alg
=
"
ASAP
"
)
sche
dule
=
Sche
dule
(
precedence_sfg_delays
,
scheduling_alg
=
"
ASAP
"
)
for
op
in
sche
ma
.
_sfg
.
get_operations_topological_order
():
for
op
in
sche
dule
.
_sfg
.
get_operations_topological_order
():
print
(
op
.
latency_offsets
)
print
(
op
.
latency_offsets
)
start_times_names
=
dict
()
start_times_names
=
dict
()
for
op_id
,
start_time
in
sche
ma
.
_start_times
.
items
():
for
op_id
,
start_time
in
sche
dule
.
_start_times
.
items
():
op_name
=
precedence_sfg_delays
.
find_by_id
(
op_id
).
name
op_name
=
precedence_sfg_delays
.
find_by_id
(
op_id
).
name
start_times_names
[
op_name
]
=
start_time
start_times_names
[
op_name
]
=
start_time
...
@@ -47,10 +47,10 @@ class TestInit:
...
@@ -47,10 +47,10 @@ class TestInit:
precedence_sfg_delays
.
find_by_name
(
"
ADD3
"
)[
0
].
set_latency_offsets
({
'
in0
'
:
2
,
'
in1
'
:
1
,
'
out0
'
:
4
})
precedence_sfg_delays
.
find_by_name
(
"
ADD3
"
)[
0
].
set_latency_offsets
({
'
in0
'
:
2
,
'
in1
'
:
1
,
'
out0
'
:
4
})
precedence_sfg_delays
.
find_by_name
(
"
ADD4
"
)[
0
].
set_latency_offsets
({
'
in0
'
:
6
,
'
in1
'
:
7
,
'
out0
'
:
9
})
precedence_sfg_delays
.
find_by_name
(
"
ADD4
"
)[
0
].
set_latency_offsets
({
'
in0
'
:
6
,
'
in1
'
:
7
,
'
out0
'
:
9
})
sche
ma
=
Sche
ma
(
precedence_sfg_delays
,
scheduling_alg
=
"
ASAP
"
)
sche
dule
=
Sche
dule
(
precedence_sfg_delays
,
scheduling_alg
=
"
ASAP
"
)
start_times_names
=
dict
()
start_times_names
=
dict
()
for
op_id
,
start_time
in
sche
ma
.
_start_times
.
items
():
for
op_id
,
start_time
in
sche
dule
.
_start_times
.
items
():
op_name
=
precedence_sfg_delays
.
find_by_id
(
op_id
).
name
op_name
=
precedence_sfg_delays
.
find_by_id
(
op_id
).
name
start_times_names
[
op_name
]
=
start_time
start_times_names
[
op_name
]
=
start_time
...
@@ -58,10 +58,10 @@ class TestInit:
...
@@ -58,10 +58,10 @@ class TestInit:
'
A1
'
:
0
,
'
A2
'
:
0
,
'
ADD3
'
:
3
,
'
ADD4
'
:
8
,
'
OUT1
'
:
17
}
'
A1
'
:
0
,
'
A2
'
:
0
,
'
ADD3
'
:
3
,
'
ADD4
'
:
8
,
'
OUT1
'
:
17
}
def
test_independent_sfg
(
self
,
sfg_two_inputs_two_outputs_independent_with_cmul
):
def
test_independent_sfg
(
self
,
sfg_two_inputs_two_outputs_independent_with_cmul
):
sche
ma
=
Sche
ma
(
sfg_two_inputs_two_outputs_independent_with_cmul
,
scheduling_alg
=
"
ASAP
"
)
sche
dule
=
Sche
dule
(
sfg_two_inputs_two_outputs_independent_with_cmul
,
scheduling_alg
=
"
ASAP
"
)
start_times_names
=
dict
()
start_times_names
=
dict
()
for
op_id
,
start_time
in
sche
ma
.
_start_times
.
items
():
for
op_id
,
start_time
in
sche
dule
.
_start_times
.
items
():
op_name
=
sfg_two_inputs_two_outputs_independent_with_cmul
.
find_by_id
(
op_id
).
name
op_name
=
sfg_two_inputs_two_outputs_independent_with_cmul
.
find_by_id
(
op_id
).
name
start_times_names
[
op_name
]
=
start_time
start_times_names
[
op_name
]
=
start_time
...
@@ -74,20 +74,20 @@ class TestSlacks:
...
@@ -74,20 +74,20 @@ class TestSlacks:
precedence_sfg_delays
.
set_latency_of_type
(
Addition
.
type_name
(),
1
)
precedence_sfg_delays
.
set_latency_of_type
(
Addition
.
type_name
(),
1
)
precedence_sfg_delays
.
set_latency_of_type
(
ConstantMultiplication
.
type_name
(),
3
)
precedence_sfg_delays
.
set_latency_of_type
(
ConstantMultiplication
.
type_name
(),
3
)
sche
ma
=
Sche
ma
(
precedence_sfg_delays
,
scheduling_alg
=
"
ASAP
"
)
sche
dule
=
Sche
dule
(
precedence_sfg_delays
,
scheduling_alg
=
"
ASAP
"
)
assert
sche
ma
.
forward_slack
(
precedence_sfg_delays
.
find_by_name
(
"
ADD3
"
)[
0
].
graph_id
)
==
7
assert
sche
dule
.
forward_slack
(
precedence_sfg_delays
.
find_by_name
(
"
ADD3
"
)[
0
].
graph_id
)
==
7
assert
sche
ma
.
backward_slack
(
precedence_sfg_delays
.
find_by_name
(
"
ADD3
"
)[
0
].
graph_id
)
==
0
assert
sche
dule
.
backward_slack
(
precedence_sfg_delays
.
find_by_name
(
"
ADD3
"
)[
0
].
graph_id
)
==
0
assert
sche
ma
.
forward_slack
(
precedence_sfg_delays
.
find_by_name
(
"
A2
"
)[
0
].
graph_id
)
==
0
assert
sche
dule
.
forward_slack
(
precedence_sfg_delays
.
find_by_name
(
"
A2
"
)[
0
].
graph_id
)
==
0
assert
sche
ma
.
backward_slack
(
precedence_sfg_delays
.
find_by_name
(
"
A2
"
)[
0
].
graph_id
)
==
16
assert
sche
dule
.
backward_slack
(
precedence_sfg_delays
.
find_by_name
(
"
A2
"
)[
0
].
graph_id
)
==
16
def
test_slacks_normal_latency
(
self
,
precedence_sfg_delays
):
def
test_slacks_normal_latency
(
self
,
precedence_sfg_delays
):
precedence_sfg_delays
.
set_latency_of_type
(
Addition
.
type_name
(),
1
)
precedence_sfg_delays
.
set_latency_of_type
(
Addition
.
type_name
(),
1
)
precedence_sfg_delays
.
set_latency_of_type
(
ConstantMultiplication
.
type_name
(),
3
)
precedence_sfg_delays
.
set_latency_of_type
(
ConstantMultiplication
.
type_name
(),
3
)
sche
ma
=
Sche
ma
(
precedence_sfg_delays
,
scheduling_alg
=
"
ASAP
"
)
sche
dule
=
Sche
dule
(
precedence_sfg_delays
,
scheduling_alg
=
"
ASAP
"
)
assert
sche
ma
.
slacks
(
precedence_sfg_delays
.
find_by_name
(
"
ADD3
"
)[
0
].
graph_id
)
==
(
0
,
7
)
assert
sche
dule
.
slacks
(
precedence_sfg_delays
.
find_by_name
(
"
ADD3
"
)[
0
].
graph_id
)
==
(
0
,
7
)
assert
sche
ma
.
slacks
(
precedence_sfg_delays
.
find_by_name
(
"
A2
"
)[
0
].
graph_id
)
==
(
16
,
0
)
assert
sche
dule
.
slacks
(
precedence_sfg_delays
.
find_by_name
(
"
A2
"
)[
0
].
graph_id
)
==
(
16
,
0
)
class
TestRescheduling
:
class
TestRescheduling
:
...
@@ -95,13 +95,13 @@ class TestRescheduling:
...
@@ -95,13 +95,13 @@ class TestRescheduling:
precedence_sfg_delays
.
set_latency_of_type
(
Addition
.
type_name
(),
4
)
precedence_sfg_delays
.
set_latency_of_type
(
Addition
.
type_name
(),
4
)
precedence_sfg_delays
.
set_latency_of_type
(
ConstantMultiplication
.
type_name
(),
3
)
precedence_sfg_delays
.
set_latency_of_type
(
ConstantMultiplication
.
type_name
(),
3
)
sche
ma
=
Sche
ma
(
precedence_sfg_delays
,
scheduling_alg
=
"
ASAP
"
)
sche
dule
=
Sche
dule
(
precedence_sfg_delays
,
scheduling_alg
=
"
ASAP
"
)
sche
ma
.
move_operation
(
precedence_sfg_delays
.
find_by_name
(
"
ADD3
"
)[
0
].
graph_id
,
4
)
sche
dule
.
move_operation
(
precedence_sfg_delays
.
find_by_name
(
"
ADD3
"
)[
0
].
graph_id
,
4
)
sche
ma
.
move_operation
(
precedence_sfg_delays
.
find_by_name
(
"
A2
"
)[
0
].
graph_id
,
2
)
sche
dule
.
move_operation
(
precedence_sfg_delays
.
find_by_name
(
"
A2
"
)[
0
].
graph_id
,
2
)
start_times_names
=
dict
()
start_times_names
=
dict
()
for
op_id
,
start_time
in
sche
ma
.
_start_times
.
items
():
for
op_id
,
start_time
in
sche
dule
.
_start_times
.
items
():
op_name
=
precedence_sfg_delays
.
find_by_id
(
op_id
).
name
op_name
=
precedence_sfg_delays
.
find_by_id
(
op_id
).
name
start_times_names
[
op_name
]
=
start_time
start_times_names
[
op_name
]
=
start_time
...
@@ -112,36 +112,36 @@ class TestRescheduling:
...
@@ -112,36 +112,36 @@ class TestRescheduling:
precedence_sfg_delays
.
set_latency_of_type
(
Addition
.
type_name
(),
1
)
precedence_sfg_delays
.
set_latency_of_type
(
Addition
.
type_name
(),
1
)
precedence_sfg_delays
.
set_latency_of_type
(
ConstantMultiplication
.
type_name
(),
3
)
precedence_sfg_delays
.
set_latency_of_type
(
ConstantMultiplication
.
type_name
(),
3
)
sche
ma
=
Sche
ma
(
precedence_sfg_delays
,
scheduling_alg
=
"
ASAP
"
)
sche
dule
=
Sche
dule
(
precedence_sfg_delays
,
scheduling_alg
=
"
ASAP
"
)
add3_id
=
precedence_sfg_delays
.
find_by_name
(
"
ADD3
"
)[
0
].
graph_id
add3_id
=
precedence_sfg_delays
.
find_by_name
(
"
ADD3
"
)[
0
].
graph_id
sche
ma
.
move_operation
(
add3_id
,
4
)
sche
dule
.
move_operation
(
add3_id
,
4
)
assert
sche
ma
.
forward_slack
(
add3_id
)
==
3
assert
sche
dule
.
forward_slack
(
add3_id
)
==
3
assert
sche
ma
.
backward_slack
(
add3_id
)
==
4
assert
sche
dule
.
backward_slack
(
add3_id
)
==
4
a2_id
=
precedence_sfg_delays
.
find_by_name
(
"
A2
"
)[
0
].
graph_id
a2_id
=
precedence_sfg_delays
.
find_by_name
(
"
A2
"
)[
0
].
graph_id
assert
sche
ma
.
forward_slack
(
a2_id
)
==
4
assert
sche
dule
.
forward_slack
(
a2_id
)
==
4
assert
sche
ma
.
backward_slack
(
a2_id
)
==
16
assert
sche
dule
.
backward_slack
(
a2_id
)
==
16
sche
ma
.
move_operation
(
a2_id
,
2
)
sche
dule
.
move_operation
(
a2_id
,
2
)
assert
sche
ma
.
forward_slack
(
add3_id
)
==
3
assert
sche
dule
.
forward_slack
(
add3_id
)
==
3
assert
sche
ma
.
backward_slack
(
add3_id
)
==
2
assert
sche
dule
.
backward_slack
(
add3_id
)
==
2
assert
sche
ma
.
forward_slack
(
a2_id
)
==
2
assert
sche
dule
.
forward_slack
(
a2_id
)
==
2
assert
sche
ma
.
backward_slack
(
a2_id
)
==
18
assert
sche
dule
.
backward_slack
(
a2_id
)
==
18
def
test_move_operation_incorrect_move_backward
(
self
,
precedence_sfg_delays
):
def
test_move_operation_incorrect_move_backward
(
self
,
precedence_sfg_delays
):
precedence_sfg_delays
.
set_latency_of_type
(
Addition
.
type_name
(),
1
)
precedence_sfg_delays
.
set_latency_of_type
(
Addition
.
type_name
(),
1
)
precedence_sfg_delays
.
set_latency_of_type
(
ConstantMultiplication
.
type_name
(),
3
)
precedence_sfg_delays
.
set_latency_of_type
(
ConstantMultiplication
.
type_name
(),
3
)
sche
ma
=
Sche
ma
(
precedence_sfg_delays
,
scheduling_alg
=
"
ASAP
"
)
sche
dule
=
Sche
dule
(
precedence_sfg_delays
,
scheduling_alg
=
"
ASAP
"
)
with
pytest
.
raises
(
ValueError
):
with
pytest
.
raises
(
ValueError
):
sche
ma
.
move_operation
(
precedence_sfg_delays
.
find_by_name
(
"
ADD3
"
)[
0
].
graph_id
,
-
4
)
sche
dule
.
move_operation
(
precedence_sfg_delays
.
find_by_name
(
"
ADD3
"
)[
0
].
graph_id
,
-
4
)
def
test_move_operation_incorrect_move_forward
(
self
,
precedence_sfg_delays
):
def
test_move_operation_incorrect_move_forward
(
self
,
precedence_sfg_delays
):
precedence_sfg_delays
.
set_latency_of_type
(
Addition
.
type_name
(),
1
)
precedence_sfg_delays
.
set_latency_of_type
(
Addition
.
type_name
(),
1
)
precedence_sfg_delays
.
set_latency_of_type
(
ConstantMultiplication
.
type_name
(),
3
)
precedence_sfg_delays
.
set_latency_of_type
(
ConstantMultiplication
.
type_name
(),
3
)
sche
ma
=
Sche
ma
(
precedence_sfg_delays
,
scheduling_alg
=
"
ASAP
"
)
sche
dule
=
Sche
dule
(
precedence_sfg_delays
,
scheduling_alg
=
"
ASAP
"
)
with
pytest
.
raises
(
ValueError
):
with
pytest
.
raises
(
ValueError
):
sche
ma
.
move_operation
(
precedence_sfg_delays
.
find_by_name
(
"
ADD3
"
)[
0
].
graph_id
,
10
)
sche
dule
.
move_operation
(
precedence_sfg_delays
.
find_by_name
(
"
ADD3
"
)[
0
].
graph_id
,
10
)
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