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
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/include/Interface.h"
9#include "Behavioural/include/Entity.h"
10
11namespace morpheo              {
12namespace behavioural          {
13
14  XML Interface::toXML (void)
15  {
16    log_printf(FUNC,Behavioural,"toXML","Begin");
17
18    XML xml ("interface");
19   
20    xml.balise_open_begin ("port");
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
27    if (_list_signal->empty()== false)
28      {
29        list<Signal*>::iterator i     = _list_signal->begin();
30
31        while (i != _list_signal->end())
32          {
33            xml.  insert_XML ((*i)->toXML());
34            ++i;
35          }
36      }
37
38    xml.balise_close      ();
39
40    log_printf(FUNC,Behavioural,"toXML","End");
41   
42    return xml;
43  };
44
45#ifdef POSITION
46  XML Interface::toXML_mapping (void)
47  {
48    log_printf(FUNC,Behavioural,"toXML_mapping","Begin");
49
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   ();
60
61    log_printf(FUNC,Behavioural,"toXML_mapping","End");
62     
63    return xml;
64  };
65#endif
66}; // end namespace behavioural         
67}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.