-------------------------------------------------- ------------------------------ -- -- -- 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;