1 | /* |
---|
2 | * $Id: Free_List_unit_allocation.cpp 88 2008-12-10 18:31:39Z 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 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace core { |
---|
14 | namespace multi_ooo_engine { |
---|
15 | namespace ooo_engine { |
---|
16 | namespace rename_unit { |
---|
17 | namespace register_translation_unit { |
---|
18 | namespace 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("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 | |
---|
70 | // ~~~~~[ interface : "push_gpr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
71 | { |
---|
72 | ALLOC1_INTERFACE("push_gpr", IN, NORTH, "General register free", _param->_nb_push); |
---|
73 | |
---|
74 | ALLOC1_VALACK_IN ( in_PUSH_GPR_VAL ,VAL); |
---|
75 | ALLOC1_VALACK_OUT(out_PUSH_GPR_ACK ,ACK); |
---|
76 | ALLOC1_SIGNAL_IN ( in_PUSH_GPR_NUM_REG,"num_reg",Tgeneral_address_t,_param->_size_general_register); |
---|
77 | } |
---|
78 | |
---|
79 | // ~~~~~[ interface : "push_spr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
80 | { |
---|
81 | ALLOC1_INTERFACE("push_spr", IN, NORTH, "General register free", _param->_nb_push); |
---|
82 | |
---|
83 | ALLOC1_VALACK_IN ( in_PUSH_SPR_VAL ,VAL); |
---|
84 | ALLOC1_VALACK_OUT(out_PUSH_SPR_ACK ,ACK); |
---|
85 | ALLOC1_SIGNAL_IN ( in_PUSH_SPR_NUM_REG,"num_reg",Tspecial_address_t,_param->_size_special_register); |
---|
86 | } |
---|
87 | |
---|
88 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
89 | { |
---|
90 | _gpr_list = new std::list<uint32_t> [_param->_nb_bank]; |
---|
91 | _spr_list = new std::list<uint32_t> [_param->_nb_bank]; |
---|
92 | |
---|
93 | internal_POP_ACK = new Tcontrol_t [_param->_nb_pop]; |
---|
94 | internal_POP_GPR_BANK = new uint32_t [_param->_nb_pop]; |
---|
95 | internal_POP_SPR_BANK = new uint32_t [_param->_nb_pop]; |
---|
96 | |
---|
97 | internal_PUSH_GPR_ACK = new Tcontrol_t [_param->_nb_push]; |
---|
98 | internal_PUSH_SPR_ACK = new Tcontrol_t [_param->_nb_push]; |
---|
99 | internal_PUSH_GPR_BANK = new uint32_t [_param->_nb_push]; |
---|
100 | internal_PUSH_SPR_BANK = new uint32_t [_param->_nb_push]; |
---|
101 | } |
---|
102 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
103 | |
---|
104 | #ifdef POSITION |
---|
105 | if (usage_is_set(_usage,USE_POSITION)) |
---|
106 | _component->generate_file(); |
---|
107 | #endif |
---|
108 | |
---|
109 | log_printf(FUNC,Free_List_unit,FUNCTION,"End"); |
---|
110 | }; |
---|
111 | |
---|
112 | }; // end namespace free_list_unit |
---|
113 | }; // end namespace register_translation_unit |
---|
114 | }; // end namespace rename_unit |
---|
115 | }; // end namespace ooo_engine |
---|
116 | }; // end namespace multi_ooo_engine |
---|
117 | }; // end namespace core |
---|
118 | |
---|
119 | }; // end namespace behavioural |
---|
120 | }; // end namespace morpheo |
---|