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

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

1) add constant method
2) test with systemc 2.2.0

  • Property svn:keywords set to Id
File size: 5.6 KB
Line 
1/*
2 * $Id: Load_store_unit.cpp 131 2009-07-08 18:40:08Z 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        //case SPECULATIVE_LOAD_BYPASS :
91      default                      :
92        {
93          break;
94        }
95      }
96
97#ifdef SYSTEMCASS_SPECIFIC
98        constant();
99#else
100    log_printf(INFO,Load_store_unit,FUNCTION,"Method - constant");
101
102    SC_METHOD (constant);
103//     dont_initialize ();
104
105#ifdef SYSTEMCASS_SPECIFIC
106    // List dependency information
107#endif   
108#endif
109
110    log_printf(INFO,Load_store_unit,FUNCTION,"Method - transition");
111
112    SC_METHOD (transition);
113    dont_initialize ();
114    sensitive << (*(in_CLOCK)).pos();
115
116#ifdef SYSTEMCASS_SPECIFIC
117    // List dependency information
118#endif   
119
120    log_printf(INFO,Load_store_unit,FUNCTION,"Method - genMoore");
121
122    SC_METHOD (genMoore);
123    dont_initialize ();
124    sensitive << (*(in_CLOCK)).neg();
125
126#ifdef SYSTEMCASS_SPECIFIC
127    // List dependency information
128#endif   
129
130    log_printf(INFO,Load_store_unit,FUNCTION,"Method - genMealy_insert");
131
132    SC_METHOD (genMealy_insert);
133    dont_initialize ();
134    sensitive << (*(in_CLOCK)).neg();
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
155#ifdef SYSTEMCASS_SPECIFIC
156    // List dependency information
157#endif   
158
159    log_printf(INFO,Load_store_unit,FUNCTION,"Method - genMealy_dcache");
160
161    SC_METHOD (genMealy_dcache);
162    dont_initialize ();
163    sensitive << (*(in_CLOCK)).neg();
164
165#ifdef SYSTEMCASS_SPECIFIC
166    // List dependency information
167#endif   
168      }
169#endif
170    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
171  };
172 
173#undef  FUNCTION
174#define FUNCTION "Load_store_unit::~Load_store_unit"
175  Load_store_unit::~Load_store_unit (void)
176  {
177    log_printf(FUNC,Load_store_unit,FUNCTION,"Begin");
178
179#ifdef STATISTICS
180    if (usage_is_set(_usage,USE_STATISTICS))
181      statistics_deallocation ();
182#endif
183
184#ifdef SYSTEMC
185    log_printf(INFO,Load_store_unit,FUNCTION,"Deallocation");
186
187    deallocation ();
188#endif
189
190    log_printf(FUNC,Load_store_unit,FUNCTION,"End");
191  };
192
193}; // end namespace load_store_unit
194}; // end namespace execute_unit
195}; // end namespace multi_execute_unit
196}; // end namespace execute_loop
197}; // end namespace multi_execute_loop
198}; // end namespace core
199
200}; // end namespace behavioural
201}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.