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

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

Interface normalisé
Début du banc de registres multi niveaux

File size: 2.5 KB
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/@DIRECTORY/include/@COMPONENT.h"
9
10namespace morpheo                    {
11namespace behavioural {
12@NAMESPACE_BEGIN
13
14#ifdef SYSTEMC
15  @COMPONENT::@COMPONENT (sc_module_name name,
16#else
17  @COMPONENT::@COMPONENT (string name,
18#endif
19#ifdef STATISTICS
20                              morpheo::behavioural::Parameters_Statistics             param_statistics,
21#endif
22                              morpheo::behavioural::@NAMESPACE_USE::Parameters param ):
23                              _name              (name)
24                              ,_param            (param)
25// #ifdef STATISTICS
26//                            ,_param_statistics (param_statistics)
27// #endif
28  {
29    log_printf(FUNC,@COMPONENT,"@COMPONENT","Begin");
30
31#ifdef STATISTICS
32    log_printf(INFO,@COMPONENT,"@COMPONENT","Allocation of statistics");
33
34    // Allocation of statistics
35    _stat = new Statistics (static_cast<string>(_name),
36                            param_statistics          ,
37                            param);
38#endif
39
40#ifdef VHDL_TESTBENCH
41    log_printf(INFO,@COMPONENT,"@COMPONENT","Creation of a testbench");
42
43    // Creation of a testbench
44    //  -> port
45    //  -> clock's signals
46    _vhdl_testbench = new Vhdl_Testbench (_name);
47#endif
48
49#ifdef VHDL
50    // generate the vhdl
51    log_printf(INFO,@COMPONENT,"@COMPONENT","Generate the vhdl");
52
53    vhdl();
54#endif
55
56#ifdef VHDL_TESTBENCH
57    // must be invoke after affect of port
58    _vhdl_testbench->set_clock    ("in_CLOCK",true);
59#endif
60
61#ifdef SYSTEMC
62    log_printf(INFO,@COMPONENT,"@COMPONENT","Allocation");
63
64    allocation ();
65
66//#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
67    log_printf(INFO,@COMPONENT,"@COMPONENT","Method - transition");
68
69    SC_METHOD (transition);
70    dont_initialize ();
71    sensitive_pos << *(in_CLOCK);
72//#endif
73
74#ifdef SYSTEMCASS_SPECIFIC
75    // List dependency information
76#endif   
77
78#endif
79    log_printf(FUNC,@COMPONENT,"@COMPONENT","End");
80  };
81 
82  @COMPONENT::~@COMPONENT (void)
83  {
84    log_printf(FUNC,@COMPONENT,"~@COMPONENT","Begin");
85
86#ifdef VHDL_TESTBENCH
87    log_printf(INFO,@COMPONENT,"~@COMPONENT","Generate Testbench  file");
88
89    // generate the test bench
90    _vhdl_testbench->generate_file();
91    delete _vhdl_testbench;
92#endif
93
94#ifdef STATISTICS
95    log_printf(INFO,@COMPONENT,"~@COMPONENT","Generate Statistics file");
96
97    _stat->generate_file(statistics(0));
98   
99    delete _stat;
100#endif
101
102#ifdef SYSTEMC
103    log_printf(INFO,@COMPONENT,"~@COMPONENT","Deallocation");
104
105    deallocation ();
106#endif
107
108    log_printf(FUNC,@COMPONENT,"~@COMPONENT","End");
109  };
110
111@NAMESPACE_END
112}; // end namespace behavioural
113}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.