[2] | 1 | #ifdef VHDL |
---|
| 2 | /* |
---|
| 3 | * $Id$ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace stage_1_ifetch { |
---|
| 14 | namespace predictor { |
---|
| 15 | namespace meta_predictor { |
---|
| 16 | namespace two_level_branch_predictor { |
---|
| 17 | namespace branch_history_table { |
---|
| 18 | |
---|
| 19 | |
---|
[42] | 20 | void Branch_History_Table::vhdl_body (Vhdl * & vhdl) |
---|
[2] | 21 | { |
---|
[42] | 22 | // vhdl->set_body ("-- Output : always at '1'"); |
---|
[15] | 23 | // for (uint32_t i=0; i<_param._nb_branch_complete; i++) |
---|
[42] | 24 | // vhdl->set_body ("out_BRANCH_COMPLETE_ACK_"+toString(i)+" <= '1';"); |
---|
[15] | 25 | // for (uint32_t i=0; i<_param._nb_prediction ; i++) |
---|
[42] | 26 | // vhdl->set_body ("out_PREDICT_ACK_"+toString(i)+" <= '1';"); |
---|
| 27 | // vhdl->set_body (""); |
---|
[2] | 28 | |
---|
| 29 | list<string> list_port_map; |
---|
| 30 | |
---|
| 31 | for (uint32_t i=0; i<_param._nb_branch_complete; i++) |
---|
| 32 | { |
---|
[42] | 33 | vhdl->set_body_component_port_map (list_port_map," in_SHIFTER_"+toString(i)+"_DATA "," in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY" ); |
---|
| 34 | vhdl->set_body_component_port_map (list_port_map," in_SHIFTER_"+toString(i)+"_CARRY_IN "," in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"); |
---|
| 35 | vhdl->set_body_component_port_map (list_port_map,"out_SHIFTER_"+toString(i)+"_DATA ","signal_BRANCH_COMPLETE_"+toString(i)+"_HISTORY" ); |
---|
[2] | 36 | } |
---|
| 37 | |
---|
[42] | 38 | vhdl->set_body_component ("component_Shifter",_name+"_Shifter",list_port_map); |
---|
[2] | 39 | |
---|
| 40 | list_port_map.clear(); |
---|
[42] | 41 | vhdl->set_body_component_port_map (list_port_map,"in_CLOCK","in_CLOCK"); |
---|
| 42 | vhdl->set_body_component_port_map (list_port_map,"in_NRESET","in_NRESET"); |
---|
[15] | 43 | |
---|
[2] | 44 | for (uint32_t i=0; i<_param._nb_prediction; i++) |
---|
| 45 | { |
---|
[42] | 46 | vhdl->set_body_component_port_map (list_port_map," in_READ_"+toString(i)+"_VAL "," In_PREDICT_"+toString(i)+"_VAL"); |
---|
| 47 | vhdl->set_body_component_port_map (list_port_map,"out_READ_"+toString(i)+"_ACK ","out_PREDICT_"+toString(i)+"_ACK"); |
---|
| 48 | vhdl->set_body_component_port_map (list_port_map," in_READ_"+toString(i)+"_ADDRESS "," in_PREDICT_"+toString(i)+"_ADDRESS"); |
---|
| 49 | vhdl->set_body_component_port_map (list_port_map,"out_READ_"+toString(i)+"_DATA ","out_PREDICT_"+toString(i)+"_HISTORY"); |
---|
[2] | 50 | } |
---|
| 51 | |
---|
| 52 | for (uint32_t i=0; i<_param._nb_branch_complete; i++) |
---|
| 53 | { |
---|
[42] | 54 | vhdl->set_body_component_port_map (list_port_map," in_WRITE_"+toString(i)+"_VAL "," in_BRANCH_COMPLETE_"+toString(i)+"_VAL"); |
---|
| 55 | vhdl->set_body_component_port_map (list_port_map,"out_WRITE_"+toString(i)+"_ACK "," out_BRANCH_COMPLETE_"+toString(i)+"_ACK"); |
---|
| 56 | vhdl->set_body_component_port_map (list_port_map," in_WRITE_"+toString(i)+"_ADDRESS"," in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"); |
---|
| 57 | vhdl->set_body_component_port_map (list_port_map," in_WRITE_"+toString(i)+"_DATA ","signal_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"); |
---|
[2] | 58 | } |
---|
[42] | 59 | vhdl->set_body_component ("component_RegisterFile",_name+"_RegisterFile",list_port_map); |
---|
[2] | 60 | }; |
---|
| 61 | |
---|
| 62 | }; // end namespace branch_history_table |
---|
| 63 | }; // end namespace two_level_branch_predictor |
---|
| 64 | }; // end namespace meta_predictor |
---|
| 65 | }; // end namespace predictor |
---|
| 66 | }; // end namespace stage_1_ifetch |
---|
| 67 | |
---|
| 68 | }; // end namespace behavioural |
---|
| 69 | }; // end namespace morpheo |
---|
| 70 | #endif |
---|