source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack.cpp @ 78

Last change on this file since 78 was 78, checked in by rosiere, 16 years ago

Add :

  • Execute_loop (must be test systemC)
  • Prediction
    • Direction : predifined scheme
    • Branch Target Buffer
  • iFetch_unit
    • ifetch_queue
    • pc management
  • Decod_unit
    • coming soon : support for custom operation
  • Rename_unit
    • RAT
    • Free_list
    • Dependence RAW check
    • Load store unit pointer
  • New Environnement (hierarchy_memory will remove in a next version)


Modif :

  • Manage Custom Operation
  • All component in execute_loop to use the new statistics management

Not Finish :

  • Return Address Stack
  • Environnement
File size: 4.0 KB
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/include/Return_Address_Stack.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace core {
13namespace multi_front_end {
14namespace front_end {
15namespace prediction_unit {
16namespace return_address_stack {
17
18
19#undef  FUNCTION
20#define FUNCTION "Return_Address_Stack::Return_Address_Stack"
21  Return_Address_Stack::Return_Address_Stack
22  (
23#ifdef SYSTEMC
24   sc_module_name name,
25#else
26   string name,
27#endif
28#ifdef STATISTICS
29   morpheo::behavioural::Parameters_Statistics * param_statistics,
30#endif
31   morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::return_address_stack::Parameters * param,
32   morpheo::behavioural::Tusage_t usage
33   ):
34    _name              (name)
35    ,_param            (param)
36    ,_usage            (usage)
37  {
38    log_printf(FUNC,Return_Address_Stack,FUNCTION,"Begin");
39
40    log_printf(INFO,Return_Address_Stack,FUNCTION,"Allocation");
41
42    allocation (
43#ifdef STATISTICS
44                param_statistics
45#endif
46                );
47
48#ifdef STATISTICS
49    if (_usage & USE_STATISTICS)
50      { 
51        log_printf(INFO,Return_Address_Stack,FUNCTION,"Allocation of statistics");
52
53        statistics_allocation(param_statistics);
54      }
55#endif
56
57#ifdef VHDL
58    if (_usage & USE_VHDL)
59      {
60        // generate the vhdl
61        log_printf(INFO,Return_Address_Stack,FUNCTION,"Generate the vhdl");
62       
63        vhdl();
64      }
65#endif
66
67#ifdef SYSTEMC
68    if (_usage & USE_SYSTEMC)
69      {
70        for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
71          {
72            internal_PREDICT_ACK [i] = 1;
73            PORT_WRITE(out_PREDICT_ACK [i], internal_PREDICT_ACK [i]);
74          }
75        for (uint32_t i=0; i<_param->_nb_inst_decod  ; i++)
76          {
77            internal_DECOD_ACK   [i] = 1;
78            PORT_WRITE(out_DECOD_ACK   [i], internal_DECOD_ACK   [i]);
79          }
80        for (uint32_t i=0; i<_param->_nb_inst_update ; i++)
81          {
82            internal_UPDATE_ACK  [i] = 1;
83            PORT_WRITE(out_UPDATE_ACK  [i], internal_UPDATE_ACK  [i]);
84          }
85
86        log_printf(INFO,Return_Address_Stack,FUNCTION,"Method - transition");
87
88        SC_METHOD (transition);
89        dont_initialize ();
90        sensitive << (*(in_CLOCK)).pos();
91       
92# ifdef SYSTEMCASS_SPECIFIC
93        // List dependency information
94# endif   
95
96        log_printf(INFO,Return_Address_Stack,FUNCTION,"Method - genMealy_predict");
97
98        SC_METHOD (genMealy_predict);
99        dont_initialize ();
100        sensitive << (*(in_CLOCK)).neg(); // use internal registers
101        for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
102          {
103            if (_param->_have_port_context_id)
104            sensitive << (*( in_PREDICT_CONTEXT_ID [i])); 
105            sensitive << (*( in_PREDICT_PUSH       [i]));
106          }
107
108# ifdef SYSTEMCASS_SPECIFIC
109        // List dependency information
110        for (uint32_t i=0; i<_param->_nb_inst_predict; i++)
111          {
112            if (_param->_have_port_context_id)
113            (*(out_PREDICT_HIT         [i])) (*( in_PREDICT_CONTEXT_ID [i]));
114            (*(out_PREDICT_HIT         [i])) (*( in_PREDICT_PUSH       [i]));
115
116            if (_param->_have_port_context_id)
117            (*(out_PREDICT_ADDRESS_POP [i])) (*( in_PREDICT_CONTEXT_ID [i]));
118            (*(out_PREDICT_ADDRESS_POP [i])) (*( in_PREDICT_PUSH       [i]));
119
120            if (_param->_have_port_context_id)
121            (*(out_PREDICT_INDEX       [i])) (*( in_PREDICT_CONTEXT_ID [i]));
122            (*(out_PREDICT_INDEX       [i])) (*( in_PREDICT_PUSH       [i]));
123          }
124# endif   
125#endif
126      }
127    log_printf(FUNC,Return_Address_Stack,FUNCTION,"End");
128  };
129   
130#undef  FUNCTION
131#define FUNCTION "Return_Address_Stack::~Return_Address_Stack"
132  Return_Address_Stack::~Return_Address_Stack (void)
133  {
134    log_printf(FUNC,Return_Address_Stack,FUNCTION,"Begin");
135
136#ifdef STATISTICS
137    if (_usage & USE_STATISTICS)
138      {
139        statistics_deallocation();
140      }
141#endif
142
143    log_printf(INFO,Return_Address_Stack,FUNCTION,"Deallocation");
144    deallocation ();
145
146    log_printf(FUNC,Return_Address_Stack,FUNCTION,"End");
147  };
148
149}; // end namespace return_address_stack
150}; // end namespace prediction_unit
151}; // end namespace front_end
152}; // end namespace multi_front_end
153}; // end namespace core
154
155}; // end namespace behavioural
156}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.