source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit.cpp @ 145

Last change on this file since 145 was 145, checked in by rosiere, 14 years ago

1) add test with SPECINT2K
2) new config of Selftest
3) modif RAT to support multiple depth_save ... but not finish (need fix Update Prediction Table)
4) add Function_pointer but need fix

  • Property svn:keywords set to Id
File size: 5.7 KB
Line 
1/*
2 * $Id: Load_store_unit.cpp 145 2010-10-13 18:15:51Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Load_store_unit.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace core {
13namespace multi_execute_loop {
14namespace execute_loop {
15namespace multi_execute_unit {
16namespace execute_unit {
17namespace load_store_unit {
18
19
20#undef  FUNCTION
21#define FUNCTION "Load_store_unit::Load_store_unit"
22  Load_store_unit::Load_store_unit
23  (
24#ifdef SYSTEMC
25   sc_module_name name,
26#else
27   std::string name,
28#endif
29#ifdef STATISTICS
30   morpheo::behavioural::Parameters_Statistics * param_statistics,
31#endif
32   morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters * param ,
33   morpheo::behavioural::Tusage_t usage
34   ):
35    _name              (name)
36    ,_param            (param)
37    ,_usage (usage)
38  {
39    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
40
41// #if DEBUG_Load_store_unit == true
42//     log_printf(INFO,Load_store_unit,FUNCTION,_("<%s> Parameters"),_name.c_str());
43
44//     std::cout << *param << std::endl;
45// #endif   
46
47#ifdef SYSTEMC
48    log_printf(INFO,Load_store_unit,FUNCTION,"Allocation");
49
50    allocation ();
51#endif
52
53#ifdef STATISTICS
54    if (usage_is_set(_usage,USE_STATISTICS))
55      { 
56        log_printf(INFO,Load_store_unit,FUNCTION,"Allocation of statistics");
57       
58        statistics_allocation(param_statistics);
59      }
60#endif
61
62#ifdef VHDL
63    if (usage_is_set(_usage,USE_VHDL))
64      { 
65        // generate the vhdl
66        log_printf(INFO,Load_store_unit,FUNCTION,"Generate the vhdl");
67       
68        vhdl();
69      }
70#endif
71
72#ifdef SYSTEMC
73    if (usage_is_set(_usage,USE_SYSTEMC))
74      { 
75
76    // Function pointer
77    switch (_param->_speculative_load)
78      {
79      case SPECULATIVE_LOAD_COMMIT :
80        {
81          function_transition      = &morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Load_store_unit::function_speculative_load_commit_transition     ;
82          function_genMoore        = &morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Load_store_unit::function_speculative_load_commit_genMoore       ;
83          function_genMealy_dcache = &morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Load_store_unit::function_speculative_load_commit_genMealy_dcache;
84          function_genMealy_insert = &morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Load_store_unit::function_speculative_load_commit_genMealy_insert;
85          function_genMealy_retire = &morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Load_store_unit::function_speculative_load_commit_genMealy_retire;
86          break;
87        }
88      case NO_SPECULATIVE_LOAD     :
89      // case SPECULATIVE_LOAD_ACCESS :
90      default                      :
91        {
92          break;
93        }
94      }
95
96#ifdef SYSTEMCASS_SPECIFIC
97        constant();
98#else
99    log_printf(INFO,Load_store_unit,FUNCTION,"Method - constant");
100
101    SC_METHOD (constant);
102//     dont_initialize ();
103
104#ifdef SYSTEMCASS_SPECIFIC
105    // List dependency information
106#endif   
107#endif
108
109    log_printf(INFO,Load_store_unit,FUNCTION,"Method - transition");
110
111    SC_METHOD (transition);
112    dont_initialize ();
113    sensitive << (*(in_CLOCK)).pos();
114
115#ifdef SYSTEMCASS_SPECIFIC
116    // List dependency information
117#endif   
118
119    log_printf(INFO,Load_store_unit,FUNCTION,"Method - genMoore");
120
121    SC_METHOD (genMoore);
122    dont_initialize ();
123    sensitive << (*(in_CLOCK)).neg();
124
125#ifdef SYSTEMCASS_SPECIFIC
126    // List dependency information
127#endif   
128
129    log_printf(INFO,Load_store_unit,FUNCTION,"Method - genMealy_insert");
130
131    SC_METHOD (genMealy_insert);
132    dont_initialize ();
133    sensitive << (*(in_CLOCK)).neg()
134              << (*(in_NRESET));
135    for (uint32_t i=0; i<_param->_nb_inst_memory; i++)
136      sensitive << (*(in_MEMORY_IN_VAL       [i]))
137                << (*(in_MEMORY_IN_OPERATION [i]));
138
139#ifdef SYSTEMCASS_SPECIFIC
140    // List dependency information
141    for (uint32_t i=0; i<_param->_nb_inst_memory; i++)
142//       for (uint32_t x=0; x<_param->_nb_inst_memory; x++)
143        {
144          (*(out_MEMORY_IN_ACK [i])) (*(in_MEMORY_IN_VAL       [i]));
145          (*(out_MEMORY_IN_ACK [i])) (*(in_MEMORY_IN_OPERATION [i]));
146        }
147#endif   
148
149    log_printf(INFO,Load_store_unit,FUNCTION,"Method - genMealy_retire");
150
151    SC_METHOD (genMealy_retire);
152    dont_initialize ();
153    sensitive << (*(in_CLOCK)).neg()
154              << (*(in_NRESET));
155
156#ifdef SYSTEMCASS_SPECIFIC
157    // List dependency information
158#endif   
159
160    log_printf(INFO,Load_store_unit,FUNCTION,"Method - genMealy_dcache");
161
162    SC_METHOD (genMealy_dcache);
163    dont_initialize ();
164    sensitive << (*(in_CLOCK)).neg()
165              << (*(in_NRESET));
166
167#ifdef SYSTEMCASS_SPECIFIC
168    // List dependency information
169#endif   
170      }
171#endif
172    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
173  };
174 
175#undef  FUNCTION
176#define FUNCTION "Load_store_unit::~Load_store_unit"
177  Load_store_unit::~Load_store_unit (void)
178  {
179    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
180
181#ifdef STATISTICS
182    if (usage_is_set(_usage,USE_STATISTICS))
183      statistics_deallocation ();
184#endif
185
186#ifdef SYSTEMC
187    log_printf(INFO,Load_store_unit,FUNCTION,"Deallocation");
188
189    deallocation ();
190#endif
191
192    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
193  };
194
195}; // end namespace load_store_unit
196}; // end namespace execute_unit
197}; // end namespace multi_execute_unit
198}; // end namespace execute_loop
199}; // end namespace multi_execute_loop
200}; // end namespace core
201
202}; // end namespace behavioural
203}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.