source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Direction_Glue/src/Direction_Glue_allocation.cpp @ 112

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

1) Stat_list : fix retire old and new register bug
2) Stat_list : remove read_counter and valid flag, because validation of destination is in retire step (not in commit step)
3) Model : add class Model (cf Morpheo.sim)
4) Allocation : alloc_interface_begin and alloc_interface_end to delete temporary array.
5) Script : add distexe.sh
6) Add Comparator, Multiplier, Divider. But this component are not implemented
7) Software : add Dhrystone

  • Property svn:keywords set to Id
File size: 5.1 KB
Line 
1/*
2 * $Id: Direction_Glue_allocation.cpp 112 2009-03-18 22:36:26Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Direction_Glue/include/Direction_Glue.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 direction {
18namespace direction_glue {
19
20
21
22#undef  FUNCTION
23#define FUNCTION "Direction_Glue::allocation"
24  void Direction_Glue::allocation (
25#ifdef STATISTICS
26                               morpheo::behavioural::Parameters_Statistics * param_statistics
27#else
28                               void
29#endif
30                               )
31  {
32    log_printf(FUNC,Direction_Glue,FUNCTION,"Begin");
33
34    _component   = new Component (_usage);
35
36    Entity * entity = _component->set_entity (_name       
37                                              ,"Direction_Glue"
38#ifdef POSITION
39                                              ,COMBINATORY
40#endif
41                                              );
42
43    _interfaces = entity->set_interfaces();
44
45    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
46    {
47      Interface * interface = _interfaces->set_interface(""
48#ifdef POSITION
49                                                         ,IN
50                                                         ,SOUTH,
51                                                         "Generalist interface"
52#endif
53                                                         );
54     
55      in_CLOCK        = interface->set_signal_clk              ("clock" ,1, CLOCK_VHDL_YES);
56      in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1, RESET_VHDL_YES);
57    }
58
59    // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60    {
61      ALLOC1_INTERFACE_BEGIN("predict", IN, SOUTH, _("predict's interface"), _param->_nb_inst_predict);
62
63      ALLOC1_SIGNAL_IN ( in_PREDICT_VAL                  ,"val"                  ,Tcontrol_t,1);
64      ALLOC1_SIGNAL_OUT(out_PREDICT_ACK                  ,"ack"                  ,Tcontrol_t,1);
65      ALLOC1_SIGNAL_IN ( in_PREDICT_ADDRESS_SRC          ,"address_src"          ,Taddress_t,_param->_size_instruction_address);
66      ALLOC1_SIGNAL_IN ( in_PREDICT_STATIC               ,"static"               ,Tcontrol_t,1);
67      ALLOC1_SIGNAL_IN ( in_PREDICT_LAST_TAKE            ,"last_take"            ,Tcontrol_t,1);
68      ALLOC1_SIGNAL_OUT(out_PREDICT_HISTORY              ,"history"              ,Thistory_t,_param->_size_history);
69      ALLOC1_SIGNAL_OUT(out_PREDICT_DIRECTION            ,"direction"            ,Tcontrol_t,1);
70
71      if (_param->_have_component_meta_predictor)                               
72        {                                                                       
73      ALLOC1_SIGNAL_OUT(out_PREDICT_PREDICTOR_VAL        ,"predictor_val"        ,Tcontrol_t,1);
74      ALLOC1_SIGNAL_IN ( in_PREDICT_PREDICTOR_ACK        ,"predictor_ack"        ,Tcontrol_t,1);
75      ALLOC1_SIGNAL_OUT(out_PREDICT_PREDICTOR_ADDRESS_SRC,"predictor_address_src",Taddress_t,_param->_size_instruction_address);
76      ALLOC1_SIGNAL_IN ( in_PREDICT_PREDICTOR_HISTORY    ,"predictor_history"    ,Thistory_t,_param->_size_history);
77      ALLOC1_SIGNAL_IN ( in_PREDICT_PREDICTOR_DIRECTION  ,"predictor_direction"  ,Tcontrol_t,1);
78        }
79
80      ALLOC1_INTERFACE_END(_param->_nb_inst_predict);
81    }
82
83    // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84    {
85      ALLOC1_INTERFACE_BEGIN("update", IN, SOUTH, _("update's interface"), _param->_nb_inst_update);
86
87      ALLOC1_SIGNAL_IN ( in_UPDATE_VAL                        ,"val"                        ,Tcontrol_t,1);
88      ALLOC1_SIGNAL_OUT(out_UPDATE_ACK                        ,"ack"                        ,Tcontrol_t,1);
89      ALLOC1_SIGNAL_IN ( in_UPDATE_ADDRESS                    ,"address"                    ,Taddress_t,_param->_size_instruction_address);
90      ALLOC1_SIGNAL_IN ( in_UPDATE_HISTORY                    ,"history"                    ,Thistory_t,_param->_size_history);
91      ALLOC1_SIGNAL_IN ( in_UPDATE_DIRECTION                  ,"direction"                  ,Tcontrol_t,1);
92      ALLOC1_SIGNAL_IN ( in_UPDATE_PREDICTION_IFETCH          ,"prediction_ifetch"          ,Tcontrol_t,1);
93
94      if (_param->_have_component_meta_predictor)
95        {
96      ALLOC1_SIGNAL_OUT(out_UPDATE_PREDICTOR_VAL              ,"predictor_val"              ,Tcontrol_t,1);
97      ALLOC1_SIGNAL_IN ( in_UPDATE_PREDICTOR_ACK              ,"predictor_ack"              ,Tcontrol_t,1);
98      ALLOC1_SIGNAL_OUT(out_UPDATE_PREDICTOR_ADDRESS          ,"predictor_address"          ,Taddress_t,_param->_size_instruction_address);
99      ALLOC1_SIGNAL_OUT(out_UPDATE_PREDICTOR_HISTORY          ,"predictor_history"          ,Thistory_t,_param->_size_history);
100      ALLOC1_SIGNAL_OUT(out_UPDATE_PREDICTOR_DIRECTION        ,"predictor_direction"        ,Tcontrol_t,1);
101      ALLOC1_SIGNAL_OUT(out_UPDATE_PREDICTOR_PREDICTION_IFETCH,"predictor_prediction_ifetch",Tcontrol_t,1);
102        }
103
104      ALLOC1_INTERFACE_END(_param->_nb_inst_update);
105    }
106   
107    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
108
109#ifdef POSITION
110    if (usage_is_set(_usage,USE_POSITION))
111      _component->generate_file();
112#endif
113
114    log_printf(FUNC,Direction_Glue,FUNCTION,"End");
115  };
116
117}; // end namespace direction_glue
118}; // end namespace direction
119}; // end namespace prediction_unit
120}; // end namespace front_end
121}; // end namespace multi_front_end
122}; // end namespace core
123
124}; // end namespace behavioural
125}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.