source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_vhdl_testbench_transition.cpp @ 4

Last change on this file since 4 was 4, checked in by rosiere, 17 years ago
File size: 3.8 KB
Line 
1#ifdef VHDL_TESTBENCH
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace stage_1_ifetch {
14namespace predictor {
15namespace meta_predictor {
16namespace meta_predictor_glue {
17
18
19  void Meta_Predictor_Glue::vhdl_testbench_transition ()
20  {
21    log_printf(FUNC,Meta_Predictor_Glue,"vhdl_testbench_transition","Begin");
22
23    // Evaluation before read the ouput signal
24    sc_start(0);
25
26    // In order with file Meta_Predictor_Glue_vhdl_testbench_port.cpp
27    // Warning : if a output depend of a subcomponent, take directly the port of subcomponent
28    // (because we have no control on the ordonnancer's policy)
29
30    for (uint32_t i=0; i<_param._nb_prediction; i++)
31      {
32        if (_param._have_meta_predictor)
33          {
34        _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_0_ACK [i]));
35        _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_1_ACK [i]));
36          }
37        _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_2_ACK [i]));
38        _vhdl_testbench->add_output(PORT_READ(out_PREDICT_ACK [i]));
39
40        if (_param._have_meta_predictor)
41          {
42        if (_param._predictor_0_have_bht)
43        _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_0_BHT_HISTORY [i]));
44        if (_param._predictor_0_have_pht)
45        _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_0_PHT_HISTORY [i]));
46        if (_param._predictor_1_have_bht)
47        _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_1_BHT_HISTORY [i]));
48        if (_param._predictor_1_have_pht)
49        _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_1_PHT_HISTORY [i]));
50          }
51        if (_param._predictor_2_have_bht)
52        _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_2_BHT_HISTORY [i]));
53        if (_param._predictor_2_have_pht)
54        _vhdl_testbench->add_input (PORT_READ( in_PREDICT_PREDICTOR_2_PHT_HISTORY [i]));
55
56        _vhdl_testbench->add_output(PORT_READ(out_PREDICT_HISTORY [i]));
57        _vhdl_testbench->add_output(PORT_READ(out_PREDICT_DIRECTION [i]));
58      }
59
60    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
61      {
62        if (_param._have_meta_predictor)
63          {
64        _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_PREDICTOR_0_ACK [i]));
65        _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_PREDICTOR_1_ACK [i]));
66          }
67        _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_PREDICTOR_2_ACK [i]));
68        _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_ACK [i]));
69
70        if (_param._have_meta_predictor)
71          {
72        if (_param._predictor_0_have_bht)
73        _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i]));
74        if (_param._predictor_0_have_pht)
75        _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i]));
76        if (_param._predictor_1_have_bht)
77        _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i]));
78        if (_param._predictor_1_have_pht)
79        _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i]));
80          }
81        if (_param._predictor_2_have_bht)
82        _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i]));
83        if (_param._predictor_2_have_pht)
84        _vhdl_testbench->add_output(PORT_READ(out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i]));
85
86        _vhdl_testbench->add_input (PORT_READ( in_BRANCH_COMPLETE_HISTORY [i]));
87      }
88   
89    // add_test :
90    //  - True  : the cycle must be compare with the output of systemC
91    //  - False : no test
92    _vhdl_testbench->add_test(true);
93
94    _vhdl_testbench->new_cycle (); // always at the end
95
96    log_printf(FUNC,Meta_Predictor_Glue,"vhdl_testbench_transition","End");
97  };
98
99}; // end namespace meta_predictor_glue
100}; // end namespace meta_predictor
101}; // end namespace predictor
102}; // end namespace stage_1_ifetch
103
104}; // end namespace behavioural
105}; // end namespace morpheo             
106#endif
Note: See TracBrowser for help on using the repository browser.