source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Priority/src/Priority.cpp @ 88

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

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 2.3 KB
Line 
1/*
2 * $Id: Priority.cpp 88 2008-12-10 18:31:39Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Generic/Priority/include/Priority.h"
9#include "Common/include/Max.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace generic {
14namespace priority {
15 
16#undef  FUNCTION
17#define FUNCTION "Priority::Priority"
18  Priority::Priority (std::string       name,
19                      Tpriority_t       priority      ,
20                      Tload_balancing_t load_balancing,
21                      uint32_t          nb_grp        ,
22                      uint32_t        * nb_elt        ,//[nb_grp]
23                      uint32_t          nb_grp_select
24                      ):
25    _name              (name)
26  {
27    log_begin(Priority,FUNCTION);
28
29    _priority       = priority      ;
30    _load_balancing = load_balancing;
31    _nb_grp         = nb_grp        ;
32    _nb_elt         = nb_elt     ;
33    _nb_grp_select  = nb_grp_select ;
34    _max_nb_elt     = max<uint32_t>(_nb_elt,_nb_grp);
35
36    allocation();
37
38    log_end(Priority,FUNCTION);
39  };
40
41#undef  FUNCTION
42#define FUNCTION "Priority::Priority"
43  Priority::Priority (std::string       name,
44                      Tpriority_t       priority      ,
45                      uint32_t          nb_grp        ,
46                      uint32_t          nb_grp_select
47                      ):
48    _name              (name)
49  {
50    log_begin(Priority,FUNCTION);
51
52    _priority       = priority   ;
53    _load_balancing = LOAD_BALANCING_MAXIMUM_FOR_PRIORITY;
54    _nb_grp         = nb_grp     ;
55//  _nb_elt         = nb_elt     ;
56    _nb_grp_select  = nb_grp_select ;
57    _max_nb_elt     = 1;
58
59    allocation();
60
61    log_end(Priority,FUNCTION);
62  };
63
64#undef  FUNCTION
65#define FUNCTION "Priority::Priority"
66  Priority::Priority (std::string       name,
67                      Tpriority_t       priority      ,
68                      uint32_t          nb_grp       
69                      ):
70    _name              (name)
71  {
72    log_begin(Priority,FUNCTION);
73
74    _priority       = priority   ;
75    _load_balancing = LOAD_BALANCING_MAXIMUM_FOR_PRIORITY;
76    _nb_grp         = nb_grp     ;
77//  _nb_elt         = nb_elt     ;
78    _nb_grp_select  = nb_grp     ;
79    _max_nb_elt     = 1;
80
81    allocation();
82
83    log_end(Priority,FUNCTION);
84  };
85   
86#undef  FUNCTION
87#define FUNCTION "Priority::~Priority"
88  Priority::~Priority (void)
89  {
90    log_begin(Priority,FUNCTION);
91
92    deallocation ();
93
94    log_end(Priority,FUNCTION);
95  };
96
97}; // end namespace priority
98}; // end namespace generic
99
100}; // end namespace behavioural
101}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.