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

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

Modification des classes d'encapsulation des interfaces :

  • gère les signaux à écrire dans le vhdl
  • les traces pour le testbench
  • la génération des vhdl structurelles

-> test sur la Pattern History Table

File size: 3.0 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 STATISTICS
41    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Allocation of statistics");
42
43    // Allocation of statistics
44    _stat = new Statistics (static_cast<string>(_name),
45                            param_statistics          ,
46                            param);
47#endif
48
49#ifdef VHDL
50    // generate the vhdl
51    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Generate the vhdl");
52
53    vhdl();
54#endif
55
56#ifdef SYSTEMC
57#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
58    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - transition");
59
60    SC_METHOD (transition);
61    dont_initialize ();
62    sensitive_pos << *(in_CLOCK);
63#endif
64
65    log_printf(INFO,Select_Priority_Fixed,"Select_Priority_Fixed","Method - genMealy_entity");
66
67    SC_METHOD (genMealy_entity);
68    dont_initialize ();
69    //sensitive_pos << *(in_CLOCK);
70    for (uint32_t i=0; i<_param._nb_entity; i++)
71      sensitive << *(in_VAL [i]);
72
73#  ifdef SYSTEMCASS_SPECIFIC
74    // List dependency information
75
76    for (uint32_t i=0; i<_param._nb_entity; i++)
77      {
78        if (_param._encoding_one_hot)
79          (*(out_ACK    [i])) (*(in_VAL [i]));
80        if (_param._encoding_compact)
81          {
82          (*(out_ENTITY    )) (*(in_VAL [i]));
83          (*(out_ENTITY_ACK)) (*(in_VAL [i]));
84          }
85      }
86   
87#  endif   
88#endif
89    log_printf(FUNC,Select_Priority_Fixed,"Select_Priority_Fixed","End");
90  };
91 
92  Select_Priority_Fixed::~Select_Priority_Fixed (void)
93  {
94    log_printf(FUNC,Select_Priority_Fixed,"~Select_Priority_Fixed","Begin");
95
96#ifdef STATISTICS
97    log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Generate Statistics file");
98
99    _stat->generate_file(statistics(0));
100   
101    delete _stat;
102#endif
103
104#ifdef SYSTEMC
105    log_printf(INFO,Select_Priority_Fixed,"~Select_Priority_Fixed","Deallocation");
106
107    deallocation ();
108#endif
109
110    log_printf(FUNC,Select_Priority_Fixed,"~Select_Priority_Fixed","End");
111  };
112
113}; // end namespace select_priority_fixed
114}; // end namespace select
115}; // end namespace generic
116}; // end namespace behavioural
117}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.