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
RevLine 
[10]1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
[15]8#include "Behavioural/Generic/Select/Select_Priority_Fixed/include/Select_Priority_Fixed.h"
[10]9
10namespace morpheo                    {
11namespace behavioural {
12namespace generic {
13namespace select {
[15]14namespace select_priority_fixed {
[10]15
16
[57]17  Select_Priority_Fixed::Select_Priority_Fixed
18  (
[10]19#ifdef SYSTEMC
[57]20   sc_module_name name,
[10]21#else
[57]22   string name,
[10]23#endif
24#ifdef STATISTICS
[57]25   morpheo::behavioural::Parameters_Statistics           *  param_statistics,
[10]26#endif
[57]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)
[10]32// #ifdef STATISTICS
33//                            ,_param_statistics (param_statistics)
34// #endif
35  {
[15]36    log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","Begin");
[10]37
[29]38    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation");
39    allocation ();
40
[10]41#ifdef STATISTICS
[15]42    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation of statistics");
[10]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
[15]52    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Generate the vhdl");
[10]53
54    vhdl();
55#endif
56
57#ifdef SYSTEMC
[57]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       
[42]76#  ifdef SYSTEMCASS_SPECIFIC
[57]77        // List dependency information
78       
79        for (uint32_t i=0; i<_param->_nb_entity; i++)
[10]80          {
[57]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              }
[10]88          }
[57]89       
90#  endif
[10]91      }
92#endif
[15]93    log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","End");
[10]94  };
95 
[15]96  Select_Priority_Fixed::~Select_Priority_Fixed (void)
[10]97  {
[15]98    log_printf(FUNC,Select_Priority_Fixed,"~Select_Priority_Fixed","Begin");
[10]99
100#ifdef STATISTICS
[15]101    log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Generate Statistics file");
[10]102
103    _stat->generate_file(statistics(0));
104   
105    delete _stat;
106#endif
107
108#ifdef SYSTEMC
[15]109    log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Deallocation");
[10]110
111    deallocation ();
112#endif
113
[15]114    log_printf(FUNC,Select_Priority_Fixed,"~Select_Priority_Fixed","End");
[10]115  };
116
[15]117}; // end namespace select_priority_fixed
[10]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.