Ignore:
Timestamp:
Jul 5, 2007, 5:50:19 PM (17 years ago)
Author:
rosiere
Message:

Modification des classes d'encapsulation des interfaces :

  • gère les signaux à écrire dans le vhdl
  • les traces pour le testbench
  • la génération des vhdl structurelles

-> test sur la Pattern History Table

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_allocation.cpp

    r2 r42  
    2121    log_printf(FUNC,Counter,"allocation","Begin");
    2222
    23 #if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    24     in_CLOCK  = new SC_CLOCK           ("in_CLOCK");
     23    _component   = new Component ();
     24
     25    Entity * entity = _component->set_entity (_name     
     26                                             ,"Counter" 
     27#ifdef POSITION
     28                                             ,COMBINATORY
    2529#endif
     30                                              );
     31   
     32    _interfaces = entity->set_interfaces();
    2633
    27      in_COUNTER_DATA  = new SC_IN (Tdata_t)    * [_param._nb_port];
    28      in_COUNTER_ADDSUB= new SC_IN (Tcontrol_t) * [_param._nb_port];
    29     out_COUNTER_DATA  = new SC_OUT(Tdata_t)    * [_param._nb_port];
    30    
    31     for (uint32_t i=0; i<_param._nb_port; i++)
    32       {
    33         rename = " in_COUNTER_DATA_" +toString(i);
    34          in_COUNTER_DATA  [i] = new SC_IN (Tdata_t)    (rename.c_str());
     34    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     35    {
     36      Interface * interface = _interfaces->set_interface(""
     37#ifdef POSITION
     38                                                         , IN 
     39                                                         , SOUTH
     40                                                         , "Generalist interface"
     41#endif
     42                                                         );
     43     
     44      in_CLOCK              = interface->set_signal_clk              ("clock" ,1,CLOCK_VHDL_NO);
     45      in_NRESET             = interface->set_signal_in  <Tcontrol_t> ("nreset",1,RESET_VHDL_NO);
     46    }
    3547
    36         rename = " in_COUNTER_ADDSUB_"+toString(i);
    37          in_COUNTER_ADDSUB[i] = new SC_IN (Tcontrol_t) (rename.c_str());
    38 
    39         rename = "out_COUNTER_DATA_" +toString(i);
    40         out_COUNTER_DATA  [i] = new SC_OUT(Tdata_t)    (rename.c_str());
    41       }
     48    // ~~~~~[ Interface : "counter" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     49     {
     50        in_COUNTER_DATA  = new SC_IN (Tdata_t)    * [_param._nb_port];
     51        in_COUNTER_ADDSUB= new SC_IN (Tcontrol_t) * [_param._nb_port];
     52       out_COUNTER_DATA  = new SC_OUT(Tdata_t)    * [_param._nb_port];
     53       
     54       for (uint32_t i=0; i<_param._nb_port; i++)
     55         {
     56           Interface_fifo * interface = _interfaces->set_interface("counter_"+toString(i)
     57#ifdef POSITION
     58                                                                   , IN 
     59                                                                   , SOUTH
     60                                                                   , "Counter interface"
     61#endif
     62                                                                   );
     63           
     64            in_COUNTER_DATA   [i] = interface->set_signal_in  <Tdata_t   > ("data"  , _param._size_data);
     65            in_COUNTER_ADDSUB [i] = interface->set_signal_in  <Tcontrol_t> ("addsub", 1                );
     66           out_COUNTER_DATA   [i] = interface->set_signal_out <Tdata_t   > ("data"  , _param._size_data);
     67         }
     68     }
     69#ifdef POSITION
     70    _component->generate_file();
     71#endif
    4272
    4373    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
Note: See TracChangeset for help on using the changeset viewer.