Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
DIOT Igloo2-based radiation-tolerant System Board
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
7
Issues
7
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Projects
DIOT Igloo2-based radiation-tolerant System Board
Commits
3b37a9f3
Commit
3b37a9f3
authored
Mar 14, 2023
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plc_urv: add app_counter application
parent
88f7ef82
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
1 deletion
+55
-1
Makefile
sw/plc_urv/Makefile
+1
-1
app_counter.c
sw/plc_urv/app_counter.c
+54
-0
No files found.
sw/plc_urv/Makefile
View file @
3b37a9f3
...
@@ -7,7 +7,7 @@ OBJDUMP = $(CROSS_COMPILE)objdump
...
@@ -7,7 +7,7 @@ OBJDUMP = $(CROSS_COMPILE)objdump
OBJCOPY
=
$(CROSS_COMPILE)
objcopy
OBJCOPY
=
$(CROSS_COMPILE)
objcopy
SIZE
=
$(CROSS_COMPILE)
size
SIZE
=
$(CROSS_COMPILE)
size
PROG
=
plc_mbox
PROG
=
app_counter
CFLAGS
=
-mabi
=
ilp32
-march
=
rv32im
-Wa
,-march
=
rv32im_zicsr
-Os
-Wall
-ffreestanding
-fno-delete-null-pointer-checks
-I
../include
CFLAGS
=
-mabi
=
ilp32
-march
=
rv32im
-Wa
,-march
=
rv32im_zicsr
-Os
-Wall
-ffreestanding
-fno-delete-null-pointer-checks
-I
../include
OBJS
=
crt0.o
$(PROG)
.o
OBJS
=
crt0.o
$(PROG)
.o
...
...
sw/plc_urv/app_counter.c
0 → 100644
View file @
3b37a9f3
#include "common-app.h"
static
unsigned
counter
;
void
init
(
void
)
{
REGS
->
mailboxes
.
mboxout
=
0
;
/* Enable scrubber */
SUPERVISOR
->
scrub_cfg
=
HYDRA_SUPERVISOR_REGS_SCRUB_CFG_IRAM_EN
|
HYDRA_SUPERVISOR_REGS_SCRUB_CFG_DRAM_EN
;
counter
=
0
;
}
void
main
(
void
)
{
unsigned
mbi
=
REGS
->
mailboxes
.
mboxin
;
/* written by mgmt */
unsigned
mbo
=
REGS
->
mailboxes
.
mboxout
;
/* written by app */
unsigned
rwslot
=
(
mbi
>>
8
)
&
0xff
;
/* Remote slots (read from). */
unsigned
rrslot
=
mbo
&
0xff
;
unsigned
lwslot
=
(
mbo
>>
8
)
&
0xff
;
/* Local slots (write to). */
unsigned
lrslot
=
mbi
&
0xff
;
unsigned
lnslot
=
(
lwslot
+
1
)
&
3
;
volatile
uint32_t
*
src
;
volatile
uint32_t
*
dst
;
/* Watchdog */
SUPERVISOR
->
wd_key
=
WD_KEY
;
/* Something to read. */
if
(
rrslot
!=
rwslot
)
{
src
=
&
REGS
->
sh_mem
[
rrslot
<<
5
];
counter
=
src
[
1
];
mbo
=
(
mbo
+
0x01
)
&
0xffffff03
;
}
if
(
lnslot
!=
lrslot
)
{
/* Free slot, send. */
dst
=
&
REGS
->
sh_mem
[
128
+
(
lwslot
<<
5
)];
dst
[
0
]
=
0x80
;
dst
[
1
]
=
counter
;
counter
++
;
mbo
=
(
mbo
+
0x100
)
&
0xffff03ff
;
}
REGS
->
mailboxes
.
mboxout
=
mbo
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment