------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- 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 Tasks; use Tasks; with Caches; use Caches; with CFGs; use CFGs; with Core_Units; use Core_Units; with Task_Set; use Task_Set; with CFG_Set; use CFG_Set; with Cache_Set; use Cache_Set; with Cache_Block_Set; use Cache_Block_Set; with Cache_Access_Profile_Set; use Cache_Access_Profile_Set; with Caches; use Caches.Cache_Blocks_Table_Package; with Basic_Block_Analysis; use Basic_Block_Analysis; with Systems; use Systems; with Debug; use Debug; with unbounded_strings; use unbounded_strings; with Xml_Tag; use Xml_Tag; with GNAT.Current_Exception; use GNAT.Current_Exception; with Sets; with Framework_Config; use Framework_Config; with Translate; use Translate; package body Call_Cache_Framework is procedure Compute_Task_Cache_Access_Profile (Sys : in out System; A_Processor : in Generic_Processor_Ptr; Result : in out Unbounded_String; Output : in Output_Format := String_Output) is A_Cache_Access_Profile : Cache_Access_Profile_Ptr; A_Task : Generic_Task_Ptr; My_Iterator : Tasks_Iterator; begin Put_Debug("Call Compute_Task_Cache_Access_Profile"); Result := To_Unbounded_String (""); if Output = Xml_Output then Set_Tag; else Set_Empty; end if; Result := Result & Lb_Minus & Lb_Compute_Cache_Access_Profile(Current_Language) & To_Unbounded_String (" ") & Lb_Compute_Cache_Access_Profile_Method(Current_Language) & To_Unbounded_String (" (") & To_Unbounded_String ("[20]") & To_Unbounded_String (")") & To_Unbounded_String (" : ") & unbounded_lf & unbounded_lf; -- Task Loop -- reset_iterator (Sys.Tasks, My_Iterator); loop A_Cache_Access_Profile := new Cache_Access_Profile; current_element (Sys.Tasks, A_Task, My_Iterator); if(A_Task.cpu_name = A_Processor.name) then if (A_Task.cfg_name /= empty_string) then Compute_Cache_Access_Profile(Sys => Sys, Task_Name => A_Task.name, A_Cache_Access_Profile => A_Cache_Access_Profile); end if; Result := Result & ASCII.HT & A_Task.name & unbounded_lf; Result := Result & ASCII.HT & ASCII.HT & "UCB: " & ASCII.HT ; for i in 0..a_cache_access_profile.UCBs.Nb_Entries-1 loop Result := Result & a_cache_access_profile.UCBs.Entries(i).cache_block_number'Img & " "; end loop; Result := Result & unbounded_lf; Result := Result & ASCII.HT & ASCII.HT & "ECB: " & ASCII.HT ; for i in 0..a_cache_access_profile.ECBs.Nb_Entries-1 loop Result := Result & a_cache_access_profile.ECBs.Entries(i).cache_block_number'Img & " "; end loop; Result := Result & unbounded_lf; end if; exit when is_last_element (Sys.Tasks, My_Iterator); next_element (Sys.Tasks, My_Iterator); end loop; exception when Basic_Block_Analysis.Invalid_Input_Data => Result := Result & Exception_Message & unbounded_lf; end Compute_Task_Cache_Access_Profile; end Call_Cache_Framework;