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/Counter
Files:
9 edited

Legend:

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

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

    r82 r88  
    3737#endif
    3838
     39  Tusage_t _usage = USE_ALL;
     40
     41//   _usage = usage_unset(_usage,USE_SYSTEMC              );
     42//   _usage = usage_unset(_usage,USE_VHDL                 );
     43//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH       );
     44//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT);
     45//   _usage = usage_unset(_usage,USE_POSITION             );
     46//   _usage = usage_unset(_usage,USE_STATISTICS           );
     47//   _usage = usage_unset(_usage,USE_INFORMATION          );
     48
    3949  Counter * _Counter = new Counter (name.c_str(),
    4050#ifdef STATISTICS
     
    4252#endif
    4353                                    param,
    44                                     USE_ALL);
     54                                    _usage);
    4555 
    4656#ifdef SYSTEMC
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/include/Counter.h

    r82 r88  
    8585  public  :          ~Counter             (void);
    8686                                               
    87 #ifdef SYSTEMC                                 
    8887  private : void     allocation                (void);
    8988  private : void     deallocation              (void);
    9089                                               
     90#ifdef SYSTEMC                                 
    9191#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    9292  public  : void     transition                (void);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/include/Parameters.h

    r81 r88  
    2929  public : Parameters  (uint32_t size_data,
    3030                        uint32_t nb_port  );
    31   public : Parameters  (Parameters & param) ;
     31//   public : Parameters  (Parameters & param) ;
    3232  public : ~Parameters () ;
     33
     34  public :        void             copy       (void);
    3335
    3436  public :        Parameters_test  msg_error  (void);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter.cpp

    r82 r88  
    3232    log_printf(FUNC,Counter,"Counter","Begin");
    3333
    34 #ifdef SYSTEMC
     34#if DEBUG_Counter == true
     35    log_printf(INFO,Counter,FUNCTION,_("<%s> Parameters"),_name.c_str());
     36
     37    std::cout << param << std::endl;
     38#endif   
     39
     40    log_printf(INFO,Core,FUNCTION,_("<%s> Allocation"),_name.c_str());
    3541    allocation ();
    36 #endif
    3742
    3843#ifdef STATISTICS
    39     // Allocation of statistics
    40     statistics_declaration(param_statistics);
     44    if (usage_is_set(_usage,USE_STATISTICS))
     45      {
     46        log_printf(INFO,Core,FUNCTION,_("<%s> Allocation of statistics"),_name.c_str());
     47
     48        // Allocation of statistics
     49        statistics_declaration(param_statistics);
     50      }
    4151#endif
    4252
    4353#ifdef VHDL
    44     // generate the vhdl
    45     vhdl();
     54    if (usage_is_set(_usage,USE_VHDL))
     55      {
     56        // generate the vhdl
     57        log_printf(INFO,Core,FUNCTION,_("<%s> Generate the vhdl"),_name.c_str());
     58       
     59        vhdl();
     60      }
    4661#endif
    4762
    4863#ifdef SYSTEMC
    4964
     65    if (usage_is_set(_usage,USE_SYSTEMC))
     66      {
    5067#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    51     SC_METHOD (transition);
    52     dont_initialize ();
    53     sensitive << (*(in_CLOCK)).pos();
     68        log_printf(INFO,Core,FUNCTION,_("<%s> Method - transition"),_name.c_str());
     69
     70        SC_METHOD (transition);
     71        dont_initialize ();
     72        sensitive << (*(in_CLOCK)).pos();
    5473#endif
    5574
    56     SC_METHOD (genMealy);
    57     dont_initialize ();
    58     for (uint32_t i=0; i<_param._nb_port; i++)
    59       sensitive << *(in_COUNTER_DATA   [i])
    60                 << *(in_COUNTER_ADDSUB [i]);
    61 
     75        log_printf(INFO,Core,FUNCTION,_("<%s> Method - genMealy"),_name.c_str());
     76        SC_METHOD (genMealy);
     77        dont_initialize ();
     78        for (uint32_t i=0; i<_param._nb_port; i++)
     79          sensitive << *(in_COUNTER_DATA   [i])
     80                    << *(in_COUNTER_ADDSUB [i]);
     81       
    6282#ifdef SYSTEMCASS_SPECIFIC
    63     // List dependency information
    64     for (uint32_t i=0; i<_param._nb_port; i++)
    65       {
    66         (*(out_COUNTER_DATA [i])) (*(in_COUNTER_DATA   [i]));
    67         (*(out_COUNTER_DATA [i])) (*(in_COUNTER_ADDSUB [i]));
     83        // List dependency information
     84        for (uint32_t i=0; i<_param._nb_port; i++)
     85          {
     86            (*(out_COUNTER_DATA [i])) (*(in_COUNTER_DATA   [i]));
     87            (*(out_COUNTER_DATA [i])) (*(in_COUNTER_ADDSUB [i]));
     88          }
     89#endif   
    6890      }
    69 #endif   
    7091
    7192#endif
     
    7697  {
    7798    log_printf(FUNC,Counter,"~Counter","Begin");
    78 #ifdef SYSTEMC
    79     deallocation ();
     99
     100#ifdef STATISTICS
     101    if (usage_is_set(_usage,USE_STATISTICS))
     102      {
     103        delete _stat;
     104      }
    80105#endif
    81106
    82 #ifdef STATISTICS
    83     delete _stat;
    84 #endif
     107    log_printf(INFO,Core,FUNCTION,_("<%s> Deallocation"),_name.c_str());
     108    deallocation ();
     109
    85110    log_printf(FUNC,Counter,"~Counter","End");
    86111  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_allocation.cpp

    r82 r88  
    1 #ifdef SYSTEMC
    21/*
    32 * $Id$
    43 *
    5  * [ Description ]
     4 * [ Description ]
    65 *
    76 */
     
    2928    _interfaces = entity->set_interfaces();
    3029
    31     // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     30    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    3231    {
    3332      Interface * interface = _interfaces->set_interface(""
     
    4342    }
    4443
    45     // ~~~~~[ Interface : "counter" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     44    // ~~~~~[ Interface : "counter" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    4645     {
    4746        in_COUNTER_DATA  = new SC_IN (Tdata_t)    * [_param._nb_port];
     
    6463         }
    6564     }
     65
    6666#ifdef POSITION
    67     _component->generate_file();
     67     if (usage_is_set(_usage,USE_POSITION))
     68       _component->generate_file();
    6869#endif
    6970
    70     // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     71    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    7172    log_printf(FUNC,Counter,"allocation","End");
    7273  };
     
    7778}; // end namespace behavioural
    7879}; // end namespace morpheo             
    79 #endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_deallocation.cpp

    r81 r88  
    1 #ifdef SYSTEMC
    21/*
    32 * $Id$
     
    1918    log_printf(FUNC,Counter,"deallocation","Begin");
    2019
    21     delete     in_CLOCK;
    22     delete     in_NRESET;
    23    
    24     delete []  in_COUNTER_DATA  ;
    25     delete []  in_COUNTER_ADDSUB;
    26     delete [] out_COUNTER_DATA  ;
    27    
     20    if (usage_is_set(_usage,USE_SYSTEMC))
     21      {
     22        delete     in_CLOCK;
     23        delete     in_NRESET;
     24       
     25        delete []  in_COUNTER_DATA  ;
     26        delete []  in_COUNTER_ADDSUB;
     27        delete [] out_COUNTER_DATA  ;
     28      }
     29
    2830    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    2931
     
    3840}; // end namespace behavioural
    3941}; // end namespace morpheo             
    40 #endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Counter_end_cycle.cpp

    r81 r88  
    2020
    2121#ifdef STATISTICS
    22     _stat->end_cycle();
     22    if (usage_is_set(_usage,USE_STATISTICS))
     23      _stat->end_cycle();
    2324#endif   
    2425
     
    2627    // Evaluation before read the ouput signal
    2728//  sc_start(0);
    28     _interfaces->testbench();
     29    if (usage_is_set(_usage,USE_VHDL_TESTBENCH))
     30      _interfaces->testbench();
    2931#endif
    3032
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Counter/src/Parameters.cpp

    r81 r88  
    2525  };
    2626 
    27   Parameters::Parameters (Parameters & param):
    28     _size_data(param._size_data),
    29     _nb_port  (param._nb_port  ),
    30     _data_max (param._data_max )
    31   {
    32     log_printf(FUNC,Counter,"Parameters","Begin");
    33     test();
    34     log_printf(FUNC,Counter,"Parameters","End");
    35   };
     27//   Parameters::Parameters (Parameters & param):
     28//     _size_data(param._size_data),
     29//     _nb_port  (param._nb_port  ),
     30//     _data_max (param._data_max )
     31//   {
     32//     log_printf(FUNC,Counter,"Parameters","Begin");
     33//     test();
     34//     log_printf(FUNC,Counter,"Parameters","End");
     35//   };
    3636
    3737  Parameters::~Parameters ()
     
    4141  };
    4242
     43  void Parameters::copy (void)
     44  {
     45    log_printf(FUNC,Counter,"copy","Begin");
     46    log_printf(FUNC,Counter,"copy","End");
     47  };
     48
    4349}; // end namespace counter
    4450}; // end namespace generic
    45 
    4651}; // end namespace behavioural
    4752}; // end namespace morpheo             
Note: See TracChangeset for help on using the changeset viewer.