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
RevLine 
[10]1/*
2 * $Id: Select_Priority_Fixed.cpp 88 2008-12-10 18:31:39Z rosiere $
3 *
[88]4 * [ Description ]
[10]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  {
[15]33    log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","Begin");
[10]34
[88]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
[29]41    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation");
42    allocation ();
43
[10]44#ifdef STATISTICS
[88]45    if (usage_is_set(_usage,USE_STATISTICS))
[68]46      {
47        log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation of statistics");
48       
[75]49        statistics_declaration(param_statistics);
[68]50      }
[10]51#endif
52
53#ifdef VHDL
[88]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      }
[10]61#endif
62
63#ifdef SYSTEMC
[88]64      if (usage_is_set(_usage,USE_SYSTEMC))
65        {
[57]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       
[42]82#  ifdef SYSTEMCASS_SPECIFIC
[57]83        // List dependency information
84       
85        for (uint32_t i=0; i<_param->_nb_entity; i++)
[10]86          {
[57]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              }
[10]94          }
[57]95       
96#  endif
[10]97      }
98#endif
[15]99    log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","End");
[10]100  };
101 
[15]102  Select_Priority_Fixed::~Select_Priority_Fixed (void)
[10]103  {
[15]104    log_printf(FUNC,Select_Priority_Fixed,"~Select_Priority_Fixed","Begin");
[10]105
106#ifdef STATISTICS
[88]107    if (usage_is_set(_usage,USE_STATISTICS))
[58]108      {
109        log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Generate Statistics file");
110       
111        delete _stat;
112      }
[10]113#endif
114
[15]115    log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Deallocation");
[10]116    deallocation ();
117
[15]118    log_printf(FUNC,Select_Priority_Fixed,"~Select_Priority_Fixed","End");
[10]119  };
120
[15]121}; // end namespace select_priority_fixed
[10]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.