Ignore:
Timestamp:
Dec 10, 2008, 7:31:39 PM (16 years ago)
Author:
rosiere
Message:

Almost complete design
with Test and test platform

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim
Files:
16 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/SelfTest/Makefile

    r81 r88  
    2424library_clean                   : Victim_library_clean
    2525
     26local_clean                     :
     27
    2628include                         $(DIR_COMPONENT)/Makefile.deps
    2729include                         $(DIR_MORPHEO)/Behavioural/Makefile.flags
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/SelfTest/src/test.cpp

    r82 r88  
    2323#endif
    2424
     25  Tusage_t _usage = USE_ALL;
     26
     27//   _usage = usage_unset(_usage,USE_SYSTEMC              );
     28//   _usage = usage_unset(_usage,USE_VHDL                 );
     29//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH       );
     30//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT);
     31//   _usage = usage_unset(_usage,USE_POSITION             );
     32//   _usage = usage_unset(_usage,USE_STATISTICS           );
     33//   _usage = usage_unset(_usage,USE_INFORMATION          );
     34
    2535  Victim * _Victim = new Victim (name.c_str(),
    2636#ifdef STATISTICS
     
    2838#endif
    2939                                 _param,
    30                                  USE_ALL);
     40                                 _usage);
    3141 
    3242#ifdef SYSTEMC
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/SelfTest/Makefile

    r81 r88  
    2323library_clean                   : Victim_Pseudo_LRU_library_clean
    2424
     25local_clean                     :
     26
    2527include                         ../Makefile.deps
    2628include                         $(DIR_MORPHEO)/Behavioural/Makefile.flags
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/SelfTest/src/test.cpp

    r82 r88  
    3838#endif
    3939
    40   Victim_Pseudo_LRU * _Victim_Pseudo_LRU = new Victim_Pseudo_LRU (name.c_str(),
     40  Tusage_t _usage = USE_ALL;
     41
     42//   _usage = usage_unset(_usage,USE_SYSTEMC              );
     43//   _usage = usage_unset(_usage,USE_VHDL                 );
     44//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH       );
     45//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT);
     46//   _usage = usage_unset(_usage,USE_POSITION             );
     47//   _usage = usage_unset(_usage,USE_STATISTICS           );
     48//   _usage = usage_unset(_usage,USE_INFORMATION          );
     49
     50  Victim_Pseudo_LRU * _Victim_Pseudo_LRU = new Victim_Pseudo_LRU
     51    (name.c_str(),
    4152#ifdef STATISTICS
    42                                                                   param_stat,
    43 #endif
    44                                                                   &param,
    45                                                                   USE_ALL);
     53     param_stat,
     54#endif
     55     &param,
     56     _usage);
    4657 
    4758#ifdef SYSTEMC
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Parameters.h

    r81 r88  
    3535                        uint32_t size_table,
    3636                        bool     table_global);
    37   public : Parameters  (Parameters & param) ;
     37//   public : Parameters  (Parameters & param) ;
    3838  public : ~Parameters () ;
    3939
     40  public :        void            copy       (void);
     41
    4042  public :        Parameters_test msg_error  (void);
     43
    4144  public :        std::string     print      (uint32_t depth);
    4245  public : friend std::ostream&   operator<< (std::ostream& output_stream,
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Victim_Pseudo_LRU.h

    r82 r88  
    112112  public  :          ~Victim_Pseudo_LRU             (void);
    113113                                               
    114 #ifdef SYSTEMC                                 
    115114  private : void     allocation                (void);
    116115  private : void     deallocation              (void);
    117116                                               
     117#ifdef SYSTEMC                                 
    118118  public  : void     transition                (void);
    119   public  : void     genMoore                  (void);
     119  public  : void     genMealy                  (void);
    120120#endif
    121121                                               
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Parameters.cpp

    r81 r88  
    3030  };
    3131 
    32   Parameters::Parameters (Parameters & param):
    33     _nb_entity  (param._nb_entity ),
    34     _nb_access  (param._nb_access ),
    35 //     _nb_update  (param._nb_update ),
    36     _size_table (param._size_table),
    37     _table_global(param._table_global),
    38     _size_address(param._size_address)
    39   {
    40     test();
     32//   Parameters::Parameters (Parameters & param):
     33//     _nb_entity  (param._nb_entity ),
     34//     _nb_access  (param._nb_access ),
     35// //     _nb_update  (param._nb_update ),
     36//     _size_table (param._size_table),
     37//     _table_global(param._table_global),
     38//     _size_address(param._size_address)
     39//   {
     40//     test();
     41//   };
     42
     43  Parameters::~Parameters ()
     44  {
    4145  };
    4246
    43   Parameters::~Parameters ()
    44   { };
     47  void Parameters::copy (void)
     48  {
     49  };
    4550
    4651}; // end namespace victim_pseudo_lru
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU.cpp

    r82 r88  
    3232    log_printf(FUNC,Victim_Pseudo_LRU,"Victim_Pseudo_LRU","Begin");
    3333
    34 #ifdef SYSTEMC
     34#if DEBUG_Victim_Pseudo_LRU == true
     35    log_printf(INFO,Victim_Pseudo_LRU,FUNCTION,_("<%s> Parameters"),_name.c_str());
     36
     37    std::cout << *param << std::endl;
     38#endif   
     39
    3540    log_printf(TRACE,Victim_Pseudo_LRU,"Victim_Pseudo_LRU","Allocation");
    3641    allocation ();
    37 #endif
    3842
    3943#ifdef STATISTICS
    40     log_printf(TRACE,Victim_Pseudo_LRU,"Victim_Pseudo_LRU","Allocation of statistics");
    41    
    42     // Allocation of statistics
    43     statistics_declaration(param_statistics);
     44    if (usage_is_set(_usage,USE_STATISTICS))
     45      {
     46        log_printf(TRACE,Victim_Pseudo_LRU,"Victim_Pseudo_LRU","Allocation of statistics");
     47       
     48        // Allocation of statistics
     49        statistics_declaration(param_statistics);
     50      }
    4451#endif
    4552
    4653#ifdef VHDL
    47     // generate the vhdl
    48     log_printf(TRACE,Victim_Pseudo_LRU,"Victim_Pseudo_LRU","Generation of VHDL");
    49     vhdl();
     54    if (usage_is_set(_usage,USE_VHDL))
     55      {
     56        // generate the vhdl
     57        log_printf(TRACE,Victim_Pseudo_LRU,"Victim_Pseudo_LRU","Generation of VHDL");
     58        vhdl();
     59      }
    5060#endif
    5161
    5262#ifdef SYSTEMC
    53     log_printf(TRACE,Victim_Pseudo_LRU,"Victim_Pseudo_LRU","Definition of sc_method");
    54     SC_METHOD (transition);
    55     dont_initialize ();
    56     sensitive << (*(in_CLOCK)).pos();
    57 
    58     SC_METHOD (genMoore);
    59     dont_initialize ();
    60     sensitive << (*(in_CLOCK)).neg();
    61 
    62 #ifdef SYSTEMCASS_SPECIFIC
    63 #endif   
    64 
     63    if (usage_is_set(_usage,USE_SYSTEMC))
     64      {
    6565    // Constant - ack is always at one
    6666    for (uint32_t i=0; i<_param->_nb_access; i++)
     
    7070      }
    7171
     72    log_printf(TRACE,Victim_Pseudo_LRU,"Victim_Pseudo_LRU","Definition of sc_method");
     73    SC_METHOD (transition);
     74    dont_initialize ();
     75    sensitive << (*(in_CLOCK)).pos();
     76
     77    SC_METHOD (genMealy);
     78    dont_initialize ();
     79    sensitive << (*(in_CLOCK)).neg();
     80    for (uint32_t i=0; i<_param->_nb_access; i++)
     81      if (_param->_size_table>1)
     82        sensitive << (*(in_ACCESS_ADDRESS[i]));
     83
     84#ifdef SYSTEMCASS_SPECIFIC
     85    if (_param->_size_table>1)
     86      for (uint32_t i=0; i<_param->_nb_access; i++)
     87        (*(out_ACCESS_VICTIM[i])) (*(in_ACCESS_ADDRESS[i]));
     88#endif   
     89      }
    7290#endif
    7391    log_printf(FUNC,Victim_Pseudo_LRU,"Victim_Pseudo_LRU","End");
     
    7795  {
    7896    log_printf(FUNC,Victim_Pseudo_LRU,"~Victim_Pseudo_LRU","Begin");
    79 #ifdef SYSTEMC
     97
    8098    deallocation ();
    81 #endif
     99
    82100
    83101#ifdef STATISTICS
    84     delete _stat;
     102    if (usage_is_set(_usage,USE_STATISTICS))
     103      delete _stat;
    85104#endif
    86105    log_printf(FUNC,Victim_Pseudo_LRU,"~Victim_Pseudo_LRU","End");
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_allocation.cpp

    r82 r88  
    1 #ifdef SYSTEMC
    21/*
    32 * $Id$
     
    5352    }
    5453
     54    if (usage_is_set(_usage,USE_SYSTEMC))
     55      {
    5556    // -----[ Register ]---------------------------------------------------
    5657    reg_TABLE = new entry_t *  [_param->_size_table];
     
    6263    internal_ACCESS_ACK    = new Tcontrol_t [_param->_nb_access];
    6364    internal_ACCESS_VICTIM = new Tentity_t  [_param->_nb_access];
     65      }
    6466
    6567#ifdef POSITION
    66     _component->generate_file();
     68    if (usage_is_set(_usage,USE_POSITION))
     69      _component->generate_file();
    6770#endif
    6871  };
     
    7477}; // end namespace behavioural
    7578}; // end namespace morpheo             
    76 #endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_deallocation.cpp

    r81 r88  
    1 #ifdef SYSTEMC
    21/*
    32 * $Id$
     
    1716  void Victim_Pseudo_LRU::deallocation (void)
    1817  {
     18    if (usage_is_set(_usage,USE_SYSTEMC))
     19      {
    1920    delete     in_CLOCK;
    2021    delete     in_NRESET;
     
    3435    delete [] internal_ACCESS_ACK   ;
    3536    delete [] internal_ACCESS_VICTIM;
     37      }
    3638
    3739    delete _component;
     
    4345}; // end namespace behavioural
    4446}; // end namespace morpheo             
    45 #endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_end_cycle.cpp

    r81 r88  
    2222
    2323#ifdef STATISTICS
    24     _stat->end_cycle();
     24    if (usage_is_set(_usage,USE_STATISTICS))
     25      _stat->end_cycle();
    2526#endif   
    2627
     
    2829    // Evaluation before read the ouput signal
    2930//  sc_start(0);
    30     _interfaces->testbench();
     31    if (usage_is_set(_usage,USE_VHDL_TESTBENCH))
     32      _interfaces->testbench();
    3133#endif
    3234
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/Victim_Pseudo_LRU/src/Victim_Pseudo_LRU_genMealy.cpp

    r87 r88  
    1515namespace victim_pseudo_lru {
    1616
    17   void Victim_Pseudo_LRU::genMoore (void)
     17  void Victim_Pseudo_LRU::genMealy (void)
    1818  {
    1919    for (uint32_t i=0; i<_param->_nb_access; i++)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/include/Parameters.h

    r81 r88  
    2424namespace generic {
    2525namespace victim {
    26 
    2726
    2827  class Parameters : public morpheo::behavioural::Parameters
     
    5756  public : ~Parameters () ;
    5857
     58  public :        void            copy       (void);
     59
    5960  public :        Parameters_test msg_error  (void);
    6061
     
    6667}; // end namespace victim
    6768}; // end namespace generic
    68 
    6969}; // end namespace behavioural
    7070}; // end namespace morpheo             
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/src/Parameters.cpp

    r81 r88  
    6969    switch (_victim_scheme)
    7070      {
    71 //    case VICTIM_RANDOM      : delete _param_victim_random     ;
    72 //    case VICTIM_ROUND_ROBIN : delete _param_victim_round_robin;
    73 //    case VICTIM_NLU         : delete _param_victim_nlu        ;
    74       case VICTIM_PSEUDO_LRU  : delete _param_victim_pseudo_lru ;
    75 //    case VICTIM_LRU         : delete _param_victim_lru        ;
    76 //    case VICTIM_FIFO        : delete _param_victim_fifo       ;
     71//    case VICTIM_RANDOM      : delete _param_victim_random     ; break;
     72//    case VICTIM_ROUND_ROBIN : delete _param_victim_round_robin; break;
     73//    case VICTIM_NLU         : delete _param_victim_nlu        ; break;
     74      case VICTIM_PSEUDO_LRU  : delete _param_victim_pseudo_lru ; break;
     75//    case VICTIM_LRU         : delete _param_victim_lru        ; break;
     76//    case VICTIM_FIFO        : delete _param_victim_fifo       ; break;
     77      default : break;
     78      }
     79
     80    log_printf(FUNC,Victim,FUNCTION,"End");
     81  };
     82
     83#undef  FUNCTION
     84#define FUNCTION "Victim::copy"
     85  void morpheo::behavioural::generic::victim::Parameters::copy (void)
     86  {
     87    log_printf(FUNC,Victim,FUNCTION,"Begin");
     88
     89    switch (_victim_scheme)
     90      {
     91//    case VICTIM_RANDOM      : COPY(_param_victim_random     ); break;
     92//    case VICTIM_ROUND_ROBIN : COPY(_param_victim_round_robin); break;
     93//    case VICTIM_NLU         : COPY(_param_victim_nlu        ); break;
     94      case VICTIM_PSEUDO_LRU  : COPY(_param_victim_pseudo_lru ); break;
     95//    case VICTIM_LRU         : COPY(_param_victim_lru        ); break;
     96//    case VICTIM_FIFO        : COPY(_param_victim_fifo       ); break;
    7797      default : break;
    7898      }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/src/Parameters_msg_error.cpp

    r81 r88  
    2626    switch (_victim_scheme)
    2727      {
    28       case VICTIM_RANDOM      : test.error("Victim scheme '"+toString(_victim_scheme)+"' is not supported. (Coming Soon)"); break;
    29       case VICTIM_ROUND_ROBIN : test.error("Victim scheme '"+toString(_victim_scheme)+"' is not supported. (Coming Soon)"); break;
    30       case VICTIM_NLU         : test.error("Victim scheme '"+toString(_victim_scheme)+"' is not supported. (Coming Soon)"); break;
    31 //    case VICTIM_PSEUDO_LRU  : test.error("Victim scheme '"+toString(_victim_scheme)+"' is not supported. (Coming Soon)"); break;
    32       case VICTIM_LRU         : test.error("Victim scheme '"+toString(_victim_scheme)+"' is not supported. (Coming Soon)"); break;
    33       case VICTIM_FIFO        : test.error("Victim scheme '"+toString(_victim_scheme)+"' is not supported. (Coming Soon)"); break;
     28      case VICTIM_RANDOM      : test.error(toString(_("Victim scheme \"%s\" is not supported. (Coming Soon)\n"),toString(_victim_scheme).c_str())); break;
     29      case VICTIM_ROUND_ROBIN : test.error(toString(_("Victim scheme \"%s\" is not supported. (Coming Soon)\n"),toString(_victim_scheme).c_str())); break;
     30      case VICTIM_NLU         : test.error(toString(_("Victim scheme \"%s\" is not supported. (Coming Soon)\n"),toString(_victim_scheme).c_str())); break;
     31//    case VICTIM_PSEUDO_LRU  : test.error(toString(_("Victim scheme \"%s\" is not supported. (Coming Soon)\n"),toString(_victim_scheme).c_str())); break;
     32      case VICTIM_LRU         : test.error(toString(_("Victim scheme \"%s\" is not supported. (Coming Soon)\n"),toString(_victim_scheme).c_str())); break;
     33      case VICTIM_FIFO        : test.error(toString(_("Victim scheme \"%s\" is not supported. (Coming Soon)\n"),toString(_victim_scheme).c_str())); break;
    3434      default : break;
    3535      }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/src/Victim.cpp

    r81 r88  
    3939    allocation (
    4040#ifdef STATISTICS
    41                 param_statistics
     41                param_statistics
    4242#endif
    43                 );
     43                );
    4444
    4545#ifdef STATISTICS
    46     if (_usage & USE_STATISTICS)
    47       {
    48         switch (_param->_victim_scheme)
    49           {
    50 //        case VICTIM_RANDOM      : _stat = _component_victim_random      ->_stat; break;
    51 //        case VICTIM_ROUND_ROBIN : _stat = _component_victim_round_robin ->_stat; break;
    52 //        case VICTIM_NLU         : _stat = _component_victim_nlu         ->_stat; break;
    53           case VICTIM_PSEUDO_LRU  : _stat = _component_victim_pseudo_lru  ->_stat; break;
    54 //        case VICTIM_LRU         : _stat = _component_victim_lru         ->_stat; break;
    55 //        case VICTIM_FIFO        : _stat = _component_victim_fifo        ->_stat; break;
    56           default : break;
    57           }
     46    switch (_param->_victim_scheme)
     47      {
     48//    case VICTIM_RANDOM      : _stat = _component_victim_random      ->_stat; break;
     49//    case VICTIM_ROUND_ROBIN : _stat = _component_victim_round_robin ->_stat; break;
     50//    case VICTIM_NLU         : _stat = _component_victim_nlu         ->_stat; break;
     51      case VICTIM_PSEUDO_LRU  : _stat = _component_victim_pseudo_lru  ->_stat; break;
     52//    case VICTIM_LRU         : _stat = _component_victim_lru         ->_stat; break;
     53//    case VICTIM_FIFO        : _stat = _component_victim_fifo        ->_stat; break;
     54      default : break;
    5855      }
    5956#endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Victim/src/Victim_deallocation.cpp

    r81 r88  
    3232      }
    3333   
    34     if (_usage & USE_SYSTEMC)
     34    if (usage_is_set(_usage,USE_SYSTEMC))
    3535      {
    3636        delete    in_CLOCK ;
Note: See TracChangeset for help on using the changeset viewer.