Commit 4e53b64f authored by yoogx's avatar yoogx

* Connections_Of: new function to fetch connections of a component

          Category_Name: new function that returns category of a component

          For openaal/ocarina#128
parent 71f43d2a
......@@ -63,6 +63,10 @@ package Ocarina.Backends.Helper is
function Subcomponents_Of (E : Node_Id) return Node_Array;
function Connections_Of (E : Node_Id) return Node_Array is
(if No (Connections (E)) then No_Nodes
else To_Node_Array (Connections (E)));
--------------------------
-- Component categories --
--------------------------
......@@ -117,4 +121,26 @@ package Ocarina.Backends.Helper is
(Filter_Instance_By_Category
(Find_All_Component_Instances (Root), CC_System));
---------------------
-- Pretty printing --
---------------------
function Category_Name (C : Component_Category) return String is
(case C is
when CC_Abstract => "abstract",
when CC_Bus => "bus",
when CC_Data => "data",
when CC_Device => "device",
when CC_Memory => "memory",
when CC_Process => "process",
when CC_Processor => "processor",
when CC_Subprogram => "subprogram",
when CC_Subprogram_Group => "subprogram_group",
when CC_System => "system",
when CC_Thread => "thread",
when CC_Thread_Group => "thread_group",
when CC_Unknown => raise Program_Error,
when CC_Virtual_Bus => "virtual_bus",
when CC_Virtual_Processor => "virtual_processor");
end Ocarina.Backends.Helper;
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