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
8da430f5
Commit
8da430f5
authored
5 years ago
by
Ivar Härnqvist
Browse files
Options
Downloads
Patches
Plain Diff
add find_result_keys_by_name utility function
parent
c117d89a
No related branches found
No related tags found
2 merge requests
!67
WIP: B-ASIC version 1.0.0 hotfix
,
!65
B-ASIC version 1.0.0
Pipeline
#16118
failed
5 years ago
Stage: test
Changes
3
Pipelines
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
_b_asic.cpython-38-x86_64-linux-gnu.so
+0
-0
0 additions, 0 deletions
_b_asic.cpython-38-x86_64-linux-gnu.so
_b_asic_debug_log.txt
+0
-119738
0 additions, 119738 deletions
_b_asic_debug_log.txt
test/test_simulation.py
+5
-15
5 additions, 15 deletions
test/test_simulation.py
with
5 additions
and
119753 deletions
_b_asic.cpython-38-x86_64-linux-gnu.so
deleted
100755 → 0
+
0
−
0
View file @
c117d89a
File deleted
This diff is collapsed.
Click to expand it.
_b_asic_debug_log.txt
deleted
100644 → 0
+
0
−
119738
View file @
c117d89a
This diff is collapsed.
Click to expand it.
test/test_simulation.py
+
5
−
15
View file @
8da430f5
import
pytest
import
pytest
import
numpy
as
np
import
numpy
as
np
<<<<<<<
HEAD
from
b_asic
import
SFG
,
Output
,
Simulation
from
b_asic
import
SFG
,
Input
,
Output
,
Delay
,
ConstantMultiplication
,
Simulation
=======
from
b_asic
import
SFG
,
Simulation
>>>>>>>
d2ae5743259f581c116bb3772d17c3b2023ed9e0
class
TestRunFor
:
class
TestRunFor
:
...
@@ -126,17 +122,11 @@ class TestRunFor:
...
@@ -126,17 +122,11 @@ class TestRunFor:
assert
simulation
.
results
[
"
0
"
][
4
]
==
-
6
assert
simulation
.
results
[
"
0
"
][
4
]
==
-
6
assert
simulation
.
results
[
"
0
"
][
5
]
==
7
assert
simulation
.
results
[
"
0
"
][
5
]
==
7
def
test_find_result_key
(
self
):
def
test_find_result_key
(
self
,
precedence_sfg_delays
):
indata
=
[
77
,
99
,
0.3
,
23
,
88
,
3.14
,
4.76
,
45
,
0.099
]
sim
=
Simulation
(
precedence_sfg_delays
,
[[
0
,
4
,
542
,
42
,
31.314
,
534.123
,
-
453415
,
5431
]])
i
=
Input
()
d
=
Delay
()
m
=
ConstantMultiplication
(
0.5
,
d
,
"
Mult
"
)
d
<<
(
m
+
i
)
o
=
Output
(
d
)
s
=
SFG
(
inputs
=
[
i
],
outputs
=
[
o
])
sim
=
Simulation
(
s
,
[
indata
])
sim
.
run
()
sim
.
run
()
assert
sim
.
results
[
s
.
find_result_keys_by_name
(
"
Mult
"
)[
0
]][
4
]
==
0.35
assert
sim
.
results
[
precedence_sfg_delays
.
find_result_keys_by_name
(
"
ADD2
"
)[
0
]][
4
]
==
31220
assert
sim
.
results
[
precedence_sfg_delays
.
find_result_keys_by_name
(
"
A1
"
)[
0
]][
2
]
==
80
class
TestRun
:
class
TestRun
:
def
test_save_results
(
self
,
sfg_two_inputs_two_outputs
):
def
test_save_results
(
self
,
sfg_two_inputs_two_outputs
):
...
...
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