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
668c63ca
Commit
668c63ca
authored
2 years ago
by
Tristan Gingold
Browse files
Options
Downloads
Patches
Plain Diff
Add comments, working tests
parent
580c5eba
Branches
Branches containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hdl/rtl/hydra_core.vhd
+9
-2
9 additions, 2 deletions
hdl/rtl/hydra_core.vhd
sw/sf2-test/main.c
+4
-1
4 additions, 1 deletion
sw/sf2-test/main.c
with
13 additions
and
3 deletions
hdl/rtl/hydra_core.vhd
+
9
−
2
View file @
668c63ca
...
@@ -143,7 +143,7 @@ architecture arch of hydra_core is
...
@@ -143,7 +143,7 @@ architecture arch of hydra_core is
begin
begin
dwb_o
<=
dwb_out
;
dwb_o
<=
dwb_out
;
cpu_rst2
<=
"111"
when
rst_n_i
=
'0'
or
cpu_rst_n_i
=
'0'
else
"000"
;
cpu_rst2
<=
"111"
when
rst_n_i
=
'0'
or
cpu_rst_n_i
=
'0'
else
cpu_rst
;
cpu_err_o
<=
'1'
when
cpu_rst
/=
"111"
else
'0'
;
cpu_err_o
<=
'1'
when
cpu_rst
/=
"111"
else
'0'
;
inst_cpus
:
entity
work
.
hydra_triple_cpu
inst_cpus
:
entity
work
.
hydra_triple_cpu
...
@@ -500,22 +500,29 @@ begin
...
@@ -500,22 +500,29 @@ begin
else
else
case
state
is
case
state
is
when
S_VOTER
=>
when
S_VOTER
=>
cpu_rst
<=
"000"
;
if
dm_cycle_in_progress
=
'0'
then
-- Release reset only when the bus is idle.
cpu_rst
<=
"000"
;
end
if
;
-- Software can clear recovery flag.
-- Software can clear recovery flag.
if
cpu_wr
=
'1'
and
cpu_recovery_in
=
'0'
then
if
cpu_wr
=
'1'
and
cpu_recovery_in
=
'0'
then
cpu_recovery
<=
'0'
;
cpu_recovery
<=
'0'
;
end
if
;
end
if
;
-- Data bus errors counter
if
err_cpu_dm
=
'1'
then
if
err_cpu_dm
=
'1'
then
nbr_cpu_data_err
<=
std_logic_vector
(
unsigned
(
nbr_cpu_data_err
)
+
1
);
nbr_cpu_data_err
<=
std_logic_vector
(
unsigned
(
nbr_cpu_data_err
)
+
1
);
end
if
;
end
if
;
if
cpu_sync
=
"110"
or
cpu_sync
=
"101"
or
cpu_sync
=
"011"
then
if
cpu_sync
=
"110"
or
cpu_sync
=
"101"
or
cpu_sync
=
"011"
then
-- Disable the cpu out of sync.
-- Disable the cpu out of sync.
cpu_rst
<=
not
cpu_sync
;
cpu_rst
<=
not
cpu_sync
;
-- Error counter
nbr_cpu_iaddr_err
<=
std_logic_vector
(
unsigned
(
nbr_cpu_iaddr_err
)
+
1
);
nbr_cpu_iaddr_err
<=
std_logic_vector
(
unsigned
(
nbr_cpu_iaddr_err
)
+
1
);
-- Go to lock-step
state
<=
S_LOCK
;
state
<=
S_LOCK
;
end
if
;
end
if
;
when
S_LOCK
=>
when
S_LOCK
=>
if
cpu_wr
=
'1'
and
cpu_recovery_in
=
'1'
then
if
cpu_wr
=
'1'
and
cpu_recovery_in
=
'1'
then
-- Start recovery (reset)
cpu_recovery
<=
'1'
;
cpu_recovery
<=
'1'
;
end
if
;
end
if
;
end
case
;
end
case
;
...
...
This diff is collapsed.
Click to expand it.
sw/sf2-test/main.c
+
4
−
1
View file @
668c63ca
...
@@ -47,7 +47,7 @@ uart_raw_putc (unsigned char c)
...
@@ -47,7 +47,7 @@ uart_raw_putc (unsigned char c)
/* Wait until TEMT (transmit empty) is set. */
/* Wait until TEMT (transmit empty) is set. */
/* NB: bit 5 for RX not empty */
/* NB: bit 5 for RX not empty */
while
(
!
(
*
(
volatile
unsigned
*
)
UART_LSR
&
0x20
))
while
(
!
(
*
(
volatile
unsigned
*
)
UART_LSR
&
0x20
))
;
SUPERVISOR
->
wd_key
=
WD_KEY
;
*
(
volatile
unsigned
*
)
UART_TX
=
c
;
*
(
volatile
unsigned
*
)
UART_TX
=
c
;
}
}
...
@@ -137,11 +137,14 @@ unreachable(void)
...
@@ -137,11 +137,14 @@ unreachable(void)
int
int
main
(
void
)
main
(
void
)
{
{
SUPERVISOR
->
wd_key
=
WD_KEY
;
uart_init
();
uart_init
();
uart_puts
(
"Rst: "
);
uart_puts
(
"Rst: "
);
unsigned
v
=
SUPERVISOR
->
reset_cause
;
unsigned
v
=
SUPERVISOR
->
reset_cause
;
uart_put_hex_digit
(
v
&
0x0f
);
uart_put_hex_digit
(
v
&
0x0f
);
uart_puts
(
", tst: "
);
uart_put_hex_digit
(
next_test
);
uart_putc
(
'\n'
);
uart_putc
(
'\n'
);
if
(
v
==
0
)
if
(
v
==
0
)
...
...
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