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
86454f36
Commit
86454f36
authored
4 years ago
by
Adam Jakobsson
Browse files
Options
Downloads
Patches
Plain Diff
started on memory elements
parent
8da430f5
No related branches found
No related tags found
No related merge requests found
Pipeline
#16143
failed
4 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
b_asic/schema.py
+26
-0
26 additions, 0 deletions
b_asic/schema.py
with
26 additions
and
0 deletions
b_asic/schema.py
+
26
−
0
View file @
86454f36
...
...
@@ -27,6 +27,7 @@ class Schema:
self
.
_laps
=
dict
()
self
.
_cyclic
=
cyclic
self
.
_resolution
=
resolution
self
.
_memory_elements
=
dict
()
if
scheduling_alg
==
"
ASAP
"
:
self
.
_schedule_asap
()
...
...
@@ -47,6 +48,8 @@ class Schema:
else
:
self
.
_schedule_time
=
schedule_time
self
.
get_memory_elements
()
def
start_time_of_operation
(
self
,
op_id
:
GraphID
):
"""
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 schema.
"
...
...
@@ -105,3 +108,26 @@ class Schema:
op_start_time
=
max
(
op_start_time
,
op_start_time_from_in
)
self
.
_start_times
[
op
.
graph_id
]
=
op_start_time
def
get_memory_elements
(
self
):
pl
=
self
.
_sfg
.
get_precedence_list
()
for
port_list
in
pl
:
for
port
in
port_list
:
time_list
=
[]
for
key
in
self
.
_start_times
:
if
port
.
operation
.
graph_id
==
key
:
for
i
in
range
(
len
(
port
.
operation
.
outputs
)
-
1
):
time_list
.
append
(
self
.
start_times
.
get
(
port
.
operation
.
graph_id
)
+
op
.
outputs
[
i
].
latency_offset
)
for
j
in
range
(
len
(
port
.
operation
.
outputs
[
i
].
signals
)
-
1
):
print
(
self
.
_start_times
.
get
(
port
.
operation
.
outputs
[
i
].
signals
[
j
].
destination
.
operation
.
op_id
))
time_list
.
append
(
self
.
_start_times
.
get
(
port
.
operation
.
outputs
[
i
].
signals
[
j
].
destination
.
operation
.
op_id
))
self
.
_memory_elements
[
port
.
operation
.
outputs
[
i
].
signals
[
j
].
type_name
]
=
time_list
time_list
.
pop
()
# remove end time if an output port has several signals as it's source
def
print_memory_elements
(
self
):
for
key
in
self
.
_memory_elements
:
for
value
in
self
.
_memory_elements
[
key
]:
print
(
key
,
value
)
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