Ignore:
Timestamp:
Sep 28, 2007, 2:58:08 PM (17 years ago)
Author:
rosiere
Message:
  • VHDL - RegisterFile_Multi_Banked (only partial_crossbar)
  • SystemC - modif Component, interface and co -> ajout du type Tusage_T pour instancier un coposant mais ne demander que le VHDL ou le systemC.
  • Séminaire interne
File:
1 edited

Legend:

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

    r44 r57  
    7575
    7676    // for each entity
    77     list<Entity *>         * list_component = _list_component;
    78     list<Entity *>::iterator i              = list_component->begin();
     77    list<Tcomponent_t *>         * list_component = _list_component;
     78    list<Tcomponent_t *>::iterator i              = list_component->begin();
    7979    if (not list_component->empty())
    8080      {
    8181        while (i != list_component->end())
    8282          {
    83             vhdl->set_library_work ((*i)->get_name() + "_Pack");
     83            Entity *    entity   = (*i)->_entity;
     84            Tinstance_t instance = (*i)->_instance;
     85           
     86            if (instance & INSTANCE_LIBRARY)
     87              vhdl->set_library_work (entity->get_name() + "_Pack");
    8488
    85             list<string> list_port_map;
    86            
    87             // for each interface
    88             list<Interface_fifo *>         * list_interface = (*i)->get_interfaces_list()->get_interface_list();
    89             list<Interface_fifo *>::iterator j              = list_interface->begin();
    90             if (not list_interface->empty())
    91               {
    92                 while (j != list_interface->end())
    93                   {
    94                     // for each signal
    95                     list<Signal *>         * list_signal = (*j)->get_signal_list();
    96                     list<Signal *>::iterator k           = list_signal->begin();
    97                     if (not list_signal->empty())
    98                       {
    99                         while (k != list_signal->end())
    100                           {
    101                             // test if is connect with external interface or with an another component.
    102                             Signal * signal_src  = (*k);
    103 
    104                             if (signal_src->presence_vhdl () == true)
    105                               {
    106                                 Signal * signal_dest = signal_src->get_connect_to_signal();
    107                                 string   name_src    = signal_src->get_name();
    108                                 string   name_dest;
    109                                
     89            if (instance & INSTANCE_COMPONENT)
     90            {
     91              list<string> list_port_map;
     92             
     93              // for each interface
     94              list<Interface_fifo *>         * list_interface = entity->get_interfaces_list()->get_interface_list();
     95              list<Interface_fifo *>::iterator j              = list_interface->begin();
     96              if (not list_interface->empty())
     97                {
     98                  while (j != list_interface->end())
     99                    {
     100                      // for each signal
     101                      list<Signal *>         * list_signal = (*j)->get_signal_list();
     102                      list<Signal *>::iterator k           = list_signal->begin();
     103                      if (not list_signal->empty())
     104                        {
     105                          while (k != list_signal->end())
     106                            {
     107                              // test if is connect with external interface or with an another component.
     108                              Signal * signal_src  = (*k);
     109                             
     110                              if (signal_src->presence_vhdl () == true)
     111                                {
     112                                  Signal * signal_dest = signal_src->get_connect_to_signal();
     113                                  string   name_src    = signal_src->get_name();
     114                                  string   name_dest;
     115                                 
    110116//                              // Test if destination signal is a interface port ?
    111117//                              if (_entity->find_signal(signal_dest) == false)
    112118//                                {
    113                                     // find if signal is already link
    114                                     map<Signal *,string>::iterator it = tab.find(signal_dest);
    115                                     if (tab.find(signal_dest) == tab.end())
    116                                       {
    117                                         // Create name
    118                                         name_dest = "signal_"+toString(cpt++);
    119                                        
    120                                         tab [signal_src ] = name_dest;
    121                                         tab [signal_dest] = name_dest;
    122                                        
    123                                         // Add a new signal
    124                                         vhdl->set_signal (name_dest, signal_src->get_size());
    125                                       }
    126                                     else
    127                                       {
    128                                         // find !!!!
    129                                         name_dest = (*it).second;
    130                                         tab [signal_src ] = name_dest;
    131                                       }
     119                                  // find if signal is already link
     120                                  map<Signal *,string>::iterator it = tab.find(signal_dest);
     121                                  if (tab.find(signal_dest) == tab.end())
     122                                    {
     123                                      // Create name
     124                                      name_dest = "signal_"+toString(cpt++);
     125                                     
     126                                      tab [signal_src ] = name_dest;
     127                                      tab [signal_dest] = name_dest;
     128                                     
     129                                      // Add a new signal
     130                                      vhdl->set_signal (name_dest, signal_src->get_size());
     131                                    }
     132                                  else
     133                                    {
     134                                      // find !!!!
     135                                      name_dest = (*it).second;
     136                                      tab [signal_src ] = name_dest;
     137                                    }
    132138//                                }
    133139//                              else
     
    150156//                                }
    151157                               
    152                                 vhdl->set_body_component_port_map (list_port_map, name_src, name_dest);
    153                               }
    154                             ++k;
    155                           }
    156                       }
    157                     ++j;
    158                   }
    159               }
    160             vhdl->set_body_component ("instance_"+(*i)->get_name(),(*i)->get_name(),list_port_map);
     158                                  vhdl->set_body_component_port_map (list_port_map, name_src, name_dest);
     159                                }
     160                              ++k;
     161                            }
     162                        }
     163                      ++j;
     164                    }
     165                }
     166              vhdl->set_body_component ("instance_"+entity->get_name(),entity->get_name(),list_port_map);
     167             
     168            }
    161169            ++i;
    162170          }
     
    164172    log_printf(FUNC,Behavioural,FUNCTION,"End");
    165173  };
    166 
     174 
    167175}; // end namespace behavioural
    168176}; // end namespace morpheo
Note: See TracChangeset for help on using the changeset viewer.