source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/src/Return_Address_Stack_allocation.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: 5.3 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#include "Behavioural/include/Allocation.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_front_end {
15namespace front_end {
16namespace prediction_unit {
17namespace return_address_stack {
18
19
20
21#undef  FUNCTION
22#define FUNCTION "Return_Address_Stack::allocation"
23  void Return_Address_Stack::allocation (
24#ifdef STATISTICS
25                               morpheo::behavioural::Parameters_Statistics * param_statistics
26#else
27                               void
28#endif
29                               )
30  {
31    log_printf(FUNC,Return_Address_Stack,FUNCTION,"Begin");
32
33    _component   = new Component (_usage);
34
35    Entity * entity = _component->set_entity (_name       
36                                              ,"Return_Address_Stack"
37#ifdef POSITION
38                                              ,COMBINATORY
39#endif
40                                              );
41
42    _interfaces = entity->set_interfaces();
43
44    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45    {
46      Interface * interface = _interfaces->set_interface(""
47#ifdef POSITION
48                                                         ,IN
49                                                         ,SOUTH,
50                                                         "Generalist interface"
51#endif
52                                                         );
53     
54      in_CLOCK        = interface->set_signal_clk              ("clock" ,1, CLOCK_VHDL_YES);
55      in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1, RESET_VHDL_YES);
56    }
57
58    // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
59    {
60      ALLOC1_INTERFACE("predict", IN, SOUTH, "predict's interface", _param->_nb_inst_predict);
61
62      ALLOC1_VALACK_IN ( in_PREDICT_VAL         ,VAL);
63      ALLOC1_VALACK_OUT(out_PREDICT_ACK         ,ACK);
64      ALLOC1_SIGNAL_IN ( in_PREDICT_CONTEXT_ID  ,"context_id"  ,Tcontext_t,_param->_size_context_id); 
65      ALLOC1_SIGNAL_OUT(out_PREDICT_HIT         ,"hit"         ,Tcontrol_t,1); 
66      ALLOC1_SIGNAL_IN ( in_PREDICT_PUSH        ,"push"        ,Tcontrol_t,1);
67      ALLOC1_SIGNAL_IN ( in_PREDICT_ADDRESS_PUSH,"address_push",Taddress_t,_param->_size_address);
68      ALLOC1_SIGNAL_OUT(out_PREDICT_ADDRESS_POP ,"address_pop" ,Taddress_t,_param->_size_address);
69      ALLOC1_SIGNAL_OUT(out_PREDICT_INDEX       ,"index"       ,Tptr_t    ,_param->_size_index);
70    }
71
72    // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73    {
74      ALLOC1_INTERFACE("decod", IN, SOUTH, "decod's interface", _param->_nb_inst_decod);
75
76      ALLOC1_VALACK_IN ( in_DECOD_VAL            ,VAL);
77      ALLOC1_VALACK_OUT(out_DECOD_ACK            ,ACK);
78      ALLOC1_SIGNAL_IN ( in_DECOD_CONTEXT_ID     ,"context_id"     ,Tcontext_t,_param->_size_context_id); 
79      ALLOC1_SIGNAL_OUT(out_DECOD_HIT            ,"hit"            ,Tcontrol_t,1); 
80      ALLOC1_SIGNAL_IN ( in_DECOD_PUSH           ,"push"           ,Tcontrol_t,1);
81      ALLOC1_SIGNAL_IN ( in_DECOD_ADDRESS_PUSH   ,"address_push"   ,Taddress_t,_param->_size_address);
82      ALLOC1_SIGNAL_OUT(out_DECOD_ADDRESS_POP    ,"address_pop"    ,Taddress_t,_param->_size_address);
83      ALLOC1_SIGNAL_OUT(out_DECOD_INDEX          ,"index"          ,Tptr_t    ,_param->_size_index);
84      ALLOC1_SIGNAL_IN ( in_DECOD_MISS_PREDICTION,"miss_prediction",Tcontrol_t,1);
85    }
86
87    // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
88    {
89      ALLOC1_INTERFACE("update", IN, SOUTH, "update's interface", _param->_nb_inst_update);
90
91      ALLOC1_VALACK_IN ( in_UPDATE_VAL            ,VAL);
92      ALLOC1_VALACK_OUT(out_UPDATE_ACK            ,ACK);
93      ALLOC1_SIGNAL_IN ( in_UPDATE_CONTEXT_ID     ,"context_id"     ,Tcontext_t,_param->_size_context_id); 
94      ALLOC1_SIGNAL_IN ( in_UPDATE_PUSH           ,"push"           ,Tcontrol_t,1);
95      ALLOC1_SIGNAL_IN ( in_UPDATE_ADDRESS        ,"address"        ,Taddress_t,_param->_size_address);
96      ALLOC1_SIGNAL_IN ( in_UPDATE_INDEX          ,"index"          ,Tptr_t    ,_param->_size_index);
97      ALLOC1_SIGNAL_IN ( in_UPDATE_MISS_PREDICTION,"miss_prediction",Tcontrol_t,1);
98    }
99
100    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101
102    reg_stack = new ras_entry_t * [_param->_nb_context];
103    for (uint32_t i=0; i<_param->_nb_context; i++)
104      reg_stack [i] = new ras_entry_t [_param->_size_queue [i]];
105
106    reg_TOP              = new Tptr_t     [_param->_nb_context];
107    reg_BOTTOM           = new Tptr_t     [_param->_nb_context];
108    reg_EMPTY            = new Tcontrol_t [_param->_nb_context];
109
110    reg_PREDICT_TOP      = new Tptr_t     [_param->_nb_context];
111    reg_PREDICT_BOTTOM   = new Tptr_t     [_param->_nb_context];
112    reg_PREDICT_EMPTY    = new Tcontrol_t [_param->_nb_context];
113
114    internal_PREDICT_ACK = new Tcontrol_t [_param->_nb_inst_predict];
115    internal_PREDICT_HIT = new Tcontrol_t [_param->_nb_inst_predict];
116    internal_DECOD_ACK   = new Tcontrol_t [_param->_nb_inst_decod  ];
117    internal_DECOD_HIT   = new Tcontrol_t [_param->_nb_inst_decod  ];
118    internal_UPDATE_ACK  = new Tcontrol_t [_param->_nb_inst_update ];
119
120    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
121
122#ifdef POSITION
123    _component->generate_file();
124#endif
125
126    log_printf(FUNC,Return_Address_Stack,FUNCTION,"End");
127  };
128
129}; // end namespace return_address_stack
130}; // end namespace prediction_unit
131}; // end namespace front_end
132}; // end namespace multi_front_end
133}; // end namespace core
134}; // end namespace behavioural
135}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.