From 0e89cc28446727a46742b21e43f3533b6c957606 Mon Sep 17 00:00:00 2001 From: yoogx Date: Wed, 14 Jan 2015 07:33:40 +0100 Subject: [PATCH] * Add support for multi-core processors for PolyORB-HI/C --- .../ocarina-backends-po_hi_c-main.adb | 12 ++++++++++- src/backends/ocarina-backends-properties.adb | 20 +++++++++++++++---- src/backends/ocarina-backends-properties.ads | 8 +++++++- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/src/backends/ocarina-backends-po_hi_c-main.adb b/src/backends/ocarina-backends-po_hi_c-main.adb index 7a89b2a4..5654382e 100644 --- a/src/backends/ocarina-backends-po_hi_c-main.adb +++ b/src/backends/ocarina-backends-po_hi_c-main.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2014 ESA & ISAE. -- +-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. -- -- -- -- Ocarina is free software; you can redistribute it and/or modify -- -- it under terms of the GNU General Public License as published by the -- @@ -100,6 +100,7 @@ package body Ocarina.Backends.PO_HI_C.Main is Parameters : List_Id; Priority : Unsigned_Long_Long; Stack_Size : Unsigned_Long_Long; + Core_Id : Unsigned_Long_Long; S : constant Node_Id := Parent_Subcomponent (E); begin Parameters := New_List (CTN.K_Parameter_List); @@ -178,6 +179,15 @@ package body Ocarina.Backends.PO_HI_C.Main is N := Make_Literal (New_Int_Value (Stack_Size, 1, 10)); Append_Node_To_List (N, Parameters); + -- Add the core this thread is attached to + + Core_Id := Get_Core_Id (Get_Bound_Processor + (Corresponding_Instance + (Get_Container_Process (E)))); + + N := Make_Literal (New_Int_Value (Core_Id, 1, 10)); + Append_Node_To_List (N, Parameters); + -- Add the name of function executed by the task in the -- parameters list. diff --git a/src/backends/ocarina-backends-properties.adb b/src/backends/ocarina-backends-properties.adb index 205b6fb0..e5c6cc3f 100644 --- a/src/backends/ocarina-backends-properties.adb +++ b/src/backends/ocarina-backends-properties.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2014 ESA & ISAE. -- +-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. -- -- -- -- Ocarina is free software; you can redistribute it and/or modify -- -- it under terms of the GNU General Public License as published by the -- @@ -352,6 +352,8 @@ package body Ocarina.Backends.Properties is Execution_Time : Name_Id; Compute_Deadline : Name_Id; + Core_Id : Name_Id; + -------------------- -- SEI properties -- -------------------- @@ -3004,6 +3006,7 @@ package body Ocarina.Backends.Properties is procedure Init is begin + Core_Id := Get_String_Name ("processor_properties::core_id"); Source_Language := Get_String_Name ("source_language"); Source_Name := Get_String_Name ("source_name"); T_Source_Name := Get_String_Name ("transformations::source_name"); @@ -4410,9 +4413,9 @@ package body Ocarina.Backends.Properties is return No_Name; end Get_Send_Function_Name; - --------------------- - -- Get_Memory_Size -- - --------------------- + ---------------------- + -- Get_Base_Address -- + ---------------------- function Get_Base_Address (D : Node_Id) return Unsigned_Long_Long is begin @@ -4428,4 +4431,13 @@ package body Ocarina.Backends.Properties is return Get_Size_Property_Value (D, Memory_Size); end Get_Memory_Size; + ----------------- + -- Get_Core_Id -- + ----------------- + + function Get_Core_Id (D : Node_Id) return Unsigned_Long_Long is + begin + return Check_And_Get_Property (D, Core_Id); + end Get_Core_Id; + end Ocarina.Backends.Properties; diff --git a/src/backends/ocarina-backends-properties.ads b/src/backends/ocarina-backends-properties.ads index 79c09012..793eb0bf 100644 --- a/src/backends/ocarina-backends-properties.ads +++ b/src/backends/ocarina-backends-properties.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2014 ESA & ISAE. -- +-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. -- -- -- -- Ocarina is free software; you can redistribute it and/or modify -- -- it under terms of the GNU General Public License as published by the -- @@ -801,6 +801,12 @@ package Ocarina.Backends.Properties is function Get_Base_Address (D : Node_Id) return Unsigned_Long_Long; function Get_Memory_Size (D : Node_Id) return Size_Type; + -------------------------- + -- Processor properties -- + -------------------------- + + function Get_Core_Id (D : Node_Id) return Unsigned_Long_Long; + private Empty_Name_Array : constant Name_Array (1 .. 0) := (others => No_Name); -- GitLab