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

Last change on this file since 57 was 57, checked in by rosiere, 17 years ago
  • VHDL - RegisterFile_Multi_Banked (only partial_crossbar)
  • SystemC - modif Component, interface and co -> ajout du type Tusage_T pour instancier un coposant mais ne demander que le VHDL ou le systemC.
  • Séminaire interne
File size: 3.0 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    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation of statistics");
43
44    // Allocation of statistics
45    _stat = new Statistics (static_cast<string>(_name),
46                            param_statistics          ,
47                            param);
48#endif
49
50#ifdef VHDL
51    // generate the vhdl
52    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Generate the vhdl");
53
54    vhdl();
55#endif
56
57#ifdef SYSTEMC
58    if (_usage & USE_SYSTEMC)
59      {
60#  if defined(STATISTICS) or defined(VHDL_TESTBENCH)
61        log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - transition");
62       
63        SC_METHOD (transition);
64        dont_initialize ();
65        sensitive_pos << *(in_CLOCK);
66#  endif
67       
68        log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - genMealy_entity");
69       
70        SC_METHOD (genMealy_entity);
71        dont_initialize ();
72        //sensitive_pos << *(in_CLOCK);
73        for (uint32_t i=0; i<_param->_nb_entity; i++)
74          sensitive << *(in_VAL [i]);
75       
76#  ifdef SYSTEMCASS_SPECIFIC
77        // List dependency information
78       
79        for (uint32_t i=0; i<_param->_nb_entity; i++)
80          {
81            if (_param->_encoding_one_hot)
82              (*(out_ACK    [i])) (*(in_VAL [i]));
83            if (_param->_encoding_compact)
84              {
85                (*(out_ENTITY    )) (*(in_VAL [i]));
86                (*(out_ENTITY_ACK)) (*(in_VAL [i]));
87              }
88          }
89       
90#  endif
91      }
92#endif
93    log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","End");
94  };
95 
96  Select_Priority_Fixed::~Select_Priority_Fixed (void)
97  {
98    log_printf(FUNC,Select_Priority_Fixed,"~Select_Priority_Fixed","Begin");
99
100#ifdef STATISTICS
101    log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Generate Statistics file");
102
103    _stat->generate_file(statistics(0));
104   
105    delete _stat;
106#endif
107
108#ifdef SYSTEMC
109    log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Deallocation");
110
111    deallocation ();
112#endif
113
114    log_printf(FUNC,Select_Priority_Fixed,"~Select_Priority_Fixed","End");
115  };
116
117}; // end namespace select_priority_fixed
118}; // end namespace select
119}; // end namespace generic
120}; // end namespace behavioural
121}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.