GR712RC unit tests
1.0
Bare-metal C++ hardware tests for the PLATO DPU (IAA-CSIC, 2019)
Loading...
Searching...
No Matches
src
app
unit_test
memory_single_access.cpp
Go to the documentation of this file.
1
19
20
#include <cstdint>
21
#include <
mcal/mcal.h
>
22
23
int
main
()
24
{
25
26
constexpr
std::uint32_t def_pattern = 0xA5A5A5A5UL;
27
28
// assert(sdram_memory_size > max_memory); Meter este assert..
29
30
mcal::init
(
nullptr
);
31
32
std::uint32_t *memory_begin_position =
reinterpret_cast<
std::uint32_t *
>
(
mcal::reg::mem_base_addr
);
33
std::uint32_t *memory_end_position =
reinterpret_cast<
std::uint32_t *
>
(
mcal::reg::mem_end_addr
);
34
35
while
(1)
36
{
37
volatile
std::uint32_t *memory_position = memory_begin_position;
38
39
(* memory_position ) = def_pattern;
40
41
mcal::cpu::flush
();
42
43
if
((*memory_position) != def_pattern)
44
return
1;
45
}
46
47
return
0;
48
}
mcal.h
Microcontroller abstraction layer.
main
int main()
Definition
memory_single_access.cpp:23
mcal::cpu::flush
void flush()
Definition
mcal_cpu.h:28
mcal::reg::mem_base_addr
constexpr std::uint32_t mem_base_addr
Definition
mcal_reg.h:16
mcal::reg::mem_end_addr
constexpr std::uint32_t mem_end_addr
Definition
mcal_reg.h:17
mcal::init
void init(config_type *)
Definition
mcal.cpp:12
Generated by
1.15.0