Repository navigation
Expand file tree
/
Copy pathtests.gpr
More file actions
90 lines (79 loc) · 2.76 KB
/
Copy pathtests.gpr
File metadata and controls
90 lines (79 loc) · 2.76 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
with "config/tests_config.gpr";
with "stm32l0xx_cmsis.gpr";
project Tests is
-- The list of languages of the sources of the project.
for Languages use ("Ada", "ASM_CPP");
-- Target platform and Runtime environment
for Target use "arm-eabi";
for Runtime ("Ada") use "light-cortex-m0p";
for Source_Dirs use ("src/", "config/");
for Object_Dir use "obj/" & Tests_Config.Build_Profile;
for Create_Missing_Dirs use "True";
for Exec_Dir use "bin/";
for Main use ("tests.adb");
package Builder is
for Switches ("tests") use ("--create-map-file");
for Executable_Suffix use ".elf";
for Global_Configuration_Pragmas use "tests.adc";
end Builder;
package Compiler is
Switches := Tests_Config.Ada_Compiler_Switches;
case Tests_Config.Build_Profile is
when "development" =>
Switches := Switches &
("-gnatw_a", "-gnatwc", "-gnatVd", "-gnatVa", "-gnatr",
"-gnatyy", "-fgnat-encodings=gdb");
when "validation" =>
Switches := Switches &
("-gnatw_a", "-gnatwc", "-gnatVd", "-gnatyy",
"-fno-strict-aliasing");
when "release" =>
Switches := Switches & ("-gnatyy", "-fno-strict-aliasing");
end case;
for Default_Switches ("Ada") use Switches;
end Compiler;
package Binder is
for Switches ("Ada") use ("-Es"); -- Symbolic traceback
end Binder;
package Linker is
for Switches ("Ada") use (
"-T", "aunit.ld",
"-T", Stm32l0xx_Cmsis.Linker.Default_Script,
"-Wl,--print-memory-usage",
"-Wl,--gc-sections");
end Linker;
type Emulation_Mode_Type is ("run", "debug");
package Emulator is
Mode : Emulation_Mode_Type := external ("EMU_MODE", "run");
Switches := (
"--eargs"
, "-monitor", "none"
, "-serial", "none"
, "--semihosting-config", "enable=on,target=native"
, "--eargs-end"
, "--add-memory="
& "name=FLASH"
& ",read-only=on"
& ",size=" & Stm32l0xx_Cmsis.Flash_Size
& ",addr=" & Stm32l0xx_Cmsis.Flash_Addr
, "--add-memory="
& "name=SRAM"
& ",size=" & Stm32l0xx_Cmsis.Sram_Size
& ",addr=" & Stm32l0xx_Cmsis.Sram_Addr
, "--add-memory="
& "name=AUNIT_FLASH,read-only=on,size=0x00100000,addr=0x60000000"
, "--add-memory="
& "name=AUNIT_SRAM,size=0x00100000,addr=0x70000000"
, "--serial=null"
);
case Mode is
when "debug" =>
Switches := Switches & (
"--gdb=4444",
"--freeze-on-startup"
);
when others => null;
end case;
for Switches use Switches;
end Emulator;
end Tests;