GR712RC unit tests 1.0
Bare-metal C++ hardware tests for the PLATO DPU (IAA-CSIC, 2019)
Loading...
Searching...
No Matches
memory_single_access.cpp
Go to the documentation of this file.
1
19
20#include <cstdint>
21#include <mcal/mcal.h>
22
23int 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
42
43 if ((*memory_position) != def_pattern)
44 return 1;
45 }
46
47 return 0;
48}
Microcontroller abstraction layer.
int main()
void flush()
Definition mcal_cpu.h:28
constexpr std::uint32_t mem_base_addr
Definition mcal_reg.h:16
constexpr std::uint32_t mem_end_addr
Definition mcal_reg.h:17
void init(config_type *)
Definition mcal.cpp:12