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

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

Changement de classes de gestions des Interfaces.

-> simplification pour les déclarations de ports, application pour le composant Select_Priority_Fixed.
-> !!! essayer de supprimer la redondance dans les fichierx xxx_vhdl_testbench_transition.cpp

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