source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/SelfTest/src/main.cpp @ 146

Last change on this file since 146 was 146, checked in by rosiere, 13 years ago

1) Integration of RegisterFile_Internal_Banked in RegisterFile?
2) Erase "read_write" interface in RegisterFile_Monolithic component
3) Add smith predictor parameters in Load_store_pointer_unit.
4) Fix not statistics flags

  • Property svn:keywords set to Id
File size: 3.7 KB
Line 
1/*
2 * $Id: main.cpp 146 2011-02-01 20:57:54Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/SelfTest/include/test.h"
9#include "Behavioural/include/Selftest.h"
10
11#define NB_PARAMS 3+8*3
12
13void usage (int argc, char * argv[])
14{
15  err (_("<Usage> %s name_instance list_params.\n"),argv[0]);
16  err (_("list_params is :\n"));
17  err (_(" * nb_inst_predict            (uint32_t     )\n"));
18  err (_(" * nb_inst_update             (uint32_t     )\n"));
19  err (_(" * size_address               (uint32_t     )\n"));
20  err (_(" * have_bht               [3] (bool         )\n"));
21  err (_(" * bht_size_shifter       [3] (uint32_t     )\n"));
22  err (_(" * bht_nb_shifter         [3] (uint32_t     )\n"));
23  err (_(" * have_pht               [3] (bool         )\n"));
24  err (_(" * pht_size_counter       [3] (uint32_t     )\n"));
25  err (_(" * pht_nb_counter         [3] (uint32_t     )\n"));
26  err (_(" * pht_size_address_share [3] (uint32_t     )\n"));
27  err (_(" * pht_scheme             [3] (Tpht_scheme_t)\n"));
28  exit (1);
29}
30
31#ifndef SYSTEMC
32int main    (int argc, char * argv[])
33#else
34int sc_main (int argc, char * argv[])
35#endif
36{
37  if (argc != static_cast<int>(2+NB_PARAMS))
38    usage (argc, argv);
39
40  uint32_t x = 1;
41
42  string name = argv[x++];
43  uint32_t      _nb_inst_predict           ;
44  uint32_t      _nb_inst_update            ;
45  uint32_t      _size_address              ;
46  bool          _have_bht               [3];
47  uint32_t      _bht_size_shifter       [3];
48  uint32_t      _bht_nb_shifter         [3];
49  bool          _have_pht               [3];
50  uint32_t      _pht_size_counter       [3];
51  uint32_t      _pht_nb_counter         [3];
52  uint32_t      _pht_size_address_share [3];
53  Tpht_scheme_t _pht_scheme             [3];
54
55  SELFTEST0(_nb_inst_predict           ,uint32_t     ,argv,x);
56  SELFTEST0(_nb_inst_update            ,uint32_t     ,argv,x);
57  SELFTEST0(_size_address              ,uint32_t     ,argv,x);
58
59  for (uint32_t i=0; i<3; ++i)
60    {
61  SELFTEST0(_have_bht               [i],bool         ,argv,x);
62  SELFTEST0(_bht_size_shifter       [i],uint32_t     ,argv,x);
63  SELFTEST0(_bht_nb_shifter         [i],uint32_t     ,argv,x);
64  SELFTEST0(_have_pht               [i],bool         ,argv,x);
65  SELFTEST0(_pht_size_counter       [i],uint32_t     ,argv,x);
66  SELFTEST0(_pht_nb_counter         [i],uint32_t     ,argv,x);
67  SELFTEST0(_pht_size_address_share [i],uint32_t     ,argv,x);
68  SELFTEST0(_pht_scheme             [i],Tpht_scheme_t,argv,x);
69    }
70
71  int _return = EXIT_SUCCESS;
72  try 
73    {
74      morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::Parameters * param = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::Parameters
75        (
76         _nb_inst_predict       ,
77         _nb_inst_update        ,
78         _size_address          ,
79         _have_bht              ,
80         _bht_size_shifter      ,
81         _bht_nb_shifter        ,
82         _have_pht              ,
83         _pht_size_counter      ,
84         _pht_nb_counter        ,
85         _pht_size_address_share,
86         _pht_scheme            ,
87         true // is_toplevel
88        );
89     
90      msg(_("%s"),param->print(0).c_str());
91     
92      test (name,param);
93    }
94  catch (morpheo::ErrorMorpheo & error)
95    {
96      msg (_("<%s> :\n%s"),name.c_str(), error.what ());
97      _return = EXIT_FAILURE;
98    }
99
100  try 
101    {
102      if (_return == EXIT_SUCCESS)
103        TEST_OK("Meta_Predictor : no error");
104      else
105        TEST_KO("Meta_Predictor : a lot of error");
106    }
107  catch (morpheo::ErrorMorpheo & error)
108    {
109//       msg (_("<%s> :\n%s"),name.c_str(), error.what ());
110      _return = EXIT_FAILURE;
111    }
112
113  return (_return);
114}
Note: See TracBrowser for help on using the repository browser.