Commit b9fe60b0 authored by Maxime Perrotin's avatar Maxime Perrotin

Fix buildsupport.gpr and prepare new AST

parent c376d36e
......@@ -16,11 +16,11 @@ checkVersion:
$(exec): $(sources)
ifeq ($(UNAME), Linux)
@echo "package buildsupport_version is" > ada/buildsupport_version.ads.new
@echo -n "buildsupport_release : constant string := \"" >> ada/buildsupport_version.ads.new
@echo "package Buildsupport_Version is" > ada/buildsupport_version.ads.new
@echo -n " Buildsupport_Release : constant String := \"" >> ada/buildsupport_version.ads.new
@git log --oneline | head -1 | cut -f1 -d' ' | tr -d '\012' >> ada/buildsupport_version.ads.new
@echo "\";" >> ada/buildsupport_version.ads.new
@echo -n "end buildsupport_version;" >> ada/buildsupport_version.ads.new
@echo -n "end Buildsupport_Version;" >> ada/buildsupport_version.ads.new
@if [ ! -f "ada/buildsupport_version.ads" ] ; then \
mv ada/buildsupport_version.ads.new ada/buildsupport_version.ads; \
else \
......@@ -39,7 +39,8 @@ endif
#clang -c -Wall -Werror -Iinclude c/*.c
$(CC) -c -W -g3 -g -Wall -Werror -Wextra -Werror=format-security -Wconversion -Wno-deprecated -Winit-self -Wsign-conversion -Wredundant-decls -Wvla -Wshadow -Wlogical-op -Wmissing-include-dirs -Winit-self -Wpointer-arith -Wcast-qual -Wcast-align -Wno-error=old-style-cast -Wundef -std=c99 -pedantic -Iinclude c/*.c
mv *.o tmpBuild/
ADA_PROJECT_PATH=`ocarina-config --prefix`/lib/gnat:$$ADA_PROJECT_PATH $(gnatpath)gnatmake -x -g $(exec) -p -P buildsupport.gpr -XBUILD="debug"
#ADA_PROJECT_PATH=`ocarina-config --prefix`/lib/gnat:$$ADA_PROJECT_PATH $(gnatpath)gnatmake -x -g $(exec) -p -P buildsupport.gpr -XBUILD="debug"
ADA_PROJECT_PATH=`ocarina-config --prefix`/lib/gnat:$$ADA_PROJECT_PATH $(gnatpath)gprbuild -x -g $(exec) -p -P buildsupport.gpr -XBUILD="debug"
# strip $(exec)
install:
......
......@@ -11,8 +11,10 @@ with Ada.Strings.Unbounded,
GNAT.OS_Lib,
Errors,
Locations,
Ocarina.Namet,
Ocarina.Types,
-- Ocarina.Namet,
-- Ocarina.Types,
Namet,
Types,
System.Assertions,
Ocarina.Analyzer,
Ocarina.Backends.Properties,
......@@ -36,8 +38,10 @@ use Ada.Strings.Unbounded,
Ada.Text_IO,
Ada.Characters.Handling,
Locations,
Ocarina.Namet,
Ocarina.Types,
-- Ocarina.Namet,
-- Ocarina.Types,
Namet,
Types,
Ocarina,
Ocarina.Analyzer,
Ocarina.Backends.Properties,
......
......@@ -5,7 +5,8 @@
with Ada.Text_IO;
with GNAT.OS_Lib;
with Ocarina.Namet;
-- with Ocarina.Namet;
with Namet;
with Ocarina.Configuration;
with Ocarina.AADL_Values;
with Ocarina.Instances.Queries;
......@@ -19,7 +20,8 @@ package body Buildsupport_Utils is
use Ada.Text_IO;
use GNAT.OS_Lib;
use Ocarina.Namet;
-- use Ocarina.Namet;
use Namet;
use Ocarina.Instances.Queries;
use Ocarina.ME_AADL.AADL_Instances.Nodes;
use Ocarina.ME_AADL.AADL_Instances.Nutils;
......
......@@ -4,16 +4,22 @@
-- Set of helper functions for buildsupport
with Ocarina,
Ocarina.Types,
-- Ocarina.Types,
Types,
Ocarina.Backends.Properties,
Ada.Containers.Indefinite_Ordered_Maps,
Ada.Containers.Vectors;
Ada.Containers.Indefinite_Vectors,
Ada.Strings.Unbounded;
use Ocarina,
Ada.Containers;
Ocarina.Backends.Properties,
Ada.Containers,
Ada.Strings.Unbounded;
package Buildsupport_Utils is
use Ocarina.Types;
-- use Ocarina.Types;
use Types;
procedure Banner;
......@@ -33,8 +39,7 @@ package Buildsupport_Utils is
Sporadic_Operation,
Unknown_Operation);
function Get_RCM_Operation_Kind
(E : Node_Id)
function Get_RCM_Operation_Kind (E : Node_Id)
return Supported_RCM_Operation_Kind;
function Get_RCM_Operation (E : Node_Id) return Node_Id;
......@@ -61,7 +66,8 @@ package Buildsupport_Utils is
ASN1_Unknown);
package Property_Maps is new Indefinite_Ordered_Maps (String, String);
package String_Vectors is new Vectors (Natural, String);
use Property_Maps;
package String_Vectors is new Indefinite_Vectors (Natural, String);
function Get_ASN1_Basic_Type (E : Node_Id) return Supported_ASN1_Basic_Type;
......@@ -75,25 +81,64 @@ package Buildsupport_Utils is
function Get_Properties_Map (D : Node_Id) return Property_Maps.Map;
type Taste_Interface is
-- Types needed to build the AST of the TASTE Interface View in Ada
type Parameter_Direction is (param_in, param_out);
type ASN1_Parameter is
record
null;
Name : Unbounded_String;
Sort : Unbounded_String;
ASN1_Module : Unbounded_String;
ASN1_Basic_Type : Supported_ASN1_Basic_Type;
ASN1_File_Name : Unbounded_String;
Encoding : Supported_ASN1_Encoding;
Direction : Parameter_Direction;
end record;
subtype Taste_Provided_Interface is Taste_Interface;
subtype Taste_Required_Interface is Taste_Interface;
package Parameters is new Indefinite_Vectors (Natural, ASN1_Parameter);
package Interfaces is new Vectors (Natural, Taste_Interface);
type Taste_Interface is
record
Name : Unbounded_String;
In_Parameters : Parameters.Vector;
Out_Parameters : Parameters.Vector;
RCM : Supported_RCM_Operation_Kind;
Period_Or_MIAT : Natural;
WCET : Natural;
WCET_Unit : Unbounded_String;
Queue_Size : Natural;
end record;
package Interfaces is new Indefinite_Vectors (Natural, Taste_Interface);
type Taste_Function is
type Taste_Terminal_Function is
record
Name_Full_Case : String;
Name : Unbounded_String;
Language : Supported_Source_Language;
Zip_File : String;
Zip_File : Unbounded_String;
Context_Params : Property_Maps.Map;
Timers : String_Vectors.Vector;
Provided : Interfaces.Vector;
Required : Interfaces.Vector;
end record;
package Functions is new Indefinite_Vectors (Natural,
Taste_Terminal_Function);
type Connection is
record
Source_Function : Taste_Terminal_Function;
Dest_Function : Taste_Terminal_Function;
Source_RI : Taste_Interface;
Dest_PI : Taste_Interface;
end record;
package Channels is new Indefinite_Vectors (Natural, Connection);
type Complete_Interface_View is limited
record
Flat_Functions : Functions.Vector;
Connections : Channels.Vector;
end record;
end Buildsupport_Utils;
......@@ -2,7 +2,8 @@
-- (c) 2015 European Space Agency - maxime.perrotin@esa.int
-- LGPL license, see LICENSE file
with Ocarina.Types; use Ocarina.Types;
-- with Ocarina.Types; use Ocarina.Types;
with Types; use Types;
package Imported_Routines is
......
......@@ -9,10 +9,11 @@ project BuildSupport is
for Main use ("buildsupport.adb");
for Languages use ("Ada", "C");
for Source_Files use ("c_backend.c", "sdl_gateway.c", "my_types.h",
"build_sdl_glue.c", "imported_routines.ads", "buildsupport.adb",
"buildsupport_utils.ads", "buildsupport_utils.adb",
"simulink_gateway.c");
for Source_Files use ("imported_routines.ads",
"buildsupport.adb",
"buildsupport_utils.ads",
"buildsupport_utils.adb",
"buildsupport_version.ads");
package Builder is
for Default_Switches ("ada") use ("-m");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment