source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Two_Level_Branch_Predictor_vhdl_testbench_port.cpp @ 2

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

Import Morpheo

File size: 2.2 KB
Line 
1#ifdef VHDL_TESTBENCH
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace stage_1_ifetch {
14namespace predictor {
15namespace meta_predictor {
16namespace two_level_branch_predictor {
17
18
19  void Two_Level_Branch_Predictor::vhdl_testbench_port ()
20  {
21    log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_testbench_port","Begin");
22
23    for (uint32_t i=0; i<_param._nb_prediction; i++)
24      {
25        _vhdl_testbench->set_port (" in_PREDICT_VAL_"        +toString(i), IN, 1);
26        _vhdl_testbench->set_port ("out_PREDICT_ACK_"        +toString(i),OUT, 1);
27        _vhdl_testbench->set_port (" in_PREDICT_ADDRESS_"    +toString(i), IN,_param._size_address);
28        if (_param._have_bht)
29        _vhdl_testbench->set_port ("out_PREDICT_BHT_HISTORY_"+toString(i),OUT,static_cast<uint32_t>(ceil(log2(_param._bht_nb_shifter))));
30        if (_param._have_pht)
31        _vhdl_testbench->set_port ("out_PREDICT_PHT_HISTORY_"+toString(i),OUT,static_cast<uint32_t>(ceil(log2(_param._pht_nb_counter))));
32      }
33
34    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
35      {
36        _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_VAL_"        +toString(i), IN, 1);
37        _vhdl_testbench->set_port ("out_BRANCH_COMPLETE_ACK_"        +toString(i),OUT, 1);
38        _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_ADDRESS_"    +toString(i), IN,_param._size_address);
39        if (_param._have_bht)
40        _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_BHT_HISTORY_"+toString(i), IN,static_cast<uint32_t>(ceil(log2(_param._bht_nb_shifter))));
41        if (_param._have_bht)
42        _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_PHT_HISTORY_"+toString(i), IN,static_cast<uint32_t>(ceil(log2(_param._pht_nb_counter))));
43        _vhdl_testbench->set_port (" in_BRANCH_COMPLETE_HIT_"        +toString(i), IN, 1);
44      }
45
46    log_printf(FUNC,Two_Level_Branch_Predictor,"vhdl_testbench_port","End");
47  };
48
49}; // end namespace two_level_branch_predictor
50}; // end namespace meta_predictor
51}; // end namespace predictor
52}; // end namespace stage_1_ifetch
53
54}; // end namespace behavioural
55}; // end namespace morpheo             
56#endif
Note: See TracBrowser for help on using the repository browser.