Ignore:
Timestamp:
Apr 14, 2009, 8:39:12 PM (16 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

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/src
Files:
11 added
52 edited
2 moved

Legend:

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

    r81 r113  
    1515  {
    1616    log_printf(FUNC,Behavioural,"Component::Component","Begin");
     17    _entity = NULL;
    1718    _list_component = new std::list<Tcomponent_t *>;
    1819    log_printf(FUNC,Behavioural,"Component::Component","End");
     
    3132  {
    3233    log_printf(FUNC,Behavioural,"Component::~Component","Begin");
    33     delete _entity;
     34    if (_entity != NULL)
     35      delete _entity;
     36    while (not _list_component->empty())
     37      {
     38        delete _list_component->front();
     39        _list_component->pop_front();
     40      }
    3441    delete _list_component;
    3542    log_printf(FUNC,Behavioural,"Component::~Component","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_port_map.cpp

    r88 r113  
    8080        Signal * signal_productor;
    8181        Entity * entity_productor;
     82        Signal * signal_consumer ;
     83        Entity * entity_consumer ;
    8284
    8385        bool     src_is_productor = (signal_src->get_direction() == OUT);
     
    8587        if (src_is_productor == true)
    8688          {
    87             signal_productor = signal_src;
    88             entity_productor = entity_src;
     89            signal_productor = signal_src ;
     90            entity_productor = entity_src ;
     91            signal_consumer  = signal_dest;
     92            entity_consumer  = entity_dest;
    8993          }
    9094        else
     
    9296            signal_productor = signal_dest;
    9397            entity_productor = entity_dest;
     98            signal_consumer  = signal_src ;
     99            entity_consumer  = entity_src ;
    94100          }
    95101
    96102        // Create internal signal
    97         signal_dest= signal_internal (entity_productor, signal_productor);
     103        signal_dest= signal_internal (entity_productor,
     104                                      signal_productor,
     105                                      entity_consumer ,
     106                                      signal_consumer );
    98107        signal_dest->set_size_max(signal_src->get_size());
    99108      }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_set_component.cpp

    r82 r113  
    22 * $Id$
    33 *
    4  * [ Description ]
     4 * [ Description ]
    55 *
    66 */
     
    2121#endif
    2222                                 ,Tinstance_t instance
     23                                 ,std::string architecture
    2324                                 )
    2425  {
     
    2930    Tcomponent_t * entry = new Tcomponent_t;
    3031   
    31     entry->_component= component;
    32     entry->_instance = instance;
    33     entry->_entity   = entity;
     32    entry->_component    = component;
     33    entry->_instance     = instance;
     34    entry->_architecture = architecture;
     35    entry->_entity       = entity;
    3436
    3537    _list_component->push_back(entry);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_set_entity.cpp

    r81 r113  
    1313#undef  FUNCTION
    1414#define FUNCTION "Component::set_entity"
    15   Entity * Component::set_entity (std::string        name   
    16                                   ,std::string        type   
     15  Entity * Component::set_entity (std::string  name
     16                                  ,std::string type
    1717#ifdef POSITION
    18                                   ,schema_t      schema
     18                                  ,schema_t    schema
    1919#endif
    2020                                  )
    2121  {
    2222    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
     23
     24    if (_entity != NULL)
     25      throw ERRORMORPHEO(FUNCTION,_("Entity is already allocated.\n"));
    2326   
    2427    Entity * entity = new Entity (name   
     
    2932                                  ,_usage
    3033                                  );
     34
    3135    _entity = entity;
    3236   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_signal_internal.cpp

    r81 r113  
    22 * $Id$
    33 *
    4  * [ Description ]
     4 * [ Description ]
    55 *
    66 */
     
    1414#define FUNCTION "Component::signal_internal"
    1515  Signal * Component::signal_internal (Entity * entity_productor,
    16                                        Signal * signal_productor)
     16                                       Signal * signal_productor,
     17                                       Entity * entity_consumer,
     18                                       Signal * signal_consumer)
    1719  {
    1820    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    1921
     22    bool productor_is_cosimulation = usage_is_set(entity_productor->get_usage(),USE_COSIMULATION);
     23    bool consumer_is_cosimulation  = usage_is_set(entity_consumer ->get_usage(),USE_COSIMULATION);
     24    bool is_cosimulation           = consumer_is_cosimulation or productor_is_cosimulation;
     25    if (productor_is_cosimulation and consumer_is_cosimulation)
     26      throw ERRORMORPHEO (FUNCTION,toString(_("Entity \"%s\" and Entity \"%s\" use both cosimulation. It's not supported.\n"),entity_productor->get_name().c_str(),entity_consumer->get_name().c_str()));
     27   
    2028    // create name of internal's signal
    21     std::string str_entity = entity_productor->get_name();
    22     std::string str_signal = signal_productor->get_name();
     29    Entity * entity = (consumer_is_cosimulation)?entity_consumer:entity_productor;
     30    Signal * signal = (consumer_is_cosimulation)?signal_consumer:signal_productor;
     31
     32    std::string str_entity = entity->get_name();
     33    std::string str_signal = signal->get_name();
    2334   
    24     UpperCase (str_entity);
    25     UpperCase (str_signal);
     35//     UpperCase (str_entity);
     36//     UpperCase (str_signal);
    2637   
    27     std::string name_internal = "internal_"+str_entity+"_"+str_signal;
     38    std::string name_internal = (is_cosimulation)?str_signal:("internal_"+str_entity+"_"+str_signal);
    2839   
    2940    // test if internal's signal exist ... else, create
     
    3849       
    3950        if (interface == NULL)
    40           throw (ErrorMorpheo ("<Component::port_map> Component \""+_entity->get_name()+"\", doesn't have an interface \"\"."));
    41        
    42         std::string signame = entity_productor->get_name()+"_"+signal_productor->get_name();
    43        
     51          throw ERRORMORPHEO (FUNCTION,toString(_("Component \"%s\", doesn't have an interface \"\".\n"),_entity->get_name().c_str()));
     52
     53//      std::string signame   = entity->get_name()+"_"+signal->get_name();
     54        std::string signame   = name_internal;
     55        type_info_t type_info = signal->get_type_info();
     56
    4457        // Signal's creation
    45         switch (signal_productor->get_type_info())
     58        switch (type_info)
    4659          {
    47           case BOOL     :
    48             {
    49               interface->set_signal_internal<bool    >(signame, signal_productor->get_size());
    50               break;
    51             }
    52           case UINT8_T  :
    53             {
    54               interface->set_signal_internal<uint8_t >(signame, signal_productor->get_size());
    55               break;
    56             }
    57           case UINT16_T :
    58             {
    59               interface->set_signal_internal<uint16_t>(signame, signal_productor->get_size());
    60               break;
    61             }
    62           case UINT32_T :
    63             {
    64               interface->set_signal_internal<uint32_t>(signame, signal_productor->get_size());
    65               break;
    66             }
    67           case UINT64_T :
    68             {
    69               interface->set_signal_internal<uint64_t>(signame, signal_productor->get_size());
    70               break;
    71             }
    72           default       :
    73             throw (ErrorMorpheo ("Signal \""+name_internal+"\" : type unknow."));
     60          case BOOL     : interface->set_signal_internal<bool    >(signame, signal->get_size()); break;
     61          case UINT8_T  : interface->set_signal_internal<uint8_t >(signame, signal->get_size()); break;
     62          case UINT16_T : interface->set_signal_internal<uint16_t>(signame, signal->get_size()); break;
     63          case UINT32_T : interface->set_signal_internal<uint32_t>(signame, signal->get_size()); break;
     64          case UINT64_T : interface->set_signal_internal<uint64_t>(signame, signal->get_size()); break;
     65          default       :throw (ErrorMorpheo ("Signal \""+name_internal+"\" : type unknow."));
    7466          }
    7567       
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Component_vhdl_instance.cpp

    r95 r113  
    9292        while (i != list_component->end())
    9393          {
    94             Entity *    entity   = (*i)->_entity;
    95             Tinstance_t instance = (*i)->_instance;
     94            Entity *    entity       = (*i)->_entity;
     95            Tinstance_t instance     = (*i)->_instance;
     96            std::string architecture = (*i)->_architecture;
     97            std::string package      = "work";
    9698           
    9799            if (instance & INSTANCE_LIBRARY)
     
    176178                    }
    177179                }
    178               vhdl->set_body_component ("instance_"+entity->get_name(),entity->get_name(),list_port_map);
     180              vhdl->set_body_component ("instance_"+entity->get_name(),
     181                                        entity->get_name(),
     182                                        architecture,
     183                                        package,
     184                                        list_port_map);
    179185             
    180186            }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface.cpp

    r112 r113  
    7373         it != _list_signal->end();
    7474         ++it)
    75       delete (*it);
     75      {
     76        if ((_usage & USE_SYSTEMC) and
     77            ((*it)->get_direction() == INTERNAL))
     78          delete (*it)->get_sc_signal();
     79        delete (*it);
     80      }
    7681   
    7782    delete _list_signal;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo_testbench_assert.cpp

    r94 r113  
    3434          while (i != _list_cycle->end())
    3535            {
    36               vhdl->set_body("assert not (("+counter_name+" = "+toString(*i)+" and "+test_name+" = '1')) report \"***** <"+_name+"> Test number "+toString(j)+" is OK     *****\" severity NOTE;");
    37               vhdl->set_body("assert not (("+counter_name+" = "+toString(*i)+" and "+test_name+" = '0')) report \"@@@@@ <"+_name+"> Test number "+toString(j)+" is KO !!! @@@@@\" severity NOTE;");
     36              vhdl->set_body("assert not (("+counter_name+" = "+toString(*i)+" and "+test_name+" = '1')) report \"***** <"+_name+"> Test number "+toString(j)+" is OK     *****\" severity "+toString(VHDL_SEVERITY_NOTE)+";");
     37              vhdl->set_body("assert not (("+counter_name+" = "+toString(*i)+" and "+test_name+" = '0')) report \"@@@@@ <"+_name+"> Test number "+toString(j)+" is KO !!! @@@@@\" severity "+toString(VHDL_SEVERITY_NOTE)+";");
    3838              j++;
    3939              ++i;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_fifo_testbench_cycle.cpp

    r81 r113  
    99#include "Behavioural/include/Interface_fifo.h"
    1010#include "Behavioural/include/Entity.h"
     11#include "Common/include/Systemc.h"
    1112
    1213namespace morpheo              {
     
    1819
    1920    // note : if defined(VHDL_TESTBENCH) then defined(SYSTEMC)
    20     _list_cycle->push_back(static_cast<uint32_t>(sc_simulation_time()));
     21    _list_cycle->push_back(static_cast<uint32_t>(simulation_cycle()));
    2122
    2223    log_printf(FUNC,Behavioural,"testbench_cycle","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_find_signal.cpp

    r81 r113  
    1515  {
    1616    log_printf(FUNC,Behavioural,"find_signal","Begin");
     17
     18    LowerCase(name);
    1719
    1820    std::list<Signal*>::iterator i   = _list_signal->begin();
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_port.cpp

    r81 r113  
    2626          }
    2727      }
     28
    2829    log_printf(FUNC,Behavioural,"set_port (Vhdl)","End");
    2930  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_set_signal.cpp

    r112 r113  
    1111namespace behavioural          {
    1212
     13#undef  FUNCTION
     14#define FUNCTION "Interface::set_signal"
    1315  Signal * Interface::set_signal (std::string     name     ,
    1416                                  direction_t     direction,
     
    1618                                  presence_port_t presence_port)
    1719  {
    18     log_printf(FUNC,Behavioural,"set_signal","Begin");
     20    log_begin(Behavioural,FUNCTION);
    1921
    2022    std::string signame = signal_name(_name, name, direction);
     
    2426    _list_signal->push_back (sig);
    2527
    26     log_printf(FUNC,Behavioural,"set_signal","End");
     28    log_end(Behavioural,FUNCTION);
    2729
    2830    return sig;
     
    3638  void Interface::set_signal (Vhdl * & vhdl)
    3739  {
    38     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
     40    log_begin(Behavioural,FUNCTION);
    3941    if (not _list_signal->empty())
    4042      {
     
    4749          }
    4850      }
    49     log_printf(FUNC,Behavioural,FUNCTION,"End");
     51    log_end(Behavioural,FUNCTION);
    5052  };
    5153#  endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interface_signal_name.cpp

    r81 r113  
    1717    log_printf(FUNC,Behavioural,"signal_name","Begin");
    1818
    19     std::string str_direction = toString(direction);
     19    std::string str_direction = (direction==INTERNAL)?"":toString(direction);
    2020    std::string str_interface = name_interface;
    2121    std::string str_signal    = name_signal;
    2222
    23     LowerCase(str_direction);   
    24     UpperCase(str_interface);
    25     UpperCase(str_signal   );
     23//     LowerCase(str_direction);   
     24//     LowerCase(str_interface);
     25//     LowerCase(str_signal   );
    2626   
    27     std::string signame = str_direction;
     27    std::string signame = "";
     28    bool need_underscore = false;
     29
     30    if (str_direction != "")
     31      {
     32        signame +=                            str_direction;
     33        need_underscore = true;
     34      }
    2835    if (str_interface != "")
    29       signame += "_"+str_interface;
    30     if (str_signal    != "")
    31       signame += "_"+str_signal;
     36      {
     37        signame += ((need_underscore)?"_":"")+str_interface;
     38        need_underscore = true;
     39      }
     40    if (str_signal != "")
     41      {
     42        signame += ((need_underscore)?"_":"")+str_signal;
     43//      need_underscore = true;
     44      }
    3245
    3346    log_printf(FUNC,Behavioural,"signal_name","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces.cpp

    r112 r113  
    1111namespace behavioural          {
    1212
    13   Interfaces::Interfaces  (std::string   name,
     13  Interfaces::Interfaces  (std::string name,
    1414                           Tusage_t usage):
    1515    _name  (name),
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_set_port.cpp

    r81 r113  
    2727            ++i;
    2828          }
     29
     30//         Signal * clock = get_clock();
     31//         if (clock != NULL)
     32//           vhdl->set_port_clock (clock->get_name());
    2933      }
     34
    3035    log_printf(FUNC,Behavioural,FUNCTION,"End");
    3136  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Interfaces_testbench_generate_file.cpp

    r94 r113  
    6666    vhdl->set_body("");
    6767    vhdl->set_body("-- if the systemC simulate have multiple reset, we make the last");
    68     vhdl->set_body(reset_name+" <= '1' after 150 ns;");   
     68    vhdl->set_body(reset_name+" <= '1' after "+toString(2.*VHDL_TIME_PERIOD)+" "+toString(VHDL_TIME_UNIT)+";");   
    6969
    7070    vhdl->set_body("");
     
    7373    vhdl->set_body("------------------------------------------------------");
    7474    vhdl->set_body("");
    75     vhdl->set_body(clock_name+" <= not "+clock_name+" after 50 ns;");
     75    vhdl->set_body(clock_name+" <= not "+clock_name+" after "+toString(VHDL_TIME_PERIOD/2.)+" "+toString(VHDL_TIME_UNIT)+";");
    7676    vhdl->set_body("");
    7777    vhdl->set_body("process ("+clock_name+")");
     
    8989#ifdef VHDL_TESTBENCH_ASSERT
    9090    for (uint32_t cpt=0; cpt<=cycle; cpt++)
    91       vhdl->set_body("\t\t\tassert not ("+counter+" = "+toString(cpt)+") report \"===== Test number "+toString(cpt)+" =====\" severity NOTE;");
     91      vhdl->set_body("\t\t\tassert not ("+counter+" = "+toString(cpt)+") report \"===== Test number "+toString(cpt)+" =====\" severity "+toString(VHDL_SEVERITY_NOTE)+";");
    9292
    9393    for (std::list<Interface_fifo*>::iterator it=_list_interface->begin();
     
    106106
    107107    vhdl->set_body("");
    108     vhdl->set_body("\t\t\tassert not ("+counter+" >= "+toString(cycle)+") report \"Test OK\" severity FAILURE;");
    109     vhdl->set_body("\t\t\tassert not ("+test_name+" = '0') report \"Test KO\" severity FAILURE;");
     108    vhdl->set_body("\t\t\tassert not ("+counter+" >= "+toString(cycle)+") report \"Test OK\" severity "+toString(VHDL_SEVERITY_FAILURE)+";");
     109    vhdl->set_body("\t\t\tassert not ("+test_name+" = '0') report \"Test KO\" severity "+toString(VHDL_SEVERITY_FAILURE)+";");
    110110    vhdl->set_body("\t\tend if;");
    111111    vhdl->set_body("\tend if;");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Model_set_model.cpp

    r112 r113  
    1212
    1313#undef  FUNCTION
    14 #define FUNCTION "Model::get_type"
     14#define FUNCTION "Model::set_model"
    1515  void Model::set_model (std::string component, model_type_t type, debug_verbosity_t debug)
    1616  {
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Parameters.cpp

    r81 r113  
    1313#undef  FUNCTION
    1414#define FUNCTION "Parameters::Parameters"
    15   Parameters::Parameters  (void)
     15  Parameters::Parameters  (void) :
     16    _type ("")
     17  {
     18    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
     19    log_printf(FUNC,Behavioural,FUNCTION,"End");
     20  };
     21
     22#undef  FUNCTION
     23#define FUNCTION "Parameters::Parameters"
     24  Parameters::Parameters  (std::string type) :
     25    _type (type)
    1626  {
    1727    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Parameters_test.cpp

    r88 r113  
    2020    Parameters_test x = msg_error();
    2121   
    22     std::cerr << x.print();
     22    msg("%s",x.print().c_str());
    2323
    2424    if (x.have_error())
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal.cpp

    r81 r113  
    1111namespace behavioural          {
    1212
    13   Signal::Signal  (std::string          name         ,
     13  Signal::Signal  (std::string     name         ,
    1414                   direction_t     direction    ,
    1515                   uint32_t        size         ,
     
    2020  {
    2121    log_printf(FUNC,Behavioural,"Signal","Begin");
    22     _size                     = size;
     22
    2323    _is_allocate              = false;
    2424    _is_map_as_component_src  = false;
     
    3333    _list_value          = new std::list<std::string>;
    3434#endif
     35    set_size(size);
    3536   
    3637    if (_size == 0)
    3738      throw ERRORMORPHEO(FUNCTION,"Size of signal '"+_name+"' is nul");
    38 
    3939
    4040    log_printf(FUNC,Behavioural,"Signal","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_get_size.cpp

    r81 r113  
    77
    88#include "Behavioural/include/Signal.h"
    9 
     9#include "Common/include/Environment.h"
    1010
    1111namespace morpheo              {
     
    1818    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    1919    uint32_t _return = _size;
     20
     21#ifdef MODELSIM_COSIMULATION
     22    switch (_type_info)
     23      {
     24      case BOOL     : _return =  1; break;
     25      case UINT8_T  : _return =  8; break;
     26      case UINT16_T : _return = 16; break;
     27      case UINT32_T : _return = 32; break;
     28      case UINT64_T : _return = 64; break;
     29      default       : break;
     30      }
     31#endif
     32
    2033    log_printf(FUNC,Behavioural,FUNCTION,"End");
    2134
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_link.cpp

    r88 r113  
    22 * $Id$
    33 *
    4  * [ Description ]
     4 * [ Description ]
    55 *
    66 */
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_presence_testbench.cpp

    r81 r113  
    1313
    1414#undef  FUNCTION
    15 #define FUNCTION "Signal::presence_vhdl"
    16   bool Signal::presence_vhdl (void)
     15#define FUNCTION "Signal::presence_testbench"
     16  bool Signal::presence_testbench (void)
    1717  {
    1818    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_set_port.cpp

    r81 r113  
    2121        (_presence_port == CLOCK_VHDL_YES)              or
    2222        (_presence_port == RESET_VHDL_YES))
    23       vhdl->set_port (_name,_direction,_size);
     23      vhdl->set_port (_name,_direction,get_size());
    2424
    2525    log_printf(FUNC,Behavioural,"set_port (Vhdl)","End");
     
    3838//      or (_presence_port == RESET_VHDL_NO )
    3939        )
    40       vhdl->set_signal (_name        ,_size);
     40      vhdl->set_signal (_name        ,get_size());
    4141
    4242    if (_direction == OUT)
    43       vhdl->set_signal (_name+"_test",_size);
     43      vhdl->set_signal (_name+"_test",get_size());
    4444
    4545    log_printf(FUNC,Behavioural,"set_signal (Vhdl)","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_set_size.cpp

    r81 r113  
    1818    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    1919    _size = size;
     20
    2021    log_printf(FUNC,Behavioural,FUNCTION,"End");
    2122  };
     
    2728    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    2829    if (size > _size)
    29       _size = size;
     30      set_size(size);
    3031    log_printf(FUNC,Behavioural,FUNCTION,"End");
    3132  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_testbench.cpp

    r81 r113  
    4444              switch (_direction)
    4545                {
    46                 case IN    : {str =             toBase2 (value,_size); break;}
    47                 case OUT   : {str =             toBase2 (value,_size); break;}
     46                case IN    : {str =             toBase2 (value,get_size()); break;}
     47                case OUT   : {str =             toBase2 (value,get_size()); break;}
    4848                default    : {break;}
    4949                }
     
    5656              switch (_direction)
    5757                {
    58                 case IN    : {str =             toBase2 (value,_size); break;}
    59                 case OUT   : {str =             toBase2 (value,_size); break;}
     58                case IN    : {str =             toBase2 (value,get_size()); break;}
     59                case OUT   : {str =             toBase2 (value,get_size()); break;}
    6060                default    : {break;}           
    6161                }
     
    6868              switch (_direction)
    6969                {
    70                 case IN    : {str =             toBase2 (value,_size); break;}
    71                 case OUT   : {str =             toBase2 (value,_size); break;}
     70                case IN    : {str =             toBase2 (value,get_size()); break;}
     71                case OUT   : {str =             toBase2 (value,get_size()); break;}
    7272                default    : {break;}
    7373                }
     
    8080              switch (_direction)
    8181                {
    82                 case IN    : {str =             toBase2 (value,_size); break;}
    83                 case OUT   : {str =             toBase2 (value,_size); break;}
     82                case IN    : {str =             toBase2 (value,get_size()); break;}
     83                case OUT   : {str =             toBase2 (value,get_size()); break;}
    8484                default    : {break;}
    8585                }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Signal_testbench_body.cpp

    r81 r113  
    2525        {
    2626          std::string separator;
    27           if (_size == 1)
     27          if (get_size() == 1)
    2828            separator = "\'";
    2929          else
     
    4848            }
    4949         
    50           if (_size == 1)
     50          if (get_size() == 1)
    5151            vhdl->set_body ("\t'0' when others;");
    5252          else
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Simulation_test_end.cpp

    r110 r113  
    88
    99#include "Behavioural/include/Simulation.h"
     10#include "Common/include/Systemc.h"
    1011
    1112namespace morpheo              {
     
    1415  bool simulation_test_end (void)
    1516  {
    16     msg("##########[ cycle %d ]\n",static_cast<uint32_t>(sc_simulation_time()));
     17    msg("##########[ cycle %d ]\n",static_cast<uint32_t>(simulation_cycle()));
    1718
    1819    // Test if a stop condition is activate
     
    2627
    2728    if (_simulation_nb_cycle != 0)
    28       end_cycle = (_simulation_nb_cycle <= sc_simulation_time());
     29      end_cycle = (_simulation_nb_cycle <= simulation_cycle());
    2930    else
    3031      end_cycle = true;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_end_cycle.cpp

    r81 r113  
    11#ifdef STATISTICS
    22#include "Behavioural/include/Stat.h"
     3#include "Common/include/Systemc.h"
    34
    45namespace morpheo {
     
    67  void Stat::end_cycle (void)
    78  {
    8     cycle_t _cycle_sum = sc_simulation_time();
     9    cycle_t _cycle_sum = simulation_cycle();
    910
    1011    if (_cycle_sum >= _nb_cycle_before_begin)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_generate_file.cpp

    r88 r113  
    33#include "Behavioural/include/Version.h"
    44#include "Common/include/Environment.h"
     5#include "Common/include/Systemc.h"
    56
    67namespace morpheo {
     
    1314    std::string body = print(1);
    1415
    15     cycle_t _cycle_sum = sc_simulation_time();
     16    cycle_t _cycle_sum = simulation_cycle();
    1617
    1718    morpheo::behavioural::XML * xml = new morpheo::behavioural::XML (_name_instance);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Stat_print.cpp

    r88 r113  
    11#ifdef STATISTICS
    22#include "Behavioural/include/Stat.h"
     3#include "Common/include/Systemc.h"
    34
    45namespace morpheo {
     
    1213    end_simulation();
    1314
    14     cycle_t _cycle_sum = sc_simulation_time();
     15    cycle_t _cycle_sum = simulation_cycle();
    1516
    1617    morpheo::behavioural::XML xml (_name_instance);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Usage.cpp

    r88 r113  
    55namespace morpheo {
    66namespace behavioural {
     7
     8#ifdef MODELSIM_COSIMULATION
     9  Tusage_t usage_cosimulation(Tusage_t usage)
     10  {
     11    Tusage_t _return = usage;
     12//  _return = usage_unset(_return,USE_SYSTEMC              );
     13    _return = usage_unset(_return,USE_SYSTEMC_INTERFACE    );
     14    _return = usage_unset(_return,USE_SYSTEMC_BODY         );
     15    _return = usage_unset(_return,USE_VHDL                 );
     16    _return = usage_unset(_return,USE_VHDL_TESTBENCH       );
     17    _return = usage_unset(_return,USE_VHDL_TESTBENCH_ASSERT);
     18//  _return = usage_unset(_return,USE_POSITION             );
     19    _return = usage_unset(_return,USE_STATISTICS           );
     20//  _return = usage_unset(_return,USE_INFORMATION          );
     21//  _return = usage_unset(_return,USE_HEADER               );
     22    _return = usage_set  (_return,USE_COSIMULATION         );
     23   
     24    return _return;
     25  }
     26#endif
    727
    828  Tusage_t usage_set         (Tusage_t usage, Tusage_t flag)
     
    2242#undef  FUNCTION
    2343#define FUNCTION "usage_environment"
    24   void    usage_environment (Tusage_t usage)
     44  Tusage_t usage_environment (Tusage_t usage)
    2545  {
    2646#ifndef SYSTEMC
    27     if (usage_is_set(usage,USE_SYSTEMC))
    28       throw ERRORMORPHEO(FUNCTION,_("Component use the flag \"USE_SYSTEMC\", but the macro's compiler \"SYSTEMC\" is unset.\n"));
     47    if (usage_is_set(usage,USE_SYSTEMC_INTERFACE))
     48      throw ERRORMORPHEO(FUNCTION,_("Component use the flag \"USE_SYSTEMC_INTERFACE\", but the macro's compiler \"SYSTEMC\" is unset.\n"));
     49    if (usage_is_set(usage,USE_SYSTEMC_BODY))
     50      throw ERRORMORPHEO(FUNCTION,_("Component use the flag \"USE_SYSTEMC_BODY\", but the macro's compiler \"SYSTEMC\" is unset.\n"));
    2951#endif
    3052#ifndef VHDL
     
    4870      throw ERRORMORPHEO(FUNCTION,_("Component use the flag \"USE_STATISTICS\", but the macro's compiler \"STATISTICS\" is unset.\n"));
    4971#endif
    50 #ifndef INFORMATION
    51     if (usage_is_set(usage,USE_INFORMATION))
    52       throw ERRORMORPHEO(FUNCTION,_("Component use the flag \"USE_INFORMATION\", but the macro's compiler \"INFORMATION\" is unset.\n"));
    53 #endif
     72// #ifndef INFORMATION
     73//     if (usage_is_set(usage,USE_INFORMATION))
     74//       throw ERRORMORPHEO(FUNCTION,_("Component use the flag \"USE_INFORMATION\", but the macro's compiler \"INFORMATION\" is unset.\n"));
     75// #endif
    5476
    5577#ifndef DEBUG
    5678#endif
    5779
    58     if (usage_is_set(usage,USE_STATISTICS) and not usage_is_set(usage,USE_SYSTEMC))
    59       throw ERRORMORPHEO(FUNCTION,_("Usage flags conflit : to use the statistics, you must set flag USE_SYSTEMC\n"));
     80    if (usage_is_set(usage,USE_STATISTICS) and not usage_is_set(usage,USE_SYSTEMC_BODY))
     81      throw ERRORMORPHEO(FUNCTION,_("Usage flags conflit : to use the statistics, you must set flag USE_SYSTEMC_BODY\n"));
    6082   
    61     if (usage_is_set(usage,USE_INFORMATION) and not usage_is_set(usage,USE_STATISTICS))
    62       throw ERRORMORPHEO(FUNCTION,_("Usage flags conflit : to use the information, you must set flag USE_STATISTICS\n"));
     83//     if (usage_is_set(usage,USE_INFORMATION) and not usage_is_set(usage,USE_STATISTICS))
     84//       throw ERRORMORPHEO(FUNCTION,_("Usage flags conflit : to use the information, you must set flag USE_STATISTICS\n"));
    6385   
    64     if (usage_is_set(usage,USE_VHDL_TESTBENCH) and not usage_is_set(usage,USE_SYSTEMC))
    65       throw ERRORMORPHEO(FUNCTION,_("Usage flags conflit : to use the vhdl's test bench, you must set flag USE_SYSTEMC\n"));
     86    if (usage_is_set(usage,USE_VHDL_TESTBENCH) and not usage_is_set(usage,USE_SYSTEMC_BODY))
     87      throw ERRORMORPHEO(FUNCTION,_("Usage flags conflit : to use the vhdl's test bench, you must set flag USE_SYSTEMC_BODY\n"));
    6688   
    6789    if (usage_is_set(usage,USE_VHDL_TESTBENCH) and not usage_is_set(usage,USE_VHDL))
     
    7092    if (usage_is_set(usage,USE_VHDL_TESTBENCH_ASSERT) and not usage_is_set(usage,USE_VHDL_TESTBENCH))
    7193      throw ERRORMORPHEO(FUNCTION,_("Usage flags conflit : to use an assert in vhdl's test bench, you must set flag USE_VHDL_TESTBENCH\n"));
     94
     95    return usage;
    7296  }
    7397
     
    77101
    78102#ifdef SYSTEMC
    79     usage = usage_set(usage,USE_SYSTEMC);
     103    usage = usage_set(usage,USE_SYSTEMC_INTERFACE);
     104    usage = usage_set(usage,USE_SYSTEMC_BODY);
    80105#endif
    81106#ifdef VHDL
     
    94119    usage = usage_set(usage,USE_STATISTICS);
    95120#endif
    96 #ifdef INFORMATION
    97     usage = usage_set(usage,USE_INFORMATION);
    98 #endif
     121// #ifdef INFORMATION
     122//     usage = usage_set(usage,USE_INFORMATION);
     123// #endif
    99124    usage = usage_set(usage,USE_HEADER);
    100125#ifdef DEBUG
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl.cpp

    r81 r113  
    1515#undef  FUNCTION
    1616#define FUNCTION "Vhdl::Vhdl"
    17   Vhdl::Vhdl  (std::string name):
    18     _name   (name)
     17  Vhdl::Vhdl  (std::string name,
     18               std::string id):
     19    _name                      (name),
     20    _id                        (id),
     21    _name_architecture_default ("morpheo_behavioural")
    1922  {
    2023    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
     24
     25    _name_architecture = _name_architecture_default;
     26//  _port_clock        = "";
     27
     28    set_library_default();
     29
    2130    log_printf(FUNC,Behavioural,FUNCTION,"End");
    2231  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_generate_file_model.cpp

    r98 r113  
    2222    directory();
    2323
    24     std::string filename = MORPHEO_VHDL + "/" + _name + ".vhdl";
     24    std::string filename = MORPHEO_VHDL + "/" + _name + VHDL_EXTENSION;
    2525   
    2626    msg_printf(INFORMATION,_("Generate file \"%s\"."),filename.c_str());
     
    3030    file.open(filename.c_str(),std::ios::out | std::ios::trunc);
    3131
    32     file << get_model (0,filename,_name,"behavioural");
     32    file << get_model (0,filename,_name);
    3333    file.close();
    3434
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_generate_file_package.cpp

    r88 r113  
    44 * $Id$
    55 *
    6  * [ Description ]
     6 * [ Description ]
    77 *
    88 */
     
    2323
    2424    std::string name     = _name + "_Pack";
    25     std::string filename = MORPHEO_VHDL + "/" + name + ".vhdl";
     25    std::string filename = MORPHEO_VHDL + "/" + name + VHDL_EXTENSION;
    2626
    2727    msg_printf(INFORMATION,_("Generate file \"%s\"."),filename.c_str());
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_alias.cpp

    r81 r113  
    2020  {
    2121    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    22     std::string _return = get_list(_list_alias, depth, ";", true);
     22
     23    test_architecture();
     24   
     25    std::string _return = get_list(_architecture[_name_architecture]._list_alias, depth, ";", true);
    2326    log_printf(FUNC,Behavioural,FUNCTION,"End");
    2427
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_architecture.cpp

    r94 r113  
    1111#include "Common/include/Tabulation.h"
    1212
    13 #include <sstream>
    14 
    1513namespace morpheo              {
    1614namespace behavioural          {
     
    1816#undef  FUNCTION
    1917#define FUNCTION "Vhdl::get_architecture"
    20   std::string Vhdl::get_architecture (uint32_t depth      ,
    21                                  std::string   name       ,
    22                                  std::string   entity_name)
     18  std::string Vhdl::get_architecture (uint32_t    depth      ,
     19                                      std::string entity_name)
    2320  {
    2421    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    2522
    26     std::string        tab = morpheo::tab(depth);
    2723    std::ostringstream text;
     24    std::string name_architecture_old = _name_architecture;
     25    std::string tab=morpheo::tab(depth);
    2826
    29     text << tab << "architecture " << name << " of " << entity_name << " is" << std::endl
    30          << tab << get_type     (depth+1)                                    << std::endl
    31          << tab << get_signal   (depth+1)                                    << std::endl
    32          << tab << get_alias    (depth+1)                                    << std::endl
    33          << tab << "begin"                                                   << std::endl
    34          << tab << get_body     (depth+1)                                    << std::endl
    35          << tab << "end " << name << ";"                                     << std::endl;
     27    for (std::map<std::string,vhdl_architecture_t>::iterator it = _architecture.begin();
     28         it!=_architecture.end();
     29         ++it)
     30      {
     31        std::string name = it->first;
     32        set_architecture(name);
     33
     34        text << tab << "architecture " << name << " of " << entity_name << " is" << std::endl
     35             << tab << get_type     (depth+1)                                    << std::endl
     36             << tab << get_signal   (depth+1)                                    << std::endl
     37             << tab << get_alias    (depth+1)                                    << std::endl
     38             << tab << "begin"                                                   << std::endl
     39             << tab << get_body     (depth+1)                                    << std::endl
     40             << tab << "end " << name << ";"                                     << std::endl;
     41      }
     42
     43    set_architecture (name_architecture_old);
    3644
    3745    log_printf(FUNC,Behavioural,FUNCTION,"End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_body.cpp

    r81 r113  
    2020  {
    2121    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    22     std::string _return = get_list(_list_body,depth,"",true);
     22
     23    test_architecture();
     24    std::string _return = get_list(_architecture[_name_architecture]._list_body,depth,"",true);
     25
     26    _return = _return + get_debug(depth);
     27   
    2328    log_printf(FUNC,Behavioural,FUNCTION,"End");
    2429
  • 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 
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_library.cpp

    r111 r113  
    1616 
    1717#undef  FUNCTION
    18 #define FUNCTION "Vhdl::get_library_work"
    19   std::string Vhdl::get_library_work (uint32_t depth)
     18#define FUNCTION "Vhdl::get_library"
     19  std::string Vhdl::get_library (uint32_t depth)
    2020  {
    2121    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    2222
    23     std::list<std::string>::iterator i   = _list_library_work.begin();
     23    std::list<std::string>::iterator i   = _list_library.begin();
    2424    std::string                 tab = morpheo::tab(depth);
    2525    std::ostringstream          text;
    2626
    27     if (i != _list_library_work.end())
    28       text << tab                    << std::endl
    29            << tab << "library work;" << std::endl
    30            << get_list(_list_library_work,depth,";",true);
     27    if (i != _list_library.end())
     28      text << get_list(_list_library,depth,";",true);
    3129
    3230    log_printf(FUNC,Behavioural,FUNCTION,"End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_list.cpp

    r81 r113  
    1717#undef  FUNCTION
    1818#define FUNCTION "Vhdl::get_list"
    19   std::string Vhdl::get_list (std::list<std::string> liste                ,
    20                               uint32_t     depth                ,
    21                               std::string       separator            ,
    22                               bool         last_separator       )
     19  std::string Vhdl::get_list (std::list<std::string> liste         ,
     20                              uint32_t               depth         ,
     21                              std::string            separator     ,
     22                              bool                   last_separator)
    2323  {
    2424    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_model.cpp

    r94 r113  
    1515namespace behavioural          {
    1616 
    17   std::string Vhdl::get_model(uint32_t depth            ,
    18                          std::string   filename         ,
    19                          std::string   entity_name      ,
    20                          std::string   architecture_name)
     17  std::string Vhdl::get_model(uint32_t depth                 ,
     18                              std::string   filename         ,
     19                              std::string   entity_name      )
    2120  {
    2221    log_printf(FUNC,Behavioural,"get_model","Begin");
     
    2524    std::ostringstream text;
    2625
    27     text << tab << get_header       (depth,filename)                      << std::endl
    28          << tab << get_library_ieee (depth)                               << std::endl
    29          << tab << get_library_work (depth)                               << std::endl
    30          << tab << get_entity       (depth,entity_name)                   << std::endl
    31          << tab << get_architecture (depth,architecture_name,entity_name) << std::endl;
     26    std::string configuration_name = "configuration_"+entity_name;
     27
     28    text << tab << get_header       (depth,filename)    << std::endl
     29         << tab << get_library      (depth)             << std::endl
     30         << tab << get_entity       (depth,entity_name) << std::endl
     31         << tab << get_architecture (depth,entity_name) << std::endl
     32         << tab << get_configuration(depth,entity_name,configuration_name) << std::endl
     33      ;
    3234   
    3335    log_printf(FUNC,Behavioural,"get_model","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_package.cpp

    r94 r113  
    2727    std::ostringstream text;
    2828
    29     text << tab << get_header       (depth,filename)                      << std::endl
    30          << tab << get_library_ieee (depth)                               << std::endl
    31          << tab << "package " << package_name << " is"                    << std::endl
    32          << tab << get_component    (depth+1,entity_name)                 << std::endl
    33          << tab << "end " << package_name << ";"                          << std::endl;
     29    text << tab << get_header          (depth,filename)     << std::endl
     30         << tab << get_library_default (depth)              << std::endl
     31         << tab << "package " << package_name << " is"      << std::endl
     32         << tab << get_component    (depth+1,entity_name)   << std::endl
     33         << tab << "end " << package_name << ";"            << std::endl;
    3434
    3535    log_printf(FUNC,Behavioural,FUNCTION,"End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_signal.cpp

    r81 r113  
    2020  {
    2121    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    22     std::string _return = get_list (_list_signal, depth, ";", true);
     22
     23    test_architecture();
     24
     25    std::string _return = get_list (_architecture[_name_architecture]._list_signal, depth, ";", true);
     26
    2327    log_printf(FUNC,Behavioural,FUNCTION,"End");
    2428
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_type.cpp

    r81 r113  
    2020  {
    2121    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    22     std::string _return = get_list (_list_type, depth, ";", true);
     22
     23    test_architecture();
     24    std::string _return = get_list (_architecture[_name_architecture]._list_type, depth, ";", true);
     25
    2326    log_printf(FUNC,Behavioural,FUNCTION,"End");
    2427
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_alias.cpp

    r81 r113  
    2323  {
    2424    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    25     set_list(_list_alias, "alias "+ name1+"\t: "+type1+"\tis "+name2+"\t"+range2);
     25   
     26    test_architecture();
     27   
     28    set_list(_architecture[_name_architecture]._list_alias, "alias "+ name1+"\t: "+type1+"\tis "+name2+"\t"+range2);
     29
    2630    log_printf(FUNC,Behavioural,FUNCTION,"End");
    2731  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_body.cpp

    r94 r113  
    3030  {
    3131    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    32     set_list(_list_body, morpheo::tab(depth)+text);
     32
     33    test_architecture();
     34
     35    set_list(_architecture[_name_architecture]._list_body, morpheo::tab(depth)+text);
    3336    log_printf(FUNC,Behavioural,FUNCTION,"End");
    3437  };
     
    4043  {
    4144    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
     45
     46    test_architecture();
    4247   
    4348    std::string tab=morpheo::tab(depth);
    4449
    45     for (std::list<std::string>::iterator it=vhdl->_list_body.begin();
    46          it!=vhdl->_list_body.end();
     50    for (std::list<std::string>::iterator it=vhdl->_architecture[_name_architecture]._list_body.begin();
     51         it!=vhdl->_architecture[_name_architecture]._list_body.end();
    4752         ++it)
    48       set_list(_list_body,tab+*it);
     53      set_list(_architecture[_name_architecture]._list_body,tab+*it);
    4954
    5055    log_printf(FUNC,Behavioural,FUNCTION,"End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_body_component.cpp

    r81 r113  
    1717#undef  FUNCTION
    1818#define FUNCTION "Vhdl::set_body_component"
    19   void Vhdl::set_body_component (std::string         name_instance      ,
    20                                  std::string         name_component     ,
    21                                  std::list<std::string>   list_port_map      )
     19  void Vhdl::set_body_component (std::string            name_instance    ,
     20                                 std::string            name_component   ,
     21                                 std::string            name_architecture,
     22                                 std::string            name_package     ,
     23                                 std::list<std::string> list_port_map )
    2224  {
    2325    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    2426
    25     set_body(name_instance + " : " + name_component);
     27    name_architecture = test_architecture(name_architecture);
     28
     29    set_body(name_instance + " : entity " + name_package + "." + name_component + " (" + name_architecture + ")");
     30//  set_body(name_instance + " : " + name_component);
    2631    set_body("port map (");
    27     set_list(_list_body, get_list(list_port_map, 1, ",", false));
     32    set_list(_architecture[name_architecture]._list_body, get_list(list_port_map, 1, ",", false));
    2833    set_body(");");
    2934
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_constant.cpp

    r95 r113  
    2222  {
    2323    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    24     set_list(_list_type, "constant "+ name+"\t: "+type+"\t:= "+init);
     24
     25    test_architecture();
     26   
     27    set_list(_architecture[_name_architecture]._list_type, "constant "+ name+"\t: "+type+"\t:= "+init);
     28   
    2529    log_printf(FUNC,Behavioural,FUNCTION,"End");
    2630  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_library_default.cpp

    r111 r113  
    44 * $Id$
    55 *
    6  * [ Description ]
     6 * [ Description ]
    77 *
    88 */
     
    1717 
    1818#undef  FUNCTION
    19 #define FUNCTION "Vhdl::get_library_ieee"
    20   std::string Vhdl::get_library_ieee (uint32_t depth)
     19#define FUNCTION "Vhdl::set_library_default"
     20  void Vhdl::set_library_default (void)
    2121  {
    22     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    23 
    24     std::string        tab = morpheo::tab(depth);
    25     std::ostringstream text;
    26 
    27     text << tab                                         << std::endl
    28          << tab << "library ieee;"                      << std::endl
    29          << tab << "  use ieee.numeric_bit.all;       " << std::endl
    30          << tab << "  use ieee.numeric_std.all;       " << std::endl
    31          << tab << "  use ieee.std_logic_1164.all;    " << std::endl
    32          << tab << "  use ieee.std_logic_arith.all;   " << std::endl
    33          << tab << "  use ieee.std_logic_misc.all;    " << std::endl
    34          << tab << "--use ieee.std_logic_signed.all;  " << std::endl
    35          << tab << "  use ieee.std_logic_unsigned.all;" << std::endl
    36          << tab << "--use ieee.std_logic_textio.all;  " << std::endl;
     22    log_begin(Behavioural,FUNCTION);
     23   
     24    set_library("ieee","numeric_bit"       ,"all");
     25    set_library("ieee","numeric_std"       ,"all");
     26    set_library("ieee","std_logic_1164"    ,"all");
     27    set_library("ieee","std_logic_arith"   ,"all");
     28    set_library("ieee","std_logic_misc"    ,"all");
     29//  set_library("ieee","std_logic_signed"  ,"all");
     30    set_library("ieee","std_logic_unsigned","all");
     31//  set_library("ieee","std_logic_textio"  ,"all");
    3732     
    38     log_printf(FUNC,Behavioural,FUNCTION,"End");
    39 
    40     return text.str();
     33    log_end(Behavioural,FUNCTION);
    4134  };
    4235 
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_library_work.cpp

    r81 r113  
    1919  void Vhdl::set_library_work (std::string      package_name)
    2020  {
    21     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    22     set_list(_list_library_work, "use work."+ package_name + ".all");
    23     log_printf(FUNC,Behavioural,FUNCTION,"End");
     21    log_begin(Behavioural,FUNCTION);
     22   
     23    set_library("work",package_name,"all");
     24
     25    log_end(Behavioural,FUNCTION);
    2426  };
    2527 
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_port.cpp

    r81 r113  
    3434    log_printf(FUNC,Behavioural,FUNCTION,"End");
    3535  };
     36
     37// #undef  FUNCTION
     38// #define FUNCTION "Vhdl::set_port_clock"
     39//   void Vhdl::set_port_clock (std::string name)
     40//   {
     41//     log_printf(FUNC,Behavioural,FUNCTION,"Begin");
     42
     43//     _port_clock = name;
     44
     45//     log_printf(FUNC,Behavioural,FUNCTION,"End");
     46//   };
    3647   
    3748}; // end namespace behavioural         
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_signal.cpp

    r95 r113  
    2222  {
    2323    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    24     set_list(_list_signal, "signal "+ name + "\t: " + type);
     24
     25    test_architecture();
     26
     27    set_list(_architecture[_name_architecture]._list_signal, "signal "+ name + "\t: " + type);
     28   
    2529    log_printf(FUNC,Behavioural,FUNCTION,"End");
    2630  };
     
    3943  {
    4044    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    41     _list_signal.push_back ("signal "+ name+"\t: "+type+"\t:= "+init);
     45
     46    test_architecture();
     47   
     48    _architecture[_name_architecture]._list_signal.push_back ("signal "+ name+"\t: "+type+"\t:= "+init);
     49
    4250    log_printf(FUNC,Behavioural,FUNCTION,"End");
    4351  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_set_type.cpp

    r81 r113  
    2121  {
    2222    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
    23     set_list(_list_type, "type "+ name + "\tis " + type);
     23
     24    test_architecture();
     25
     26    set_list(_architecture[_name_architecture]._list_type, "type "+ name + "\tis " + type);
     27
    2428    log_printf(FUNC,Behavioural,FUNCTION,"End");
    2529  };
Note: See TracChangeset for help on using the changeset viewer.