Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Hydra - a radiation-tolerant SoC
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
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
Hydra - a radiation-tolerant SoC
Commits
0437655b
Commit
0437655b
authored
2 years ago
by
Tristan Gingold
Browse files
Options
Downloads
Patches
Plain Diff
sw: add dram scrubber test
parent
71cf6b89
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sw/sf2-test/main.c
+33
-1
33 additions, 1 deletion
sw/sf2-test/main.c
with
33 additions
and
1 deletion
sw/sf2-test/main.c
+
33
−
1
View file @
0437655b
...
...
@@ -20,6 +20,7 @@ static enum t_test
{
TEST_DRAM_DE
,
TEST_DRAM_SE
,
TEST_DRAM_SCRUB
,
TEST_IRAM_DE
,
TEST_IRAM_SE
,
TEST_IRAM_SCRUB
,
...
...
@@ -182,16 +183,20 @@ main (void)
switch
(
next_test
)
{
case
TEST_DRAM_DE
:
/* Add double-errors */
SUPERVISOR
->
dram_ecc_mask
=
0x03
;
ecc
[
0
]
=
12
;
ecc
[
2
]
=
23
;
/* Add single-errors */
SUPERVISOR
->
dram_ecc_mask
=
0x01
;
ecc
[
1
]
=
56
;
ecc
[
3
]
=
78
;
/* Do not add errors anymore! */
SUPERVISOR
->
dram_ecc_mask
=
0x00
;
next_test
=
TEST_DRAM_SE
;
/* Order is important! */
asm
volatile
(
""
);
/* Trigger a single error */
v
=
ecc
[
0
];
unreachable
();
break
;
...
...
@@ -199,6 +204,7 @@ main (void)
case
TEST_DRAM_SE
:
if
(
SUPERVISOR
->
dram_ecc_se
!=
0
)
unreachable
();
/* Trigger a single error */
v
=
ecc
[
1
];
if
(
SUPERVISOR
->
dram_ecc_se
!=
1
)
unreachable
();
...
...
@@ -206,12 +212,38 @@ main (void)
/* Fallthrough */
case
TEST_IRAM_DE
:
next_test
=
TEST_
I
RAM_S
E
;
next_test
=
TEST_
D
RAM_S
CRUB
;
/* Generate a fatal error */
v
=
*
(
volatile
unsigned
*
)
0xfffc
;
unreachable
();
break
;
case
TEST_DRAM_SCRUB
:
if
(
SUPERVISOR
->
dram_scrub_se
!=
0
||
SUPERVISOR
->
dram_scrub_de
!=
0
)
unreachable
();
uart_puts
(
"Start DRAM scrubber"
);
SUPERVISOR
->
scrub_cfg
=
HYDRA_SUPERVISOR_REGS_SCRUB_CFG_DRAM_EN
;
next_test
=
TEST_IRAM_SE
;
do
{
v
=
SUPERVISOR
->
dram_scrub_de
;
SUPERVISOR
->
wd_key
=
WD_KEY
;
}
while
(
v
==
0
);
/* Because the scrubber is always running, the counter is always
incrementing. So the original value is kept. */
uart_putc
(
'\n'
);
if
(
SUPERVISOR
->
dram_scrub_se
!=
1
||
v
>
2
)
{
uart_puts
(
"se:"
);
uart_put_hex8
(
SUPERVISOR
->
dram_scrub_se
);
uart_puts
(
", de:"
);
uart_put_hex8
(
v
);
unreachable
();
}
/* Remove the errors */
ecc
[
0
]
=
0
;
ecc
[
2
]
=
0
;
/* Fallthrough */
case
TEST_IRAM_SE
:
/* Generate a single error */
v
=
*
(
volatile
unsigned
*
)
0xfff8
;
...
...
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