Ignore:
Timestamp:
Apr 14, 2009, 8:39:12 PM (15 years ago)
Author:
rosiere
Message:

1) Add modelsim simulation systemC
2) Modelsim cosimulation systemC / VHDL is not finish !!!! (cf execute_queue and write_unit)
3) Add multi architecture
5) Add template for comparator, multiplier and divider
6) Change Message
Warning) Various test macro have change, many selftest can't compile

File:
1 edited

Legend:

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

    r98 r113  
    1212#include <time.h>
    1313#include <sstream>
     14#include <fstream>
    1415
    1516namespace morpheo              {
     
    2122                               std::string   filename)
    2223  {
    23     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
     24    log_begin(Behavioural,FUNCTION);
    2425
    2526    std::string text;
     
    3233    text += "-- "+toString(_("Date    : ")) + ctime (&current_time );
    3334    text += "-- "+toString(_("Version : ")) + MORPHEO_HEADER +"\n";
     35    text += "-- "+toString(_("Id      : ")) + _id +"  \n";
    3436    text += "-- "+toString(_("Comment : ")) + _("it's a autogenerated file, don't modify") +"\n";
    3537    text += "-------------------------------------------------------------------------------\n";
    3638   
    37     log_printf(FUNC,Behavioural,FUNCTION,"End");
     39    log_end(Behavioural,FUNCTION);
    3840
    3941    return text;
     42  };
     43
     44#undef  FUNCTION
     45#define FUNCTION "vhdl_get_id"
     46  std::string vhdl_get_id(std::string model_name)
     47  {
     48    log_begin(Behavioural,FUNCTION);
     49
     50    std::string id="";
     51
     52    directory();
     53
     54    std::string filename = MORPHEO_VHDL + "/" + model_name + VHDL_EXTENSION;
     55    std::ifstream file;
     56
     57    file.open(filename.c_str(),std::ios::in);
     58
     59    // open file
     60    if (!file)
     61      {
     62        log_printf(INFO,Behavioural,FUNCTION,_("Can't open file : \"%s\""),filename.c_str());
     63      }
     64    else
     65      {
     66        // get line with Id
     67        do
     68          {
     69            std::getline(file,id,'\n'); // comment
     70          } while ((id.find("Id      :") == std::string::npos) and
     71                   (not file.eof()));
     72
     73        if (file.eof())
     74          log_printf(INFO,Behavioural,FUNCTION,_("\"Id\" not find in file : \"%s\""),filename.c_str());
     75        else
     76          {
     77            // get id
     78            id = id.substr(id.find_first_of(':',0)+1,std::string::npos);
     79
     80            // Erase all ' '
     81            size_t i=id.find_first_of(' ',0);
     82            while (i!=std::string::npos)
     83              {
     84                id.erase(i,i+1);
     85                i=id.find_first_of(' ',i);
     86              }
     87          }
     88      }
     89
     90    log_end(Behavioural,FUNCTION);
     91
     92    return id;
    4093  };
    4194 
Note: See TracChangeset for help on using the changeset viewer.