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
5be86917
Commit
5be86917
authored
1 year ago
by
Oscar Gustafsson
Browse files
Options
Downloads
Patches
Plain Diff
Add cell info to architecture
parent
5aaf4c28
No related branches found
No related tags found
1 merge request
!394
Add cell info to architecture
Pipeline
#97575
passed
1 year ago
Stage: test
Stage: deploy
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
b_asic/architecture.py
+12
-2
12 additions, 2 deletions
b_asic/architecture.py
test/test_architecture.py
+12
-4
12 additions, 4 deletions
test/test_architecture.py
with
24 additions
and
6 deletions
b_asic/architecture.py
+
12
−
2
View file @
5be86917
...
@@ -184,12 +184,15 @@ class Resource(HardwareBlock):
...
@@ -184,12 +184,15 @@ class Resource(HardwareBlock):
if
inputs
:
if
inputs
:
in_strs
=
[
f
"
<
{
in_str
}
>
{
in_str
}
"
for
in_str
in
inputs
]
in_strs
=
[
f
"
<
{
in_str
}
>
{
in_str
}
"
for
in_str
in
inputs
]
ret
+=
f
"
{{
{
'
|
'
.
join
(
in_strs
)
}
}}|
"
ret
+=
f
"
{{
{
'
|
'
.
join
(
in_strs
)
}
}}|
"
ret
+=
f
"
{
self
.
entity_name
}
"
ret
+=
f
"
<
{
self
.
entity_name
}
>
{
self
.
entity_name
}{
self
.
_info
()
}
"
if
outputs
:
if
outputs
:
out_strs
=
[
f
"
<
{
out_str
}
>
{
out_str
}
"
for
out_str
in
outputs
]
out_strs
=
[
f
"
<
{
out_str
}
>
{
out_str
}
"
for
out_str
in
outputs
]
ret
+=
f
"
|{{
{
'
|
'
.
join
(
out_strs
)
}
}}
"
ret
+=
f
"
|{{
{
'
|
'
.
join
(
out_strs
)
}
}}
"
return
"
{
"
+
ret
+
"
}
"
return
"
{
"
+
ret
+
"
}
"
def
_info
(
self
):
return
""
@property
@property
def
schedule_time
(
self
)
->
int
:
def
schedule_time
(
self
)
->
int
:
# doc-string inherited
# doc-string inherited
...
@@ -456,6 +459,13 @@ class Memory(Resource):
...
@@ -456,6 +459,13 @@ class Memory(Resource):
# Add information about the iterator type
# Add information about the iterator type
return
cast
(
Iterator
[
MemoryVariable
],
iter
(
self
.
_collection
))
return
cast
(
Iterator
[
MemoryVariable
],
iter
(
self
.
_collection
))
def
_info
(
self
):
if
self
.
is_assigned
:
if
self
.
_memory_type
==
"
RAM
"
:
plural_s
=
'
s
'
if
len
(
self
.
_assignment
)
>=
2
else
''
return
f
"
: (RAM,
{
len
(
self
.
_assignment
)
}
cell
{
plural_s
}
)
"
return
""
def
assign
(
self
,
heuristic
:
str
=
"
left_edge
"
)
->
None
:
def
assign
(
self
,
heuristic
:
str
=
"
left_edge
"
)
->
None
:
"""
"""
Perform assignment of the memory variables.
Perform assignment of the memory variables.
...
@@ -819,7 +829,7 @@ of :class:`~b_asic.architecture.ProcessingElement`
...
@@ -819,7 +829,7 @@ of :class:`~b_asic.architecture.ProcessingElement`
in_strs
=
[
f
"
<
{
in_str
}
>
{
in_str
}
"
for
in_str
in
inputs
]
in_strs
=
[
f
"
<
{
in_str
}
>
{
in_str
}
"
for
in_str
in
inputs
]
ret
+=
f
"
{{
{
'
|
'
.
join
(
in_strs
)
}
}}|
"
ret
+=
f
"
{{
{
'
|
'
.
join
(
in_strs
)
}
}}|
"
name
=
f
"
{
destination
.
replace
(
'
:
'
,
'
_
'
)
}
_mux
"
name
=
f
"
{
destination
.
replace
(
'
:
'
,
'
_
'
)
}
_mux
"
ret
+=
name
ret
+=
f
"
<
{
name
}
>
{
name
}
"
ret
+=
"
|<out> out
"
ret
+=
"
|<out> out
"
dg
.
node
(
name
,
"
{
"
+
ret
+
"
}
"
)
dg
.
node
(
name
,
"
{
"
+
ret
+
"
}
"
)
dg
.
edge
(
f
"
{
name
}
:out
"
,
destination
)
dg
.
edge
(
f
"
{
name
}
:out
"
,
destination
)
...
...
This diff is collapsed.
Click to expand it.
test/test_architecture.py
+
12
−
4
View file @
5be86917
...
@@ -104,9 +104,9 @@ def test_architecture(schedule_direct_form_iir_lp_filter: Schedule):
...
@@ -104,9 +104,9 @@ def test_architecture(schedule_direct_form_iir_lp_filter: Schedule):
if
pe
.
_type_name
==
'
add
'
:
if
pe
.
_type_name
==
'
add
'
:
s
=
(
s
=
(
'
digraph {
\n\t
node [shape=record]
\n\t
'
'
digraph {
\n\t
node [shape=record]
\n\t
'
+
pe
.
_
entity_name
+
pe
.
entity_name
+
'
[label=
"
{{<in0> in0|<in1> in1}|
'
+
'
[label=
"
{{<in0> in0|<in1> in1}|
'
+
pe
.
_
entity_name
+
f
'
<
{
pe
.
entity_name
}
>
{
pe
.
entity_name
}
'
+
'
|{<out0> out0}}
"
]
\n
}
'
+
'
|{<out0> out0}}
"
]
\n
}
'
)
)
assert
pe
.
_digraph
().
source
in
(
s
,
s
+
'
\n
'
)
assert
pe
.
_digraph
().
source
in
(
s
,
s
+
'
\n
'
)
...
@@ -123,8 +123,8 @@ def test_architecture(schedule_direct_form_iir_lp_filter: Schedule):
...
@@ -123,8 +123,8 @@ def test_architecture(schedule_direct_form_iir_lp_filter: Schedule):
for
i
,
memory
in
enumerate
(
memories
):
for
i
,
memory
in
enumerate
(
memories
):
memory
.
set_entity_name
(
f
"
MEM
{
i
}
"
)
memory
.
set_entity_name
(
f
"
MEM
{
i
}
"
)
s
=
(
s
=
(
'
digraph {
\n\t
node [shape=record]
\n\t
MEM0 [label=
"
{{<in0> in0}|MEM0
|{<out0
>
'
'
digraph {
\n\t
node [shape=record]
\n\t
MEM0 [label=
"
{{<in0> in0}|
<
MEM0>
'
'
out0}}
"
]
\n
}
'
'
MEM0|{<out0>
out0}}
"
]
\n
}
'
)
)
assert
memory
.
schedule_time
==
18
assert
memory
.
schedule_time
==
18
assert
memory
.
_digraph
().
source
in
(
s
,
s
+
'
\n
'
)
assert
memory
.
_digraph
().
source
in
(
s
,
s
+
'
\n
'
)
...
@@ -134,6 +134,14 @@ def test_architecture(schedule_direct_form_iir_lp_filter: Schedule):
...
@@ -134,6 +134,14 @@ def test_architecture(schedule_direct_form_iir_lp_filter: Schedule):
processing_elements
,
memories
,
direct_interconnects
=
direct_conn
processing_elements
,
memories
,
direct_interconnects
=
direct_conn
)
)
# Parts are non-deterministic, but this first part seems OK
s
=
(
'
digraph {
\n\t
node [shape=record]
\n\t
splines=spline
\n\t
subgraph
'
'
cluster_memories
'
)
assert
architecture
.
_digraph
().
source
.
startswith
(
s
)
s
=
'
digraph {
\n\t
node [shape=record]
\n\t
splines=spline
\n\t
MEM0
'
assert
architecture
.
_digraph
(
cluster
=
False
).
source
.
startswith
(
s
)
assert
architecture
.
schedule_time
==
18
assert
architecture
.
schedule_time
==
18
# assert architecture._digraph().source == "foo"
# assert architecture._digraph().source == "foo"
...
...
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