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
b874af0a
Commit
b874af0a
authored
11 months ago
by
Oscar Gustafsson
Browse files
Options
Downloads
Patches
Plain Diff
Add __slots__ to some classes
parent
ea99fc59
No related branches found
Branches containing commit
No related tags found
1 merge request
!442
Add __slots__ to some classes
Pipeline
#132084
passed
9 months ago
Stage: test
Changes
4
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
b_asic/operation.py
+2
-1
2 additions, 1 deletion
b_asic/operation.py
b_asic/port.py
+3
-0
3 additions, 0 deletions
b_asic/port.py
b_asic/process.py
+21
-0
21 additions, 0 deletions
b_asic/process.py
b_asic/resources.py
+5
-0
5 additions, 0 deletions
b_asic/resources.py
with
31 additions
and
1 deletion
b_asic/operation.py
+
2
−
1
View file @
b874af0a
...
...
@@ -454,9 +454,10 @@ class AbstractOperation(Operation, AbstractGraphComponent):
behavior.
"""
__slots__
=
(
"
_input_ports
"
,
"
_output_ports
"
,
"
_execution_time
"
)
_input_ports
:
List
[
InputPort
]
_output_ports
:
List
[
OutputPort
]
_execution_time
:
Un
ion
[
int
,
None
]
=
None
_execution_time
:
Opt
ion
al
[
int
]
def
__init__
(
self
,
...
...
This diff is collapsed.
Click to expand it.
b_asic/port.py
+
3
−
0
View file @
b874af0a
...
...
@@ -130,6 +130,7 @@ class AbstractPort(Port):
behavior.
"""
__slots__
=
(
"
_operation
"
,
"
_index
"
,
"
_latency_offset
"
)
_operation
:
"
Operation
"
_index
:
int
_latency_offset
:
Optional
[
int
]
...
...
@@ -276,6 +277,7 @@ class InputPort(AbstractPort):
May have one or zero signals connected to it.
"""
__slots__
=
(
"
_source_signal
"
,)
_source_signal
:
Optional
[
Signal
]
def
__init__
(
self
,
operation
:
"
Operation
"
,
index
:
int
):
...
...
@@ -372,6 +374,7 @@ class OutputPort(AbstractPort, SignalSourceProvider):
May have zero or more signals connected to it.
"""
__slots__
=
(
"
_destination_signals
"
,)
_destination_signals
:
List
[
Signal
]
def
__init__
(
self
,
operation
:
"
Operation
"
,
index
:
int
):
...
...
This diff is collapsed.
Click to expand it.
b_asic/process.py
+
21
−
0
View file @
b874af0a
...
...
@@ -24,6 +24,11 @@ class Process:
The name of the process.
"""
__slots__
=
(
"
_start_time
"
,
"
_execution_time
"
,
"
_name
"
)
_start_time
:
int
_execution_time
:
int
_name
:
str
def
__init__
(
self
,
start_time
:
int
,
execution_time
:
int
,
name
:
str
=
""
):
self
.
_start_time
=
start_time
self
.
_execution_time
=
execution_time
...
...
@@ -82,6 +87,9 @@ class OperatorProcess(Process):
The name of the process.
"""
__slots__
=
(
"
_operation
"
,)
_operation
:
Operation
def
__init__
(
self
,
start_time
:
int
,
...
...
@@ -131,6 +139,9 @@ class MemoryProcess(Process):
Name of the process.
"""
__slots__
=
(
"
_life_times
"
,)
_life_times
:
List
[
int
]
def
__init__
(
self
,
write_time
:
int
,
...
...
@@ -274,6 +285,11 @@ class MemoryVariable(MemoryProcess):
The name of the process.
"""
__slots__
=
(
"
_reads
"
,
"
_read_ports
"
,
"
_write_port
"
)
_reads
:
Dict
[
InputPort
,
int
]
_read_ports
:
List
[
InputPort
]
_write_port
:
OutputPort
def
__init__
(
self
,
write_time
:
int
,
...
...
@@ -359,6 +375,11 @@ class PlainMemoryVariable(MemoryProcess):
The name of the process.
"""
__slots__
=
(
"
_reads
"
,
"
_read_ports
"
,
"
_write_port
"
)
_reads
:
Dict
[
int
,
int
]
_read_ports
:
List
[
int
]
_write_port
:
OutputPort
def
__init__
(
self
,
write_time
:
int
,
...
...
This diff is collapsed.
Click to expand it.
b_asic/resources.py
+
5
−
0
View file @
b874af0a
...
...
@@ -449,6 +449,11 @@ class ProcessCollection:
.. math:: t = t \bmod T_{\textrm{schedule}}.
"""
__slots__
=
(
"
_collection
"
,
"
_schedule_time
"
,
"
_cyclic
"
)
_collection
:
List
[
Process
]
_schedule_time
:
int
_cyclic
:
bool
def
__init__
(
self
,
collection
:
Iterable
[
Process
],
...
...
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