source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Free_List_unit/src/Free_List_unit_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: 4.5 KB
Line 
1/*
2 * $Id: Free_List_unit_allocation.cpp 112 2009-03-18 22:36:26Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Free_List_unit/include/Free_List_unit.h"
9#include "Behavioural/include/Allocation.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_ooo_engine {
15namespace ooo_engine {
16namespace rename_unit {
17namespace register_translation_unit {
18namespace free_list_unit {
19
20
21
22#undef  FUNCTION
23#define FUNCTION "Free_List_unit::allocation"
24  void Free_List_unit::allocation (
25#ifdef STATISTICS
26                               morpheo::behavioural::Parameters_Statistics * param_statistics
27#else
28                               void
29#endif
30                               )
31  {
32    log_printf(FUNC,Free_List_unit,FUNCTION,"Begin");
33
34    _component   = new Component (_usage);
35
36    Entity * entity = _component->set_entity (_name       
37                                              ,"Free_List_unit"
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    // ~~~~~[ interface : "pop" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
59     {
60       ALLOC1_INTERFACE_BEGIN("pop", IN, NORTH, _("New destination register"), _param->_nb_pop);
61
62       ALLOC1_VALACK_IN ( in_POP_VAL        ,VAL);
63       ALLOC1_VALACK_OUT(out_POP_ACK        ,ACK);
64       ALLOC1_SIGNAL_IN ( in_POP_GPR_VAL    ,"gpr_val"    ,Tcontrol_t        ,1                             );
65       ALLOC1_SIGNAL_OUT(out_POP_GPR_NUM_REG,"gpr_num_reg",Tgeneral_address_t,_param->_size_general_register);
66       ALLOC1_SIGNAL_IN ( in_POP_SPR_VAL    ,"spr_val"    ,Tcontrol_t        ,1                             );
67       ALLOC1_SIGNAL_OUT(out_POP_SPR_NUM_REG,"spr_num_reg",Tspecial_address_t,_param->_size_special_register);
68
69       ALLOC1_INTERFACE_END(_param->_nb_pop);
70     }
71
72    // ~~~~~[ interface : "push_gpr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73     {
74       ALLOC1_INTERFACE_BEGIN("push_gpr", IN, NORTH, _("General register free"), _param->_nb_push);
75
76       ALLOC1_VALACK_IN ( in_PUSH_GPR_VAL    ,VAL);
77       ALLOC1_VALACK_OUT(out_PUSH_GPR_ACK    ,ACK);
78       ALLOC1_SIGNAL_IN ( in_PUSH_GPR_NUM_REG,"num_reg",Tgeneral_address_t,_param->_size_general_register);
79
80       ALLOC1_INTERFACE_END(_param->_nb_push);
81     }
82
83    // ~~~~~[ interface : "push_spr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84     {
85       ALLOC1_INTERFACE_BEGIN("push_spr", IN, NORTH, _("General register free"), _param->_nb_push);
86
87       ALLOC1_VALACK_IN ( in_PUSH_SPR_VAL    ,VAL);
88       ALLOC1_VALACK_OUT(out_PUSH_SPR_ACK    ,ACK);
89       ALLOC1_SIGNAL_IN ( in_PUSH_SPR_NUM_REG,"num_reg",Tspecial_address_t,_param->_size_special_register);
90
91       ALLOC1_INTERFACE_END(_param->_nb_push);
92     }
93
94     if (usage_is_set(_usage,USE_SYSTEMC))
95       {
96     ALLOC1(_gpr_list,std::list<uint32_t>,_param->_nb_bank);
97     ALLOC1(_spr_list,std::list<uint32_t>,_param->_nb_bank);
98
99     ALLOC1(internal_POP_ACK      ,Tcontrol_t,_param->_nb_pop);
100     ALLOC1(internal_POP_GPR_BANK ,uint32_t  ,_param->_nb_pop);
101     ALLOC1(internal_POP_SPR_BANK ,uint32_t  ,_param->_nb_pop);
102
103     ALLOC1(internal_PUSH_GPR_ACK ,Tcontrol_t,_param->_nb_push);
104     ALLOC1(internal_PUSH_SPR_ACK ,Tcontrol_t,_param->_nb_push);
105     ALLOC1(internal_PUSH_GPR_BANK,uint32_t  ,_param->_nb_push);
106     ALLOC1(internal_PUSH_SPR_BANK,uint32_t  ,_param->_nb_push);
107       }
108
109    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
110    _priority_gpr = new generic::priority::Priority (_name+"_priority_gpr",
111                                                     _param->_priority,
112                                                     _param->_nb_bank,
113                                                     _param->_nb_bank);
114
115    _priority_spr = new generic::priority::Priority (_name+"_priority_spr",
116                                                     _param->_priority,
117                                                     _param->_nb_bank,
118                                                     _param->_nb_bank);
119
120#ifdef POSITION
121     if (usage_is_set(_usage,USE_POSITION))
122       _component->generate_file();
123#endif
124
125    log_printf(FUNC,Free_List_unit,FUNCTION,"End");
126  };
127
128}; // end namespace free_list_unit
129}; // end namespace register_translation_unit
130}; // end namespace rename_unit
131}; // end namespace ooo_engine
132}; // end namespace multi_ooo_engine
133}; // end namespace core
134
135}; // end namespace behavioural
136}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.