Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libnux
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EBRAINS RI
Tech Hub
Apps
BrainScaleS
libnux
Commits
753dfd86
Commit
753dfd86
authored
5 years ago
by
Philipp Spilger
Browse files
Options
Downloads
Patches
Plain Diff
Add CADC read test for fixture data in simulation
Change-Id: I4b9cde62a9d46c025d41067a48790b1e3368352f
parent
7d7a64b2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
libnux/dls_vx.h
+12
-0
12 additions, 0 deletions
libnux/dls_vx.h
test/helpers/hwtest_common.py
+11
-1
11 additions, 1 deletion
test/helpers/hwtest_common.py
test/test_cadc.cpp
+50
-0
50 additions, 0 deletions
test/test_cadc.cpp
wscript
+1
-0
1 addition, 0 deletions
wscript
with
74 additions
and
1 deletion
libnux/dls_vx.h
+
12
−
0
View file @
753dfd86
...
...
@@ -59,3 +59,15 @@ static constexpr omnibus_address_t dls_spike_base = 0x1c000040ul;
/* MADC and reference current generator configuration base address */
static
constexpr
omnibus_address_t
madc_base_address
=
(
1ul
<<
19
|
1ul
<<
18
);
/* Address of synram */
static
constexpr
omnibus_address_t
synram_top_base_address
=
0x02800000
|
(
1
<<
22
);
static
constexpr
omnibus_address_t
synram_bottom_base_address
=
0x03800000
|
(
1
<<
22
);
/* CADC causal base address for top PPU */
static
constexpr
omnibus_address_t
cadc_top_causal_base_address
=
synram_top_base_address
|
dls_causal_base
;
/* CADC acausal base address for top PPU */
static
constexpr
omnibus_address_t
cadc_top_acausal_base_address
=
synram_top_base_address
|
dls_acausal_base
;
This diff is collapsed.
Click to expand it.
test/helpers/hwtest_common.py
+
11
−
1
View file @
753dfd86
...
...
@@ -93,7 +93,7 @@ def get_special_binaries(dls_version: str) -> Set[PpuHwTest]:
stack_protection
=
os
.
environ
.
get
(
"
STACK_PROTECTION
"
,
""
).
lower
()
==
"
true
"
stack_redzone
=
os
.
environ
.
get
(
"
STACK_REDZONE
"
,
""
).
lower
()
==
"
true
"
return
{
test_list
=
{
PpuHwTest
(
join
(
TEST_BINARY_PATH
,
f
"
test_unittest_
{
dls_version
}
.bin
"
),
expected_exit_code
=
1
),
...
...
@@ -107,3 +107,13 @@ def get_special_binaries(dls_version: str) -> Set[PpuHwTest]:
join
(
TEST_BINARY_PATH
,
f
"
test_stack_redzone_
{
dls_version
}
.bin
"
),
expected_exit_code
=
12
if
stack_redzone
else
2
)
}
if
dls_version
==
'
vx
'
:
simulation
=
os
.
environ
.
get
(
"
FLANGE_SIMULATION_RCF_PORT
"
)
test_list
.
update
({
PpuHwTest
(
join
(
TEST_BINARY_PATH
,
f
"
test_cadc_
{
dls_version
}
.bin
"
),
expected_exit_code
=
0
if
simulation
is
not
None
else
1
),
})
return
test_list
This diff is collapsed.
Click to expand it.
test/test_cadc.cpp
0 → 100644
+
50
−
0
View file @
753dfd86
#include
<array>
#include
<stddef.h>
#include
<stdint.h>
#include
"libnux/dls.h"
#include
"libnux/omnibus.h"
#include
"libnux/unittest.h"
#include
"libnux/vector.h"
using
namespace
libnux
;
// generated in hx_top/**/anncore.sv
vector_row_t
get_expectation
()
{
vector_row_t
ret
;
for
(
size_t
col
=
0
;
col
<
dls_num_columns
;
++
col
)
{
if
(
col
%
2
==
0
)
{
ret
.
even_columns
[
col
/
2
]
=
1
<<
7
|
((
col
%
64
)
<<
1
);
}
else
{
ret
.
odd_columns
[
col
/
2
]
=
1
<<
7
|
((
col
%
64
)
<<
1
);
}
}
return
ret
;
}
// program entry point
void
start
(
void
)
{
libnux_test_init
();
libnux_testcase_begin
(
"cadc static pattern"
);
auto
const
expectation
=
get_expectation
();
constexpr
size_t
row
=
0
;
// arbitrary in [0,256)
std
::
array
<
bool
,
2
>
is_causal
=
{
false
,
true
};
for
(
auto
const
causal
:
is_causal
)
{
auto
const
cadc_vector
=
get_row_via_vector
(
row
,
causal
?
dls_causal_base
:
dls_acausal_base
);
// static test pattern is same for both top and bottom tree, therefore only top
// is tested here
auto
const
cadc_omnibus
=
get_row_via_omnibus
(
row
,
causal
?
cadc_top_causal_base_address
:
cadc_top_acausal_base_address
);
libnux_test_equal
(
cadc_vector
,
cadc_omnibus
);
libnux_test_equal
(
cadc_vector
,
expectation
);
}
libnux_testcase_end
();
libnux_test_summary
();
libnux_test_shutdown
();
}
This diff is collapsed.
Click to expand it.
wscript
+
1
−
0
View file @
753dfd86
...
...
@@ -172,6 +172,7 @@ def build(bld):
else:
# These tests only work for HX
program_list += [
'test/test_cadc.cpp',
'test/test_fpga_memory_vector_access.cpp',
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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