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
9cabf03d
Commit
9cabf03d
authored
2 years ago
by
Oscar Gustafsson
Browse files
Options
Downloads
Patches
Plain Diff
Add documentation
parent
7651da34
No related branches found
No related tags found
1 merge request
!118
Add documentation
Pipeline
#88323
passed
2 years ago
Stage: test
Stage: deploy
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
b_asic/process.py
+41
-16
41 additions, 16 deletions
b_asic/process.py
b_asic/save_load_structure.py
+20
-2
20 additions, 2 deletions
b_asic/save_load_structure.py
docs_sphinx/scheduler_gui.rst
+1
-1
1 addition, 1 deletion
docs_sphinx/scheduler_gui.rst
with
62 additions
and
19 deletions
b_asic/process.py
+
41
−
16
View file @
9cabf03d
"""
B-ASIC classes representing resource usage.
"""
from
typing
import
Dict
,
Tuple
from
b_asic.operation
import
Abstract
Operation
from
b_asic.operation
import
Operation
from
b_asic.port
import
InputPort
,
OutputPort
...
...
@@ -9,17 +13,16 @@ class Process:
Object for use in resource allocation. Has a start time and an execution
time. Subclasses will in many cases contain additional information for
resource assignment.
Parameters
==========
start_time : int
Start time of process.
execution_time : int
Execution time (lifetime) of process.
"""
def
__init__
(
self
,
start_time
:
int
,
execution_time
:
int
):
"""
Parameters
----------
start_time : int
Start time of process.
execution_time : int
Execution time (lifetime) of process.
"""
self
.
_start_time
=
start_time
self
.
_execution_time
=
execution_time
...
...
@@ -43,15 +46,16 @@ class Process:
class
OperatorProcess
(
Process
):
"""
Object that corresponds to usage of an operator.
"""
def
__init__
(
self
,
start_time
:
int
,
operation
:
AbstractOperation
):
"""
Parameters
==========
start_time : int
Start time of process.
operation : Operation
Operation that the process corresponds to.
"""
Returns
-------
object
"""
def
__init__
(
self
,
start_time
:
int
,
operation
:
Operation
):
execution_time
=
operation
.
execution_time
if
execution_time
is
None
:
raise
ValueError
(
...
...
@@ -65,6 +69,17 @@ class OperatorProcess(Process):
class
MemoryVariable
(
Process
):
"""
Object that corresponds to a memory variable.
Parameters
==========
write_time : int
Time when the memory variable is written.
write_port : OutputPort
The OutputPort that the memory variable originates from.
reads : {InputPort: int, ...}
Dictionary with the InputPorts that reads the memory variable and
for how long after the *write_time* they will read.
"""
def
__init__
(
...
...
@@ -98,6 +113,16 @@ class PlainMemoryVariable(Process):
Object that corresponds to a memory variable which only use numbers for
ports. This can be useful when only a plain memory variable is wanted with
no connection to a schedule.
Parameters
==========
write_time : int
The time the memory variable is written.
write_port : int
Identifier for the source of the memory variable.
reads : {int: int, ...}
Dictionary where the key is the destination identifier and the value
is the time after *write_time* that the memory variable is read.
"""
def
__init__
(
...
...
This diff is collapsed.
Click to expand it.
b_asic/save_load_structure.py
+
20
−
2
View file @
9cabf03d
...
...
@@ -14,7 +14,19 @@ from b_asic.special_operations import Input, Output
def
sfg_to_python
(
sfg
:
SFG
,
counter
:
int
=
0
,
suffix
:
str
=
None
)
->
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.
Parameters
==========
sfg : SFG
The SFG to serialize
counter : int, default: 0
Number used for naming the SFG. Enables SFGs in SFGs.
suffix : str, optional
String to append at the end of the result.
"""
result
=
(
'
\n
"""
\n
B-ASIC automatically generated SFG file.
\n
'
+
"
Name:
"
...
...
@@ -112,7 +124,13 @@ def sfg_to_python(sfg: SFG, counter: int = 0, suffix: str = None) -> str:
def
python_to_sfg
(
path
:
str
)
->
SFG
:
"""
Given a serialized file try to deserialize it and load it to the library.
"""
Given a serialized file try to deserialize it and load it to the library.
Parameters
==========
path : str
Path to file to read and deserialize.
"""
with
open
(
path
)
as
f
:
code
=
compile
(
f
.
read
(),
path
,
"
exec
"
)
...
...
This diff is collapsed.
Click to expand it.
docs_sphinx/scheduler_gui.rst
+
1
−
1
View file @
9cabf03d
...
...
@@ -70,7 +70,7 @@ scheduler\_gui.timeline\_item module
:show-inheritance:
Helper module
=============
-------------
scheduler\_gui.compile module
-----------------------------
...
...
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