source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/src/Branch_History_Table_vhdl_body.cpp @ 3

Last change on this file since 3 was 3, checked in by kane, 17 years ago

1) Ajout d'un "printer" XML pour la configuration de paramètres

2) Fin du composant "Two_Level_Branch_Predictor"

validation * systemc

  • vhdl
File size: 2.7 KB
Line 
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
11namespace morpheo                    {
12namespace behavioural {
13namespace stage_1_ifetch {
14namespace predictor {
15namespace meta_predictor {
16namespace two_level_branch_predictor {
17namespace branch_history_table {
18
19
20  void Branch_History_Table::vhdl_body (Vhdl & vhdl)
21  {
22    vhdl.set_body ("-- Output : always at '1'");
23    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
24      vhdl.set_body ("out_BRANCH_COMPLETE_ACK_"+toString(i)+" <= '1';");
25    for (uint32_t i=0; i<_param._nb_prediction     ; i++)
26      vhdl.set_body ("out_PREDICT_ACK_"+toString(i)+"         <= '1';");
27    vhdl.set_body ("");
28
29    list<string> list_port_map;
30
31    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
32      {
33        vhdl.set_body_component_port_map (list_port_map," in_SHIFTER_DATA_"+toString(i)+"     ","    in_BRANCH_COMPLETE_HISTORY_"+toString(i));
34        vhdl.set_body_component_port_map (list_port_map," in_SHIFTER_CARRY_IN_"+toString(i)+" ","    in_BRANCH_COMPLETE_DIRECTION_"+toString(i)    );
35        vhdl.set_body_component_port_map (list_port_map,"out_SHIFTER_DATA_"+toString(i)+"     ","signal_BRANCH_COMPLETE_HISTORY_"+toString(i));
36      }
37
38    vhdl.set_body_component ("component_Shifter",_name+"_Shifter",list_port_map);
39
40    list_port_map.clear();
41    vhdl.set_body_component_port_map (list_port_map,"in_CLOCK","in_CLOCK");
42    for (uint32_t i=0; i<_param._nb_prediction; i++)
43      {
44        vhdl.set_body_component_port_map (list_port_map," in_READ_ENABLE_"+toString(i)+"  "," in_PREDICT_VAL_"+toString(i));
45        vhdl.set_body_component_port_map (list_port_map," in_READ_ADDRESS_"+toString(i)+" "," in_PREDICT_ADDRESS_"+toString(i));
46        vhdl.set_body_component_port_map (list_port_map,"out_READ_DATA_"+toString(i)+"    ","out_PREDICT_HISTORY_"+toString(i));   
47      }
48   
49    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
50      {
51        vhdl.set_body_component_port_map (list_port_map," in_WRITE_ENABLE_"+toString(i)+" ","    in_BRANCH_COMPLETE_VAL_"+toString(i)+"");
52        vhdl.set_body_component_port_map (list_port_map," in_WRITE_ADDRESS_"+toString(i)+"","    in_BRANCH_COMPLETE_ADDRESS_"+toString(i));
53        vhdl.set_body_component_port_map (list_port_map," in_WRITE_DATA_"+toString(i)+"   ","signal_BRANCH_COMPLETE_HISTORY_"+toString(i));
54      }
55    vhdl.set_body_component ("component_RegisterFile",_name+"_RegisterFile",list_port_map);
56  };
57
58}; // end namespace branch_history_table
59}; // end namespace two_level_branch_predictor
60}; // end namespace meta_predictor
61}; // end namespace predictor
62}; // end namespace stage_1_ifetch
63
64}; // end namespace behavioural
65}; // end namespace morpheo             
66#endif
Note: See TracBrowser for help on using the repository browser.