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

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

Interface normalisé
Début du banc de registres multi niveaux

File size: 3.6 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#ifdef SYSTEMC
18  Select_Priority_Fixed::Select_Priority_Fixed (sc_module_name name,
19#else
20  Select_Priority_Fixed::Select_Priority_Fixed (string name,
21#endif
22#ifdef STATISTICS
23                              morpheo::behavioural::Parameters_Statistics             param_statistics,
24#endif
25                              morpheo::behavioural::generic::select::select_priority_fixed::Parameters param ):
26                              _name              (name)
27                              ,_param            (param)
28// #ifdef STATISTICS
29//                            ,_param_statistics (param_statistics)
30// #endif
31  {
32    log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","Begin");
33
34#ifdef STATISTICS
35    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation of statistics");
36
37    // Allocation of statistics
38    _stat = new Statistics (static_cast<string>(_name),
39                            param_statistics          ,
40                            param);
41#endif
42
43#ifdef VHDL_TESTBENCH
44    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Creation of a testbench");
45
46    // Creation of a testbench
47    //  -> port
48    //  -> clock's signals
49    _vhdl_testbench = new Vhdl_Testbench (_name);
50//     _vhdl_testbench->set_clock    ("in_CLOCK",false);
51#endif
52
53#ifdef VHDL
54    // generate the vhdl
55    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Generate the vhdl");
56
57    vhdl();
58#endif
59
60#ifdef VHDL_TESTBENCH
61    _vhdl_testbench->set_clock    ("in_CLOCK",true);
62#endif
63
64#ifdef SYSTEMC
65    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation");
66
67    allocation ();
68
69#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
70    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - transition");
71
72    SC_METHOD (transition);
73    dont_initialize ();
74    sensitive_pos << *(in_CLOCK);
75#endif
76
77    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - genMealy_entity");
78
79    SC_METHOD (genMealy_entity);
80    dont_initialize ();
81    //sensitive_pos << *(in_CLOCK);
82    for (uint32_t i=0; i<_param._nb_entity; i++)
83      sensitive << *(in_VAL [i]);
84
85#ifdef SYSTEMCASS_SPECIFIC
86    // List dependency information
87
88    for (uint32_t i=0; i<_param._nb_entity; i++)
89      {
90        if (_param._encoding_one_hot)
91          (*(out_ACK    [i])) (*(in_VAL [i]));
92        if (_param._encoding_compact)
93          {
94          (*(out_ENTITY    )) (*(in_VAL [i]));
95          (*(out_ENTITY_ACK)) (*(in_VAL [i]));
96          }
97      }
98   
99#endif   
100
101#endif
102    log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","End");
103  };
104 
105  Select_Priority_Fixed::~Select_Priority_Fixed (void)
106  {
107    log_printf(FUNC,Select_Priority_Fixed,"~Select_Priority_Fixed","Begin");
108
109#ifdef VHDL_TESTBENCH
110    log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Generate Testbench  file");
111
112    // generate the test bench
113    _vhdl_testbench->generate_file();
114    delete _vhdl_testbench;
115#endif
116
117#ifdef STATISTICS
118    log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Generate Statistics file");
119
120    _stat->generate_file(statistics(0));
121   
122    delete _stat;
123#endif
124
125#ifdef SYSTEMC
126    log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Deallocation");
127
128    deallocation ();
129#endif
130
131    log_printf(FUNC,Select_Priority_Fixed,"~Select_Priority_Fixed","End");
132  };
133
134}; // end namespace select_priority_fixed
135}; // end namespace select
136}; // end namespace generic
137
138}; // end namespace behavioural
139}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.