source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/SelfTest/src/main.cpp @ 76

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

Add new component : Read_unit (no tested)
Change functionnal_unit : now use type and operation to execute the good function
Change New_Component's script

File size: 3.3 KB
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/SelfTest/include/test.h"
9
10#define NB_PARAMS 15
11
12void usage (int argc, char * argv[])
13{
14  cerr << "<Usage> " << argv[0] << " name_instance list_params" << endl
15       << "list_params is :" << endl
16       << " - size_queue          (unsigned int)" << endl
17       << " - nb_context          (unsigned int)" << endl
18       << " - nb_front_end        (unsigned int)" << endl
19       << " - nb_ooo_engine       (unsigned int)" << endl
20       << " - nb_packet           (unsigned int)" << endl
21       << " - size_general_data   (unsigned int)" << endl
22       << " - size_special_data   (unsigned int)" << endl
23       << " - nb_general_register (unsigned int)" << endl
24       << " - nb_special_register (unsigned int)" << endl
25       << " - nb_operation        (unsigned int)" << endl
26       << " - nb_type             (unsigned int)" << endl
27       << " - nb_gpr_write        (unsigned int)" << endl
28       << " - nb_spr_write        (unsigned int)" << endl
29       << " - size_store_queue    (unsigned int)" << endl
30       << " - size_load_queue     (unsigned int)" << endl
31       << "" << endl;
32
33  for (int i=0; i<argc; i++)
34    cerr << argv[i] << " ";
35  cerr << endl;
36
37  exit (1);
38}
39
40#ifndef SYSTEMC
41int main    (int argc, char * argv[])
42#else
43int sc_main (int argc, char * argv[])
44#endif
45{
46  if (argc != 2+NB_PARAMS)
47    usage (argc, argv);
48
49  uint32_t x=1;
50  const string   name                =      argv[x++];
51  const uint32_t size_queue          = atoi(argv[x++]);
52  const uint32_t nb_context          = atoi(argv[x++]);
53  const uint32_t nb_front_end        = atoi(argv[x++]);
54  const uint32_t nb_ooo_engine       = atoi(argv[x++]);
55  const uint32_t nb_packet           = atoi(argv[x++]);
56  const uint32_t size_general_data   = atoi(argv[x++]);
57  const uint32_t size_special_data   = atoi(argv[x++]);
58  const uint32_t nb_general_register = atoi(argv[x++]);
59  const uint32_t nb_special_register = atoi(argv[x++]);
60  const uint32_t nb_operation        = atoi(argv[x++]);
61  const uint32_t nb_type             = atoi(argv[x++]);
62  const uint32_t nb_gpr_write        = atoi(argv[x++]);
63  const uint32_t nb_spr_write        = atoi(argv[x++]);
64  const uint32_t size_store_queue    = atoi(argv[x++]);
65  const uint32_t size_load_queue     = atoi(argv[x++]);
66
67  try 
68    {
69      morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::read_queue::Parameters * param = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::read_queue::Parameters
70        ( size_queue   
71         ,nb_context         
72         ,nb_front_end       
73         ,nb_ooo_engine
74         ,nb_packet         
75         ,size_general_data 
76         ,size_special_data 
77         ,nb_general_register
78         ,nb_special_register
79         ,nb_operation       
80         ,nb_type           
81         ,nb_gpr_write
82         ,nb_spr_write
83         ,size_store_queue
84         ,size_load_queue
85          );
86     
87      cout << param->print(1);
88     
89      test (name,param);
90    }
91  catch (morpheo::ErrorMorpheo & error)
92    {
93      cout << "<" << name << "> : " <<  error.what ();
94      exit (EXIT_FAILURE);
95    }
96  catch (...)
97    {
98      cerr << "<" << name << "> : This test must generate a error" << endl;
99      exit (EXIT_FAILURE);
100    }
101
102  return (EXIT_SUCCESS);
103}
104
Note: See TracBrowser for help on using the repository browser.