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
Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed.cpp

    r42 r57  
    1515
    1616
     17  Select_Priority_Fixed::Select_Priority_Fixed
     18  (
    1719#ifdef SYSTEMC
    18   Select_Priority_Fixed::Select_Priority_Fixed (sc_module_name name,
     20   sc_module_name name,
    1921#else
    20   Select_Priority_Fixed::Select_Priority_Fixed (string name,
     22   string name,
    2123#endif
    2224#ifdef STATISTICS
    23                               morpheo::behavioural::Parameters_Statistics             param_statistics,
     25   morpheo::behavioural::Parameters_Statistics           *  param_statistics,
    2426#endif
    25                               morpheo::behavioural::generic::select::select_priority_fixed::Parameters param ):
    26                               _name              (name)
    27                               ,_param            (param)
     27   morpheo::behavioural::generic::select::select_priority_fixed::Parameters * param,
     28   morpheo::behavioural::Tusage_t usage ):
     29    _name              (name),
     30    _param            (param),
     31    _usage            (usage)
    2832// #ifdef STATISTICS
    2933//                            ,_param_statistics (param_statistics)
     
    3236    log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","Begin");
    3337
    34 #ifdef SYSTEMC
    3538    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation");
    36 
    3739    allocation ();
    38 #endif
    3940
    4041#ifdef STATISTICS
     
    5556
    5657#ifdef SYSTEMC
    57 #if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    58     log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - transition");
    59 
    60     SC_METHOD (transition);
    61     dont_initialize ();
    62     sensitive_pos << *(in_CLOCK);
    63 #endif
    64 
    65     log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - genMealy_entity");
    66 
    67     SC_METHOD (genMealy_entity);
    68     dont_initialize ();
    69     //sensitive_pos << *(in_CLOCK);
    70     for (uint32_t i=0; i<_param._nb_entity; i++)
    71       sensitive << *(in_VAL [i]);
    72 
     58    if (_usage & USE_SYSTEMC)
     59      {
     60#  if defined(STATISTICS) or defined(VHDL_TESTBENCH)
     61        log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - transition");
     62       
     63        SC_METHOD (transition);
     64        dont_initialize ();
     65        sensitive_pos << *(in_CLOCK);
     66#  endif
     67       
     68        log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - genMealy_entity");
     69       
     70        SC_METHOD (genMealy_entity);
     71        dont_initialize ();
     72        //sensitive_pos << *(in_CLOCK);
     73        for (uint32_t i=0; i<_param->_nb_entity; i++)
     74          sensitive << *(in_VAL [i]);
     75       
    7376#  ifdef SYSTEMCASS_SPECIFIC
    74     // List dependency information
    75 
    76     for (uint32_t i=0; i<_param._nb_entity; i++)
    77       {
    78         if (_param._encoding_one_hot)
    79           (*(out_ACK    [i])) (*(in_VAL [i]));
    80         if (_param._encoding_compact)
     77        // List dependency information
     78       
     79        for (uint32_t i=0; i<_param->_nb_entity; i++)
    8180          {
    82           (*(out_ENTITY    )) (*(in_VAL [i]));
    83           (*(out_ENTITY_ACK)) (*(in_VAL [i]));
     81            if (_param->_encoding_one_hot)
     82              (*(out_ACK    [i])) (*(in_VAL [i]));
     83            if (_param->_encoding_compact)
     84              {
     85                (*(out_ENTITY    )) (*(in_VAL [i]));
     86                (*(out_ENTITY_ACK)) (*(in_VAL [i]));
     87              }
    8488          }
     89       
     90#  endif
    8591      }
    86    
    87 #  endif   
    8892#endif
    8993    log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_allocation.cpp

    r42 r57  
    1919    log_printf(FUNC,Select_Priority_Fixed,"allocation","Begin");
    2020
    21     _component   = new Component ();
     21    _component   = new Component (_usage);
    2222
    2323    Entity * entity = _component->set_entity (_name                 
     24                                             ,"Select_Priority_Fixed"
    2425#ifdef POSITION
    25                                              ,"Select_Priority_Fixed"
    2626                                             ,COMBINATORY           
    2727#endif
     
    4141
    4242     in_CLOCK        = interface->set_signal_clk              ("clock" ,1, CLOCK_VHDL_NO);
    43      in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1);
    44      in_VAL          = new SC_IN (Tcontrol_t)           * [_param._nb_entity];
    45     if (_param._encoding_one_hot)
    46     out_ACK          = new SC_OUT(Tcontrol_t)           * [_param._nb_entity];
     43     in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1, RESET_VHDL_NO);
    4744
    48     for (uint32_t i=0; i<_param._nb_entity; i++)
     45     in_VAL          = new SC_IN (Tcontrol_t)           * [_param->_nb_entity];
     46    if (_param->_encoding_one_hot)
     47    out_ACK          = new SC_OUT(Tcontrol_t)           * [_param->_nb_entity];
     48
     49    for (uint32_t i=0; i<_param->_nb_entity; i++)
    4950      {
    5051         in_VAL [i]    = interface->set_signal_in  <Tcontrol_t> ("val_"+toString(i),1);
    51         if (_param._encoding_one_hot)
     52        if (_param->_encoding_one_hot)
    5253        out_ACK [i]    = interface->set_signal_out <Tcontrol_t> ("ack_"+toString(i),1);
    5354      }
    5455
    55     if (_param._encoding_compact)
     56    if (_param->_encoding_compact)
    5657      {
    57         out_ENTITY     = interface->set_signal_out <Tentity_t > ("entity"    , _param._size_entity);
     58        out_ENTITY     = interface->set_signal_out <Tentity_t > ("entity"    , _param->_size_entity);
    5859        out_ENTITY_ACK = interface->set_signal_out <Tcontrol_t> ("entity_ack", 1);
    5960      }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_deallocation.cpp

    r42 r57  
    2020    log_printf(FUNC,Select_Priority_Fixed,"deallocation","Begin");
    2121
    22     delete     in_CLOCK;
    23     delete     in_NRESET;
    24 
    25     delete []  in_VAL;
    26     if (_param._encoding_one_hot)
    27     delete [] out_ACK;
    28 
    29     if (_param._encoding_compact)
     22    if (_usage & USE_SYSTEMC)
    3023      {
    31     delete    out_ENTITY;
    32     delete    out_ENTITY_ACK;
     24        delete     in_CLOCK;
     25        delete     in_NRESET;
     26       
     27        delete []  in_VAL;
     28        if (_param->_encoding_one_hot)
     29          delete [] out_ACK;
     30       
     31        if (_param->_encoding_compact)
     32          {
     33            delete    out_ENTITY;
     34            delete    out_ENTITY_ACK;
     35          }
    3336      }
    3437    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    35 
     38   
    3639    delete _component;
    3740
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_genMealy_entity.cpp

    r40 r57  
    2222    // init
    2323     
    24     Tcontrol_t ack [_param._nb_entity];
     24    Tcontrol_t ack [_param->_nb_entity];
    2525    bool       find  = false;
    2626    Tentity_t  entity;
    2727
    28     if (_param._encoding_one_hot)
    29     for (uint32_t i=0; i<_param._nb_entity; i++)
     28    if (_param->_encoding_one_hot)
     29    for (uint32_t i=0; i<_param->_nb_entity; i++)
    3030      ack [i] = 0;
    3131
    3232    log_printf(TRACE,Select_Priority_Fixed,"genMealy_entity","Scearch...");
    33     for (entity=0; entity<_param._nb_entity; entity++)
     33    for (entity=0; entity<_param->_nb_entity; entity++)
    3434      {
    3535        if (PORT_READ(in_VAL [entity]) == 1)
    3636          {
    3737            log_printf(TRACE,Select_Priority_Fixed,"genMealy_entity","Find! entity %d",entity);
    38             if (_param._encoding_one_hot)
     38            if (_param->_encoding_one_hot)
    3939              ack [entity] = 1;
    4040            find = true;
     
    4444     
    4545    // Write port
    46     if (_param._encoding_one_hot)
    47       for (uint32_t i=0; i<_param._nb_entity; i++)
     46    if (_param->_encoding_one_hot)
     47      for (uint32_t i=0; i<_param->_nb_entity; i++)
    4848        PORT_WRITE(out_ACK [i], ack [i]);
    4949
    50     if (_param._encoding_compact)
     50    if (_param->_encoding_compact)
    5151      {
    5252        PORT_WRITE(out_ENTITY    , (find==true)?entity:0); 
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl_body.cpp

    r29 r57  
    2222
    2323    vhdl->set_body("internal_entity <=");
    24     for (uint32_t i=0; i<_param._nb_entity; i++)
     24    for (uint32_t i=0; i<_param->_nb_entity; i++)
    2525      {
    26         vhdl->set_body("\t"+std_logic_conv(_param._size_entity+1,i)+" when in_VAL_"+toString(i)+"='1' else");
     26        vhdl->set_body("\t"+std_logic_conv(_param->_size_entity+1,i)+" when in_VAL_"+toString(i)+"='1' else");
    2727      }
    28     vhdl->set_body("\t"+std_logic_conv(_param._size_entity+1,1<<_param._size_entity)+";");
     28    vhdl->set_body("\t"+std_logic_conv(_param->_size_entity+1,1<<_param->_size_entity)+";");
    2929    vhdl->set_body ("");
    3030
    31     if (_param._encoding_one_hot)
     31    if (_param->_encoding_one_hot)
    3232      {
    33         for (uint32_t i=0; i<_param._nb_entity; i++)
    34           vhdl->set_body("out_ACK_"+toString(i)+" <= '1' when internal_entity"+std_logic_range(_param._size_entity+1)+" = "+std_logic_conv(_param._size_entity+1,i)+" else '0';");
     33        for (uint32_t i=0; i<_param->_nb_entity; i++)
     34          vhdl->set_body("out_ACK_"+toString(i)+" <= '1' when internal_entity"+std_logic_range(_param->_size_entity+1)+" = "+std_logic_conv(_param->_size_entity+1,i)+" else '0';");
    3535        vhdl->set_body ("");
    3636      }
    3737
    38     if (_param._encoding_compact)
     38    if (_param->_encoding_compact)
    3939      {
    40         vhdl->set_body ("out_ENTITY     <=     internal_entity"+std_logic_range(_param._size_entity-1,                  0)+";");
    41         vhdl->set_body ("out_ENTITY_ACK <= not internal_entity"+std_logic_range(_param._size_entity  ,_param._size_entity)+";");
     40        vhdl->set_body ("out_ENTITY     <=     internal_entity"+std_logic_range(_param->_size_entity-1,                  0)+";");
     41        vhdl->set_body ("out_ENTITY_ACK <= not internal_entity"+std_logic_range(_param->_size_entity  ,_param->_size_entity)+";");
    4242      }   
    4343   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed_vhdl_declaration.cpp

    r29 r57  
    2020    log_printf(FUNC,Select_Priority_Fixed,"vhdl_declaration","Begin");
    2121
    22     vhdl->set_signal("internal_entity",_param._size_entity+1);
     22    vhdl->set_signal("internal_entity",_param->_size_entity+1);
    2323
    2424    log_printf(FUNC,Select_Priority_Fixed,"vhdl_declaration","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Statistics.cpp

    r15 r57  
    1717
    1818  Statistics::Statistics (string                                      name                       ,
    19                           morpheo::behavioural::Parameters_Statistics parameters_statistics      ,
    20                           Parameters                                  parameters
     19                          morpheo::behavioural::Parameters_Statistics * parameters_statistics      ,
     20                          Parameters                                  * parameters
    2121                          ) :
    2222    morpheo::behavioural::Statistics(name                  ,
Note: See TracChangeset for help on using the changeset viewer.