source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/src/Select_Priority_Fixed.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: 3.1 KB
Line 
1/*
2 * $Id: Select_Priority_Fixed.cpp 88 2008-12-10 18:31:39Z 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_pos << *(in_CLOCK);
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        //sensitive_pos << *(in_CLOCK);
79        for (uint32_t i=0; i<_param->_nb_entity; i++)
80          sensitive << *(in_VAL [i]);
81       
82#  ifdef SYSTEMCASS_SPECIFIC
83        // List dependency information
84       
85        for (uint32_t i=0; i<_param->_nb_entity; i++)
86          {
87            if (_param->_encoding_one_hot)
88              (*(out_ACK    [i])) (*(in_VAL [i]));
89            if (_param->_encoding_compact)
90              {
91                (*(out_ENTITY    )) (*(in_VAL [i]));
92                (*(out_ENTITY_ACK)) (*(in_VAL [i]));
93              }
94          }
95       
96#  endif
97      }
98#endif
99    log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","End");
100  };
101 
102  Select_Priority_Fixed::~Select_Priority_Fixed (void)
103  {
104    log_printf(FUNC,Select_Priority_Fixed,"~Select_Priority_Fixed","Begin");
105
106#ifdef STATISTICS
107    if (usage_is_set(_usage,USE_STATISTICS))
108      {
109        log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Generate Statistics file");
110       
111        delete _stat;
112      }
113#endif
114
115    log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Deallocation");
116    deallocation ();
117
118    log_printf(FUNC,Select_Priority_Fixed,"~Select_Priority_Fixed","End");
119  };
120
121}; // end namespace select_priority_fixed
122}; // end namespace select
123}; // end namespace generic
124}; // end namespace behavioural
125}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.