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

Last change on this file was 131, checked in by rosiere, 15 years ago

1) add constant method
2) test with systemc 2.2.0

  • Property svn:keywords set to Id
File size: 3.1 KB
RevLine 
[10]1/*
2 * $Id: Select_Priority_Fixed.cpp 131 2009-07-08 18:40:08Z 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
[97]54    if (usage_is_set(_usage,USE_VHDL))
[88]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 ();
[131]71        sensitive << (*(in_CLOCK)).pos();
[57]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        for (uint32_t i=0; i<_param->_nb_entity; i++)
79          sensitive << *(in_VAL [i]);
80       
[42]81#  ifdef SYSTEMCASS_SPECIFIC
[57]82        // List dependency information
83       
84        for (uint32_t i=0; i<_param->_nb_entity; i++)
[10]85          {
[57]86            if (_param->_encoding_one_hot)
87              (*(out_ACK    [i])) (*(in_VAL [i]));
88            if (_param->_encoding_compact)
89              {
90                (*(out_ENTITY    )) (*(in_VAL [i]));
91                (*(out_ENTITY_ACK)) (*(in_VAL [i]));
92              }
[10]93          }
[57]94       
95#  endif
[10]96      }
97#endif
[15]98    log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","End");
[10]99  };
100 
[15]101  Select_Priority_Fixed::~Select_Priority_Fixed (void)
[10]102  {
[15]103    log_printf(FUNC,Select_Priority_Fixed,"~Select_Priority_Fixed","Begin");
[10]104
105#ifdef STATISTICS
[88]106    if (usage_is_set(_usage,USE_STATISTICS))
[58]107      {
108        log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Generate Statistics file");
109       
110        delete _stat;
111      }
[10]112#endif
113
[15]114    log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Deallocation");
[10]115    deallocation ();
116
[15]117    log_printf(FUNC,Select_Priority_Fixed,"~Select_Priority_Fixed","End");
[10]118  };
119
[15]120}; // end namespace select_priority_fixed
[10]121}; // end namespace select
122}; // end namespace generic
123}; // end namespace behavioural
124}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.