source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Execute_loop_Glue/src/Execute_loop_Glue.cpp @ 132

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

1) add constant method - compatibility with SystemC
2) add Script to test sensitive list
3) fix bug in sensitive list

  • Property svn:keywords set to Id
File size: 6.6 KB
Line 
1/*
2 * $Id: Execute_loop_Glue.cpp 132 2009-07-11 16:39:35Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Execute_loop_Glue/include/Execute_loop_Glue.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace core {
13namespace multi_execute_loop {
14namespace execute_loop {
15namespace execute_loop_glue {
16
17
18#undef  FUNCTION
19#define FUNCTION "Execute_loop_Glue::Execute_loop_Glue"
20  Execute_loop_Glue::Execute_loop_Glue
21  (
22#ifdef SYSTEMC
23   sc_module_name name,
24#else
25   string name,
26#endif
27#ifdef STATISTICS
28   morpheo::behavioural::Parameters_Statistics * param_statistics,
29#endif
30   morpheo::behavioural::core::multi_execute_loop::execute_loop::execute_loop_glue::Parameters * param,
31   morpheo::behavioural::Tusage_t usage
32   ):
33    _name              (name)
34    ,_param            (param)
35    ,_usage            (usage)
36  {
37    log_begin(Execute_loop_Glue,FUNCTION);
38
39    usage_environment(_usage);
40
41// #if DEBUG_Execute_loop_Glue == true
42//     log_printf(INFO,Execute_loop_Glue,FUNCTION,_("<%s> Parameters"),_name.c_str());
43
44//     std::cout << *param << std::endl;
45// #endif   
46
47    log_printf(INFO,Execute_loop_Glue,FUNCTION,_("<%s> : Allocation"),_name.c_str());
48
49    allocation (
50#ifdef STATISTICS
51                param_statistics
52#endif
53                );
54
55#ifdef STATISTICS
56    if (usage_is_set(_usage,USE_STATISTICS))
57      { 
58        log_printf(INFO,Execute_loop_Glue,FUNCTION,_("<%s> : Allocation of statistics"),_name.c_str());
59
60        statistics_allocation(param_statistics);
61      }
62#endif
63
64#ifdef VHDL
65    if (usage_is_set(_usage,USE_VHDL))
66      {
67        // generate the vhdl
68        log_printf(INFO,Execute_loop_Glue,FUNCTION,_("<%s> : Generate the vhdl"),_name.c_str());
69       
70        vhdl();
71      }
72#endif
73
74#ifdef SYSTEMC
75    if (usage_is_set(_usage,USE_SYSTEMC))
76      {
77        log_printf(INFO,Execute_loop_Glue,FUNCTION,_("<%s> : Method - transition"),_name.c_str());
78
79        SC_METHOD (transition);
80        dont_initialize ();
81        sensitive << (*(in_CLOCK)).pos();
82       
83# ifdef SYSTEMCASS_SPECIFIC
84        // List dependency information
85# endif   
86
87//      log_printf(INFO,Execute_loop_Glue,FUNCTION,_("<%s> : Method - genMoore"),_name.c_str());
88
89//      SC_METHOD (genMoore);
90//      dont_initialize ();
91//      sensitive << (*(in_CLOCK)).neg(); // need internal register
92       
93// # ifdef SYSTEMCASS_SPECIFIC
94//      // List dependency information
95// # endif   
96
97        log_printf(INFO,Execute_loop_Glue,FUNCTION,_("<%s> : Method - genMealy_gpr_write"),_name.c_str());
98
99        SC_METHOD (genMealy_gpr_write);
100        dont_initialize ();
101//      sensitive << (*(in_CLOCK)).neg(); // don't internal register
102        sensitive << (*(in_NRESET));
103
104    for (uint32_t i=0; i<_param->_nb_gpr_write; i++)
105      {
106        sensitive <<(*(in_GPR_WRITE_WRITE_UNIT_VAL           [i]))
107                  <<(*(in_GPR_WRITE_WRITE_UNIT_NUM_REG       [i]))
108                  <<(*(in_GPR_WRITE_WRITE_UNIT_DATA          [i]))
109                  <<(*(in_GPR_WRITE_REGISTER_FILE_ACK        [i]));
110        if (_param->_have_port_ooo_engine_id)
111        sensitive <<(*(in_GPR_WRITE_WRITE_UNIT_OOO_ENGINE_ID [i]));
112      }
113
114# ifdef SYSTEMCASS_SPECIFIC
115        // List dependency information
116    for (uint32_t i=0; i<_param->_nb_gpr_write; i++)
117      {
118        (*(out_GPR_WRITE_WRITE_UNIT_ACK               [i])) (*( in_GPR_WRITE_REGISTER_FILE_ACK         [i]));
119        (*(out_GPR_WRITE_REGISTER_FILE_VAL            [i])) (*( in_GPR_WRITE_WRITE_UNIT_VAL            [i]));
120        if (_param->_have_port_ooo_engine_id)
121        (*(out_GPR_WRITE_REGISTER_FILE_OOO_ENGINE_ID  [i])) (*( in_GPR_WRITE_WRITE_UNIT_OOO_ENGINE_ID  [i]));
122        (*(out_GPR_WRITE_REGISTER_FILE_NUM_REG        [i])) (*( in_GPR_WRITE_WRITE_UNIT_NUM_REG        [i]));
123        (*(out_GPR_WRITE_REGISTER_FILE_DATA           [i])) (*( in_GPR_WRITE_WRITE_UNIT_DATA           [i]));
124        (*(out_GPR_WRITE_READ_UNIT_VAL                [i])) (*( in_GPR_WRITE_WRITE_UNIT_VAL            [i]));
125        (*(out_GPR_WRITE_READ_UNIT_VAL                [i])) (*( in_GPR_WRITE_REGISTER_FILE_ACK         [i]));
126        if (_param->_have_port_ooo_engine_id)
127        (*(out_GPR_WRITE_READ_UNIT_OOO_ENGINE_ID      [i])) (*( in_GPR_WRITE_WRITE_UNIT_OOO_ENGINE_ID  [i]));
128        (*(out_GPR_WRITE_READ_UNIT_NUM_REG            [i])) (*( in_GPR_WRITE_WRITE_UNIT_NUM_REG        [i]));
129        (*(out_GPR_WRITE_READ_UNIT_DATA               [i])) (*( in_GPR_WRITE_WRITE_UNIT_DATA           [i]));
130      }
131# endif   
132
133        log_printf(INFO,Execute_loop_Glue,FUNCTION,_("<%s> : Method - genMealy_spr_write"),_name.c_str());
134
135        SC_METHOD (genMealy_spr_write);
136        dont_initialize ();
137//      sensitive << (*(in_CLOCK)).neg(); // don't internal register
138        sensitive << (*(in_NRESET));
139
140    for (uint32_t i=0; i<_param->_nb_spr_write; i++)
141      {
142        sensitive <<(*(in_SPR_WRITE_WRITE_UNIT_VAL           [i]))
143                  <<(*(in_SPR_WRITE_WRITE_UNIT_NUM_REG       [i]))
144                  <<(*(in_SPR_WRITE_WRITE_UNIT_DATA          [i]))
145                  <<(*(in_SPR_WRITE_REGISTER_FILE_ACK        [i]));
146        if (_param->_have_port_ooo_engine_id)
147        sensitive <<(*(in_SPR_WRITE_WRITE_UNIT_OOO_ENGINE_ID [i]));
148      }
149
150# ifdef SYSTEMCASS_SPECIFIC
151        // List dependency information
152    for (uint32_t i=0; i<_param->_nb_spr_write; i++)
153      {
154        (*(out_SPR_WRITE_WRITE_UNIT_ACK               [i])) (*( in_SPR_WRITE_REGISTER_FILE_ACK         [i]));
155        (*(out_SPR_WRITE_REGISTER_FILE_VAL            [i])) (*( in_SPR_WRITE_WRITE_UNIT_VAL            [i]));
156        if (_param->_have_port_ooo_engine_id)
157        (*(out_SPR_WRITE_REGISTER_FILE_OOO_ENGINE_ID  [i])) (*( in_SPR_WRITE_WRITE_UNIT_OOO_ENGINE_ID  [i]));
158        (*(out_SPR_WRITE_REGISTER_FILE_NUM_REG        [i])) (*( in_SPR_WRITE_WRITE_UNIT_NUM_REG        [i]));
159        (*(out_SPR_WRITE_REGISTER_FILE_DATA           [i])) (*( in_SPR_WRITE_WRITE_UNIT_DATA           [i]));
160        (*(out_SPR_WRITE_READ_UNIT_VAL                [i])) (*( in_SPR_WRITE_WRITE_UNIT_VAL            [i]));
161        (*(out_SPR_WRITE_READ_UNIT_VAL                [i])) (*( in_SPR_WRITE_REGISTER_FILE_ACK         [i]));
162        if (_param->_have_port_ooo_engine_id)
163        (*(out_SPR_WRITE_READ_UNIT_OOO_ENGINE_ID      [i])) (*( in_SPR_WRITE_WRITE_UNIT_OOO_ENGINE_ID  [i]));
164        (*(out_SPR_WRITE_READ_UNIT_NUM_REG            [i])) (*( in_SPR_WRITE_WRITE_UNIT_NUM_REG        [i]));
165        (*(out_SPR_WRITE_READ_UNIT_DATA               [i])) (*( in_SPR_WRITE_WRITE_UNIT_DATA           [i]));
166      }
167# endif   
168       
169#endif
170      }
171    log_end(Execute_loop_Glue,FUNCTION);
172  };
173   
174#undef  FUNCTION
175#define FUNCTION "Execute_loop_Glue::~Execute_loop_Glue"
176  Execute_loop_Glue::~Execute_loop_Glue (void)
177  {
178    log_begin(Execute_loop_Glue,FUNCTION);
179
180#ifdef STATISTICS
181    if (usage_is_set(_usage,USE_STATISTICS))
182      {
183        statistics_deallocation();
184      }
185#endif
186
187    log_printf(INFO,Execute_loop_Glue,FUNCTION,_("<%s> : Deallocation"),_name.c_str());
188    deallocation ();
189
190    log_end(Execute_loop_Glue,FUNCTION);
191  };
192
193}; // end namespace execute_loop_glue
194}; // end namespace execute_loop
195}; // end namespace multi_execute_loop
196}; // end namespace core
197
198}; // end namespace behavioural
199}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.