1 | #ifdef SYSTEMC |
---|
2 | /* |
---|
3 | * $Id: Free_List_unit_genMealy_pop.cpp 108 2009-02-12 11:55:06Z rosiere $ |
---|
4 | * |
---|
5 | * [ Description ] |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Free_List_unit/include/Free_List_unit.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 | #undef FUNCTION |
---|
22 | #define FUNCTION "Free_List_unit::genMealy_pop" |
---|
23 | void Free_List_unit::genMealy_pop (void) |
---|
24 | { |
---|
25 | log_begin(Free_List_unit,FUNCTION); |
---|
26 | log_function(Free_List_unit,FUNCTION,_name.c_str()); |
---|
27 | |
---|
28 | for (uint32_t i=0; i<_param->_nb_pop; i++) |
---|
29 | { |
---|
30 | log_printf(TRACE,Free_List_unit,FUNCTION," * POP [%d]",i); |
---|
31 | |
---|
32 | uint32_t offset = i*_param->_nb_bank_by_pop; |
---|
33 | |
---|
34 | // GPR |
---|
35 | bool gpr_ack = not PORT_READ(in_POP_GPR_VAL[i]); |
---|
36 | |
---|
37 | log_printf(TRACE,Free_List_unit,FUNCTION," * GPR_VAL : %d",PORT_READ(in_POP_GPR_VAL[i])); |
---|
38 | |
---|
39 | if (not gpr_ack) |
---|
40 | for (uint32_t j=0; j<_param->_nb_bank_by_pop; j++) |
---|
41 | { |
---|
42 | uint32_t bank = offset+((j+reg_BANK_PRIORITY)%_param->_nb_bank_by_pop |
---|
43 | ); |
---|
44 | |
---|
45 | log_printf(TRACE,Free_List_unit,FUNCTION," * bank : %d",bank); |
---|
46 | |
---|
47 | if (not _gpr_list[bank].empty()) |
---|
48 | { |
---|
49 | // find |
---|
50 | log_printf(TRACE,Free_List_unit,FUNCTION," * find : %d",_gpr_list[bank].front()); |
---|
51 | |
---|
52 | gpr_ack = true; |
---|
53 | internal_POP_GPR_BANK [i] = bank; |
---|
54 | PORT_WRITE(out_POP_GPR_NUM_REG [i], |
---|
55 | //(bank << _param->_shift) | // only in VHDL |
---|
56 | _gpr_list[bank].front()); |
---|
57 | |
---|
58 | break; |
---|
59 | } |
---|
60 | } |
---|
61 | |
---|
62 | // SPR |
---|
63 | bool spr_ack = not PORT_READ(in_POP_SPR_VAL[i]); |
---|
64 | |
---|
65 | log_printf(TRACE,Free_List_unit,FUNCTION," * SPR_VAL : %d",PORT_READ(in_POP_SPR_VAL[i])); |
---|
66 | |
---|
67 | if (not spr_ack) |
---|
68 | for (uint32_t j=0; j<_param->_nb_bank_by_pop; j++) |
---|
69 | { |
---|
70 | uint32_t bank = offset+((j+reg_BANK_PRIORITY)%_param->_nb_bank_by_pop |
---|
71 | ); |
---|
72 | |
---|
73 | log_printf(TRACE,Free_List_unit,FUNCTION," * bank : %d",bank); |
---|
74 | |
---|
75 | if (not _spr_list[bank].empty()) |
---|
76 | { |
---|
77 | // find |
---|
78 | log_printf(TRACE,Free_List_unit,FUNCTION," * find : %d",_spr_list[bank].front()); |
---|
79 | |
---|
80 | spr_ack = true; |
---|
81 | internal_POP_SPR_BANK [i] = bank; |
---|
82 | PORT_WRITE(out_POP_SPR_NUM_REG [i], |
---|
83 | //(bank << _param->_shift) | // only in VHDL |
---|
84 | _spr_list[bank].front()); |
---|
85 | |
---|
86 | break; |
---|
87 | } |
---|
88 | } |
---|
89 | |
---|
90 | internal_POP_ACK [i] = gpr_ack and spr_ack; |
---|
91 | |
---|
92 | PORT_WRITE(out_POP_ACK [i], internal_POP_ACK [i]); |
---|
93 | } |
---|
94 | |
---|
95 | |
---|
96 | log_end(Free_List_unit,FUNCTION); |
---|
97 | }; |
---|
98 | |
---|
99 | }; // end namespace free_list_unit |
---|
100 | }; // end namespace register_translation_unit |
---|
101 | }; // end namespace rename_unit |
---|
102 | }; // end namespace ooo_engine |
---|
103 | }; // end namespace multi_ooo_engine |
---|
104 | }; // end namespace core |
---|
105 | |
---|
106 | }; // end namespace behavioural |
---|
107 | }; // end namespace morpheo |
---|
108 | #endif |
---|