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
9ade7216
Commit
9ade7216
authored
5 years ago
by
Oscar Gustafsson
Browse files
Options
Downloads
Patches
Plain Diff
Fixed some tests
parent
02c41cd0
No related branches found
No related tags found
2 merge requests
!71
Better schedule, including plotting
,
!69
Some basic functionality for plotting a schedule
Pipeline
#16832
failed
5 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
b_asic/core_operations.py
+1
-1
1 addition, 1 deletion
b_asic/core_operations.py
b_asic/schema.py
+4
-1
4 additions, 1 deletion
b_asic/schema.py
test/test_schema.py
+7
-6
7 additions, 6 deletions
test/test_schema.py
with
12 additions
and
8 deletions
b_asic/core_operations.py
+
1
−
1
View file @
9ade7216
...
@@ -22,7 +22,7 @@ class Constant(AbstractOperation):
...
@@ -22,7 +22,7 @@ class Constant(AbstractOperation):
def
__init__
(
self
,
value
:
Number
=
0
,
name
:
Name
=
""
):
def
__init__
(
self
,
value
:
Number
=
0
,
name
:
Name
=
""
):
"""
Construct a Constant operation with the given value.
"""
"""
Construct a Constant operation with the given value.
"""
super
().
__init__
(
input_count
=
0
,
output_count
=
1
,
name
=
name
)
super
().
__init__
(
input_count
=
0
,
output_count
=
1
,
name
=
name
,
latency_offsets
=
{
'
out0
'
:
0
}
)
self
.
set_param
(
"
value
"
,
value
)
self
.
set_param
(
"
value
"
,
value
)
@classmethod
@classmethod
...
...
This diff is collapsed.
Click to expand it.
b_asic/schema.py
+
4
−
1
View file @
9ade7216
...
@@ -174,7 +174,10 @@ class Schema:
...
@@ -174,7 +174,10 @@ class Schema:
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
source_port
=
output
.
inputs
[
0
].
signals
[
0
].
source
self
.
_start_times
[
output
.
graph_id
]
=
self
.
_start_times
[
source_port
.
operation
.
graph_id
]
+
source_port
.
latency_offset
if
source_port
.
operation
.
graph_id
in
non_schedulable_ops
:
self
.
_start_times
[
output
.
graph_id
]
=
0
else
:
self
.
_start_times
[
output
.
graph_id
]
=
self
.
_start_times
[
source_port
.
operation
.
graph_id
]
+
source_port
.
latency_offset
self
.
_remove_delays
()
self
.
_remove_delays
()
def
plot_schedule
(
self
)
->
None
:
def
plot_schedule
(
self
)
->
None
:
...
...
This diff is collapsed.
Click to expand it.
test/test_schema.py
+
7
−
6
View file @
9ade7216
...
@@ -12,7 +12,7 @@ class TestInit:
...
@@ -12,7 +12,7 @@ class TestInit:
schema
=
Schema
(
sfg_simple_filter
)
schema
=
Schema
(
sfg_simple_filter
)
assert
schema
.
_start_times
==
{
"
add1
"
:
4
,
"
cmul1
"
:
0
}
assert
schema
.
_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
)
...
@@ -28,8 +28,8 @@ class TestInit:
...
@@ -28,8 +28,8 @@ class TestInit:
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
assert
start_times_names
==
{
"
C0
"
:
0
,
"
B1
"
:
0
,
"
B2
"
:
0
,
"
ADD2
"
:
3
,
"
ADD1
"
:
7
,
"
Q1
"
:
11
,
assert
start_times_names
==
{
"
IN1
"
:
0
,
"
C0
"
:
0
,
"
B1
"
:
0
,
"
B2
"
:
0
,
"
ADD2
"
:
3
,
"
ADD1
"
:
7
,
"
Q1
"
:
11
,
"
A0
"
:
14
,
"
A1
"
:
0
,
"
A2
"
:
0
,
"
ADD3
"
:
3
,
"
ADD4
"
:
17
}
"
A0
"
:
14
,
"
A1
"
:
0
,
"
A2
"
:
0
,
"
ADD3
"
:
3
,
"
ADD4
"
:
17
,
"
OUT1
"
:
21
}
def
test_complicated_single_outputs_complex_latencies
(
self
,
precedence_sfg_delays
):
def
test_complicated_single_outputs_complex_latencies
(
self
,
precedence_sfg_delays
):
precedence_sfg_delays
.
set_latency_offsets_of_type
(
ConstantMultiplication
.
type_name
(),
{
'
in0
'
:
3
,
'
out0
'
:
5
})
precedence_sfg_delays
.
set_latency_offsets_of_type
(
ConstantMultiplication
.
type_name
(),
{
'
in0
'
:
3
,
'
out0
'
:
5
})
...
@@ -53,8 +53,8 @@ class TestInit:
...
@@ -53,8 +53,8 @@ class TestInit:
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
assert
start_times_names
==
{
'
C0
'
:
0
,
'
B1
'
:
0
,
'
B2
'
:
0
,
'
ADD2
'
:
3
,
'
ADD1
'
:
5
,
'
Q1
'
:
6
,
'
A0
'
:
12
,
assert
start_times_names
==
{
'
IN1
'
:
0
,
'
C0
'
:
0
,
'
B1
'
:
0
,
'
B2
'
:
0
,
'
ADD2
'
:
3
,
'
ADD1
'
:
5
,
'
Q1
'
:
6
,
'
A0
'
:
12
,
'
A1
'
:
0
,
'
A2
'
:
0
,
'
ADD3
'
:
3
,
'
ADD4
'
:
8
}
'
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
):
schema
=
Schema
(
sfg_two_inputs_two_outputs_independent_with_cmul
,
scheduling_alg
=
"
ASAP
"
)
schema
=
Schema
(
sfg_two_inputs_two_outputs_independent_with_cmul
,
scheduling_alg
=
"
ASAP
"
)
...
@@ -64,7 +64,8 @@ class TestInit:
...
@@ -64,7 +64,8 @@ class TestInit:
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
assert
start_times_names
==
{
'
CMUL1
'
:
0
,
'
CMUL2
'
:
5
,
"
ADD1
"
:
0
,
"
CMUL3
"
:
7
}
assert
start_times_names
==
{
'
C1
'
:
0
,
'
IN1
'
:
0
,
'
IN2
'
:
0
,
'
CMUL1
'
:
0
,
'
CMUL2
'
:
5
,
"
ADD1
"
:
0
,
"
CMUL3
"
:
7
,
'
OUT1
'
:
9
,
'
OUT2
'
:
10
}
def
test_slack_normal_latency
(
self
,
precedence_sfg_delays
):
def
test_slack_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
)
...
...
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