------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Cheddar is a GNU GPL real-time scheduling analysis tool. -- This program provides services to automatically check schedulability and -- other performance criteria of real-time architecture models. -- -- Copyright (C) 2002-2016, Frank Singhoff, Alain Plantec, Jerome Legrand -- -- The Cheddar project was started in 2002 by -- Frank Singhoff, Lab-STICC UMR 6285 laboratory, Université de Bretagne Occidentale -- -- Cheddar has been published in the "Agence de Protection des Programmes/France" in 2008. -- Since 2008, Ellidiss technologies also contributes to the development of -- Cheddar and provides industrial support. -- -- The full list of contributors and sponsors can be found in AUTHORS.txt and SPONSORS.txt -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program 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 -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -- -- Contact : cheddar@listes.univ-brest.fr -- ------------------------------------------------------------------------------ -- Last update : -- $Rev: 1249 $ -- $Date: 2014-08-28 07:02:15 +0200 (Fri, 28 Aug 2014) $ -- $Author: singhoff $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ WITH Ada.Sequential_Io; WITH Io_Tools; USE Io_Tools; PACKAGE BODY Network.Uni_Processor IS PROCEDURE Initialize ( A_Network : IN OUT Monoprocessor_Network) IS BEGIN Reset(A_Network); END Initialize; PROCEDURE Finalize ( A_Network : IN OUT Monoprocessor_Network) IS BEGIN NULL; END Finalize; PROCEDURE Adjust ( A_Network : IN OUT Monoprocessor_Network) IS BEGIN NULL; END Adjust; TYPE Descriptor IS RECORD Reception_Latency_Bound : Natural; Emission_Latency_Bound : Natural; Media_Length : Natural; Name : Unbounded_String; Architecture : Network_Architecture; END RECORD; PROCEDURE Dispatched_Read_From_File ( My_Network : IN OUT Monoprocessor_Network; File_Name : IN Unbounded_String) IS Desc : Descriptor; PACKAGE Uni_File IS NEW Ada.Sequential_Io( Descriptor ); USE Uni_File; A_Uni_File : Uni_File.File_Type; BEGIN Open(A_Uni_File, Mode => In_File, Name => To_String(File_Name)); IF NOT Is_Open(A_Uni_File) THEN RAISE Can_Not_Open_File_For_Reading; END IF; Read(A_Uni_File,Desc); My_Network.Reception_Latency_Bound:=Desc.Reception_Latency_Bound; My_Network.Emission_Latency_Bound:=Desc.Emission_Latency_Bound; My_Network.Media_Length:=Desc.Media_Length; My_Network.Name:=Desc.Name; My_Network.Architecture:=Desc.Architecture; Close(A_Uni_File); END Dispatched_Read_From_File; PROCEDURE Dispatched_Write_To_File ( My_Network : IN Monoprocessor_Network; File_Name : IN Unbounded_String) IS Desc : Descriptor; PACKAGE Uni_File IS NEW Ada.Sequential_Io( Descriptor ); USE Uni_File; A_Uni_File : Uni_File.File_Type; BEGIN Create(A_Uni_File, Mode => Out_File, Name => To_String(File_Name)); IF NOT Is_Open(A_Uni_File) THEN RAISE Can_Not_Open_File_For_Writing; END IF; Desc.Reception_Latency_Bound:=My_Network.Reception_Latency_Bound; Desc.Emission_Latency_Bound:=My_Network.Emission_Latency_Bound; Desc.Media_Length:=My_Network.Media_Length; Desc.Name:=My_Network.Name; Desc.Architecture:=My_Network.Architecture; Write(A_Uni_File,Desc); Close(A_Uni_File); END Dispatched_Write_To_File; PROCEDURE Dispatched_Reset ( My_Network : IN OUT Monoprocessor_Network) IS BEGIN My_Network.Reception_Latency_Bound:=0; My_Network.Emission_Latency_Bound:=0; My_Network.Media_Length:=0; My_Network.Name:=To_Unbounded_String(""); My_Network.Architecture:=Single_Processor; END Dispatched_Reset; PROCEDURE Dispatched_Put ( My_Network : IN Monoprocessor_Network) IS BEGIN NULL; END Dispatched_Put; PROCEDURE Dispatched_Transmission_Delay ( My_Network : IN Monoprocessor_Network; My_Messages : IN Messages_Set; Response_Time : OUT Response_Table) IS BEGIN NULL; END Dispatched_Transmission_Delay; END Network.Uni_Processor;