Commit a9ef0ec4 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fix population of devices in the concurrency view

parent 6a4799b8
......@@ -917,19 +917,28 @@ package body TASTE.Concurrency_View is
All_Drivers.Append (N.Drivers);
for D : Taste_Device_Driver of N.Drivers loop
Device_Node_Name := Device_Node_Name & N.Name;
Device_Partition_Name := -- There must be only one
Device_Partition_Name & N.Partitions.First_Element.Name;
-- Update list of types and files without duplicates
if not Unique_ASN1_Sorts_Set.Contains
(Strip_String (To_String (D.ASN1_Typename)))
then
Unique_ASN1_Sorts_Set.Insert
(Strip_String (To_String (D.ASN1_Typename)));
Unique_ASN1_Sorts := Unique_ASN1_Sorts & D.ASN1_Typename;
Unique_ASN1_Modules :=
Unique_ASN1_Modules & D.ASN1_Module;
Unique_ASN1_Files := Unique_ASN1_Files & D.ASN1_Filename;
-- The vector tags of drivers miss the name of the node
-- and partition as they are not part of the Driver
-- data structure. We add them here as we are iterating
-- on nodes (and we consider only one partition)
if not D.Accessed_Bus_Name.Is_Empty then
-- Here add only if driver is bound to a bus
Device_Node_Name := Device_Node_Name & N.Name;
Device_Partition_Name := -- There must be only one
Device_Partition_Name & N.Partitions.First_Element.Name;
-- Update list of types and files without duplicates
if not Unique_ASN1_Sorts_Set.Contains
(Strip_String (To_String (D.ASN1_Typename)))
then
Unique_ASN1_Sorts_Set.Insert
(Strip_String (To_String (D.ASN1_Typename)));
Unique_ASN1_Sorts :=
Unique_ASN1_Sorts & D.ASN1_Typename;
Unique_ASN1_Modules :=
Unique_ASN1_Modules & D.ASN1_Module;
Unique_ASN1_Files :=
Unique_ASN1_Files & D.ASN1_Filename;
end if;
end if;
end loop;
end loop;
......
......@@ -91,8 +91,8 @@ package body TASTE.Deployment_View is
Device_ASN1_Modules : Vector_Tag;
begin
for Driver of Drivers loop
declare
begin
-- Only consider devices that are actually connected to a bus
if not Driver.Accessed_Bus_Name.Is_Empty then
Device_Names := Device_Names & Driver.Device_Instance_Name;
Device_Driver_Names := Device_Driver_Names
& Driver.Driver_Name;
......@@ -106,9 +106,9 @@ package body TASTE.Deployment_View is
Device_Configurations := Device_Configurations
& Driver.Device_Configuration;
Device_Accessed_Bus_Names := Device_Accessed_Bus_Names
& Driver.Accessed_Bus_Name;
& Driver.Accessed_Bus_Name.Element;
Device_Accessed_Port_Names := Device_Accessed_Port_Names
& Driver.Accessed_Port_Name;
& Driver.Accessed_Port_Name.Element;
Device_ASN1_Filenames := Device_ASN1_Filenames
& Driver.ASN1_Filename;
Device_ASN1_Typenames := Device_ASN1_Typenames
......@@ -121,7 +121,7 @@ package body TASTE.Deployment_View is
& Driver.Send_Function;
Device_Init_Languages := Device_Init_Languages
& Driver.Init_Language;
end;
end if;
end loop;
return +Assoc ("Device_Names", Device_Names)
......@@ -453,12 +453,15 @@ package body TASTE.Deployment_View is
Find_Connected_Bus (CI, Accessed_Bus, Accessed_Port);
-- Set the optional fields if the device is connected
if Accessed_Bus /= No_Node and then Accessed_Port /= No_Node
then
Result.Accessed_Bus_Name :=
US (Get_Name_String (Name (Identifier (Accessed_Bus))));
String_Holders.To_Holder
(Get_Name_String (Name (Identifier (Accessed_Bus))));
Result.Accessed_Port_Name :=
US (Get_Name_String (Name (Identifier (Accessed_Port))));
String_Holders.To_Holder
(Get_Name_String (Name (Identifier (Accessed_Port))));
end if;
return Result;
exception
......@@ -871,33 +874,35 @@ package body TASTE.Deployment_View is
New_Line (Output);
end loop;
for Driver of Each.Drivers loop
Put_Line (Output, " |_ Driver : " & To_String (Driver.Name));
Put_Line (Output, " |_ Name : "
& To_String (Driver.Driver_Name));
Put_Line (Output, " |_ Package : "
& To_String (Driver.Package_Name));
Put_Line (Output, " |_ Classifier : "
& To_String (Driver.Device_Classifier));
Put_Line (Output, " |_ Processor : "
& To_String (Driver.Associated_Processor_Name));
Put_Line (Output, " |_ Configuration : "
& To_String (Driver.Device_Configuration));
Put_Line (Output, " |_ Bus_Name : "
& To_String (Driver.Accessed_Bus_Name));
Put_Line (Output, " |_ Port_Name : "
& To_String (Driver.Accessed_Port_Name));
Put_Line (Output, " |_ ASN.1 File : "
& To_String (Driver.ASN1_Filename));
Put_Line (Output, " |_ ASN.1 Type : "
& To_String (Driver.ASN1_Typename));
Put_Line (Output, " |_ ASN.1 Module : "
& To_String (Driver.ASN1_Module));
Put_Line (Output, " |_ Init function : "
& To_String (Driver.Init_Function));
Put_Line (Output, " |_ Init function : "
& To_String (Driver.Send_Function));
Put_Line (Output, " |_ Language : "
& To_String (Driver.Init_Language));
if not Driver.Accessed_Bus_Name.Is_Empty then
Put_Line (Output, " |_ Driver : " & To_String (Driver.Name));
Put_Line (Output, " |_ Name : "
& To_String (Driver.Driver_Name));
Put_Line (Output, " |_ Package : "
& To_String (Driver.Package_Name));
Put_Line (Output, " |_ Classifier : "
& To_String (Driver.Device_Classifier));
Put_Line (Output, " |_ Processor : "
& To_String (Driver.Associated_Processor_Name));
Put_Line (Output, " |_ Configuration : "
& To_String (Driver.Device_Configuration));
Put_Line (Output, " |_ Bus_Name : "
& Driver.Accessed_Bus_Name.Element);
Put_Line (Output, " |_ Port_Name : "
& Driver.Accessed_Port_Name.Element);
Put_Line (Output, " |_ ASN.1 File : "
& To_String (Driver.ASN1_Filename));
Put_Line (Output, " |_ ASN.1 Type : "
& To_String (Driver.ASN1_Typename));
Put_Line (Output, " |_ ASN.1 Module : "
& To_String (Driver.ASN1_Module));
Put_Line (Output, " |_ Init function : "
& To_String (Driver.Init_Function));
Put_Line (Output, " |_ Init function : "
& To_String (Driver.Send_Function));
Put_Line (Output, " |_ Language : "
& To_String (Driver.Init_Language));
end if;
end loop;
end loop;
end Dump_Nodes;
......
......@@ -91,14 +91,15 @@ package TASTE.Deployment_View is
Device_Classifier,
Associated_Processor_Name,
Device_Configuration,
Accessed_Bus_Name,
Accessed_Port_Name,
Init_Function,
Init_Language,
Send_Function,
ASN1_Filename,
ASN1_Typename,
ASN1_Module : Unbounded_String;
-- Optional fields: exist only if device is connected
Accessed_Bus_Name,
Accessed_Port_Name : String_Holder;
end record;
function Device_Instance_Name (Driver : Taste_Device_Driver) return String;
......
......@@ -183,25 +183,27 @@ package body TASTE.Dump is
Asn1_Modules : Vector_Tag;
begin
for Driver of N.Drivers loop
Device_Names := Device_Names & Driver.Name;
Package_Names :=
Package_Names & Driver.Package_Name;
Device_Classifiers :=
Device_Classifiers & Driver.Device_Classifier;
Proc_Names :=
Proc_Names & Driver.Associated_Processor_Name;
Config :=
Config & Driver.Device_Configuration;
Bus_Names :=
Bus_Names & Driver.Accessed_Bus_Name;
Port_Names :=
Port_Names & Driver.Accessed_Port_Name;
Asn1_Files :=
Asn1_Files & Driver.ASN1_Filename;
Asn1_Typenames :=
Asn1_Typenames & Driver.ASN1_Typename;
Asn1_Modules :=
Asn1_Modules & Driver.ASN1_Module;
if not Driver.Accessed_Bus_Name.Is_Empty then
Device_Names := Device_Names & Driver.Name;
Package_Names :=
Package_Names & Driver.Package_Name;
Device_Classifiers :=
Device_Classifiers & Driver.Device_Classifier;
Proc_Names :=
Proc_Names & Driver.Associated_Processor_Name;
Config :=
Config & Driver.Device_Configuration;
Bus_Names :=
Bus_Names & Driver.Accessed_Bus_Name.Element;
Port_Names :=
Port_Names & Driver.Accessed_Port_Name.Element;
Asn1_Files :=
Asn1_Files & Driver.ASN1_Filename;
Asn1_Typenames :=
Asn1_Typenames & Driver.ASN1_Typename;
Asn1_Modules :=
Asn1_Modules & Driver.ASN1_Module;
end if;
end loop;
-- Add drivers to the node map
......
Supports Markdown
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