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
0f18389a
Commit
0f18389a
authored
2 years ago
by
Tristan Gingold
Browse files
Options
Downloads
Patches
Plain Diff
sw: test divergence of all cpus
parent
886f5bc2
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sw/sf2-test/crt0.S
+0
-12
0 additions, 12 deletions
sw/sf2-test/crt0.S
sw/sf2-test/main.c
+25
-17
25 additions, 17 deletions
sw/sf2-test/main.c
with
25 additions
and
29 deletions
sw/sf2-test/crt0.S
+
0
−
12
View file @
0f18389a
...
...
@@ -17,15 +17,3 @@ _start:
mv
a0
,
zero
call
main
.
global
clear_bss
clear_bss
:
#
clear
the
bss
segment
la
t0
,
_fbss
la
t1
,
_end
1
:
sw
zero
,
0
(
t0
)
addi
t0
,
t0
,
4
bltu
t0
,
t1
,
1
b
ret
This diff is collapsed.
Click to expand it.
sw/sf2-test/main.c
+
25
−
17
View file @
0f18389a
...
...
@@ -19,9 +19,12 @@ extern void clear_bss(void);
static
enum
t_test
{
TEST_WD
,
TEST_CPU0_RECOVER
,
TEST_CPU0_FATAL
,
TEST_RAM
TEST_CPU1_RECOVER
,
TEST_CPU2_RECOVER
,
TEST_CPU3_RECOVER
,
TEST_CPU1_FATAL
,
TEST_RAM
,
TEST_DONE
}
next_test
;
static
void
...
...
@@ -112,14 +115,15 @@ ram_test(void)
return
0
;
}
/* ID must be 0-2 */
static
void
force_divergence
_1
(
vo
id
)
force_divergence
(
unsigned
id
)
{
unsigned
v
;
/* Force divergence by executing different code. */
v
=
SUPERVISOR
->
force_divergence
;
if
(
v
!=
1
)
if
(
v
!=
(
1
<<
id
)
)
uart_putc
(
'D'
);
/* Must be in lock-step. */
...
...
@@ -147,22 +151,21 @@ main (void)
uart_put_hex_digit
(
next_test
);
uart_putc
(
'\n'
);
if
(
v
==
0
)
clear_bss
();
switch
(
next_test
)
{
case
TEST_WD
:
next_test
=
TEST_CPU0_RECOVER
;
/* Test watchdog - infinite loop */
next_test
=
TEST_CPU1_RECOVER
;
while
(
1
)
v
=
pad
[
0
];
unreachable
();
break
;
case
TEST_CPU0_RECOVER
:
case
TEST_CPU1_RECOVER
:
case
TEST_CPU2_RECOVER
:
case
TEST_CPU3_RECOVER
:
SUPERVISOR
->
wd_key
=
WD_KEY
;
force_divergence
_1
(
);
force_divergence
(
next_test
-
TEST_CPU1_RECOVER
);
next_test
=
TEST_CPU0_FATAL
;
next_test
++
;
/* Generate reset for recovery */
SUPERVISOR
->
cpu
=
HYDRA_SUPERVISOR_REGS_CPU_RECOVERY
;
...
...
@@ -170,12 +173,12 @@ main (void)
unreachable
();
break
;
case
TEST_CPU
0
_FATAL
:
case
TEST_CPU
1
_FATAL
:
SUPERVISOR
->
wd_key
=
WD_KEY
;
/* Clear recovery */
SUPERVISOR
->
cpu
=
0
;
force_divergence
_1
();
force_divergence
(
0
);
next_test
=
TEST_RAM
;
...
...
@@ -195,10 +198,15 @@ main (void)
uart_put_hex_digit
(
v
&
0x0f
);
unreachable
();
}
}
while
(
1
)
{
next_test
=
TEST_DONE
;
/* Fallthrough */
case
TEST_DONE
:
SUPERVISOR
->
wd_key
=
WD_KEY
;
SUPERVISOR
->
wd_period
=
100000000
;
uart_puts
(
"Hello diot.
\n
"
);
while
(
1
)
;
}
}
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