GRMON3-UM
June 2019, Version 3.1.0
34 www.cobham.com/gaisler
3.10. EDAC protection
3.10.1. Using EDAC protected memory
Some LEON Fault-Tolerant (FT) systems use EDAC protected memory. To enable the memory EDAC during ex-
ecution, GRMON should be started with the -edac switch. Before any application is loaded, the wash command
might be issued to write all RAM memory locations and thereby initialize the EDAC check-sums. If a LEON CPU
is present in the system GRMON will instruct the CPU to clear memory, clearing memory on a CPU-less system
over a slow debug-link can be very time consuming.
$ grmon -edac
...
grmon3> wash
40000000 8.0MB / 8.0MB [===============>] 100%
60000000 256.0MB / 256.0MB [===============>] 100%
Finished washing!
By default wash writes to all EDAC protected writable memory (SRAM, SDRAM, DDR, etc.) areas which has
been detected or forced with a command line switch. start and stop parameters can also be given to wash a range.
Washing memory with EDAC disabled will not generate check bits, however it can be used to clear or set a memory
region even if the memory controller does not implement EDAC.
grmon3> wash 0x40000000 0x41000000
40000000 16.0MB / 16.0MB [===============>] 100%
Finished washing!
If the memory controller has support for EDAC with 8-bit wide SRAM memory, the upper part of the memory
will consist of check bits. In this case the wash will only write to the data area (the check bits will automatically
be written by the memory controller). The amount of memory written will be displayed in GRMON.
GRMON will not automatically write the check bits for flash PROMs. For 8-bit flash PROMs, the check bits can
be generated by the mkprom2 utility and included in the image. But for 32-bit flash PROMs the check bits must
be written by the user via the TCB field in MCFG3.
3.10.2. LEON3-FT error injection
All RAM blocks (cache and register-file memory) in LEON3-FT are Single Event Upset (SEU) protected. Error
injection function emulates SEU in LEON3-FT memory blocks and lets the user test the fault-tolerant operation of
LEON3-FT by inserting random bit errors in LEON3-FT memory blocks during program execution. An injected
error flips a randomly chosen memory bit in one of the memory blocks, effectively emulating a SEU. The user
defines error rate and can choose between two error distribution modes:
1. Uniform error distribution mode. The 'ei un NR T' command instructs GRMON to insert NR errors during
the time period of T minutes. After T minutes has expired no more errors are inserted, but the application
will continue its execution.
2. Average error rate mode. With the 'ei av R' command the user selects at which rate errors are injected.
Average error rate is R errors per second. Randomly generated noise is added to every error injection sample.
The time between two samples vary between zero up to two periods depending on the noise, where one
period is 1/R seconds. Errors are inserted during the whole program execution.
GRMON can also perform error correction monitoring and report error injection statistics including number of
detected and injected errors and error coverage, see ei command reference.
Error injection is performed during the run-loop of GRMON, to improve the performance and accuracy other
services in the run-loop should be disabled. For example profiling and UART tunneling should be disabled, and
one should select the fastest debug-link.
grmon> load rtems-tasks
40000000, .text 113.9kB / 113.9kB [===============>] 100%
4001c7a0, .data 2.7kB / 2.7kB [===============>] 100%
Total size: 116.56kB (786.00kbit/s)
Entry point 0x40000000
Image /home/daniel/examples/v8/stanford.exe loaded
grmon> ei un 100 1
Error injection enabled
100 errors will be injected during 1.0 min