Compare commits

...

2 Commits

Author SHA1 Message Date
Maxim Reznik e4e1148eb9 Limit Python version to 3.11 in the GitHub Action
as the distutils package has been removed in Python version 3.12.
2023-12-01 14:45:54 +02:00
Maxim Reznik f5f17346d8 Move 'for Target use xxx;' up
to fix loading project in VSCode extension and avoid

> error: cannot set configuration attribute "Target" after it was referenced

See details in GPR issue #166.
2023-12-01 14:45:54 +02:00
32 changed files with 43 additions and 34 deletions

View File

@ -28,7 +28,7 @@ jobs:
- name: Install Python 3.x (required for the testsuite)
uses: actions/setup-python@v2
with:
python-version: '3.x'
python-version: '3.11'
- run: python3 $PWD/scripts/build_all_examples.py
- run: python3 $PWD/testsuite/run.py

View File

@ -8,6 +8,7 @@ library project HiFive1_ZFP is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "riscv32-elf";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project HiFive1_ZFP is
for Library_Name use "ada_drivers_library";
Linker_Switches := ("-T", Project'Project_dir & "/src/zfp/link.ld");
for Target use "riscv32-elf";
for Runtime ("Ada") use "light-rv32imac";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project HiFive1_rev_B_ZFP is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "riscv32-elf";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project HiFive1_rev_B_ZFP is
for Library_Name use "ada_drivers_library";
Linker_Switches := ("-T", Project'Project_dir & "/src/zfp/link.ld");
for Target use "riscv32-elf";
for Runtime ("Ada") use "light-rv32imac";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project MicroBit_ZFP is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project MicroBit_ZFP is
for Library_Name use "ada_drivers_library";
Linker_Switches := ("-T", Project'Project_dir & "/src/zfp/link.ld");
for Target use "arm-eabi";
for Runtime ("Ada") use "light-cortex-m0";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project NRF52_DK_ZFP is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project NRF52_DK_ZFP is
for Library_Name use "ada_drivers_library";
Linker_Switches := ("-T", Project'Project_dir & "/src/zfp/link.ld");
for Target use "arm-eabi";
for Runtime ("Ada") use "light-cortex-m4f";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project OpenMV2_Full is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project OpenMV2_Full is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "arm-eabi";
for Runtime ("Ada") use "embedded-openmv2";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project OpenMV2_SFP is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project OpenMV2_SFP is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "arm-eabi";
for Runtime ("Ada") use "light-tasking-openmv2";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project Unleashed_Full is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "riscv32-elf";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project Unleashed_Full is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "riscv32-elf";
for Runtime ("Ada") use "embedded-unleashed";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project Unleashed_SFP is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "riscv32-elf";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project Unleashed_SFP is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "riscv32-elf";
for Runtime ("Ada") use "light-tasking-unleashed";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project Unleashed_ZFP is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "riscv32-elf";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project Unleashed_ZFP is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "riscv32-elf";
for Runtime ("Ada") use "light-unleashed";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project Crazyflie_Full is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project Crazyflie_Full is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "arm-eabi";
for Runtime ("Ada") use "embedded-stm32f4";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project Crazyflie_SFP is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project Crazyflie_SFP is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "arm-eabi";
for Runtime ("Ada") use "light-tasking-stm32f4";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project Feather_STM32F405_Full is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project Feather_STM32F405_Full is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "arm-eabi";
for Runtime ("Ada") use "embedded-feather_stm32f405";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project Feather_STM32F405_SFP is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project Feather_STM32F405_SFP is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "arm-eabi";
for Runtime ("Ada") use "light-tasking-feather_stm32f405";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project NUCLEO_F446ZE_Full is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project NUCLEO_F446ZE_Full is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "arm-eabi";
for Runtime ("Ada") use "embedded-stm32f4";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project NUCLEO_F446ZE_SFP is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project NUCLEO_F446ZE_SFP is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "arm-eabi";
for Runtime ("Ada") use "light-tasking-stm32f4";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project STM32_H405_Full is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project STM32_H405_Full is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "arm-eabi";
for Runtime ("Ada") use "embedded-stm32f4";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project STM32_H405_SFP is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project STM32_H405_SFP is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "arm-eabi";
for Runtime ("Ada") use "light-tasking-stm32f4";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project STM32F407_Discovery_Full is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project STM32F407_Discovery_Full is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "arm-eabi";
for Runtime ("Ada") use "embedded-stm32f4";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project STM32F407_Discovery_SFP is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project STM32F407_Discovery_SFP is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "arm-eabi";
for Runtime ("Ada") use "light-tasking-stm32f4";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project STM32F429_Discovery_Full is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project STM32F429_Discovery_Full is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "arm-eabi";
for Runtime ("Ada") use "embedded-stm32f429disco";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project STM32F429_Discovery_SFP is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project STM32F429_Discovery_SFP is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "arm-eabi";
for Runtime ("Ada") use "light-tasking-stm32f429disco";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project STM32F469_Discovery_Full is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project STM32F469_Discovery_Full is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "arm-eabi";
for Runtime ("Ada") use "embedded-stm32f469disco";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project STM32F469_Discovery_SFP is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project STM32F469_Discovery_SFP is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "arm-eabi";
for Runtime ("Ada") use "light-tasking-stm32f469disco";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project STM32F4XX_M_Full is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project STM32F4XX_M_Full is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "arm-eabi";
for Runtime ("Ada") use "embedded-stm32f4";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project STM32F4XX_M_SFP is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project STM32F4XX_M_SFP is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "arm-eabi";
for Runtime ("Ada") use "light-tasking-stm32f4";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project STM32F746_Discovery_Full is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project STM32F746_Discovery_Full is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "arm-eabi";
for Runtime ("Ada") use "embedded-stm32f746disco";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project STM32F746_Discovery_SFP is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project STM32F746_Discovery_SFP is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "arm-eabi";
for Runtime ("Ada") use "light-tasking-stm32f746disco";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project STM32F769_Discovery_Full is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project STM32F769_Discovery_Full is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "arm-eabi";
for Runtime ("Ada") use "embedded-stm32f769disco";
package Device_Configuration is

View File

@ -8,6 +8,7 @@ library project STM32F769_Discovery_SFP is
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
for Target use "arm-eabi";
Target := Project'Target;
-- Callgraph info is not available on all architectures
@ -61,7 +62,6 @@ library project STM32F769_Discovery_SFP is
for Library_Name use "ada_drivers_library";
Linker_Switches := ();
for Target use "arm-eabi";
for Runtime ("Ada") use "light-tasking-stm32f769disco";
package Device_Configuration is

View File

@ -59,10 +59,9 @@ class Database:
return out
def gpr_configuration(self, src_root_dir, extra_source_dir):
out = ""
def target(self):
arch = self.get_config("Architecture")
runtime = self.get_config("Runtime_Name")
target = ""
if arch is not None and arch != "Native":
if arch == "ARM":
@ -70,7 +69,12 @@ class Database:
elif arch == "RISC-V":
target = "riscv32-elf"
out += " for Target use \"%s\";\n" % target
return target
def gpr_configuration(self, src_root_dir, extra_source_dir):
out = ""
arch = self.get_config("Architecture")
runtime = self.get_config("Runtime_Name")
if runtime is not None:
out += " for Runtime (\"Ada\") use \"%s\";\n" % runtime

View File

@ -192,6 +192,11 @@ def ADL_configuration(config, project_directory, project_name,
Build_Checks : Build_Checks_Type := external ("ADL_BUILD_CHECKS", "Disabled");
-- Target architecture
"""
gpr += ' for Target use \"%s\";' % config.target()
gpr += """
Target := Project'Target;
-- Callgraph info is not available on all architectures