source: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_toXML.cpp @ 38

Last change on this file since 38 was 38, checked in by rosiere, 17 years ago

Interface et vhdl_testbench : l'appel aux fonction add_input et add_ouput est maintenant réalisé par la classe Interface (et autre).

2 remarques :

  • tester avec des sous composants (en particulier les sorties d'un est directement relié au sortie d'un autre)
  • Signal_testbench.cpp -> l'optimisé (par exemple pointeur de fonction afin d'éviter le test et le switch)
File size: 1.6 KB
RevLine 
[29]1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/include/Interface.h"
[31]9#include "Behavioural/include/Entity.h"
[29]10
11namespace morpheo              {
12namespace behavioural          {
13
14  XML Interface::toXML (void)
15  {
[38]16    log_printf(FUNC,Behavioural,"toXML","Begin");
17
[29]18    XML xml ("interface");
19   
[31]20    xml.balise_open_begin ("port");
[29]21    xml.  attribut        ("name"         ,_name                 );
22    xml.  attribut        ("direction"   ,toString(_direction   ));
23    xml.  attribut        ("localisation",toString(_localisation));
24    xml.balise_open_end   ();
25    xml.  text            (get_comment());
26
[31]27    if (_list_signal->empty()== false)
[29]28      {
[38]29        list<Signal*>::iterator i     = _list_signal->begin();
[29]30
[31]31        while (i != _list_signal->end())
[29]32          {
[38]33            xml.  insert_XML ((*i)->toXML());
[29]34            ++i;
35          }
36      }
37
38    xml.balise_close      ();
[38]39
40    log_printf(FUNC,Behavioural,"toXML","End");
41   
[29]42    return xml;
43  };
44
[31]45#ifdef POSITION
46  XML Interface::toXML_mapping (void)
47  {
[38]48    log_printf(FUNC,Behavioural,"toXML_mapping","Begin");
49
[31]50    if (_is_map != true)
51      throw (ErrorMorpheo ("Interface \""+_name+"\" is never mapped"));
52
53    XML xml ("interface");
54   
55    xml.singleton_begin ("port_map");
56    xml.  attribut      ("name"     ,_name               );
57    xml.  attribut      ("component",(static_cast<Entity    *>(_entity_map   ))->_name);
58    xml.  attribut      ("port"     ,(static_cast<Interface *>(_interface_map))->_name);
59    xml.singleton_end   ();
[38]60
61    log_printf(FUNC,Behavioural,"toXML_mapping","End");
[31]62     
63    return xml;
64  };
65#endif
[29]66}; // end namespace behavioural         
67}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.