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
Merge requests
!293
Add architecture stub classes
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add architecture stub classes
architecture
into
master
Overview
0
Commits
1
Pipelines
6
Changes
8
Merged
Oscar Gustafsson
requested to merge
architecture
into
master
2 years ago
Overview
0
Commits
1
Pipelines
6
Changes
6
Expand
0
0
Merge request reports
Compare
version 1
version 5
ad5bc340
2 years ago
version 4
a631cace
2 years ago
version 3
6c506f9b
2 years ago
version 2
0e7790a0
2 years ago
version 1
11a7df72
2 years ago
master (base)
and
version 3
latest version
98df396f
1 commit,
2 years ago
version 5
ad5bc340
1 commit,
2 years ago
version 4
a631cace
1 commit,
2 years ago
version 3
6c506f9b
1 commit,
2 years ago
version 2
0e7790a0
1 commit,
2 years ago
version 1
11a7df72
1 commit,
2 years ago
Show latest version
6 files
+
82
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
6
Search (e.g. *.vue) (Ctrl+P)
b_asic/architecture.py
+
53
−
5
Options
"""
B-ASIC architecture classes.
"""
from
typing
import
Set
from
typing
import
Set
,
cast
from
b_asic.process
import
MemoryVariable
,
OperatorProcess
,
PlainMemoryVariable
from
b_asic.resources
import
ProcessCollection
@@ -25,18 +25,38 @@ class ProcessingElement:
isinstance
(
operator
,
OperatorProcess
)
for
operator
in
process_collection
.
collection
):
raise
Valu
eError
(
raise
Typ
eError
(
"
Can only have OperatorProcesses in ProcessCollection when creating
"
"
ProcessingElement
"
)
ops
=
[
operand
.
operation
for
operand
in
process_collection
.
collection
]
ops
=
[
cast
(
operand
,
OperatorProcess
).
operation
for
operand
in
process_collection
.
collection
]
op_type
=
type
(
ops
[
0
])
if
not
all
(
isinstance
(
op
,
op_type
)
for
op
in
ops
):
raise
Valu
eError
(
"
Different Operation types in ProcessCollection
"
)
raise
Typ
eError
(
"
Different Operation types in ProcessCollection
"
)
self
.
_collection
=
process_collection
self
.
_operation_type
=
op_type
self
.
_type_name
=
op_type
.
type_name
()
def
write_code
(
self
,
path
:
str
,
entity_name
:
str
):
"""
Write VHDL code for memory.
Parameters
----------
path : str
Directory to write code in.
entity_name : str
Returns
-------
"""
raise
NotImplementedError
class
Memory
:
"""
@@ -57,13 +77,30 @@ class Memory:
isinstance
(
operator
,
(
MemoryVariable
,
PlainMemoryVariable
))
for
operator
in
process_collection
.
collection
):
raise
Valu
eError
(
raise
Typ
eError
(
"
Can only have MemoryVariable or PlainMemoryVariable in
"
"
ProcessCollection when creating Memory
"
)
self
.
_collection
=
process_collection
self
.
_memory_type
=
memory_type
def
write_code
(
self
,
path
:
str
,
entity_name
:
str
):
"""
Write VHDL code for memory.
Parameters
----------
path : str
Directory to write code in.
entity_name : str
Returns
-------
"""
raise
NotImplementedError
class
Architecture
:
"""
@@ -89,3 +126,14 @@ class Architecture:
self
.
_processing_elements
=
processing_elements
self
.
_memories
=
memories
self
.
_name
=
name
def
write_code
(
self
,
path
:
str
):
"""
Write HDL of architecture.
Parameters
----------
path : str
Directory to write code in.
"""
raise
NotImplementedError
Loading