source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/SelfTest/src/main.cpp @ 88

Last change on this file since 88 was 88, checked in by rosiere, 15 years ago

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 3.4 KB
Line 
1/*
2 * $Id: main.cpp 88 2008-12-10 18:31:39Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/SelfTest/include/test.h"
9
10#define NB_PARAMS 7
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_front_end                         (uint32_t         )\n"));
17  err (_(" * nb_context            [nb_front_end] (uint32_t         )\n"));
18//   err (_(" * size_nb_front_end_id                 (uint32_t         )\n"));
19//   err (_(" * size_nb_context_id                   (uint32_t         )\n"));
20  err (_(" * max_branch_speculated                (uint32_t         )\n"));
21  err (_(" * size_general_data                    (uint32_t         )\n"));
22  err (_(" * nb_inst_rename                       (uint32_t         )\n"));
23  err (_(" * nb_inst_decod         [nb_front_end] (uint32_t         )\n"));
24  err (_(" * nb_front_end_select                  (uint32_t         )\n"));
25  err (_(" * priority                             (Tpriority_t      )\n"));
26  err (_(" * load_balancing                       (Tload_balancing_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  uint32_t          _nb_front_end         = atoi(argv[x++]);
45
46  if (argc != static_cast<int>(2+NB_PARAMS+2*_nb_front_end))
47    usage (argc, argv);
48
49  uint32_t *        _nb_context           = new uint32_t [_nb_front_end];
50  for (uint32_t i=0; i<_nb_front_end; i++)
51    _nb_context [i] = atoi(argv[x++]);
52
53//   uint32_t          _size_front_end_id    = atoi(argv[x++]);
54//   uint32_t          _size_context_id      = atoi(argv[x++]);
55  uint32_t          _max_branch_speculated= atoi(argv[x++]);
56  uint32_t          _size_general_data    = atoi(argv[x++]);
57  uint32_t          _nb_inst_rename       = atoi(argv[x++]);
58  uint32_t *        _nb_inst_decod        = new uint32_t [_nb_front_end];
59  for (uint32_t i=0; i<_nb_front_end; i++)
60    _nb_inst_decod [i] = atoi(argv[x++]);
61
62  uint32_t          _nb_front_end_select  = atoi(argv[x++]);
63  Tpriority_t       _priority             = fromString<Tpriority_t      >(argv[x++]);
64  Tload_balancing_t _load_balancing       = fromString<Tload_balancing_t>(argv[x++]);
65
66  int _return = EXIT_SUCCESS;
67  try 
68    {
69      morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::rename_select::Parameters * param = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::rename_select::Parameters
70        (_nb_front_end         ,
71         _nb_context           ,
72//          _size_front_end_id    ,
73//          _size_context_id      ,
74         _max_branch_speculated,
75         _size_general_data    ,
76         _nb_inst_rename       ,
77         _nb_inst_decod        ,
78         _nb_front_end_select  ,
79         _priority             ,
80         _load_balancing       ,
81         true // is_toplevel
82         );
83     
84      msg(_("%s"),param->print(1).c_str());
85     
86      test (name,param);
87    }
88  catch (morpheo::ErrorMorpheo & error)
89    {
90      msg (_("<%s> :\n%s"),name.c_str(), error.what ());
91      _return = EXIT_FAILURE;
92    }
93  catch (...)
94    {
95      err (_("<%s> : This test must generate a error.\n"),name.c_str());
96      _return = EXIT_FAILURE;
97    }
98
99  delete _nb_context   ;
100  delete _nb_inst_decod;
101
102  return (_return);
103}
Note: See TracBrowser for help on using the repository browser.