source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/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: 2.2 KB
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack/SelfTest/include/test.h"
9
10#define NB_PARAMS 5
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 (_(" * nb_context                   (uint32_t)\n"));
17  err (_(" * size_queue      [nb_context] (uint32_t)\n"));
18  err (_(" * size_address                 (uint32_t)\n"));
19  err (_(" * nb_inst_predict              (uint32_t)\n"));
20  err (_(" * nb_inst_decod                (uint32_t)\n"));
21  err (_(" * nb_inst_update               (uint32_t)\n"));
22
23  exit (1);
24}
25
26#ifndef SYSTEMC
27int main    (int argc, char * argv[])
28#else
29int sc_main (int argc, char * argv[])
30#endif
31{
32  if (argc < static_cast<int>(2+NB_PARAMS))
33    usage (argc, argv);
34
35  uint32_t x = 1;
36
37  string name = argv[x++];
38
39  uint32_t   _nb_context      = fromString<uint32_t>(argv[x++]);
40 
41  if (argc < static_cast<int>(2+NB_PARAMS+_nb_context))
42    usage (argc, argv);
43 
44  uint32_t * _size_queue      = new uint32_t [_nb_context];
45  for (uint32_t i=0; i<_nb_context; i++)
46    _size_queue [i] = fromString<uint32_t>(argv[x++]);
47
48  uint32_t   _size_address    = fromString<uint32_t>(argv[x++]);
49  uint32_t   _nb_inst_predict = fromString<uint32_t>(argv[x++]);
50  uint32_t   _nb_inst_decod   = fromString<uint32_t>(argv[x++]);
51  uint32_t   _nb_inst_update  = fromString<uint32_t>(argv[x++]);
52
53  int _return = EXIT_SUCCESS;
54  try 
55    {
56      morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::return_address_stack::Parameters * param = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::return_address_stack::Parameters
57        (_nb_context      ,
58         _size_queue      ,
59         _size_address    ,
60         _nb_inst_predict ,
61         _nb_inst_decod   ,
62         _nb_inst_update  );
63     
64      msg(_("%s"),param->print(1).c_str());
65     
66      test (name,param);
67    }
68  catch (morpheo::ErrorMorpheo & error)
69    {
70      msg (_("<%s> :\n%s"),name.c_str(), error.what ());
71      _return = EXIT_FAILURE;
72    }
73  catch (...)
74    {
75      err (_("<%s> : This test must generate a error.\n"),name.c_str());
76      _return = EXIT_FAILURE;
77    }
78
79  delete _size_queue;
80
81  return (_return);
82}
Note: See TracBrowser for help on using the repository browser.