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
a4332b0e
Commit
a4332b0e
authored
1 year ago
by
Oscar Gustafsson
Browse files
Options
Downloads
Patches
Plain Diff
Some typing fixes
parent
b496973b
No related branches found
Branches containing commit
No related tags found
1 merge request
!262
Some typing fixes
Pipeline
#93205
passed
1 year ago
Stage: test
Stage: deploy
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
b_asic/_preferences.py
+4
-4
4 additions, 4 deletions
b_asic/_preferences.py
b_asic/save_load_structure.py
+1
-1
1 addition, 1 deletion
b_asic/save_load_structure.py
b_asic/schedule.py
+11
-4
11 additions, 4 deletions
b_asic/schedule.py
with
16 additions
and
9 deletions
b_asic/_preferences.py
+
4
−
4
View file @
a4332b0e
...
@@ -2,10 +2,10 @@ LATENCY_COLOR = (0, 185, 231)
...
@@ -2,10 +2,10 @@ LATENCY_COLOR = (0, 185, 231)
EXECUTION_TIME_COLOR
=
(
255
,
100
,
66
,
200
)
EXECUTION_TIME_COLOR
=
(
255
,
100
,
66
,
200
)
SIGNAL_COLOR
=
(
0
,
0
,
0
)
SIGNAL_COLOR
=
(
0
,
0
,
0
)
SIGNAL_LINEWIDTH
=
1.0
SIGNAL_LINEWIDTH
:
float
=
1.0
OPERATION_GAP
=
0.5
OPERATION_GAP
:
float
=
0.5
SCHEDULE_OFFSET
=
0.2
SCHEDULE_OFFSET
:
float
=
0.2
SPLINE_OFFSET
=
0.2
SPLINE_OFFSET
:
float
=
0.2
This diff is collapsed.
Click to expand it.
b_asic/save_load_structure.py
+
1
−
1
View file @
a4332b0e
...
@@ -16,7 +16,7 @@ from b_asic.signal_flow_graph import SFG
...
@@ -16,7 +16,7 @@ from b_asic.signal_flow_graph import SFG
def
sfg_to_python
(
def
sfg_to_python
(
sfg
:
SFG
,
counter
:
int
=
0
,
suffix
:
Optional
[
str
]
=
None
,
schedule
=
False
sfg
:
SFG
,
counter
:
int
=
0
,
suffix
:
Optional
[
str
]
=
None
,
schedule
:
bool
=
False
)
->
str
:
)
->
str
:
"""
"""
Given an SFG structure try to serialize it for saving to a file.
Given an SFG structure try to serialize it for saving to a file.
...
...
This diff is collapsed.
Click to expand it.
b_asic/schedule.py
+
11
−
4
View file @
a4332b0e
...
@@ -7,7 +7,7 @@ Contains the schedule class for scheduling operations in an SFG.
...
@@ -7,7 +7,7 @@ Contains the schedule class for scheduling operations in an SFG.
import
io
import
io
import
sys
import
sys
from
collections
import
defaultdict
from
collections
import
defaultdict
from
typing
import
Dict
,
List
,
Optional
,
Tuple
,
cast
from
typing
import
Dict
,
List
,
Optional
,
Sequence
,
Tuple
,
cast
import
matplotlib.pyplot
as
plt
import
matplotlib.pyplot
as
plt
import
numpy
as
np
import
numpy
as
np
...
@@ -720,8 +720,8 @@ class Schedule:
...
@@ -720,8 +720,8 @@ class Schedule:
line_cache
=
[]
line_cache
=
[]
def
_draw_arrow
(
def
_draw_arrow
(
start
:
List
[
float
],
end
:
List
[
float
],
name
:
str
=
""
,
laps
:
int
=
0
start
:
Sequence
[
float
],
end
:
Sequence
[
float
],
name
:
str
=
""
,
laps
:
int
=
0
):
)
->
None
:
"""
Draw an arrow from *start* to *end*.
"""
"""
Draw an arrow from *start* to *end*.
"""
if
end
[
0
]
<
start
[
0
]
or
laps
>
0
:
# Wrap around
if
end
[
0
]
<
start
[
0
]
or
laps
>
0
:
# Wrap around
if
start
not
in
line_cache
:
if
start
not
in
line_cache
:
...
@@ -802,7 +802,14 @@ class Schedule:
...
@@ -802,7 +802,14 @@ class Schedule:
)
)
ax
.
add_patch
(
path_patch
)
ax
.
add_patch
(
path_patch
)
def
_draw_offset_arrow
(
start
,
end
,
start_offset
,
end_offset
,
name
=
""
,
laps
=
0
):
def
_draw_offset_arrow
(
start
:
Sequence
[
float
],
end
:
Sequence
[
float
],
start_offset
:
Sequence
[
float
],
end_offset
:
Sequence
[
float
],
name
:
str
=
""
,
laps
:
int
=
0
,
)
->
None
:
"""
Draw an arrow from *start* to *end*, but with an offset.
"""
"""
Draw an arrow from *start* to *end*, but with an offset.
"""
_draw_arrow
(
_draw_arrow
(
[
start
[
0
]
+
start_offset
[
0
],
start
[
1
]
+
start_offset
[
1
]],
[
start
[
0
]
+
start_offset
[
0
],
start
[
1
]
+
start_offset
[
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