source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/src/Core.cpp @ 145

Last change on this file since 145 was 145, checked in by rosiere, 14 years ago

1) add test with SPECINT2K
2) new config of Selftest
3) modif RAT to support multiple depth_save ... but not finish (need fix Update Prediction Table)
4) add Function_pointer but need fix

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