source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/src/Queue.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

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