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

Almost complete design
with Test and test platform

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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  };
Note: See TracChangeset for help on using the changeset viewer.