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

Last change on this file since 78 was 78, checked in by rosiere, 16 years ago

Add :

  • Execute_loop (must be test systemC)
  • Prediction
    • Direction : predifined scheme
    • Branch Target Buffer
  • iFetch_unit
    • ifetch_queue
    • pc management
  • Decod_unit
    • coming soon : support for custom operation
  • Rename_unit
    • RAT
    • Free_list
    • Dependence RAW check
    • Load store unit pointer
  • New Environnement (hierarchy_memory will remove in a next version)


Modif :

  • Manage Custom Operation
  • All component in execute_loop to use the new statistics management

Not Finish :

  • Return Address Stack
  • Environnement
File size: 3.2 KB
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/SelfTest/include/test.h"
9
10#define NB_PARAMS 25
11
12void usage (int argc, char * argv[])
13{
14  err (_("<Usage> %s name_instance list_params.\n"),argv[0]);
15  err (_("list_params is :\n"));
16  err (_(" * predictor_scheme           (Tpredictor_t)\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
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
44  Tpredictor_t _predictor_scheme = fromString<Tpredictor_t>(argv[x++]);
45  uint32_t     _nb_inst_predict  = fromString<uint32_t    >(argv[x++]);
46  uint32_t     _nb_inst_update   = fromString<uint32_t    >(argv[x++]);
47  uint32_t     _size_address     = fromString<uint32_t    >(argv[x++]);
48  bool         _have_bht               [3];
49  uint32_t     _bht_size_shifter       [3];
50  uint32_t     _bht_nb_shifter         [3];
51  bool         _have_pht               [3];
52  uint32_t     _pht_size_counter       [3];
53  uint32_t     _pht_nb_counter         [3];
54  uint32_t     _pht_size_address_share [3];
55
56  for (uint32_t i=0; i<3; i++)
57    {
58      _have_bht               [i] = fromString<bool    >(argv[x++]);
59      _bht_size_shifter       [i] = fromString<uint32_t>(argv[x++]);
60      _bht_nb_shifter         [i] = fromString<uint32_t>(argv[x++]);
61      _have_pht               [i] = fromString<bool    >(argv[x++]);
62      _pht_size_counter       [i] = fromString<uint32_t>(argv[x++]);
63      _pht_nb_counter         [i] = fromString<uint32_t>(argv[x++]);
64      _pht_size_address_share [i] = fromString<uint32_t>(argv[x++]);
65    }
66 
67  int _return = EXIT_SUCCESS;
68  try 
69    {
70      morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::Parameters * param = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::Parameters
71        (_predictor_scheme      ,
72         _nb_inst_predict       ,
73         _nb_inst_update        ,
74         _size_address          ,
75         _have_bht              ,
76         _bht_size_shifter      ,
77         _bht_nb_shifter        ,
78         _have_pht              ,
79         _pht_size_counter      ,
80         _pht_nb_counter        ,
81         _pht_size_address_share);
82     
83      msg(_("%s"),param->print(1).c_str());
84     
85      test (name,param);
86    }
87  catch (morpheo::ErrorMorpheo & error)
88    {
89      msg (_("<%s> :\n%s"),name.c_str(), error.what ());
90      _return = EXIT_FAILURE;
91    }
92  catch (...)
93    {
94      err (_("<%s> : This test must generate a error.\n"),name.c_str());
95      _return = EXIT_FAILURE;
96    }
97
98  return (_return);
99}
Note: See TracBrowser for help on using the repository browser.