------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- This source file was automatically generated by Platypus -- see http://dossen.univ-brest.fr/apl -- -- Any modification of this file will be lost. -- Please see the "platypus" directory instead : it contains the Cheddar's -- model and its meta-model. ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Cheddar is a free real time scheduling tool. -- This program provides services to automatically check temporal constraints -- of real time tasks. -- -- Copyright (C) 2002-2014 Frank Singhoff -- Cheddar is developed by the LAB-STICC Team, University of Brest -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -- -- Contact : cheddar@listes.univ-brest.fr -- To post to this mailing list, you must be subscribed -- (see http//beru.univ-brest.fr/~singhoff/cheddar for details) -- ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with Text_io; use Text_io; with unbounded_strings; use unbounded_strings; with primitive_xml_strings; use primitive_xml_strings; Package Body Networks is function XML_String(obj : in Networks_Delay_Type) return Unbounded_String is begin return to_unbounded_string(Networks_Delay_Type'image (obj) ); end XML_String; function XML_Ref_String (obj : in Networks_Delay_Type) return Unbounded_String is begin raise xml_ref_string_error; return to_unbounded_string(""); end XML_Ref_String; function XML_String(obj : in Networks_Architecture_Type) return Unbounded_String is begin return to_unbounded_string(Networks_Architecture_Type'image (obj) ); end XML_String; function XML_Ref_String (obj : in Networks_Architecture_Type) return Unbounded_String is begin raise xml_ref_string_error; return to_unbounded_string(""); end XML_Ref_String; function XML_String(obj : in Topology_Type) return Unbounded_String is begin return to_unbounded_string(Topology_Type'image (obj) ); end XML_String; function XML_Ref_String (obj : in Topology_Type) return Unbounded_String is begin raise xml_ref_string_error; return to_unbounded_string(""); end XML_Ref_String; function XML_String(obj : in Routing_Type) return Unbounded_String is begin return to_unbounded_string(Routing_Type'image (obj) ); end XML_String; function XML_Ref_String (obj : in Routing_Type) return Unbounded_String is begin raise xml_ref_string_error; return to_unbounded_string(""); end XML_Ref_String; function XML_String(obj : in NoC_Preemption_Level_Type) return Unbounded_String is begin return to_unbounded_string(NoC_Preemption_Level_Type'image (obj) ); end XML_String; function XML_Ref_String (obj : in NoC_Preemption_Level_Type) return Unbounded_String is begin raise xml_ref_string_error; return to_unbounded_string(""); end XML_Ref_String; function XML_String(obj : in Switching_Type) return Unbounded_String is begin return to_unbounded_string(Switching_Type'image (obj) ); end XML_String; function XML_Ref_String (obj : in Switching_Type) return Unbounded_String is begin raise xml_ref_string_error; return to_unbounded_string(""); end XML_Ref_String; function XML_String(obj : in Data_Memorisation_Type) return Unbounded_String is begin return to_unbounded_string(Data_Memorisation_Type'image (obj) ); end XML_String; function XML_Ref_String (obj : in Data_Memorisation_Type) return Unbounded_String is begin raise xml_ref_string_error; return to_unbounded_string(""); end XML_Ref_String; function XML_String(obj : in Arbitration_Type) return Unbounded_String is begin return to_unbounded_string(Arbitration_Type'image (obj) ); end XML_String; function XML_Ref_String (obj : in Arbitration_Type) return Unbounded_String is begin raise xml_ref_string_error; return to_unbounded_string(""); end XML_Ref_String; -- --------= Generic_Network =-------- procedure Initialize(obj : in out Generic_Network) is begin initialize(Named_Object(obj)); obj.network_delay := Bounded_Delay; obj.network_architecture_type := Shared_Bus; obj.object_type := Network_Object_Type; end Initialize; function Copy ( obj : in Generic_Network ) return Generic_Network_Ptr is New_Generic_Network : Generic_Network_Ptr; begin New_Generic_Network := new Generic_Network'(obj); return (New_Generic_Network); end Copy; function Copy ( obj : in Generic_Network_Ptr ) return Generic_Network_Ptr is begin return copy(obj.all); end Copy; procedure Put(obj : in Generic_Network) is begin put(Named_Object(obj)); put("network_delay: "); put(obj.network_delay); put ( "; " ); put("network_architecture_type: "); put(obj.network_architecture_type); put ( "; " ); end Put; procedure Put(obj : in Generic_Network_Ptr) is begin Put(Obj.All); end Put; procedure Put_Name ( obj : in Generic_Network_Ptr) is begin Put ( To_String ( Obj.Name ) ); end Put_Name; function Get_Name (obj : in Generic_Network) return Unbounded_String is begin return obj.name; end Get_Name; function Get_Name (obj : in Generic_Network_ptr) return Unbounded_String is begin return obj.name; end Get_Name; function type_of ( obj : in Generic_Network ) return unbounded_string_list is list : unbounded_string_list; s : unbounded_string_ptr; begin Initialize(list); s := new unbounded_string; s.all := to_unbounded_string("OBJECTS.GENERIC_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("OBJECTS.NAMED_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("NETWORKS.GENERIC_NETWORK"); Add (list, s); return list; end type_of; function type_of ( obj : in Generic_Network_Ptr ) return unbounded_string_list is begin return type_of(obj.all); end type_of; procedure Build_Attributes_XML_String(obj : in Generic_Network; result : in out Unbounded_String) is begin Build_Attributes_XML_String(Named_Object(obj), result); if (XML_String(obj.network_delay) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.network_delay) & to_unbounded_string(""); end if; if (XML_String(obj.network_architecture_type) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.network_architecture_type) & to_unbounded_string(""); end if; end Build_Attributes_XML_String; function XML_String(obj : in Generic_Network) return Unbounded_String is result : Unbounded_String; begin result := to_unbounded_string(""); Build_Attributes_XML_String(obj, result); result := result & to_unbounded_string(""); return (result); end XML_String; function XML_String(obj : in Generic_Network_Ptr) return Unbounded_String is begin if obj /= null then return XML_String(obj.all); else return Empty_String; end if; end XML_String; function XML_Ref_String(obj : in Generic_Network) return Unbounded_String is result : Unbounded_String; begin result := to_unbounded_string(""); return (result); end XML_Ref_String; function XML_Ref_String(obj : in Generic_Network_Ptr) return Unbounded_String is begin return XML_Ref_String(obj.all); end XML_Ref_String; -- --------= Position =-------- procedure Initialize(obj : out Position) is begin obj.X := 0; obj.Y := 0; end Initialize; procedure Put(obj : in Position) is begin put("X: "); standards_io.natural_io.put(obj.X); put ( "; " ); put("Y: "); standards_io.natural_io.put(obj.Y); put ( "; " ); end Put; procedure Put(obj : in Position_Ptr) is begin Put(Obj.All); end Put; procedure Build_Attributes_XML_String(obj : in Position; result : in out Unbounded_String) is begin if (XML_String(obj.X) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.X) & to_unbounded_string(""); end if; if (XML_String(obj.Y) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.Y) & to_unbounded_string(""); end if; end Build_Attributes_XML_String; function XML_String(obj : in Position) return Unbounded_String is result : Unbounded_String; begin result := to_unbounded_string(""); Build_Attributes_XML_String(obj, result); result := result & to_unbounded_string(""); return (result); end XML_String; function XML_String(obj : in Position_Ptr) return Unbounded_String is begin if obj /= null then return XML_String(obj.all); else return Empty_String; end if; end XML_String; function XML_Ref_String(obj : in Position) return Unbounded_String is result : Unbounded_String; begin raise xml_ref_string_error; return to_unbounded_string(""); end XML_Ref_String; function Copy ( obj : in Position ) return Position_Ptr is New_Position : Position_Ptr; begin New_Position := new Position'(obj); return (New_Position); end Copy; function Copy ( obj : in Position_Ptr ) return Position_Ptr is begin return copy(obj.all); end Copy; -- --------= NOC_Network =-------- procedure Initialize(obj : in out NOC_Network) is begin initialize(Generic_Network(obj)); obj.topology := Mesh_Topology; obj.number_of_processor := 0; obj.link_delay := 0; obj.dimension := 0; obj.number_of_virtual_channel := 0; obj.routing_protocol := XY; obj.switching_protocol := Wormwole; obj.network_architecture_type := NOC; end Initialize; function Copy ( obj : in NOC_Network ) return Generic_Network_Ptr is New_NOC_Network : NOC_Network_Ptr; begin New_NOC_Network := new NOC_Network'(obj); return Generic_Network_Ptr(New_NOC_Network); end Copy; function Copy ( obj : in NOC_Network_Ptr ) return Generic_Network_Ptr is begin return copy(obj.all); end Copy; procedure Put(obj : in NOC_Network) is begin put(Generic_Network(obj)); put("topology: "); put(obj.topology); put ( "; " ); put("number_of_processor: "); standards_io.natural_io.put(obj.number_of_processor); put ( "; " ); put("link_delay: "); standards_io.natural_io.put(obj.link_delay); put ( "; " ); put("dimension: "); standards_io.natural_io.put(obj.dimension); put ( "; " ); put("number_of_virtual_channel: "); standards_io.natural_io.put(obj.number_of_virtual_channel); put ( "; " ); put("routing_protocol: "); put(obj.routing_protocol); put ( "; " ); put("switching_protocol: "); put(obj.switching_protocol); put ( "; " ); put("processor_positions: "); put(obj.processor_positions); put ( "; " ); end Put; procedure Put(obj : in NOC_Network_Ptr) is begin Put(Obj.All); end Put; procedure Put_Name ( obj : in NOC_Network_Ptr) is begin Put ( To_String ( Obj.Name ) ); end Put_Name; function Get_Name (obj : in NOC_Network) return Unbounded_String is begin return obj.name; end Get_Name; function Get_Name (obj : in NOC_Network_ptr) return Unbounded_String is begin return obj.name; end Get_Name; function type_of ( obj : in NOC_Network ) return unbounded_string_list is list : unbounded_string_list; s : unbounded_string_ptr; begin Initialize(list); s := new unbounded_string; s.all := to_unbounded_string("OBJECTS.GENERIC_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("OBJECTS.NAMED_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("NETWORKS.GENERIC_NETWORK"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("NETWORKS.NOC_NETWORK"); Add (list, s); return list; end type_of; function type_of ( obj : in NOC_Network_Ptr ) return unbounded_string_list is begin return type_of(obj.all); end type_of; procedure Build_Attributes_XML_String(obj : in NOC_Network; result : in out Unbounded_String) is begin Build_Attributes_XML_String(Generic_Network(obj), result); if (XML_String(obj.topology) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.topology) & to_unbounded_string(""); end if; if (XML_String(obj.number_of_processor) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.number_of_processor) & to_unbounded_string(""); end if; if (XML_String(obj.link_delay) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.link_delay) & to_unbounded_string(""); end if; if (XML_String(obj.dimension) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.dimension) & to_unbounded_string(""); end if; if (XML_String(obj.number_of_virtual_channel) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.number_of_virtual_channel) & to_unbounded_string(""); end if; if (XML_String(obj.routing_protocol) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.routing_protocol) & to_unbounded_string(""); end if; if (XML_String(obj.switching_protocol) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.switching_protocol) & to_unbounded_string(""); end if; if (XML_String(obj.processor_positions) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.processor_positions) & to_unbounded_string(""); end if; end Build_Attributes_XML_String; function XML_String(obj : in NOC_Network) return Unbounded_String is result : Unbounded_String; begin result := to_unbounded_string(""); Build_Attributes_XML_String(obj, result); result := result & to_unbounded_string(""); return (result); end XML_String; function XML_String(obj : in NOC_Network_Ptr) return Unbounded_String is begin if obj /= null then return XML_String(obj.all); else return Empty_String; end if; end XML_String; function XML_Ref_String(obj : in NOC_Network) return Unbounded_String is result : Unbounded_String; begin result := to_unbounded_string(""); return (result); end XML_Ref_String; function XML_Ref_String(obj : in NOC_Network_Ptr) return Unbounded_String is begin return XML_Ref_String(obj.all); end XML_Ref_String; -- --------= Spacewire_Network =-------- procedure Initialize(obj : in out Spacewire_Network) is begin initialize(Generic_Network(obj)); obj.number_of_processor := 0; obj.link_delay := 0; obj.Xdimension := 0; obj.Ydimension := 0; obj.routing_protocol := XY; end Initialize; function Copy ( obj : in Spacewire_Network ) return Generic_Network_Ptr is New_Spacewire_Network : Spacewire_Network_Ptr; begin New_Spacewire_Network := new Spacewire_Network'(obj); return Generic_Network_Ptr(New_Spacewire_Network); end Copy; function Copy ( obj : in Spacewire_Network_Ptr ) return Generic_Network_Ptr is begin return copy(obj.all); end Copy; procedure Put(obj : in Spacewire_Network) is begin put(Generic_Network(obj)); put("number_of_processor: "); standards_io.natural_io.put(obj.number_of_processor); put ( "; " ); put("link_delay: "); standards_io.natural_io.put(obj.link_delay); put ( "; " ); put("Xdimension: "); standards_io.natural_io.put(obj.Xdimension); put ( "; " ); put("Ydimension: "); standards_io.natural_io.put(obj.Ydimension); put ( "; " ); put("routing_protocol: "); put(obj.routing_protocol); put ( "; " ); put("processor_positions: "); put(obj.processor_positions); put ( "; " ); end Put; procedure Put(obj : in Spacewire_Network_Ptr) is begin Put(Obj.All); end Put; procedure Put_Name ( obj : in Spacewire_Network_Ptr) is begin Put ( To_String ( Obj.Name ) ); end Put_Name; function Get_Name (obj : in Spacewire_Network) return Unbounded_String is begin return obj.name; end Get_Name; function Get_Name (obj : in Spacewire_Network_ptr) return Unbounded_String is begin return obj.name; end Get_Name; function type_of ( obj : in Spacewire_Network ) return unbounded_string_list is list : unbounded_string_list; s : unbounded_string_ptr; begin Initialize(list); s := new unbounded_string; s.all := to_unbounded_string("OBJECTS.GENERIC_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("OBJECTS.NAMED_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("NETWORKS.GENERIC_NETWORK"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("NETWORKS.SPACEWIRE_NETWORK"); Add (list, s); return list; end type_of; function type_of ( obj : in Spacewire_Network_Ptr ) return unbounded_string_list is begin return type_of(obj.all); end type_of; procedure Build_Attributes_XML_String(obj : in Spacewire_Network; result : in out Unbounded_String) is begin Build_Attributes_XML_String(Generic_Network(obj), result); if (XML_String(obj.number_of_processor) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.number_of_processor) & to_unbounded_string(""); end if; if (XML_String(obj.link_delay) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.link_delay) & to_unbounded_string(""); end if; if (XML_String(obj.Xdimension) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.Xdimension) & to_unbounded_string(""); end if; if (XML_String(obj.Ydimension) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.Ydimension) & to_unbounded_string(""); end if; if (XML_String(obj.routing_protocol) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.routing_protocol) & to_unbounded_string(""); end if; if (XML_String(obj.processor_positions) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.processor_positions) & to_unbounded_string(""); end if; end Build_Attributes_XML_String; function XML_String(obj : in Spacewire_Network) return Unbounded_String is result : Unbounded_String; begin result := to_unbounded_string(""); Build_Attributes_XML_String(obj, result); result := result & to_unbounded_string(""); return (result); end XML_String; function XML_String(obj : in Spacewire_Network_Ptr) return Unbounded_String is begin if obj /= null then return XML_String(obj.all); else return Empty_String; end if; end XML_String; function XML_Ref_String(obj : in Spacewire_Network) return Unbounded_String is result : Unbounded_String; begin result := to_unbounded_string(""); return (result); end XML_Ref_String; function XML_Ref_String(obj : in Spacewire_Network_Ptr) return Unbounded_String is begin return XML_Ref_String(obj.all); end XML_Ref_String; -- --------= Bus_Network =-------- procedure Initialize(obj : in out Bus_Network) is begin initialize(Generic_Network(obj)); obj.bus_arbitration := TDMA; obj.memory_word_access_time := 0; obj.maximum_interbank_interferences_memory_delay := 0; obj.network_architecture_type := Shared_Bus; end Initialize; function Copy ( obj : in Bus_Network ) return Generic_Network_Ptr is New_Bus_Network : Bus_Network_Ptr; begin New_Bus_Network := new Bus_Network'(obj); return Generic_Network_Ptr(New_Bus_Network); end Copy; function Copy ( obj : in Bus_Network_Ptr ) return Generic_Network_Ptr is begin return copy(obj.all); end Copy; procedure Put(obj : in Bus_Network) is begin put(Generic_Network(obj)); put("processor_list: "); put(obj.processor_list); put ( "; " ); put("memory_list: "); put(obj.memory_list); put ( "; " ); put("bus_arbitration: "); put(obj.bus_arbitration); put ( "; " ); put("memory_word_access_time: "); standards_io.natural_io.put(obj.memory_word_access_time); put ( "; " ); put("maximum_interbank_interferences_memory_delay: "); standards_io.natural_io.put(obj.maximum_interbank_interferences_memory_delay); put ( "; " ); end Put; procedure Put(obj : in Bus_Network_Ptr) is begin Put(Obj.All); end Put; procedure Put_Name ( obj : in Bus_Network_Ptr) is begin Put ( To_String ( Obj.Name ) ); end Put_Name; function Get_Name (obj : in Bus_Network) return Unbounded_String is begin return obj.name; end Get_Name; function Get_Name (obj : in Bus_Network_ptr) return Unbounded_String is begin return obj.name; end Get_Name; function type_of ( obj : in Bus_Network ) return unbounded_string_list is list : unbounded_string_list; s : unbounded_string_ptr; begin Initialize(list); s := new unbounded_string; s.all := to_unbounded_string("OBJECTS.GENERIC_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("OBJECTS.NAMED_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("NETWORKS.GENERIC_NETWORK"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("NETWORKS.BUS_NETWORK"); Add (list, s); return list; end type_of; function type_of ( obj : in Bus_Network_Ptr ) return unbounded_string_list is begin return type_of(obj.all); end type_of; procedure Build_Attributes_XML_String(obj : in Bus_Network; result : in out Unbounded_String) is begin Build_Attributes_XML_String(Generic_Network(obj), result); if (XML_String(obj.processor_list) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.processor_list) & to_unbounded_string(""); end if; if (XML_String(obj.memory_list) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.memory_list) & to_unbounded_string(""); end if; if (XML_String(obj.bus_arbitration) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.bus_arbitration) & to_unbounded_string(""); end if; if (XML_String(obj.memory_word_access_time) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.memory_word_access_time) & to_unbounded_string(""); end if; if (XML_String(obj.maximum_interbank_interferences_memory_delay) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.maximum_interbank_interferences_memory_delay) & to_unbounded_string(""); end if; end Build_Attributes_XML_String; function XML_String(obj : in Bus_Network) return Unbounded_String is result : Unbounded_String; begin result := to_unbounded_string(""); Build_Attributes_XML_String(obj, result); result := result & to_unbounded_string(""); return (result); end XML_String; function XML_String(obj : in Bus_Network_Ptr) return Unbounded_String is begin if obj /= null then return XML_String(obj.all); else return Empty_String; end if; end XML_String; function XML_Ref_String(obj : in Bus_Network) return Unbounded_String is result : Unbounded_String; begin result := to_unbounded_string(""); return (result); end XML_Ref_String; function XML_Ref_String(obj : in Bus_Network_Ptr) return Unbounded_String is begin return XML_Ref_String(obj.all); end XML_Ref_String; End Networks;