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
!17
Resolve "Operation Evaluation"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Operation Evaluation"
5-operation-evaluation
into
develop
Overview
11
Commits
20
Pipelines
3
Changes
7
Merged
Angus Lothian
requested to merge
5-operation-evaluation
into
develop
5 years ago
Overview
11
Commits
20
Pipelines
3
Changes
7
Expand
Adds tests and implementation for evaluate_output function that takes a list of input values, and returns the output values calculated.
Remove old evaluate_outputs method that isn't part of the architecture anymore.
Add Butterfly core operation to have an operation to use in testcases for multiple outputs.
Request review from
@jacwa448
@ivaha717
Closes
#5 (closed)
0
0
Merge request reports
Compare
develop
version 2
24431096
5 years ago
version 1
030d3d38
5 years ago
develop (base)
and
latest version
latest version
40327137
20 commits,
5 years ago
version 2
24431096
19 commits,
5 years ago
version 1
030d3d38
18 commits,
5 years ago
7 files
+
214
−
75
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
7
Search (e.g. *.vue) (Ctrl+P)
b_asic/core_operations.py
+
25
−
2
Options
@@ -4,10 +4,8 @@ TODO: More info.
"""
from
numbers
import
Number
from
typing
import
Any
from
numpy
import
conjugate
,
sqrt
,
abs
as
np_abs
from
b_asic.port
import
InputPort
,
OutputPort
from
b_asic.graph_id
import
GraphIDType
from
b_asic.operation
import
AbstractOperation
from
b_asic.graph_component
import
Name
,
TypeName
@@ -335,3 +333,28 @@ class ConstantDivision(AbstractOperation):
@property
def
type_name
(
self
)
->
TypeName
:
return
"
cdiv
"
class
Butterfly
(
AbstractOperation
):
"""
Butterfly operation that returns two outputs.
The first output is a + b and the second output is a - b.
TODO: More info.
"""
def
__init__
(
self
,
source1
:
OutputPort
=
None
,
source2
:
OutputPort
=
None
,
name
:
Name
=
""
):
super
().
__init__
(
name
)
self
.
_input_ports
=
[
InputPort
(
0
,
self
),
InputPort
(
1
,
self
)]
self
.
_output_ports
=
[
OutputPort
(
0
,
self
),
OutputPort
(
1
,
self
)]
if
source1
is
not
None
:
self
.
_input_ports
[
0
].
connect
(
source1
)
if
source2
is
not
None
:
self
.
_input_ports
[
1
].
connect
(
source2
)
def
evaluate
(
self
,
a
,
b
):
return
a
+
b
,
a
-
b
@property
def
type_name
(
self
)
->
TypeName
:
return
"
bfly
"
Loading