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

Last change on this file since 68 was 68, checked in by rosiere, 17 years ago

read_queue : systemC et vhdl ok !
queue : quelques petits modif pour avoir une queue de taille 1
nettoyage des fichiers *mkf*

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