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
0237b882
Commit
0237b882
authored
2 years ago
by
Oscar Gustafsson
Browse files
Options
Downloads
Patches
Plain Diff
Add assign argument to reource initialization
parent
6717f355
No related branches found
No related tags found
1 merge request
!386
Assign argument to resources
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
b_asic/architecture.py
+14
-2
14 additions, 2 deletions
b_asic/architecture.py
with
14 additions
and
2 deletions
b_asic/architecture.py
+
14
−
2
View file @
0237b882
...
...
@@ -293,10 +293,15 @@ class ProcessingElement(Resource):
Process collection containing operations to map to processing element.
entity_name : str, optional
Name of processing element entity.
assign : bool, default True
Perform assignment when creating the ProcessingElement.
"""
def
__init__
(
self
,
process_collection
:
ProcessCollection
,
entity_name
:
Optional
[
str
]
=
None
self
,
process_collection
:
ProcessCollection
,
entity_name
:
Optional
[
str
]
=
None
,
assign
:
bool
=
True
,
):
super
().
__init__
(
process_collection
=
process_collection
,
entity_name
=
entity_name
)
if
not
all
(
...
...
@@ -318,7 +323,8 @@ class ProcessingElement(Resource):
self
.
_type_name
=
op_type
.
type_name
()
self
.
_input_count
=
ops
[
0
].
input_count
self
.
_output_count
=
ops
[
0
].
output_count
self
.
assign
()
if
assign
:
self
.
assign
()
@property
def
processes
(
self
)
->
List
[
OperatorProcess
]:
...
...
@@ -364,6 +370,9 @@ class Memory(Resource):
Number of read ports for memory.
write_ports : int, optional
Number of write ports for memory.
assign : bool, default False
Perform assignment when creating the Memory (using the default properties).
"""
def
__init__
(
...
...
@@ -373,6 +382,7 @@ class Memory(Resource):
entity_name
:
Optional
[
str
]
=
None
,
read_ports
:
Optional
[
int
]
=
None
,
write_ports
:
Optional
[
int
]
=
None
,
assign
:
bool
=
False
,
):
super
().
__init__
(
process_collection
=
process_collection
,
entity_name
=
entity_name
)
if
not
all
(
...
...
@@ -401,6 +411,8 @@ class Memory(Resource):
raise
ValueError
(
f
"
At least
{
write_ports_bound
}
write ports required
"
)
self
.
_input_count
=
write_ports
self
.
_memory_type
=
memory_type
if
assign
:
self
.
assign
()
memory_processes
=
[
cast
(
MemoryProcess
,
process
)
for
process
in
process_collection
...
...
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