source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_allocation.cpp @ 145

Last change on this file since 145 was 145, checked in by rosiere, 14 years ago

1) add test with SPECINT2K
2) new config of Selftest
3) modif RAT to support multiple depth_save ... but not finish (need fix Update Prediction Table)
4) add Function_pointer but need fix

  • Property svn:keywords set to Id
File size: 33.3 KB
Line 
1/*
2 * $Id: Commit_unit_allocation.cpp 145 2010-10-13 18:15:51Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/include/Commit_unit.h"
9#include "Behavioural/include/Allocation.h"
10#include "Common/include/Max.h"
11#include "Common/include/Filename.h"
12
13namespace morpheo                    {
14namespace behavioural {
15namespace core {
16namespace multi_ooo_engine {
17namespace ooo_engine {
18namespace commit_unit {
19
20#undef  FUNCTION
21#define FUNCTION "Commit_unit::allocation"
22  void Commit_unit::allocation (
23#ifdef STATISTICS
24                               morpheo::behavioural::Parameters_Statistics * param_statistics
25#else
26                               void
27#endif
28                               )
29  {
30    log_begin(Commit_unit,FUNCTION);
31
32    _component   = new Component (_usage);
33
34    Entity * entity = _component->set_entity (_name       
35                                              ,"Commit_unit"
36#ifdef POSITION
37                                              ,COMBINATORY
38#endif
39                                              );
40
41    _interfaces = entity->set_interfaces();
42
43    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44    {
45      Interface * interface = _interfaces->set_interface(""
46#ifdef POSITION
47                                                         ,IN
48                                                         ,SOUTH,
49                                                         _("Generalist interface")
50#endif
51                                                         );
52     
53      in_CLOCK        = interface->set_signal_clk              ("clock" ,1, CLOCK_VHDL_YES);
54      in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1, RESET_VHDL_YES);
55    }
56
57    // ~~~~~[ Interface "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58    {
59      ALLOC2_INTERFACE_BEGIN("insert", IN, SOUTH, _("Interface with rename_unit."),_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
60
61      _ALLOC2_VALACK_IN      ( in_INSERT_VAL                     ,VAL,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
62      _ALLOC2_VALACK_OUT     (out_INSERT_ACK                     ,ACK,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
63      _ALLOC2_SIGNAL_IN      ( in_INSERT_FRONT_END_ID            ,"front_end_id"         ,Tcontext_t        ,_param->_size_front_end_id          ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
64      _ALLOC2_SIGNAL_IN      ( in_INSERT_CONTEXT_ID              ,"context_id"           ,Tcontext_t        ,_param->_size_context_id            ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
65      _ALLOC2_SIGNAL_OUT     (out_INSERT_PACKET_ID               ,"packet_id"            ,Tpacket_t         ,_param->_size_rob_ptr               ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
66//    _ALLOC2_SIGNAL_IN      ( in_INSERT_RENAME_UNIT_ID          ,"rename_unit_id"       ,Tcontext_t        ,_param->_size_rename_unit_id        ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
67      _ALLOC2_SIGNAL_IN      ( in_INSERT_DEPTH                   ,"depth"                ,Tdepth_t          ,_param->_size_depth                 ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
68      _ALLOC2_SIGNAL_IN_COND ( in_INSERT_SAVE_RAT                ,"save_rat"             ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_rat_scheme[it1] == RAT_DEPTH_SAVE);
69#ifdef STATISTICS           
70      _ALLOC2_SIGNAL_IN      ( in_INSERT_INSTRUCTION             ,"instruction"          ,uint32_t          ,32                                  ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
71#endif                       
72      _ALLOC2_SIGNAL_IN      ( in_INSERT_TYPE                    ,"type"                 ,Ttype_t           ,_param->_size_type                  ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
73      _ALLOC2_SIGNAL_IN      ( in_INSERT_OPERATION               ,"operation"            ,Toperation_t      ,_param->_size_operation             ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
74      _ALLOC2_SIGNAL_IN      ( in_INSERT_NO_EXECUTE              ,"no_execute"           ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
75      _ALLOC2_SIGNAL_IN      ( in_INSERT_LAST_EVENT              ,"last_event"           ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
76      _ALLOC2_SIGNAL_IN      ( in_INSERT_IS_DELAY_SLOT           ,"is_delay_slot"        ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
77#ifdef DEBUG                 
78      _ALLOC2_SIGNAL_IN      ( in_INSERT_ADDRESS                 ,"address"              ,Taddress_t        ,_param->_size_instruction_address   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
79#endif                       
80      _ALLOC2_SIGNAL_IN      ( in_INSERT_ADDRESS_NEXT            ,"address_next"         ,Taddress_t        ,_param->_size_instruction_address   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
81      _ALLOC2_SIGNAL_IN      ( in_INSERT_EXCEPTION               ,"exception"            ,Texception_t      ,_param->_size_exception             ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
82      _ALLOC2_SIGNAL_IN      ( in_INSERT_EXCEPTION_USE           ,"exception_use"        ,Texception_t      ,_param->_size_exception_use         ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
83      _ALLOC2_SIGNAL_IN      ( in_INSERT_STORE_QUEUE_PTR_WRITE   ,"store_queue_ptr_write",Tlsq_ptr_t        ,_param->_size_store_queue_ptr       ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
84      _ALLOC2_SIGNAL_IN      ( in_INSERT_LOAD_QUEUE_PTR_WRITE    ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr        ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
85#ifdef DEBUG                 
86      _ALLOC2_SIGNAL_IN      ( in_INSERT_READ_RA                 ,"read_ra"              ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
87      _ALLOC2_SIGNAL_IN      ( in_INSERT_NUM_REG_RA_LOG          ,"num_reg_ra_log"       ,Tgeneral_address_t,_param->_size_general_register_logic,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
88      _ALLOC2_SIGNAL_IN      ( in_INSERT_NUM_REG_RA_PHY          ,"num_reg_ra_phy"       ,Tgeneral_address_t,_param->_size_general_register      ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
89#endif                       
90      _ALLOC2_SIGNAL_IN      ( in_INSERT_READ_RB                 ,"read_rb"              ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
91#ifdef DEBUG                 
92      _ALLOC2_SIGNAL_IN      ( in_INSERT_NUM_REG_RB_LOG          ,"num_reg_rb_log"       ,Tgeneral_address_t,_param->_size_general_register_logic,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
93      _ALLOC2_SIGNAL_IN      ( in_INSERT_NUM_REG_RB_PHY          ,"num_reg_rb_phy"       ,Tgeneral_address_t,_param->_size_general_register      ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
94      _ALLOC2_SIGNAL_IN      ( in_INSERT_READ_RC                 ,"read_rc"              ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
95      _ALLOC2_SIGNAL_IN      ( in_INSERT_NUM_REG_RC_LOG          ,"num_reg_rc_log"       ,Tspecial_address_t,_param->_size_special_register_logic,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
96      _ALLOC2_SIGNAL_IN      ( in_INSERT_NUM_REG_RC_PHY          ,"num_reg_rc_phy"       ,Tspecial_address_t,_param->_size_special_register      ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
97#endif                       
98      _ALLOC2_SIGNAL_IN      ( in_INSERT_WRITE_RD                ,"write_rd"             ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
99      _ALLOC2_SIGNAL_IN      ( in_INSERT_NUM_REG_RD_LOG          ,"num_reg_rd_log"       ,Tgeneral_address_t,_param->_size_general_register_logic,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
100      _ALLOC2_SIGNAL_IN      ( in_INSERT_NUM_REG_RD_PHY_OLD      ,"num_reg_rd_phy_old"   ,Tgeneral_address_t,_param->_size_general_register      ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
101      _ALLOC2_SIGNAL_IN      ( in_INSERT_NUM_REG_RD_PHY_NEW      ,"num_reg_rd_phy_new"   ,Tgeneral_address_t,_param->_size_general_register      ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
102      _ALLOC2_SIGNAL_IN      ( in_INSERT_WRITE_RE                ,"write_re"             ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
103      _ALLOC2_SIGNAL_IN      ( in_INSERT_NUM_REG_RE_LOG          ,"num_reg_re_log"       ,Tspecial_address_t,_param->_size_special_register_logic,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
104      _ALLOC2_SIGNAL_IN      ( in_INSERT_NUM_REG_RE_PHY_OLD      ,"num_reg_re_phy_old"   ,Tspecial_address_t,_param->_size_special_register      ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
105      _ALLOC2_SIGNAL_IN      ( in_INSERT_NUM_REG_RE_PHY_NEW      ,"num_reg_re_phy_new"   ,Tspecial_address_t,_param->_size_special_register      ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
106
107      ALLOC2_INTERFACE_END(_param->_nb_rename_unit,_param->_nb_inst_insert[it1]);
108    }
109
110    // ~~~~~[ Interface "retire" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
111    {
112      ALLOC2_INTERFACE_BEGIN("retire",OUT,SOUTH, _("Interface to update rename_unit."),_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
113     
114      _ALLOC2_VALACK_OUT(out_RETIRE_VAL                     ,VAL,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
115      _ALLOC2_VALACK_IN ( in_RETIRE_ACK                     ,ACK,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
116      _ALLOC2_SIGNAL_OUT(out_RETIRE_FRONT_END_ID            ,"front_end_id"         ,Tcontext_t        ,_param->_size_front_end_id          ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]); 
117      _ALLOC2_SIGNAL_OUT(out_RETIRE_CONTEXT_ID              ,"context_id"           ,Tcontext_t        ,_param->_size_context_id            ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);   
118//    _ALLOC2_SIGNAL_OUT(out_RETIRE_RENAME_UNIT_ID          ,"rename_unit_id"       ,Tcontext_t        ,_param->_size_rename_unit_id        ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
119//    _ALLOC2_SIGNAL_OUT_COND(out_RETIRE_DEPTH              ,"depth"                ,Tdepth_t          ,_param->_size_depth                 ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1],_param->_rat_scheme[it1] == RAT_DEPTH_SAVE);
120      _ALLOC2_SIGNAL_OUT(out_RETIRE_USE_STORE_QUEUE         ,"use_store_queue"      ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
121      _ALLOC2_SIGNAL_OUT(out_RETIRE_USE_LOAD_QUEUE          ,"use_load_queue"       ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
122      _ALLOC2_SIGNAL_OUT(out_RETIRE_STORE_QUEUE_PTR_WRITE   ,"store_queue_ptr_write",Tlsq_ptr_t        ,_param->_size_store_queue_ptr       ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
123      _ALLOC2_SIGNAL_OUT(out_RETIRE_LOAD_QUEUE_PTR_WRITE    ,"load_queue_ptr_write" ,Tlsq_ptr_t        ,_param->_size_load_queue_ptr        ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
124//    _ALLOC2_SIGNAL_OUT(out_RETIRE_READ_RA                 ,"read_ra"              ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
125//    _ALLOC2_SIGNAL_OUT(out_RETIRE_NUM_REG_RA_PHY          ,"num_reg_ra_phy"       ,Tgeneral_address_t,_param->_size_general_register      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
126//    _ALLOC2_SIGNAL_OUT(out_RETIRE_READ_RB                 ,"read_rb"              ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
127//    _ALLOC2_SIGNAL_OUT(out_RETIRE_NUM_REG_RB_PHY          ,"num_reg_rb_phy"       ,Tgeneral_address_t,_param->_size_general_register      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
128//    _ALLOC2_SIGNAL_OUT(out_RETIRE_READ_RC                 ,"read_rc"              ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
129//    _ALLOC2_SIGNAL_OUT(out_RETIRE_NUM_REG_RC_PHY          ,"num_reg_rc_phy"       ,Tspecial_address_t,_param->_size_special_register      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
130      _ALLOC2_SIGNAL_OUT(out_RETIRE_WRITE_RD                ,"write_rd"             ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
131      _ALLOC2_SIGNAL_OUT(out_RETIRE_NUM_REG_RD_LOG          ,"num_reg_rd_log"       ,Tgeneral_address_t,_param->_size_general_register_logic,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
132      _ALLOC2_SIGNAL_OUT(out_RETIRE_NUM_REG_RD_PHY_OLD      ,"num_reg_rd_phy_old"   ,Tgeneral_address_t,_param->_size_general_register      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
133      _ALLOC2_SIGNAL_OUT(out_RETIRE_NUM_REG_RD_PHY_NEW      ,"num_reg_rd_phy_new"   ,Tgeneral_address_t,_param->_size_general_register      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
134      _ALLOC2_SIGNAL_OUT(out_RETIRE_WRITE_RE                ,"write_re"             ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
135      _ALLOC2_SIGNAL_OUT(out_RETIRE_NUM_REG_RE_LOG          ,"num_reg_re_log"       ,Tspecial_address_t,_param->_size_special_register_logic,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
136      _ALLOC2_SIGNAL_OUT(out_RETIRE_NUM_REG_RE_PHY_OLD      ,"num_reg_re_phy_old"   ,Tspecial_address_t,_param->_size_special_register      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
137      _ALLOC2_SIGNAL_OUT(out_RETIRE_NUM_REG_RE_PHY_NEW      ,"num_reg_re_phy_new"   ,Tspecial_address_t,_param->_size_special_register      ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
138      _ALLOC2_SIGNAL_OUT(out_RETIRE_RESTORE                 ,"RESTORE"              ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
139      _ALLOC2_SIGNAL_OUT(out_RETIRE_RESTORE_RD_PHY_OLD      ,"RESTORE_RD_PHY_OLD"   ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
140      _ALLOC2_SIGNAL_OUT(out_RETIRE_RESTORE_RE_PHY_OLD      ,"RESTORE_RE_PHY_OLD"   ,Tcontrol_t        ,1                                   ,_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
141
142      ALLOC2_INTERFACE_END(_param->_nb_rename_unit,_param->_nb_inst_retire[it1]);
143    }
144
145    // ~~~~~[ Interface : "retire_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
146    {
147      ALLOC2_INTERFACE_BEGIN("retire_event",OUT,SOUTH, _("Interface to update rename_unit."),_param->_nb_front_end,_param->_nb_context[it1]);
148   
149      _ALLOC2_VALACK_OUT     (out_RETIRE_EVENT_VAL   ,VAL,_param->_nb_front_end,_param->_nb_context[it1]);
150      _ALLOC2_VALACK_IN      ( in_RETIRE_EVENT_ACK   ,ACK,_param->_nb_front_end,_param->_nb_context[it1]);
151      _ALLOC2_SIGNAL_OUT     (out_RETIRE_EVENT_STATE ,"state"      ,Tevent_state_t    ,_param->_size_event_state,_param->_nb_front_end,_param->_nb_context[it1]);
152//    _ALLOC2_SIGNAL_OUT     (out_RETIRE_EVENT_FLUSH ,"flush"      ,Tcontrol_t        ,1                        ,_param->_nb_front_end,_param->_nb_context[it1]);
153      _ALLOC2_SIGNAL_OUT     (out_RETIRE_EVENT_STOP  ,"stop"       ,Tcontrol_t        ,1                        ,_param->_nb_front_end,_param->_nb_context[it1]);
154      _ALLOC2_SIGNAL_OUT_COND(out_RETIRE_EVENT_TYPE  ,"type"       ,Tevent_type_t     ,_param->_size_event_type ,_param->_nb_front_end,_param->_nb_context[it1],_param->_front_end_rat_scheme[it1] == RAT_DEPTH_SAVE);
155      _ALLOC2_SIGNAL_OUT_COND(out_RETIRE_EVENT_DEPTH ,"depth"      ,Tdepth_t          ,_param->_size_depth      ,_param->_nb_front_end,_param->_nb_context[it1],_param->_front_end_rat_scheme[it1] == RAT_DEPTH_SAVE);
156
157      ALLOC2_INTERFACE_END(_param->_nb_front_end,_param->_nb_context[it1]);
158    }
159
160    // ~~~~~[ Interface : "commit" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
161    {
162      ALLOC1_INTERFACE_BEGIN("commit",IN,EAST,_("End of execute."),_param->_nb_inst_commit);
163
164      ALLOC1_VALACK_IN ( in_COMMIT_VAL               ,VAL);
165      ALLOC1_VALACK_OUT(out_COMMIT_ACK               ,ACK);
166      ALLOC1_SIGNAL_IN ( in_COMMIT_WEN               ,"wen"        ,Tcontrol_t        ,1                             );
167      ALLOC1_SIGNAL_IN ( in_COMMIT_PACKET_ID         ,"packet_id"  ,Tpacket_t         ,_param->_size_rob_ptr         );
168//    ALLOC1_SIGNAL_IN ( in_COMMIT_OPERATION         ,"operation"  ,Toperation_t      ,_param->_size_operation       );
169//    ALLOC1_SIGNAL_IN ( in_COMMIT_TYPE              ,"type"       ,Ttype_t           ,_param->_size_type            );
170      ALLOC1_SIGNAL_IN ( in_COMMIT_CANCEL            ,"cancel"     ,Tcontrol_t        ,1                             );
171      ALLOC1_SIGNAL_IN ( in_COMMIT_FLAGS             ,"flags"      ,Tspecial_data_t   ,_param->_size_special_data    );
172      ALLOC1_SIGNAL_IN ( in_COMMIT_EXCEPTION         ,"exception"  ,Texception_t      ,_param->_size_exception       );
173      ALLOC1_SIGNAL_IN ( in_COMMIT_NO_SEQUENCE       ,"no_sequence",Tcontrol_t        ,1                             );
174      ALLOC1_SIGNAL_IN ( in_COMMIT_ADDRESS           ,"address"    ,Taddress_t        ,_param->_size_instruction_address);
175//    ALLOC1_SIGNAL_OUT(out_COMMIT_NUM_REG_RD        ,"num_reg_rd" ,Tgeneral_address_t,_param->_size_general_register+_param->_size_rename_unit_id);
176      ALLOC1_SIGNAL_OUT(out_COMMIT_NUM_REG_RD        ,"num_reg_rd" ,Tgeneral_address_t,_param->_size_general_register);
177
178      ALLOC1_INTERFACE_END(_param->_nb_inst_commit);
179    }
180
181    // ~~~~~[ Interface : "reexecute" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
182    {
183      ALLOC1_INTERFACE_BEGIN("reexecute",OUT,EAST,_("Interface to reexecute an instruction (store)"),_param->_nb_inst_reexecute);
184
185      ALLOC1_VALACK_OUT(out_REEXECUTE_VAL                  ,VAL);
186      ALLOC1_VALACK_IN ( in_REEXECUTE_ACK                  ,ACK);
187      ALLOC1_SIGNAL_OUT(out_REEXECUTE_CONTEXT_ID           ,"context_id"           ,Tcontext_t        ,_param->_size_context_id);
188      ALLOC1_SIGNAL_OUT(out_REEXECUTE_FRONT_END_ID         ,"front_end_id"         ,Tcontext_t        ,_param->_size_front_end_id);
189      ALLOC1_SIGNAL_OUT(out_REEXECUTE_PACKET_ID            ,"packet_id"            ,Tpacket_t         ,_param->_size_rob_ptr  );
190      ALLOC1_SIGNAL_OUT(out_REEXECUTE_OPERATION            ,"operation"            ,Toperation_t      ,_param->_size_operation);
191      ALLOC1_SIGNAL_OUT(out_REEXECUTE_TYPE                 ,"type"                 ,Ttype_t           ,_param->_size_type);
192      ALLOC1_SIGNAL_OUT(out_REEXECUTE_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t        ,_param->_size_store_queue_ptr);
193
194      ALLOC1_INTERFACE_END(_param->_nb_inst_reexecute);
195    }
196
197    // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
198    {
199      ALLOC1_INTERFACE_BEGIN("branch_complete",OUT,WEST,_("Interface to reexecute an instruction (store)"),_param->_nb_inst_branch_complete);
200
201      ALLOC1_VALACK_OUT(out_BRANCH_COMPLETE_VAL            ,VAL);
202      ALLOC1_VALACK_IN ( in_BRANCH_COMPLETE_ACK            ,ACK);
203      ALLOC1_SIGNAL_OUT(out_BRANCH_COMPLETE_CONTEXT_ID     ,"context_id"     ,Tcontext_t         ,_param->_size_context_id);
204      ALLOC1_SIGNAL_OUT(out_BRANCH_COMPLETE_FRONT_END_ID   ,"front_end_id"   ,Tcontext_t         ,_param->_size_front_end_id);
205      ALLOC1_SIGNAL_OUT(out_BRANCH_COMPLETE_DEPTH          ,"depth"          ,Tdepth_t           ,_param->_size_depth    );
206      ALLOC1_SIGNAL_OUT(out_BRANCH_COMPLETE_ADDRESS        ,"address"        ,Taddress_t         ,_param->_size_instruction_address);
207//    ALLOC1_SIGNAL_OUT(out_BRANCH_COMPLETE_FLAG           ,"flag"           ,Tcontrol_t         ,1);
208      ALLOC1_SIGNAL_OUT(out_BRANCH_COMPLETE_NO_SEQUENCE    ,"no_sequence"    ,Tcontrol_t         ,1);
209      ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_MISS_PREDICTION,"miss_prediction",Tcontrol_t         ,1);
210
211      ALLOC1_INTERFACE_END(_param->_nb_inst_branch_complete);
212    }
213
214    // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
215    {
216      ALLOC0_INTERFACE_BEGIN("update", OUT, WEST,_("Interface with to Context State."));
217
218      ALLOC0_VALACK_OUT(out_UPDATE_VAL                      ,VAL);
219      ALLOC0_VALACK_IN ( in_UPDATE_ACK                      ,ACK);
220      ALLOC0_SIGNAL_OUT(out_UPDATE_CONTEXT_ID               ,"context_id"      ,Tcontext_t         ,_param->_size_context_id);
221      ALLOC0_SIGNAL_OUT(out_UPDATE_FRONT_END_ID             ,"front_end_id"    ,Tcontext_t         ,_param->_size_front_end_id);
222      ALLOC0_SIGNAL_OUT(out_UPDATE_DEPTH                    ,"depth"           ,Tdepth_t           ,_param->_size_depth    );
223      ALLOC0_SIGNAL_OUT(out_UPDATE_TYPE                     ,"type"            ,Tevent_type_t      ,_param->_size_event_type);
224      ALLOC0_SIGNAL_OUT(out_UPDATE_IS_DELAY_SLOT            ,"is_delay_slot"   ,Tcontrol_t         ,1);
225      ALLOC0_SIGNAL_OUT(out_UPDATE_ADDRESS                  ,"address"         ,Taddress_t         ,_param->_size_instruction_address);
226      ALLOC0_SIGNAL_OUT(out_UPDATE_ADDRESS_EPCR_VAL         ,"address_epcr_val",Tcontrol_t         ,1);
227      ALLOC0_SIGNAL_OUT(out_UPDATE_ADDRESS_EPCR             ,"address_epcr"    ,Taddress_t         ,_param->_size_instruction_address);
228      ALLOC0_SIGNAL_OUT(out_UPDATE_ADDRESS_EEAR_VAL         ,"address_eear_val",Tcontrol_t         ,1);
229      ALLOC0_SIGNAL_OUT(out_UPDATE_ADDRESS_EEAR             ,"address_eear"    ,Tgeneral_data_t    ,_param->_size_general_data);
230
231      ALLOC0_INTERFACE_END();
232    }
233
234    // ~~~~~[ Interface "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
235    {
236      ALLOC2_INTERFACE_BEGIN("event",IN,WEST,_("Interface with Context State (event)."),_param->_nb_front_end, _param->_nb_context[it1]);
237
238      _ALLOC2_VALACK_IN ( in_EVENT_VAL             , VAL                                                           ,_param->_nb_front_end, _param->_nb_context[it1]);
239      _ALLOC2_VALACK_OUT(out_EVENT_ACK             , ACK                                                           ,_param->_nb_front_end, _param->_nb_context[it1]);
240      _ALLOC2_SIGNAL_IN ( in_EVENT_ADDRESS         ,"ADDRESS"         ,Taddress_t,_param->_size_instruction_address,_param->_nb_front_end, _param->_nb_context[it1]);
241      _ALLOC2_SIGNAL_IN ( in_EVENT_ADDRESS_NEXT    ,"ADDRESS_NEXT"    ,Taddress_t,_param->_size_instruction_address,_param->_nb_front_end, _param->_nb_context[it1]); 
242      _ALLOC2_SIGNAL_IN ( in_EVENT_ADDRESS_NEXT_VAL,"ADDRESS_NEXT_VAL",Tcontrol_t,1                                ,_param->_nb_front_end, _param->_nb_context[it1]);
243      _ALLOC2_SIGNAL_IN ( in_EVENT_IS_DS_TAKE      ,"IS_DS_TAKE"      ,Tcontrol_t,1                                ,_param->_nb_front_end, _param->_nb_context[it1]);
244
245      ALLOC2_INTERFACE_END(_param->_nb_front_end, _param->_nb_context[it1]);
246    } 
247
248    // ~~~~~[ Interface : "nb_inst" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
249    {
250      ALLOC2_INTERFACE_BEGIN("nb_inst",OUT,WEST,_("Interface with Context State (synchronization)."),_param->_nb_front_end, _param->_nb_context[it1]);
251
252      _ALLOC2_SIGNAL_OUT(out_NB_INST_COMMIT_ALL             ,"commit_all",Tcounter_t         ,_param->_size_nb_inst_commit,_param->_nb_front_end, _param->_nb_context[it1]);
253      _ALLOC2_SIGNAL_OUT(out_NB_INST_COMMIT_MEM             ,"commit_mem",Tcounter_t         ,_param->_size_nb_inst_commit,_param->_nb_front_end, _param->_nb_context[it1]);
254      _ALLOC2_SIGNAL_IN ( in_NB_INST_DECOD_ALL              ,"decod_all" ,Tcounter_t         ,_param->_size_nb_inst_decod ,_param->_nb_front_end, _param->_nb_context[it1]);
255
256      ALLOC2_INTERFACE_END(_param->_nb_front_end, _param->_nb_context[it1]);
257    }
258
259//  // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
260//  {
261//    ALLOC2_INTERFACE_BEGIN("depth",IN,WEST,_("Interface with Prediction unit."),_param->_nb_front_end, _param->_nb_context[it1]);
262//
263//    _ALLOC2_SIGNAL_IN ( in_DEPTH_MIN                     ,"min"      ,Tdepth_t           ,_param->_size_depth,_param->_nb_front_end, _param->_nb_context[it1]);
264//    _ALLOC2_SIGNAL_IN ( in_DEPTH_MAX                     ,"max"      ,Tdepth_t           ,_param->_size_depth,_param->_nb_front_end, _param->_nb_context[it1]);
265//    _ALLOC2_SIGNAL_IN ( in_DEPTH_FULL                    ,"full"     ,Tcontrol_t         ,1                  ,_param->_nb_front_end, _param->_nb_context[it1]);
266//
267//    ALLOC2_INTERFACE_END(_param->_nb_front_end, _param->_nb_context[it1]);
268//  }
269
270
271    // ~~~~~[ Interface : "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
272    {
273      ALLOC2_INTERFACE_BEGIN("spr_read",IN ,EAST,_("Interface with special register file (read)."),_param->_nb_front_end, _param->_nb_context[it1]);
274
275      _ALLOC2_SIGNAL_IN ( in_SPR_READ_SR_OVE                ,"sr_ove"    ,Tcontrol_t         ,1,_param->_nb_front_end, _param->_nb_context[it1]);
276
277      ALLOC2_INTERFACE_END(_param->_nb_front_end, _param->_nb_context[it1]);
278    }
279
280    // ~~~~~[ Interface : "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
281    {
282      ALLOC2_INTERFACE_BEGIN("spr_write",OUT,EAST,_("Interface with special register file (write)."),_param->_nb_front_end, _param->_nb_context[it1]);
283
284      _ALLOC2_VALACK_OUT(out_SPR_WRITE_VAL                    ,VAL,_param->_nb_front_end, _param->_nb_context[it1]);
285      _ALLOC2_VALACK_IN ( in_SPR_WRITE_ACK                    ,ACK,_param->_nb_front_end, _param->_nb_context[it1]);
286      _ALLOC2_SIGNAL_OUT(out_SPR_WRITE_SR_F_VAL               ,"sr_f_val"    ,Tcontrol_t         ,1                         ,_param->_nb_front_end, _param->_nb_context[it1]);
287      _ALLOC2_SIGNAL_OUT(out_SPR_WRITE_SR_F                   ,"sr_f"        ,Tcontrol_t         ,1                         ,_param->_nb_front_end, _param->_nb_context[it1]);
288      _ALLOC2_SIGNAL_OUT(out_SPR_WRITE_SR_CY_VAL              ,"sr_cy_val"   ,Tcontrol_t         ,1                         ,_param->_nb_front_end, _param->_nb_context[it1]);
289      _ALLOC2_SIGNAL_OUT(out_SPR_WRITE_SR_CY                  ,"sr_cy"       ,Tcontrol_t         ,1                         ,_param->_nb_front_end, _param->_nb_context[it1]);
290      _ALLOC2_SIGNAL_OUT(out_SPR_WRITE_SR_OV_VAL              ,"sr_ov_val"   ,Tcontrol_t         ,1                         ,_param->_nb_front_end, _param->_nb_context[it1]);
291      _ALLOC2_SIGNAL_OUT(out_SPR_WRITE_SR_OV                  ,"sr_ov"       ,Tcontrol_t         ,1                         ,_param->_nb_front_end, _param->_nb_context[it1]);
292
293      ALLOC2_INTERFACE_END(_param->_nb_front_end, _param->_nb_context[it1]);
294    }
295
296#ifdef DEBUG_TEST
297    {
298      ALLOC0_INTERFACE_BEGIN("info",OUT,EAST,_("Information."));
299      ALLOC0_SIGNAL_OUT(out_INFO_ROB_EMPTY                   ,"rob_empty"   ,bool               ,1);
300      ALLOC0_INTERFACE_END();
301    }
302#endif
303
304    if (usage_is_set(_usage,USE_SYSTEMC))
305      {
306    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~         
307    ALLOC1(internal_BANK_INSERT_VAL             ,Tcontrol_t,_param->_nb_bank);
308    ALLOC1(internal_BANK_INSERT_NUM_RENAME_UNIT ,uint32_t  ,_param->_nb_bank);
309    ALLOC1(internal_BANK_INSERT_NUM_INST        ,uint32_t  ,_param->_nb_bank);
310
311    ALLOC2(internal_BANK_COMMIT_VAL             ,Tcontrol_t,_param->_nb_bank,_param->_nb_bank_access_commit);
312    ALLOC2(internal_BANK_COMMIT_NUM_INST        ,uint32_t  ,_param->_nb_bank,_param->_nb_bank_access_commit);
313    ALLOC2(internal_BANK_COMMIT_ENTRY           ,entry_t * ,_param->_nb_bank,_param->_nb_bank_access_commit);
314
315    ALLOC1(internal_BANK_RETIRE_VAL               ,Tcontrol_t,_param->_nb_bank);
316    ALLOC1(internal_BANK_RETIRE_NUM_RENAME_UNIT   ,uint32_t  ,_param->_nb_bank);
317    ALLOC1(internal_BANK_RETIRE_NUM_INST          ,uint32_t  ,_param->_nb_bank);
318//  ALLOC1(internal_BANK_RETIRE_RESTORE           ,Tcontrol_t,_param->_nb_bank);
319    ALLOC1(internal_BANK_RETIRE_RESTORE_RD_PHY_OLD,Tcontrol_t,_param->_nb_bank);
320    ALLOC1(internal_BANK_RETIRE_RESTORE_RE_PHY_OLD,Tcontrol_t,_param->_nb_bank);
321
322    ALLOC1(internal_REEXECUTE_VAL               ,Tcontrol_t,_param->_nb_inst_reexecute);
323    ALLOC1(internal_REEXECUTE_NUM_BANK          ,uint32_t  ,_param->_nb_inst_reexecute);
324
325    ALLOC1(internal_BRANCH_COMPLETE_VAL         ,Tcontrol_t,_param->_nb_inst_branch_complete);
326    ALLOC1(internal_BRANCH_COMPLETE_NUM_BANK    ,uint32_t  ,_param->_nb_inst_branch_complete);
327
328    ALLOC2(internal_EVENT_ACK                   ,Tcontrol_t,_param->_nb_front_end,_param->_nb_context[it1]);
329    ALLOC2(internal_RETIRE_EVENT_VAL            ,Tcontrol_t,_param->_nb_front_end,_param->_nb_context[it1]);
330
331    ALLOC3(internal_rat_gpr_update_table        ,bool      ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic);
332    ALLOC3(internal_rat_spr_update_table        ,bool      ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic);
333
334
335    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
336    ALLOC2     (_nb_cycle_idle           ,double               ,_param->_nb_front_end,_param->_nb_context [it1]);
337    ALLOC1     (_rob                     ,std::list<entry_t*>  ,_param->_nb_bank);
338               
339    ALLOC1     (reg_BANK_PTR             ,uint32_t             ,_param->_nb_bank);
340                                                         
341    ALLOC2     (reg_NB_INST_COMMIT_ALL   ,Tcounter_t           ,_param->_nb_front_end,_param->_nb_context [it1]);
342    ALLOC2     (reg_NB_INST_COMMIT_MEM   ,Tcounter_t           ,_param->_nb_front_end,_param->_nb_context [it1]);
343    ALLOC3_COND(reg_NB_INST_DEPTH        ,Tcounter_t           ,_param->_nb_front_end,_param->_nb_context [it1],_param->_nb_branch_speculated[it1][it2],_param->_front_end_rat_scheme[it1] == RAT_DEPTH_SAVE);
344    ALLOC2     (reg_EVENT_STATE          ,Tcommit_event_state_t,_param->_nb_front_end,_param->_nb_context [it1]);
345    ALLOC2     (reg_EVENT_TYPE           ,Tevent_type_t        ,_param->_nb_front_end,_param->_nb_context [it1]);
346//  ALLOC2     (reg_EVENT_FLUSH          ,bool                 ,_param->_nb_front_end,_param->_nb_context [it1]);
347//  ALLOC2     (reg_EVENT_STOP           ,bool                 ,_param->_nb_front_end,_param->_nb_context [it1]);
348//  ALLOC2     (reg_EVENT_NUM_BANK       ,uint32_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
349//  ALLOC2     (reg_EVENT_NUM_PTR        ,uint32_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
350//  ALLOC2     (reg_EVENT_CAN_RESTART    ,bool                 ,_param->_nb_front_end,_param->_nb_context [it1]);
351    ALLOC2     (reg_EVENT_PACKET         ,uint32_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
352    ALLOC2     (reg_EVENT_DEPTH          ,Tdepth_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
353    ALLOC2     (reg_EVENT_NB_INST        ,uint32_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
354    ALLOC2     (reg_EVENT_LAST           ,bool                 ,_param->_nb_front_end,_param->_nb_context [it1]);
355    ALLOC2     (reg_EVENT_LAST_NUM_BANK  ,uint32_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
356    ALLOC2     (reg_EVENT_LAST_NUM_PTR   ,uint32_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
357               
358    ALLOC2     (reg_EVENT_NEXT_STOP      ,bool                 ,_param->_nb_front_end,_param->_nb_context [it1]);
359    ALLOC2     (reg_EVENT_NEXT_PACKET    ,uint32_t             ,_param->_nb_front_end,_param->_nb_context [it1]);
360                                                               
361//  ALLOC2     (reg_PC_PREVIOUS          ,Taddress_t           ,_param->_nb_front_end,_param->_nb_context [it1]);
362    ALLOC2     (reg_PC_CURRENT           ,Taddress_t           ,_param->_nb_front_end,_param->_nb_context [it1]);
363    ALLOC2     (reg_PC_CURRENT_IS_DS     ,Taddress_t           ,_param->_nb_front_end,_param->_nb_context [it1]);
364    ALLOC2     (reg_PC_CURRENT_IS_DS_TAKE,Taddress_t           ,_param->_nb_front_end,_param->_nb_context [it1]);
365    ALLOC2     (reg_PC_NEXT              ,Taddress_t           ,_param->_nb_front_end,_param->_nb_context [it1]);
366               
367    ALLOC3     (rat_gpr_update_table     ,bool                 ,_param->_nb_front_end,_param->_nb_context [it1],_param->_nb_general_register_logic);
368    ALLOC3     (rat_spr_update_table     ,bool                 ,_param->_nb_front_end,_param->_nb_context [it1],_param->_nb_special_register_logic);
369
370   
371      }
372
373    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
374    _priority_insert  = new generic::priority::Priority (_name+"_priority_insert",
375                                                         _param->_priority      ,
376                                                         _param->_load_balancing,
377                                                         _param->_nb_rename_unit,
378                                                         _param->_nb_inst_insert,
379                                                         _param->_nb_rename_unit_select);
380
381#ifdef POSITION
382    if (usage_is_set(_usage,USE_POSITION))
383        _component->generate_file();
384#endif
385
386#if defined(DEBUG) and defined(DEBUG_Commit_unit) and (DEBUG_Commit_unit == true)
387    if (log_file_generate)
388      {
389        directory_init ();
390       
391        instruction_log_file = new std::ofstream [_param->_nb_thread];
392        for (uint32_t i=0; i<_param->_nb_thread; ++i)
393          if (_param->_have_thread [i])
394            {
395             
396              std::string filename = morpheo::filename(MORPHEO_LOG,
397                                                       "Instruction_flow-thread_"+toString(i),
398                                                       "",
399                                                       "log",
400                                                       _simulation_file_with_date,
401                                                       _simulation_file_with_pid ,
402                                                       true);
403             
404              instruction_log_file [i].open(filename.c_str() ,std::ios::out | std::ios::trunc);
405            }
406      }
407#endif
408
409    log_end(Commit_unit,FUNCTION);
410  };
411
412}; // end namespace commit_unit
413}; // end namespace ooo_engine
414}; // end namespace multi_ooo_engine
415}; // end namespace core
416
417}; // end namespace behavioural
418}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.