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

Last change on this file since 113 was 113, checked in by rosiere, 15 years ago

1) Add modelsim simulation systemC
2) Modelsim cosimulation systemC / VHDL is not finish !!!! (cf execute_queue and write_unit)
3) Add multi architecture
5) Add template for comparator, multiplier and divider
6) Change Message
Warning) Various test macro have change, many selftest can't compile

File size: 2.5 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)
[2]31  {
[82]32    log_begin(@COMPONENT,FUNCTION);
[2]33
[113]34    _usage = usage_environment(usage);
[81]35
[113]36#ifdef MODELSIM_COSIMULATION
37    if (_model.get_type(_param->_type) == MODEL_VHDL)
38      {
39        _usage = usage_cosimulation(_usage);
40      }
41#endif
42
[88]43    log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Allocation"),_name.c_str());
[40]44
[74]45    allocation (
[2]46#ifdef STATISTICS
[74]47                param_statistics
48#endif
49                );
50
51#ifdef STATISTICS
[81]52    if (usage_is_set(_usage,USE_STATISTICS))
[68]53      { 
[88]54        log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Allocation of statistics"),_name.c_str());
[71]55
[78]56        statistics_allocation(param_statistics);
[68]57      }
[2]58#endif
59
60#ifdef VHDL
[81]61    if (usage_is_set(_usage,USE_VHDL))
[68]62      {
63        // generate the vhdl
[88]64        log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Generate the vhdl"),_name.c_str());
[68]65       
66        vhdl();
67      }
[2]68#endif
69
70#ifdef SYSTEMC
[113]71    if (usage_is_set(_usage,USE_SYSTEMC_BODY))
[68]72      {
[88]73        log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Method - transition"),_name.c_str());
[15]74
[68]75        SC_METHOD (transition);
76        dont_initialize ();
77        sensitive << (*(in_CLOCK)).pos();
78       
79# ifdef SYSTEMCASS_SPECIFIC
80        // List dependency information
81# endif   
[88]82
83//      log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Method - genMoore"),_name.c_str());
84
85//      SC_METHOD (genMoore);
86//      dont_initialize ();
87//      sensitive << (*(in_CLOCK)).neg(); // need internal register
[68]88       
[88]89// # ifdef SYSTEMCASS_SPECIFIC
90//      // List dependency information
91// # endif   
92       
[113]93      }
[2]94#endif
[113]95
[82]96    log_end(@COMPONENT,FUNCTION);
[2]97  };
[68]98   
[53]99#undef  FUNCTION
100#define FUNCTION "@COMPONENT::~@COMPONENT"
[2]101  @COMPONENT::~@COMPONENT (void)
102  {
[82]103    log_begin(@COMPONENT,FUNCTION);
[2]104
105#ifdef STATISTICS
[81]106    if (usage_is_set(_usage,USE_STATISTICS))
[68]107      {
[78]108        statistics_deallocation();
[68]109      }
[2]110#endif
111
[88]112    log_printf(INFO,@COMPONENT,FUNCTION,_("<%s> : Deallocation"),_name.c_str());
[2]113    deallocation ();
114
[82]115    log_end(@COMPONENT,FUNCTION);
[2]116  };
117
118@NAMESPACE_END
119}; // end namespace behavioural
120}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.