Ignore:
Timestamp:
Mar 6, 2007, 3:34:04 PM (17 years ago)
Author:
kane
Message:

1) Ajout d'un "printer" XML pour la configuration de paramètres

2) Fin du composant "Two_Level_Branch_Predictor"

validation * systemc

  • vhdl
Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/src
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML.cpp

    r2 r3  
    1111namespace behavioural          {
    1212
    13   XML::XML  (string filename) :
    14     _filename (filename)
     13  XML::XML  (string name) :
     14    _name (name)
    1515  {
    16     header ("UTF-8");
    17   };
    18 
    19   XML::XML  (string filename,
    20              string encoding) :
    21     _filename (filename)
    22   {
    23     header(encoding);
    2416  };
    2517
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_balise_open_end.cpp

    r2 r3  
    1313  bool XML::balise_open_end (void)
    1414  {
    15     _body += ">\n";
     15    _body += " >\n";
    1616
    1717    return true;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_generate_file.cpp

    r2 r3  
    77
    88#include "Behavioural/include/XML.h"
     9#include <fstream>
     10using namespace std;
    911
    1012namespace morpheo              {
    1113namespace behavioural          {
    1214
     15  void XML::generate_file (string encoding)
     16  {
     17    header (encoding);
     18
     19    string name     = _name;
     20    string filename =  name + ".xml";
     21
     22    cout << "Generate file \""<< filename << "\"" << endl;
     23
     24    ofstream file;
     25    file.open(filename.c_str(),ios::out | ios::trunc);
     26
     27    file << get_body();
     28
     29    file.close();
     30  };
     31
    1332  void XML::generate_file (void)
    1433  {
     34    generate_file("UTF-8");
    1535  };
    1636
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_get_body.cpp

    r2 r3  
    1616  };
    1717
     18  string XML::get_body (uint32_t depth)
     19  {
     20    string body       = _body;
     21    string tabulation = indent(depth);
     22
     23    body.insert(0,tabulation);
     24    for (size_t pos=body.find('\n',0); pos<body.length()-1; pos=body.find('\n',++pos))
     25      body.insert(++pos,tabulation);
     26
     27    return body;
     28  };
     29
    1830}; // end namespace behavioural         
    1931}; // end namespace morpheo             
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/XML_header.cpp

    r2 r3  
    1313  void XML::header (string encoding)
    1414  {
    15     _body += "<?xml version=\"1.0\" encoding=\""+encoding+"\"?>\n";
     15    _body = "<?xml version=\"1.0\" encoding=\""+encoding+"\" ?>\n" + _body;
    1616  };
    1717
Note: See TracChangeset for help on using the changeset viewer.