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 @ 59

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

Add Load store queue -> but not terminated and tested
Add article to sympa 2007 -> but no started

File size: 4.9 KB
Line 
1/*
2 * $Id$
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#ifdef SYSTEMC
23  Load_store_unit::Load_store_unit (sc_module_name name,
24#else
25  Load_store_unit::Load_store_unit (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::multi_execute_unit::execute_unit::load_store_unit::Parameters * param ):
31                              _name              (name)
32                              ,_param            (param)
33// #ifdef STATISTICS
34//                            ,_param_statistics (param_statistics)
35// #endif
36  {
37    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
38
39#ifdef SYSTEMC
40    log_printf(INFO,Load_store_unit,FUNCTION,"Allocation");
41
42    allocation ();
43#endif
44
45#ifdef STATISTICS
46    log_printf(INFO,Load_store_unit,FUNCTION,"Allocation of statistics");
47
48    // Allocation of statistics
49    _stat = new Statistics (static_cast<string>(_name),
50                            param_statistics          ,
51                            param);
52#endif
53
54#ifdef VHDL
55    // generate the vhdl
56    log_printf(INFO,Load_store_unit,FUNCTION,"Generate the vhdl");
57
58    vhdl();
59#endif
60
61#ifdef SYSTEMC
62    // Function pointer
63
64    switch (_param->_speculative_load)
65      {
66      case SPECULATIVE_LOAD_COMMIT :
67        {
68          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     ;
69          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       ;
70          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;
71          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;
72          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;
73          break;
74        }
75      case NO_SPECULATIVE_LOAD     :
76      case SPECULATIVE_LOAD_ACCESS :
77      case SPECULATIVE_LOAD_BYPASS :
78      default                      :
79        {
80          break;
81        }
82      }
83
84    log_printf(INFO,Load_store_unit,FUNCTION,"Method - transition");
85
86    SC_METHOD (transition);
87    dont_initialize ();
88    sensitive_pos << *(in_CLOCK);
89
90#ifdef SYSTEMCASS_SPECIFIC
91    // List dependency information
92#endif   
93
94    log_printf(INFO,Load_store_unit,FUNCTION,"Method - genMoore");
95
96    SC_METHOD (genMoore);
97    dont_initialize ();
98    sensitive_neg << *(in_CLOCK);
99
100#ifdef SYSTEMCASS_SPECIFIC
101    // List dependency information
102#endif   
103
104    log_printf(INFO,Load_store_unit,FUNCTION,"Method - genMealy_insert");
105
106    SC_METHOD (genMealy_insert);
107    dont_initialize ();
108    sensitive_neg << *(in_CLOCK);
109    sensitive     << *(in_MEMORY_IN_OPERATION);
110
111#ifdef SYSTEMCASS_SPECIFIC
112    // List dependency information
113    (*(out_MEMORY_IN_ACK)) (*(in_MEMORY_IN_OPERATION));
114#endif   
115
116    log_printf(INFO,Load_store_unit,FUNCTION,"Method - genMealy_retire");
117
118    SC_METHOD (genMealy_retire);
119    dont_initialize ();
120    sensitive_neg << *(in_CLOCK);
121
122#ifdef SYSTEMCASS_SPECIFIC
123    // List dependency information
124#endif   
125
126    log_printf(INFO,Load_store_unit,FUNCTION,"Method - genMealy_dcache");
127
128    SC_METHOD (genMealy_dcache);
129    dont_initialize ();
130    sensitive_neg << *(in_CLOCK);
131
132#ifdef SYSTEMCASS_SPECIFIC
133    // List dependency information
134#endif   
135
136#endif
137    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
138  };
139 
140#undef  FUNCTION
141#define FUNCTION "Load_store_unit::~Load_store_unit"
142  Load_store_unit::~Load_store_unit (void)
143  {
144    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
145
146#ifdef STATISTICS
147    log_printf(INFO,Load_store_unit,FUNCTION,"Generate Statistics file");
148
149    _stat->generate_file(statistics(0));
150   
151    delete _stat;
152#endif
153
154#ifdef SYSTEMC
155    log_printf(INFO,Load_store_unit,FUNCTION,"Deallocation");
156
157    deallocation ();
158#endif
159
160    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
161  };
162
163}; // end namespace load_store_unit
164}; // end namespace execute_unit
165}; // end namespace multi_execute_unit
166}; // end namespace execute_loop
167}; // end namespace multi_execute_loop
168}; // end namespace core
169
170}; // end namespace behavioural
171}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.