source: trunk/IPs/systemC/processor/Morpheo/TopLevel/src/Morpheo.cpp @ 88

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

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 2.2 KB
Line 
1/*
2 * $Id: Morpheo.cpp 88 2008-12-10 18:31:39Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "TopLevel/include/Morpheo.h"
9#include "Common/include/Translation.h"
10
11namespace morpheo {
12
13  using namespace behavioural;
14
15#undef  FUNCTION
16#define FUNCTION "Morpheo::Morpheo"
17  Morpheo::Morpheo
18  (
19#ifdef SYSTEMC
20   sc_module_name name,
21#else             
22   std::string    name,
23#endif                         
24   std::string    filename_simulator, 
25   std::string    filename_generator, 
26   std::string    filename_instance ,
27   morpheo::behavioural::custom::custom_information_t (*get_custom_information) (void)
28   )
29  {
30    translation ();
31   
32    log_begin(Morpheo,FUNCTION);
33
34    log_printf(INFO,Morpheo,FUNCTION,_("Configuration"));
35    configuration (filename_simulator,
36                   filename_generator, 
37                   filename_instance, 
38                   get_custom_information);
39 
40    if (usage_is_set(_usage,USE_HEADER))
41      std::cout << header();
42 
43    log_printf(INFO,Morpheo,FUNCTION,_("<%s> : Allocation"),_name.c_str());
44
45    allocation (
46#ifdef STATISTICS
47                _param_statistics
48#endif
49                );
50
51#ifdef STATISTICS
52    if (usage_is_set(_usage,USE_STATISTICS))
53      { 
54        log_printf(INFO,Morpheo,FUNCTION,_("<%s> : Allocation of statistics"),_name.c_str());
55
56        statistics_allocation(_param_statistics);
57      }
58#endif
59
60#ifdef VHDL
61    if (usage_is_set(_usage,USE_VHDL))
62      {
63        // generate the vhdl
64        log_printf(INFO,Morpheo,FUNCTION,_("<%s> : Generate the vhdl"),_name.c_str());
65       
66        vhdl();
67      }
68#endif
69
70#ifdef SYSTEMC
71    if (usage_is_set(_usage,USE_SYSTEMC))
72      {
73        log_printf(INFO,Morpheo,FUNCTION,_("<%s> : Method - transition"),_name.c_str());
74
75        SC_METHOD (transition);
76        dont_initialize ();
77        sensitive << (*(in_CLOCK)).pos();
78       
79# ifdef SYSTEMCASS_SPECIFIC
80        // List dependency information
81# endif   
82       
83#endif
84      }
85    log_end(Morpheo,FUNCTION);
86  };
87   
88#undef  FUNCTION
89#define FUNCTION "Morpheo::~Morpheo"
90  Morpheo::~Morpheo (void)
91  {
92    log_begin(Morpheo,FUNCTION);
93
94#ifdef STATISTICS
95    if (usage_is_set(_usage,USE_STATISTICS))
96      {
97        statistics_deallocation();
98      }
99#endif
100
101    log_printf(INFO,Morpheo,FUNCTION,_("<%s> : Deallocation"),_name.c_str());
102    deallocation ();
103
104    delete _param_core;
105    delete _config;
106
107    log_end(Morpheo,FUNCTION);
108  };
109
110}; // end namespace morpheo
Note: See TracBrowser for help on using the repository browser.