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

Last change on this file since 54 was 54, checked in by rosiere, 17 years ago

Ajout de Read_queue

  • seulement en systemC
  • validé
File size: 2.7 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 0
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_read_queue     (unsigned int)" << endl
17       << " - nb_context          (unsigned int)" << endl
18       << " - nb_packet           (unsigned int)" << endl
19       << " - size_general_data   (unsigned int)" << endl
20       << " - size_special_data   (unsigned int)" << endl
21       << " - nb_general_register (unsigned int)" << endl
22       << " - nb_special_register (unsigned int)" << endl
23       << " - nb_operation        (unsigned int)" << endl
24       << " - nb_type             (unsigned int)" << endl
25       << " - nb_gpr_write        (unsigned int)" << endl
26       << " - nb_spr_write        (unsigned int)" << endl
27       << "" << endl;
28
29  for (int i=0; i<argc; i++)
30    cerr << argv[i] << " ";
31  cerr << endl;
32
33  exit (1);
34}
35
36#ifndef SYSTEMC
37int main    (int argc, char * argv[])
38#else
39int sc_main (int argc, char * argv[])
40#endif
41{
42  if (argc < 2+NB_PARAMS)
43    usage (argc, argv);
44
45  const string   name                = argv[1];
46  const uint32_t size_read_queue     = atoi(argv[ 2]);
47  const uint32_t nb_context          = atoi(argv[ 3]);
48  const uint32_t nb_packet           = atoi(argv[ 4]);
49  const uint32_t size_general_data   = atoi(argv[ 5]);
50  const uint32_t size_special_data   = atoi(argv[ 6]);
51  const uint32_t nb_general_register = atoi(argv[ 7]);
52  const uint32_t nb_special_register = atoi(argv[ 8]);
53  const uint32_t nb_operation        = atoi(argv[ 9]);
54  const uint32_t nb_type             = atoi(argv[10]);
55  const uint32_t nb_gpr_write        = atoi(argv[11]);
56  const uint32_t nb_spr_write        = atoi(argv[12]);
57
58  try 
59    {
60      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
61        ( size_read_queue   
62         ,nb_context         
63         ,nb_packet         
64         ,size_general_data 
65         ,size_special_data 
66         ,nb_general_register
67         ,nb_special_register
68         ,nb_operation       
69         ,nb_type           
70         ,nb_gpr_write
71         ,nb_spr_write
72          );
73     
74      cout << param->print(1);
75     
76      test (name,param);
77    }
78  catch (morpheo::ErrorMorpheo & error)
79    {
80      cout << "<" << name << "> : " <<  error.what ();
81      exit (EXIT_FAILURE);
82    }
83  catch (...)
84    {
85      cerr << "<" << name << "> : This test must generate a error" << endl;
86      exit (EXIT_FAILURE);
87    }
88
89  return (EXIT_SUCCESS);
90}
91
Note: See TracBrowser for help on using the repository browser.