Commit bbc43558 authored by yoogx's avatar yoogx

* Generate the __PO_HI_TASKS_STACK which is the sum of stack

          size of all threads in the system

          For issue #59
parent 3fa81987
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. -- -- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2016 ESA & ISAE. --
-- -- -- --
-- Ocarina is free software; you can redistribute it and/or modify under -- -- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -182,6 +182,7 @@ package body Ocarina.Backends.PO_HI_C.Deployment is ...@@ -182,6 +182,7 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
Local_Port_Identifier : Unsigned_Long_Long := 0; Local_Port_Identifier : Unsigned_Long_Long := 0;
Entity_Identifier : Unsigned_Long_Long := 0; Entity_Identifier : Unsigned_Long_Long := 0;
Task_Identifier : Unsigned_Long_Long := 0; Task_Identifier : Unsigned_Long_Long := 0;
Tasks_Stack : Unsigned_Long_Long := 0;
Nb_Protected : Unsigned_Long_Long := 0; Nb_Protected : Unsigned_Long_Long := 0;
Device_Id : Unsigned_Long_Long := 0; Device_Id : Unsigned_Long_Long := 0;
Bus_Id : Unsigned_Long_Long := 0; Bus_Id : Unsigned_Long_Long := 0;
...@@ -907,6 +908,7 @@ package body Ocarina.Backends.PO_HI_C.Deployment is ...@@ -907,6 +908,7 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
Node_Identifier := 0; Node_Identifier := 0;
Task_Identifier := 0; Task_Identifier := 0;
Tasks_Stack := 0;
Nb_Protected := 0; Nb_Protected := 0;
Nb_Ports_In_Process := 0; Nb_Ports_In_Process := 0;
...@@ -1271,6 +1273,12 @@ package body Ocarina.Backends.PO_HI_C.Deployment is ...@@ -1271,6 +1273,12 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
Value => Make_Literal (New_Int_Value (Task_Identifier, 1, 10))); Value => Make_Literal (New_Int_Value (Task_Identifier, 1, 10)));
Append_Node_To_List (N, CTN.Declarations (Current_File)); Append_Node_To_List (N, CTN.Declarations (Current_File));
N :=
Make_Define_Statement
(Defining_Identifier => RE (RE_Tasks_Stack),
Value => Make_Literal (New_Int_Value (Tasks_Stack, 1, 10)));
Append_Node_To_List (N, CTN.Declarations (Current_File));
-- Add an enumerator corresponding to an INVALID server -- Add an enumerator corresponding to an INVALID server
-- entity to the entity list. -- entity to the entity list.
...@@ -1564,6 +1572,8 @@ package body Ocarina.Backends.PO_HI_C.Deployment is ...@@ -1564,6 +1572,8 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
(Make_Literal (CV.New_Int_Value (Task_Identifier, 0, 10)))); (Make_Literal (CV.New_Int_Value (Task_Identifier, 0, 10))));
Append_Node_To_List (N, Tasks_Enumerator_List); Append_Node_To_List (N, Tasks_Enumerator_List);
Task_Identifier := Task_Identifier + 1; Task_Identifier := Task_Identifier + 1;
Tasks_Stack := Tasks_Stack + To_Bytes (Get_Thread_Stack_Size (E));
end if; end if;
if Current_Device /= No_Node if Current_Device /= No_Node
...@@ -1583,6 +1593,7 @@ package body Ocarina.Backends.PO_HI_C.Deployment is ...@@ -1583,6 +1593,7 @@ package body Ocarina.Backends.PO_HI_C.Deployment is
(Make_Literal (CV.New_Int_Value (Task_Identifier, 0, 10)))); (Make_Literal (CV.New_Int_Value (Task_Identifier, 0, 10))));
Append_Node_To_List (N, Tasks_Enumerator_List); Append_Node_To_List (N, Tasks_Enumerator_List);
Task_Identifier := Task_Identifier + 1; Task_Identifier := Task_Identifier + 1;
Tasks_Stack := Tasks_Stack + To_Bytes (Get_Thread_Stack_Size (E));
end if; end if;
-- Get the Process parent of the thread -- Get the Process parent of the thread
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. -- -- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2016 ESA & ISAE. --
-- -- -- --
-- Ocarina is free software; you can redistribute it and/or modify under -- -- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -180,6 +180,7 @@ package Ocarina.Backends.PO_HI_C.Runtime is ...@@ -180,6 +180,7 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Simulink_Init_Func, -- __PO_HI_SIMULINK_INIT RE_Simulink_Init_Func, -- __PO_HI_SIMULINK_INIT
RE_Simulink_Model_Type, -- __PO_HI_SIMULINK_MODEL RE_Simulink_Model_Type, -- __PO_HI_SIMULINK_MODEL
RE_Nb_Tasks, -- __PO_HI_NB_TASKS RE_Nb_Tasks, -- __PO_HI_NB_TASKS
RE_Tasks_Stack, -- __PO_HI_TASKS_STACK
RE_In_Data_Inter_Process, RE_In_Data_Inter_Process,
RE_In_Data_Intra_Process, RE_In_Data_Intra_Process,
RE_Out_Data_Inter_Process, RE_Out_Data_Inter_Process,
...@@ -427,6 +428,7 @@ package Ocarina.Backends.PO_HI_C.Runtime is ...@@ -427,6 +428,7 @@ package Ocarina.Backends.PO_HI_C.Runtime is
RE_Bigendian => RH_PO_HI_Transport, RE_Bigendian => RH_PO_HI_Transport,
RE_Littleendian => RH_PO_HI_Transport, RE_Littleendian => RH_PO_HI_Transport,
RE_Nb_Tasks => RH_Deployment, RE_Nb_Tasks => RH_Deployment,
RE_Tasks_Stack => RH_Deployment,
RE_In_Data_Inter_Process => RH_PO_HI_Types, RE_In_Data_Inter_Process => RH_PO_HI_Types,
RE_In_Data_Intra_Process => RH_PO_HI_Types, RE_In_Data_Intra_Process => RH_PO_HI_Types,
RE_Out_Data_Inter_Process => RH_PO_HI_Types, RE_Out_Data_Inter_Process => RH_PO_HI_Types,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment