startup_gen_24.0.0_73ac30e1/testsuite/tests/boards/stm32f407_disco/src/test-ram.ads

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
with Interfaces;              use Interfaces;
with System;                  use System;
with System.Storage_Elements; use System.Storage_Elements;

package Test is

   Start : constant Unsigned_32;
   pragma Import (C, Start, "Reset_Handler");

   --  This vector inserted in the flash_rodata section is supposed to be
   --  allocated at the address zero, and will be used by QEMU to find the
   --  reset PC address and stack pointer.
   Boot_Vect : constant array (1 .. 2) of Address :=
     (Null_Address,  -- Stack pointer
      Start'Address) -- Reset address
     with Linker_Section => ".flash_rodata";

   procedure Check_Memories;

   function In_CCM (Addr : System.Address) return Boolean
   is (To_Integer (Addr) in 16#10000000# .. 16#10000000# + 64 * 1024);

   function In_SRAM (Addr : System.Address) return Boolean
   is (To_Integer (Addr) in 16#20000000# .. 16#20000000# + 128 * 1024);

   function In_FLASH (Addr : System.Address) return Boolean
   is (To_Integer (Addr) in 16#08000000# .. 16#08000000# + 1024 * 1024);

end Test;