source: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component_vbe/src/New_Component.cpp @ 88

Last change on this file since 88 was 88, checked in by rosiere, 16 years ago

Almost complete design
with Test and test platform

File size: 2.3 KB
RevLine 
[2]1/*
2 * $Id$
3 *
[68]4 * [ Description ]
[2]5 *
6 */
7
8#include "Behavioural/@DIRECTORY/include/@COMPONENT.h"
9
10namespace morpheo                    {
11namespace behavioural {
12@NAMESPACE_BEGIN
13
[53]14#undef  FUNCTION
15#define FUNCTION "@COMPONENT::@COMPONENT"
[57]16  @COMPONENT::@COMPONENT
17  (
[2]18#ifdef SYSTEMC
[57]19   sc_module_name name,
[2]20#else
[57]21   string name,
[2]22#endif
23#ifdef STATISTICS
[57]24   morpheo::behavioural::Parameters_Statistics * param_statistics,
[2]25#endif
[57]26   morpheo::behavioural::@NAMESPACE_USE::Parameters * param,
27   morpheo::behavioural::Tusage_t usage
28   ):
29    _name              (name)
30    ,_param            (param)
31    ,_usage            (usage)
[2]32  {
[82]33    log_begin(@COMPONENT,FUNCTION);
[2]34
[81]35    usage_environment(_usage);
36
[88]37    log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Allocation"),_name.c_str());
[40]38
[74]39    allocation (
[2]40#ifdef STATISTICS
[74]41                param_statistics
42#endif
43                );
44
45#ifdef STATISTICS
[81]46    if (usage_is_set(_usage,USE_STATISTICS))
[68]47      { 
[88]48        log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Allocation of statistics"),_name.c_str());
[71]49
[78]50        statistics_allocation(param_statistics);
[68]51      }
[2]52#endif
53
54#ifdef VHDL
[81]55    if (usage_is_set(_usage,USE_VHDL))
[68]56      {
57        // generate the vhdl
[88]58        log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Generate the vhdl"),_name.c_str());
[68]59       
60        vhdl();
61      }
[2]62#endif
63
64#ifdef SYSTEMC
[81]65    if (usage_is_set(_usage,USE_SYSTEMC))
[68]66      {
[88]67        log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Method - transition"),_name.c_str());
[15]68
[68]69        SC_METHOD (transition);
70        dont_initialize ();
71        sensitive << (*(in_CLOCK)).pos();
72       
73# ifdef SYSTEMCASS_SPECIFIC
74        // List dependency information
75# endif   
[88]76
77//      log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Method - genMoore"),_name.c_str());
78
79//      SC_METHOD (genMoore);
80//      dont_initialize ();
81//      sensitive << (*(in_CLOCK)).neg(); // need internal register
[68]82       
[88]83// # ifdef SYSTEMCASS_SPECIFIC
84//      // List dependency information
85// # endif   
86       
[2]87#endif
[68]88      }
[82]89    log_end(@COMPONENT,FUNCTION);
[2]90  };
[68]91   
[53]92#undef  FUNCTION
93#define FUNCTION "@COMPONENT::~@COMPONENT"
[2]94  @COMPONENT::~@COMPONENT (void)
95  {
[82]96    log_begin(@COMPONENT,FUNCTION);
[2]97
98#ifdef STATISTICS
[81]99    if (usage_is_set(_usage,USE_STATISTICS))
[68]100      {
[78]101        statistics_deallocation();
[68]102      }
[2]103#endif
104
[88]105    log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Deallocation"),_name.c_str());
[2]106    deallocation ();
107
[82]108    log_end(@COMPONENT,FUNCTION);
[2]109  };
110
111@NAMESPACE_END
112}; // end namespace behavioural
113}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.