Commit 782df583 authored by julien.delange's avatar julien.delange

begin to generate driver content




git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@532 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent f535edb6
......@@ -909,17 +909,21 @@ package body Ocarina.Backends.C_Common.Mapping is
elsif AINU.Is_Thread (Corresponding_Instance (E)) then
-- For threads, the enumerator name is mapped from the
-- containing process name and the thread subcomponent name.
-- Verifiy that the thread is a subcomponent of a process
pragma Assert (AINU.Is_Process (Parent_Component (E)));
C_Name_1 := CTU.To_C_Name
(Display_Name
(Identifier
(Parent_Subcomponent
if Parent_Subcomponent (Parent_Component (E)) = No_Node then
C_Name_1 := CTU.To_C_Name
(Display_Name
(Identifier
(Parent_Component
(E)))));
(E))));
else
C_Name_1 := CTU.To_C_Name
(Display_Name
(Identifier
(Parent_Subcomponent
(Parent_Component
(E)))));
end if;
C_Name_2 := CTU.To_C_Name
(Display_Name
(Identifier
......
......@@ -75,6 +75,7 @@ package body Ocarina.Backends.PO_HI_C.Activity is
procedure Visit_Component_Instance (E : Node_Id);
procedure Visit_System_Instance (E : Node_Id);
procedure Visit_Process_Instance (E : Node_Id);
procedure Visit_Device_Instance (E : Node_Id);
procedure Visit_Thread_Instance (E : Node_Id);
function Task_Job_Spec (E : Node_Id) return Node_Id;
function Task_Deliver_Spec (E : Node_Id) return Node_Id;
......@@ -185,6 +186,8 @@ package body Ocarina.Backends.PO_HI_C.Activity is
Parameters : constant List_Id := New_List (CTN.K_Parameter_List);
S : Node_Id;
N : Node_Id;
The_System : constant Node_Id := Parent_Component
(Parent_Subcomponent (E));
begin
Push_Entity (P);
Push_Entity (U);
......@@ -253,10 +256,47 @@ package body Ocarina.Backends.PO_HI_C.Activity is
(N, CTN.Declarations (CTN.Activity_Source (U)));
end if;
-- Visit all devices attached to the parent system that
-- share the same processor as process E.
if not AAU.Is_Empty (Subcomponents (The_System)) then
S := First_Node (Subcomponents (The_System));
while Present (S) loop
if AAU.Is_Device (Corresponding_Instance (S))
and then
Get_Bound_Processor (Corresponding_Instance (S))
= Get_Bound_Processor (E)
then
Visit_Device_Instance
(Corresponding_Instance (S));
end if;
S := Next_Node (S);
end loop;
end if;
Pop_Entity; -- U
Pop_Entity; -- P
end Visit_Process_Instance;
---------------------------
-- Visit_Device_Instance --
---------------------------
procedure Visit_Device_Instance (E : Node_Id) is
Implementation : constant Node_Id := Get_Implementation (E);
S : Node_Id;
begin
if Implementation /= No_Node then
if not AAU.Is_Empty (AAN.Subcomponents (Implementation)) then
S := First_Node (Subcomponents (Implementation));
while Present (S) loop
Visit_Component_Instance (Corresponding_Instance (S));
S := Next_Node (S);
end loop;
end if;
end if;
end Visit_Device_Instance;
---------------------------
-- Visit_System_Instance --
---------------------------
......@@ -344,6 +384,7 @@ package body Ocarina.Backends.PO_HI_C.Activity is
procedure Visit_Component_Instance (E : Node_Id);
procedure Visit_System_Instance (E : Node_Id);
procedure Visit_Process_Instance (E : Node_Id);
procedure Visit_Device_Instance (E : Node_Id);
procedure Visit_Thread_Instance (E : Node_Id);
function Task_Job_Body (E : Node_Id) return Node_Id;
......@@ -1316,6 +1357,8 @@ package body Ocarina.Backends.PO_HI_C.Activity is
(CTN.K_Declaration_List);
Statements : constant List_Id := New_List (CTN.K_Statement_List);
Parameters : List_Id;
The_System : constant Node_Id := Parent_Component
(Parent_Subcomponent (E));
begin
Push_Entity (P);
Push_Entity (U);
......@@ -1456,10 +1499,47 @@ package body Ocarina.Backends.PO_HI_C.Activity is
Append_Node_To_List (N, CTN.Declarations (Current_File));
end if;
-- Visit all devices attached to the parent system that
-- share the same processor as process E.
if not AAU.Is_Empty (Subcomponents (The_System)) then
S := First_Node (Subcomponents (The_System));
while Present (S) loop
if AAU.Is_Device (Corresponding_Instance (S))
and then
Get_Bound_Processor (Corresponding_Instance (S))
= Get_Bound_Processor (E)
then
Visit_Device_Instance
(Corresponding_Instance (S));
end if;
S := Next_Node (S);
end loop;
end if;
Pop_Entity; -- U
Pop_Entity; -- P
end Visit_Process_Instance;
---------------------------
-- Visit_Device_Instance --
---------------------------
procedure Visit_Device_Instance (E : Node_Id) is
Implementation : constant Node_Id := Get_Implementation (E);
S : Node_Id;
begin
if Implementation /= No_Node then
if not AAU.Is_Empty (AAN.Subcomponents (Implementation)) then
S := First_Node (Subcomponents (Implementation));
while Present (S) loop
Visit_Component_Instance (Corresponding_Instance (S));
S := Next_Node (S);
end loop;
end if;
end if;
end Visit_Device_Instance;
---------------------------
-- Visit_System_Instance --
---------------------------
......
......@@ -93,6 +93,7 @@ package body Ocarina.Backends.Properties is
-- Subprogram, thread, data, port...
Implemented_As : Name_Id;
Device_Driver_Name : Name_Id;
-------------------------------
-- Data component properties --
......@@ -2125,6 +2126,8 @@ package body Ocarina.Backends.Properties is
begin
if Is_Defined_Property (E, Implemented_As) then
return Get_Classifier_Property (E, Implemented_As);
elsif Is_Defined_Property (E, Device_Driver_Name) then
return Get_Classifier_Property (E, Device_Driver_Name);
else
return No_Node;
end if;
......@@ -2727,6 +2730,7 @@ package body Ocarina.Backends.Properties is
Original_Name := Get_String_Name
("transformations::original_name");
Implemented_As := Get_String_Name ("implemented_as");
Device_Driver_Name := Get_String_Name ("device_driver");
Base_Type := Get_String_Name ("data_model::base_type");
Code_Set := Get_String_Name ("data_model::code_set");
......
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