-------------------------------------------------- ------------------------------ -- -- -- OCARINA COMPONENTS -- -- -- -- O C A R I N A . G E N E R A T O R S . P R O P E R T I E S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2007, GET-Telecom Paris. -- -- -- -- Ocarina is free software; you can redistribute it and/or modify -- -- it under terms of the GNU General Public License as published by the -- -- Free Software Foundation; either version 2, or (at your option) any -- -- later version. Ocarina is distributed in the hope that it will be -- -- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -- -- Public License for more details. You should have received a copy of the -- -- GNU General Public License distributed with Ocarina; see file COPYING. -- -- If not, write to the Free Software Foundation, 51 Franklin Street, Fifth -- -- Floor, Boston, MA 02111-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- Ocarina is maintained by the Ocarina team -- -- (ocarina-users@listes.enst.fr) -- -- -- ------------------------------------------------------------------------------ -- This packege contains the Ada-side definition of all AADL -- properties that are relevent to the code generation. It extracts -- brute information and doeas only sonsistency check. package Ocarina.Generators.Properties is type Name_Array is array (Nat range <>) of Name_Id; -- Common types to several components and entities type Size_Units is (Bit, Byte, Kilo_Byte, Mega_Byte, Giga_Byte); type Size_Type is record S : Unsigned_Long_Long; U : Size_Units; end record; type Supported_Source_Language is ( Language_Ada_95, Language_ASN1, Language_C, Language_Lustre, Language_None); function Get_Source_Language (E : Node_Id) return Supported_Source_Language; -- Return the language of the entity instance (subprogram, thread, -- data, port, etc...) implementation. Language_None is returned -- if no language has been specified bu the user. It is up to the -- user to interpret it as an error or to assign a default value. function Get_Source_Text (E : Node_Id) return Name_Array; -- Return the list of files (source, objects or libraries) -- involved in the implementation of the entity E (data -- subprogram, thread, port, etc...). function Get_Source_Name (E : Node_Id) return Name_Id; -- Return the implementation name of the entity instance E (data -- subprogram, thread, port, etc...). No_Name is returned if no -- implementation has been specified by the user. function Get_Type_Source_Name (E : Node_Id) return Name_Id; -- Return the implementation name of the entity instance E (data -- subprogram, thread, port, etc...). No_Name is returned if no -- implementation has been specified by the user. ------------------------------- -- Data Component Properties -- ------------------------------- -- Supported data types type Supported_Data_Type is ( Data_Integer, Data_Boolean, Data_Float, Data_Fixed, Data_String, Data_Wide_String, Data_Character, Data_Wide_Character, Data_Array, Data_Record, Data_With_Accessors, Data_None); -- Leads to an error type Supported_Data_Access is ( Access_Read_Only, Access_Write_Only, Access_Read_Write, Access_By_Method, Access_None); type Supported_Concurrency_Control_Protocol is ( Concurrency_NoneSpecified, Concurrency_Protected_Access, Concurrency_Priority_Ceiling); function Get_Data_Type (D : Node_Id) return Supported_Data_Type; -- Return the data type of a data component. If no data type has -- been specified by the user, returns Data_None. function Get_Data_Digits (D : Node_Id) return Unsigned_Long_Long; -- Return the value of the "data_digits" aadl property of a data -- component. Return 0 if the property is not defined for the -- component. function Get_Data_Scale (D : Node_Id) return Unsigned_Long_Long; -- Return the value of the "data_scale" aadl property of a data -- component. Return 0 if the property is not defined for the -- component. function Get_Data_Size (D : Node_Id) return Size_Type; -- Return the size of the data function Get_Provided_Data_Access (D : Node_Id) return Supported_Data_Access; -- Return the provided data access of a data component instance -- D. Access_None is returned when the provided data access -- property is not defined for D. function Get_Priority_Celing_Of_Data_Access (D : Node_Id) return Unsigned_Long_Long; -- Return the prioriry associated to the data component. Otherwise, -- return 0. function Get_Required_Data_Access (D : Node_Id) return Supported_Data_Access; -- Return the required data access of a data component instance -- D. Access_None is returned when the required data access -- property is not defined for D. function Get_Data_Length (D : Node_Id) return Unsigned_Long_Long; -- Return the maximum length for [wide] string types and the -- length for an array. function Get_Concurrency_Protocol (D : Node_Id) return Supported_Concurrency_Control_Protocol; -- Return the concurrency protocol of a data type with -- accessors. Return Concurrency_NoneSpecified if the property is -- not defined. --------------------------------- -- Thread Component Properties -- --------------------------------- type Supported_Thread_Dispatch_Protocol is ( Thread_Periodic, Thread_Aperiodic, Thread_Sporadic, Thread_None); type Time_Units is ( Picosecond, Nanosecond, Microsecond, Millisecond, Second, Minute, Hour); type Time_Type is record T : Unsigned_Long_Long; U : Time_Units; end record; type Supported_Thread_Implementation is ( Thread_With_Call_Sequence, Thread_With_Compute_Entrypoint, Thread_With_Port_Compute_Entrypoint, Thread_Unknown); function Get_Thread_Dispatch_Protocol (T : Node_Id) return Supported_Thread_Dispatch_Protocol; -- Return the dispatching protocol of a given thread component. If -- no protocol has been specified by the user, then return -- Thread_None. function Get_Thread_Period (T : Node_Id) return Time_Type; -- Return the period (for periodic threads) or the minumum -- dispatch interval (for sporadic threads). The retuned value is -- converted to the closest time unit depending on its unit in -- AADL. Raises an error if the thread is not periodic nor -- sporadic. function Get_Thread_Priority (T : Node_Id) return Unsigned_Long_Long; -- Return the thread priority given by the user. Otherwise, return -- 0. function Get_Min_Priority return Unsigned_Long_Long; function Get_Max_Priority return Unsigned_Long_Long; -- Return the bounds of the AADL type representing the thread -- priorities. These function must be called after a first call to -- Get_Thread_Priority. function Get_Thread_Stack_Size (T : Node_Id) return Size_Type; -- Return the storage size of a thread component. The returned -- value is associated with its unit given in the AADL model. If -- the user did not give a storage size value, then returns 0 bits. function Get_Thread_Implementation_Kind (T : Node_Id) return Supported_Thread_Implementation; -- Return the kind of the thread implementation. Return -- Thread_Unknown if no valid kind can be deduced. function Get_Thread_Compute_Entrypoint (T : Node_Id) return Name_Id; -- Return the compute entry point of the given thread. Return -- No_Name in case the property is not defined for the thread. ------------------------------------- -- Subprogram Component Properties -- ------------------------------------- type Supported_Subprogram_Kind is ( Subprogram_Unknown, Subprogram_Empty, Subprogram_Opaque_Ada_95, Subprogram_Opaque_C, Subprogram_Opaque_ASN1_Wrapped, Subprogram_Pure_Call_Sequence, Subprogram_Hybrid_Ada_95); function Get_Subprogram_Kind (S : Node_Id) return Supported_Subprogram_Kind; -- Return the kind of a subprogram depending on its internal -- structure. Subprogram_Unknown is returned if the subprogram -- kind cannot be deduced. ---------------------------------- -- Process Component Properties -- ---------------------------------- function Get_Bound_Processor (P : Node_Id) return Node_Id; -- Return the processor component to which the process P is -- bound. Raises an error if P is not bound to any processor. function Get_Process_Port_Number (P : Node_Id) return Value_Id; -- Return the port number of the process P function Get_Process_Id (P : Node_Id) return Value_Id; -- Return the process id of the process P function Get_Channel_Address (P : Node_Id) return Value_Id; -- Return the address of the SpaceWire channel of the process P ------------------------------------ -- Processor Component Properties -- ------------------------------------ type Supported_Execution_Platform is ( Platform_Native, Platform_LEON_RTEMS, Platform_LEON_ORK, Platform_ERC32_ORK, Platform_ARM_DSLINUX, Platform_ARM_N770, Platform_None); -- Unspecified function Get_Execution_Platform (P : Node_Id) return Supported_Execution_Platform; -- Return the execution platform of the given processor P function Get_Processor_Location (P : Node_Id) return Name_Id; -- Return the location of the processor P. No_Name is returned if -- the processor to which O is mapped does not have a location and -- an error is raised if P is not mapped to any processor. -------------------------------- -- AADL Connection Properties -- -------------------------------- function Get_Bound_Bus (C : Node_Id) return Node_Id; -- Return the bus component to which the connection C is -- bound. Raises an error if C is not bound to any bus or if it -- cannot be bound to any bus. ------------------------------ -- Bus Component Properties -- ------------------------------ type Supported_Transport_APIs is ( Transport_BSD_Sockets, Transport_SpaceWire, Transport_None); -- Leads to and error function Get_Transport_API (B : Node_Id) return Supported_Transport_APIs; -- Return the transport layer supported by the bus B ---------------------- -- Port properties -- ---------------------- Default_Queue_Size : constant := 16; -- FIXME: Find a way to fetch the value from AADL_Project function Get_Queue_Size (P : Node_Id) return Long_Long; -- Retunr the size of the queue correspodning to and event [data] -- port. Return -1 if non specified by the user. function Get_Port_Compute_Entrypoint (P : Node_Id) return Name_Id; -- Return the compute entry point of the given port. Return -- No_Name in case the property is not defined for the port. --------------------------------- -- System component properties -- --------------------------------- type Protocol_Type is (Protocol_IIOP, Protocol_DIOP, Protocol_None); function Get_Protocol (S : Node_Id) return Protocol_Type; -- Return the protocol of a distributed application. ---------- -- Misc -- ---------- procedure Init; -- Initialize some internal parts of the package No_Value : constant Value_Id := 0; -- Used to indicate a null value. This value does not depend on -- whether we use AADL values or other language values. private Empty_Array : constant Name_Array (1 .. 0) := (others => No_Name); end Ocarina.Generators.Properties;