source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Free_List_unit/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: 2.2 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/Register_translation_unit/Free_List_unit/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_thread           (uint32_t   )\n"));
17  err (_("nb_general_register (uint32_t   )\n"));
18  err (_("nb_special_register (uint32_t   )\n"));
19  err (_("nb_bank             (uint32_t   )\n"));
20  err (_("nb_pop              (uint32_t   )\n"));
21  err (_("nb_push             (uint32_t   )\n"));
22  err (_("priority            (Tpriority_t)\n"));
23
24  exit (1);
25}
26
27#ifndef SYSTEMC
28int main    (int argc, char * argv[])
29#else
30int sc_main (int argc, char * argv[])
31#endif
32{
33  if (argc != 2+NB_PARAMS)
34    usage (argc, argv);
35
36  uint32_t       x = 1;
37
38  const string   name      =      argv[x++];
39//const uint32_t size_data = atoi(argv[x++]);
40//const uint32_t nb_port   = atoi(argv[x++]);
41 
42  uint32_t    _nb_thread           = atoi(argv[x++]);
43  uint32_t    _nb_general_register = atoi(argv[x++]);
44  uint32_t    _nb_special_register = atoi(argv[x++]);
45  uint32_t    _nb_bank             = atoi(argv[x++]);
46  uint32_t    _nb_pop              = atoi(argv[x++]);
47  uint32_t    _nb_push             = atoi(argv[x++]);
48  Tpriority_t _priority            = fromString<Tpriority_t>(argv[x++]);
49
50  try 
51    {
52      morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::free_list_unit::Parameters * param = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::free_list_unit::Parameters
53        (_nb_thread          ,
54         _nb_general_register,
55         _nb_special_register,
56         _nb_bank            ,
57         _nb_pop             ,
58         _nb_push            ,
59         _priority           ,
60         true //is_toplevel
61         );
62     
63      msg(_("%s"),param->print(1).c_str());
64     
65      test (name,param);
66    }
67  catch (morpheo::ErrorMorpheo & error)
68    {
69      msg (_("<%s> : %s.\n"),name.c_str(), error.what ());
70      exit (EXIT_FAILURE);
71    }
72  catch (...)
73    {
74      err (_("<%s> : This test must generate a error.\n"),name.c_str());
75      exit (EXIT_FAILURE);
76    }
77
78  return (EXIT_SUCCESS);
79}
80
Note: See TracBrowser for help on using the repository browser.