source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_allocation.cpp @ 111

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

1) Decod_queue : multi implementation (one_fifo, multi_fifo)
2) Issue_queue : multi implementation (in_order, out_of_order)
3) Direction : Add Meta predictor
4) Context_State : re add Branch_complete, More priority to Load miss (is not speculative)
5) Return_Address_Stack : update reg_PREDICT pointer on decod miss prediction
6) UPT : Fix bug in multi event
7) Prediction_glue : in read_stack case, insert in UPT pc_next
8) Rename select : when rob have an event (need flush), read_r{a,b,c} and write_r{d,e} is set at 0

  • Property svn:keywords set to Id
File size: 4.5 KB
Line 
1/*
2 * $Id: Meta_Predictor_Glue_allocation.cpp 111 2009-02-27 18:37:40Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
9#include "Behavioural/include/Allocation.h"
10#include "Common/include/Max.h"
11
12namespace morpheo                    {
13namespace behavioural {
14namespace core {
15namespace multi_front_end {
16namespace front_end {
17namespace prediction_unit {
18namespace direction {
19namespace meta_predictor {
20namespace meta_predictor_glue {
21
22
23
24#undef  FUNCTION
25#define FUNCTION "Meta_Predictor_Glue::allocation"
26  void Meta_Predictor_Glue::allocation (
27#ifdef STATISTICS
28                               morpheo::behavioural::Parameters_Statistics * param_statistics
29#else
30                               void
31#endif
32                               )
33  {
34    log_begin(Meta_Predictor_Glue,FUNCTION);
35
36    _component   = new Component (_usage);
37
38    Entity * entity = _component->set_entity (_name       
39                                              ,"Meta_Predictor_Glue"
40#ifdef POSITION
41                                              ,COMBINATORY
42#endif
43                                              );
44
45    _interfaces = entity->set_interfaces();
46
47    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48    {
49      Interface * interface = _interfaces->set_interface(""
50#ifdef POSITION
51                                                         ,IN
52                                                         ,SOUTH,
53                                                         _("Generalist interface")
54#endif
55                                                         );
56     
57      in_CLOCK        = interface->set_signal_clk              ("clock" ,1, CLOCK_VHDL_YES);
58      in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1, RESET_VHDL_YES);
59    }
60
61    // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
62    {
63      ALLOC1_INTERFACE("predict",IN,NORTH,_("Predict next address"),_param->_nb_inst_predict);
64
65      ALLOC1_SIGNAL_IN ( in_PREDICT_VAL                    ,"VAL"          ,Tcontrol_t,1);
66      ALLOC1_SIGNAL_OUT(out_PREDICT_ACK                    ,"ACK"          ,Tcontrol_t,1);
67      ALLOC1_SIGNAL_OUT(out_PREDICT_HISTORY                ,"HISTORY"      ,Thistory_t,_param->_size_history);
68      ALLOC1_SIGNAL_OUT(out_PREDICT_DIRECTION              ,"DIRECTION"    ,Tcontrol_t,1);
69    }
70
71    {
72      ALLOC2_INTERFACE("predict_predictor",IN,NORTH,_("Predict next address"),_param->_nb_predictor,_param->_nb_inst_predict);
73     
74      ALLOC2_SIGNAL_OUT(out_PREDICT_PREDICTOR_VAL          ,"VAL"          ,Tcontrol_t,1);
75      ALLOC2_SIGNAL_IN ( in_PREDICT_PREDICTOR_ACK          ,"ACK"          ,Tcontrol_t,1);
76      ALLOC2_SIGNAL_IN ( in_PREDICT_PREDICTOR_HISTORY      ,"HISTORY"      ,Thistory_t,_param->_predictor_size_history[it1]);
77      ALLOC2_SIGNAL_IN ( in_PREDICT_PREDICTOR_DIRECTION    ,"DIRECTION"    ,Tcontrol_t,1);
78      ALLOC2_SIGNAL_OUT(out_PREDICT_PREDICTOR_DIRECTION_VAL,"DIRECTION_VAL",Tcontrol_t,(_param->_predictor_update_on_prediction [it1])?1:0);
79      ALLOC2_SIGNAL_OUT(out_PREDICT_PREDICTOR_DIRECTION    ,"DIRECTION"    ,Tcontrol_t,(_param->_predictor_update_on_prediction [it1])?1:0);
80    }
81
82    // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
83    {
84      ALLOC1_INTERFACE("update",IN,NORTH,_("Update predictor"),_param->_nb_inst_update);
85     
86      ALLOC1_SIGNAL_IN ( in_UPDATE_VAL                     ,"VAL"          ,Tcontrol_t,1);
87      ALLOC1_SIGNAL_OUT(out_UPDATE_ACK                     ,"ACK"          ,Tcontrol_t,1);
88      ALLOC1_SIGNAL_IN ( in_UPDATE_HISTORY                 ,"HISTORY"      ,Thistory_t,_param->_size_history);
89      ALLOC1_SIGNAL_IN ( in_UPDATE_DIRECTION               ,"DIRECTION"    ,Tcontrol_t,1);
90    }
91    {
92      ALLOC2_INTERFACE("update_predictor",IN,NORTH,_("Update predictor"),_param->_nb_predictor,_param->_nb_inst_update);
93     
94      ALLOC2_SIGNAL_OUT(out_UPDATE_PREDICTOR_VAL           ,"VAL"          ,Tcontrol_t,1);
95      ALLOC2_SIGNAL_IN ( in_UPDATE_PREDICTOR_ACK           ,"ACK"          ,Tcontrol_t,1);
96      ALLOC2_SIGNAL_OUT(out_UPDATE_PREDICTOR_HISTORY       ,"HISTORY"      ,Thistory_t,_param->_predictor_size_history[it1]);
97      ALLOC2_SIGNAL_OUT(out_UPDATE_PREDICTOR_DIRECTION     ,"DIRECTION"    ,Tcontrol_t,1);
98      ALLOC2_SIGNAL_OUT(out_UPDATE_PREDICTOR_MISS          ,"MISS"         ,Tcontrol_t,(_param->_predictor_update_on_prediction [it1])?1:0);
99    }
100
101    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
102
103#ifdef POSITION
104    if (usage_is_set(_usage,USE_POSITION))
105        _component->generate_file();
106#endif
107
108    log_end(Meta_Predictor_Glue,FUNCTION);
109  };
110
111}; // end namespace meta_predictor_glue
112}; // end namespace meta_predictor
113}; // end namespace direction
114}; // end namespace prediction_unit
115}; // end namespace front_end
116}; // end namespace multi_front_end
117}; // end namespace core
118
119}; // end namespace behavioural
120}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.