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_testbench_transition.cpp @ 2

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

Import Morpheo

File size: 1.9 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/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_testbench_transition (void)
21  {
22    // In order with file Branch_History_Table_vhdl_testbench_port.cpp
23#ifndef SYSTEMCASS_SPECIFIC
24    sc_cycle(0);
25#endif   
26
27    for (uint32_t i=0; i<_param._nb_prediction; i++)
28      {
29        _vhdl_testbench->add_input  (PORT_READ( in_PREDICT_VAL     [i]));
30        _vhdl_testbench->add_output (PORT_READ(out_PREDICT_ACK     [i]));
31        _vhdl_testbench->add_input  (PORT_READ( in_PREDICT_ADDRESS [i]));
32        _vhdl_testbench->add_output (PORT_READ(component_RegisterFile->out_READ_DATA [i]));
33      //_vhdl_testbench->add_output (PORT_READ(out_PREDICT_HISTORY [i]));
34      }
35
36     for (uint32_t i=0; i<_param._nb_branch_complete; i++)
37       {
38         _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_VAL     [i]));
39         _vhdl_testbench->add_output (PORT_READ(out_BRANCH_COMPLETE_ACK     [i]));
40         _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_ADDRESS [i]));
41         _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_HISTORY [i]));
42         _vhdl_testbench->add_input  (PORT_READ( in_BRANCH_COMPLETE_HIT     [i]));
43       }
44   
45    // add_test :
46    //  - True  : the cycle must be compare with the output of systemC
47    //  - False : no test
48    _vhdl_testbench->add_test(true);
49
50    _vhdl_testbench->new_cycle (); // always at the end
51  };
52
53}; // end namespace branch_history_table
54}; // end namespace two_level_branch_predictor
55}; // end namespace meta_predictor
56}; // end namespace predictor
57}; // end namespace stage_1_ifetch
58
59}; // end namespace behavioural
60}; // end namespace morpheo             
61#endif
Note: See TracBrowser for help on using the repository browser.