source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed.cpp @ 131

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

1) add constant method
2) test with systemc 2.2.0

  • Property svn:keywords set to Id
File size: 3.1 KB
Line 
1/*
2 * $Id: Select_Priority_Fixed.cpp 131 2009-07-08 18:40:08Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace generic {
13namespace select {
14namespace select_priority_fixed {
15
16
17  Select_Priority_Fixed::Select_Priority_Fixed
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   morpheo::behavioural::generic::select::select_priority_fixed::Parameters * param,
28   morpheo::behavioural::Tusage_t usage ):
29    _name              (name),
30    _param            (param),
31    _usage            (usage)
32  {
33    log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","Begin");
34
35#if DEBUG_Select_Priority_Fixed == true
36    log_printf(INFO,Select_Priority_Fixed,FUNCTION,_("<%s> Parameters"),_name.c_str());
37
38    std::cout << *param << std::endl;
39#endif   
40
41    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation");
42    allocation ();
43
44#ifdef STATISTICS
45    if (usage_is_set(_usage,USE_STATISTICS))
46      {
47        log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation of statistics");
48       
49        statistics_declaration(param_statistics);
50      }
51#endif
52
53#ifdef VHDL
54    if (usage_is_set(_usage,USE_VHDL))
55      {
56        // generate the vhdl
57        log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Generate the vhdl");
58       
59        vhdl();
60      }
61#endif
62
63#ifdef SYSTEMC
64      if (usage_is_set(_usage,USE_SYSTEMC))
65        {
66#  if defined(STATISTICS) or defined(VHDL_TESTBENCH)
67        log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - transition");
68       
69        SC_METHOD (transition);
70        dont_initialize ();
71        sensitive << (*(in_CLOCK)).pos();
72#  endif
73       
74        log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - genMealy_entity");
75       
76        SC_METHOD (genMealy_entity);
77        dont_initialize ();
78        for (uint32_t i=0; i<_param->_nb_entity; i++)
79          sensitive << *(in_VAL [i]);
80       
81#  ifdef SYSTEMCASS_SPECIFIC
82        // List dependency information
83       
84        for (uint32_t i=0; i<_param->_nb_entity; i++)
85          {
86            if (_param->_encoding_one_hot)
87              (*(out_ACK    [i])) (*(in_VAL [i]));
88            if (_param->_encoding_compact)
89              {
90                (*(out_ENTITY    )) (*(in_VAL [i]));
91                (*(out_ENTITY_ACK)) (*(in_VAL [i]));
92              }
93          }
94       
95#  endif
96      }
97#endif
98    log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","End");
99  };
100 
101  Select_Priority_Fixed::~Select_Priority_Fixed (void)
102  {
103    log_printf(FUNC,Select_Priority_Fixed,"~Select_Priority_Fixed","Begin");
104
105#ifdef STATISTICS
106    if (usage_is_set(_usage,USE_STATISTICS))
107      {
108        log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Generate Statistics file");
109       
110        delete _stat;
111      }
112#endif
113
114    log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Deallocation");
115    deallocation ();
116
117    log_printf(FUNC,Select_Priority_Fixed,"~Select_Priority_Fixed","End");
118  };
119
120}; // end namespace select_priority_fixed
121}; // end namespace select
122}; // end namespace generic
123}; // end namespace behavioural
124}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.