1 | #ifdef SYSTEMC |
---|
2 | /* |
---|
3 | * $Id: Address_management_genMoore.cpp 123 2009-06-08 20:43:30Z rosiere $ |
---|
4 | * |
---|
5 | * [ Description ] |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management/include/Address_management.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace core { |
---|
14 | namespace multi_front_end { |
---|
15 | namespace front_end { |
---|
16 | namespace ifetch_unit { |
---|
17 | namespace address_management { |
---|
18 | |
---|
19 | |
---|
20 | #undef FUNCTION |
---|
21 | #define FUNCTION "Address_management::genMoore" |
---|
22 | void Address_management::genMoore (void) |
---|
23 | { |
---|
24 | log_printf(FUNC,Address_management,FUNCTION,"Begin"); |
---|
25 | |
---|
26 | if (PORT_READ(in_NRESET)) |
---|
27 | { |
---|
28 | // ========================================= |
---|
29 | // ===== ADDRESS =========================== |
---|
30 | // ========================================= |
---|
31 | |
---|
32 | internal_ADDRESS_VAL = reg_PC_ACCESS_VAL; |
---|
33 | |
---|
34 | // Align pc on instruction packet address. |
---|
35 | PORT_WRITE(out_ADDRESS_INSTRUCTION_ADDRESS ,reg_PC_ACCESS - (reg_PC_ACCESS%_param->_nb_instruction)); |
---|
36 | if (_param->_have_port_inst_ifetch_ptr) |
---|
37 | PORT_WRITE(out_ADDRESS_INST_IFETCH_PTR ,reg_PC_ACCESS_INST_IFETCH_PTR ); |
---|
38 | PORT_WRITE(out_ADDRESS_BRANCH_STATE ,reg_PC_ACCESS_BRANCH_STATE ); |
---|
39 | if (_param->_have_port_depth) |
---|
40 | PORT_WRITE(out_ADDRESS_BRANCH_UPDATE_PREDICTION_ID,reg_PC_ACCESS_BRANCH_UPDATE_PREDICTION_ID); |
---|
41 | |
---|
42 | for (uint32_t i=0; i<_param->_nb_instruction; i++) |
---|
43 | PORT_WRITE(out_ADDRESS_INSTRUCTION_ENABLE [i], reg_PC_ACCESS_INSTRUCTION_ENABLE[i]); |
---|
44 | |
---|
45 | // ========================================= |
---|
46 | // ===== PREDICT =========================== |
---|
47 | // ========================================= |
---|
48 | |
---|
49 | internal_PREDICT_VAL = not reg_PC_NEXT_NEXT_VAL; |
---|
50 | |
---|
51 | PORT_WRITE(out_PREDICT_PC_PREVIOUS ,reg_PC_CURRENT ); |
---|
52 | PORT_WRITE(out_PREDICT_PC_CURRENT ,reg_PC_NEXT ); |
---|
53 | PORT_WRITE(out_PREDICT_PC_CURRENT_IS_DS_TAKE,reg_PC_NEXT_IS_DS_TAKE); |
---|
54 | } |
---|
55 | else |
---|
56 | { |
---|
57 | internal_ADDRESS_VAL = 0; |
---|
58 | internal_PREDICT_VAL = 0; |
---|
59 | } |
---|
60 | |
---|
61 | PORT_WRITE(out_ADDRESS_VAL,internal_ADDRESS_VAL); |
---|
62 | PORT_WRITE(out_PREDICT_VAL,internal_PREDICT_VAL); |
---|
63 | |
---|
64 | log_printf(FUNC,Address_management,FUNCTION,"End"); |
---|
65 | }; |
---|
66 | |
---|
67 | }; // end namespace address_management |
---|
68 | }; // end namespace ifetch_unit |
---|
69 | }; // end namespace front_end |
---|
70 | }; // end namespace multi_front_end |
---|
71 | }; // end namespace core |
---|
72 | |
---|
73 | }; // end namespace behavioural |
---|
74 | }; // end namespace morpheo |
---|
75 | #endif |
---|