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
b7feba38
Commit
b7feba38
authored
2 years ago
by
Frans Skarman
Committed by
Oscar Gustafsson
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove debug prints
parent
df17cad4
No related branches found
No related tags found
1 merge request
!195
Unfolding
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
b_asic/signal_flow_graph.py
+0
-22
0 additions, 22 deletions
b_asic/signal_flow_graph.py
test/test_sfg.py
+0
-16
0 additions, 16 deletions
test/test_sfg.py
with
0 additions
and
38 deletions
b_asic/signal_flow_graph.py
+
0
−
22
View file @
b7feba38
...
@@ -1542,14 +1542,6 @@ class SFG(AbstractOperation):
...
@@ -1542,14 +1542,6 @@ class SFG(AbstractOperation):
f
"
{
new_ops
[
layer
][
op_idx
].
graph_id
}
_
{
suffix
}
"
f
"
{
new_ops
[
layer
][
op_idx
].
graph_id
}
_
{
suffix
}
"
)
)
def
sanity_check
():
all_ops
=
[
op
for
op_list
in
new_ops
for
op
in
op_list
]
cmul201
=
[
op
for
op
in
all_ops
if
op
.
graph_id
==
GraphID
(
"
cmul2_0_1
"
)
]
if
cmul201
:
print
(
f
"
NOW:
{
cmul201
[
0
]
}
"
)
# Walk through the operations, replacing delay nodes with connections
# Walk through the operations, replacing delay nodes with connections
for
layer
in
range
(
factor
):
for
layer
in
range
(
factor
):
for
op_idx
,
op
in
enumerate
(
self
.
operations
):
for
op_idx
,
op
in
enumerate
(
self
.
operations
):
...
@@ -1625,14 +1617,6 @@ class SFG(AbstractOperation):
...
@@ -1625,14 +1617,6 @@ class SFG(AbstractOperation):
target_output
target_output
)
)
print
(
f
"
Connecting
{
new_ops
[
layer
][
op_idx
].
name
}
<-
"
f
"
{
target_output
.
operation
.
name
}
(
{
target_output
.
operation
.
graph_id
}
)
"
)
print
(
f
"
|>
{
new_ops
[
layer
][
op_idx
]
}
"
)
print
(
f
"
|<
{
target_output
.
operation
}
"
)
sanity_check
()
all_ops
=
[
op
for
op_list
in
new_ops
for
op
in
op_list
]
all_ops
=
[
op
for
op_list
in
new_ops
for
op
in
op_list
]
# To get the input order correct, we need to know the input order in the original
# To get the input order correct, we need to know the input order in the original
...
@@ -1663,12 +1647,6 @@ class SFG(AbstractOperation):
...
@@ -1663,12 +1647,6 @@ class SFG(AbstractOperation):
)
)
)
)
print
(
"
All ops:
"
)
print
(
*
all_ops
,
sep
=
"
\n
"
)
print
(
"
All outputs:
"
)
print
(
*
all_outputs
,
sep
=
"
\n
"
)
# Sanity check to ensure that no duplicate graph IDs have been created
# Sanity check to ensure that no duplicate graph IDs have been created
ids
=
[
op
.
graph_id
for
op
in
all_ops
]
ids
=
[
op
.
graph_id
for
op
in
all_ops
]
assert
len
(
ids
)
==
len
(
set
(
ids
))
assert
len
(
ids
)
==
len
(
set
(
ids
))
...
...
This diff is collapsed.
Click to expand it.
test/test_sfg.py
+
0
−
16
View file @
b7feba38
...
@@ -1662,16 +1662,10 @@ class TestUnfold:
...
@@ -1662,16 +1662,10 @@ class TestUnfold:
for
_
in
sfg
.
inputs
for
_
in
sfg
.
inputs
]
]
print
(
"
In:
"
)
print
(
input_list
)
sim
=
Simulation
(
sfg
,
input_list
)
sim
=
Simulation
(
sfg
,
input_list
)
sim
.
run
()
sim
.
run
()
ref
=
sim
.
results
ref
=
sim
.
results
print
(
"
out:
"
)
print
(
list
(
ref
[
ResultKey
(
"
0
"
)]))
# We have i copies of the inputs, each sourcing their input from the orig
# We have i copies of the inputs, each sourcing their input from the orig
unfolded_input_lists
=
[
unfolded_input_lists
=
[
[]
for
_
in
range
(
len
(
sfg
.
inputs
)
*
factor
)
[]
for
_
in
range
(
len
(
sfg
.
inputs
)
*
factor
)
...
@@ -1687,10 +1681,6 @@ class TestUnfold:
...
@@ -1687,10 +1681,6 @@ class TestUnfold:
sim
.
run
()
sim
.
run
()
unfolded_results
=
sim
.
results
unfolded_results
=
sim
.
results
print
(
"
ref out:
"
)
print
(
"
0:
"
,
unfolded_results
[
ResultKey
(
"
0
"
)])
print
(
"
1:
"
,
unfolded_results
[
ResultKey
(
"
1
"
)])
for
n
,
_
in
enumerate
(
sfg
.
outputs
):
for
n
,
_
in
enumerate
(
sfg
.
outputs
):
# Outputs for an original output
# Outputs for an original output
ref_values
=
list
(
ref
[
ResultKey
(
f
"
{
n
}
"
)])
ref_values
=
list
(
ref
[
ResultKey
(
f
"
{
n
}
"
)])
...
@@ -1698,7 +1688,6 @@ class TestUnfold:
...
@@ -1698,7 +1688,6 @@ class TestUnfold:
# Output n will be split into `factor` output ports, compute the
# Output n will be split into `factor` output ports, compute the
# indicies where we find the outputs
# indicies where we find the outputs
out_indices
=
[
n
+
k
*
len
(
sfg
.
outputs
)
for
k
in
range
(
factor
)]
out_indices
=
[
n
+
k
*
len
(
sfg
.
outputs
)
for
k
in
range
(
factor
)]
print
(
"
out indices:
"
,
out_indices
)
u_values
=
[
u_values
=
[
[
[
unfolded_results
[
ResultKey
(
f
"
{
idx
}
"
)][
k
]
unfolded_results
[
ResultKey
(
f
"
{
idx
}
"
)][
k
]
...
@@ -1707,13 +1696,8 @@ class TestUnfold:
...
@@ -1707,13 +1696,8 @@ class TestUnfold:
for
k
in
range
(
int
(
NUM_TESTS
))
for
k
in
range
(
int
(
NUM_TESTS
))
]
]
print
(
"
u_values:
"
,
u_values
)
flat_u_values
=
list
(
itertools
.
chain
.
from_iterable
(
u_values
))
flat_u_values
=
list
(
itertools
.
chain
.
from_iterable
(
u_values
))
print
(
"
ref_values:
"
,
ref_values
)
print
(
"
flat u_values:
"
,
flat_u_values
)
assert
flat_u_values
==
ref_values
assert
flat_u_values
==
ref_values
def
test_value_error
(
self
,
sfg_two_inputs_two_outputs
:
SFG
):
def
test_value_error
(
self
,
sfg_two_inputs_two_outputs
:
SFG
):
...
...
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