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

  • Property svn:keywords set to Id
File size: 2.4 KB
RevLine 
[67]1/*
2 * $Id: Queue.cpp 113 2009-04-14 18:39:12Z 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  {
[113]35    log_begin(Queue,FUNCTION);
36   
37// #if DEBUG_Core == true
38//     log_printf(INFO,Core,FUNCTION,_("<%s> Parameters"),_name.c_str());
[67]39
[113]40//     std::cout << *param << std::endl;
41// #endif   
[88]42
[113]43    log_printf(INFO,Queue,FUNCTION,_("<%s> Allocation"),_name.c_str());
[67]44    allocation ();
45
46#ifdef STATISTICS
[88]47    if (usage_is_set(_usage,USE_STATISTICS))
[68]48      { 
[113]49        log_printf(INFO,Queue,FUNCTION,_("<%s> Allocation of statistics"),_name.c_str());
[68]50       
[75]51        statistics_declaration(param_statistics);
[68]52      }
[67]53#endif
54
55#ifdef VHDL
[88]56    if (usage_is_set(_usage,USE_VHDL))
[68]57      {
58        // generate the vhdl
[113]59        log_printf(INFO,Queue,FUNCTION,_("<%s> Generate the vhdl"),_name.c_str());
[68]60       
61        vhdl();
62      }
[67]63#endif
64
65#ifdef SYSTEMC
[88]66    if (usage_is_set(_usage,USE_SYSTEMC))
[68]67      {
[113]68        log_printf(INFO,Queue,FUNCTION,_("<%s> Method - transition"),_name.c_str());
[68]69       
70        SC_METHOD (transition);
71        dont_initialize ();
72        sensitive << (*(in_CLOCK)).pos();
73       
[67]74# ifdef SYSTEMCASS_SPECIFIC
[68]75        // List dependency information
[67]76# endif   
[68]77       
[113]78        log_printf(INFO,Queue,FUNCTION,_("<%s> Method - genMoore"),_name.c_str());
[68]79       
80        SC_METHOD (genMoore);
81        dont_initialize ();
82        sensitive << (*(in_CLOCK)).neg();
83       
[67]84# ifdef SYSTEMCASS_SPECIFIC
[68]85        // List dependency information
[67]86# endif   
[68]87       
[67]88#endif
[68]89      }
[113]90    log_end(Queue,FUNCTION);
[67]91  };
92 
93#undef  FUNCTION
94#define FUNCTION "Queue::~Queue"
95  Queue::~Queue (void)
96  {
[113]97    log_begin(Queue,FUNCTION);
[67]98
99#ifdef STATISTICS
[88]100    if (usage_is_set(_usage,USE_STATISTICS))
[68]101      {
[113]102        log_printf(INFO,Queue,FUNCTION,_("<%s> Generate Statistics file"),_name.c_str());
[68]103       
104        delete _stat;
105      }
[67]106#endif
107
[113]108    log_printf(INFO,Queue,FUNCTION,_("<%s> Deallocation"),_name.c_str());
[67]109    deallocation ();
110
[113]111    log_end(Queue,FUNCTION);
[67]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.