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

Last change on this file since 75 was 75, checked in by rosiere, 16 years ago

Update all component (except front_end) to :

  • new statistics model
  • no namespace std
File size: 2.9 KB
Line 
1/*
2 * $Id$
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    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation");
36    allocation ();
37
38#ifdef STATISTICS
39    if (_usage & USE_STATISTICS)
40      {
41        log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation of statistics");
42       
43        statistics_declaration(param_statistics);
44      }
45#endif
46
47#ifdef VHDL
48    // generate the vhdl
49    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Generate the vhdl");
50
51    vhdl();
52#endif
53
54#ifdef SYSTEMC
55    if (_usage & USE_SYSTEMC)
56      {
57#  if defined(STATISTICS) or defined(VHDL_TESTBENCH)
58        log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - transition");
59       
60        SC_METHOD (transition);
61        dont_initialize ();
62        sensitive_pos << *(in_CLOCK);
63#  endif
64       
65        log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - genMealy_entity");
66       
67        SC_METHOD (genMealy_entity);
68        dont_initialize ();
69        //sensitive_pos << *(in_CLOCK);
70        for (uint32_t i=0; i<_param->_nb_entity; i++)
71          sensitive << *(in_VAL [i]);
72       
73#  ifdef SYSTEMCASS_SPECIFIC
74        // List dependency information
75       
76        for (uint32_t i=0; i<_param->_nb_entity; i++)
77          {
78            if (_param->_encoding_one_hot)
79              (*(out_ACK    [i])) (*(in_VAL [i]));
80            if (_param->_encoding_compact)
81              {
82                (*(out_ENTITY    )) (*(in_VAL [i]));
83                (*(out_ENTITY_ACK)) (*(in_VAL [i]));
84              }
85          }
86       
87#  endif
88      }
89#endif
90    log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","End");
91  };
92 
93  Select_Priority_Fixed::~Select_Priority_Fixed (void)
94  {
95    log_printf(FUNC,Select_Priority_Fixed,"~Select_Priority_Fixed","Begin");
96
97#ifdef STATISTICS
98    if (_usage & USE_STATISTICS)
99      {
100        log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Generate Statistics file");
101       
102        delete _stat;
103      }
104#endif
105
106#ifdef SYSTEMC
107    log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Deallocation");
108
109    deallocation ();
110#endif
111
112    log_printf(FUNC,Select_Priority_Fixed,"~Select_Priority_Fixed","End");
113  };
114
115}; // end namespace select_priority_fixed
116}; // end namespace select
117}; // end namespace generic
118}; // end namespace behavioural
119}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.