source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/SelfTest/src/main.cpp @ 53

Last change on this file since 53 was 53, checked in by rosiere, 17 years ago
  • Banc de registre multi banc
  • Banc de registre générique.
File size: 2.5 KB
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked/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       << " - nb_port_read          (uint32_t   )" << endl
17       << " - nb_port_write         (uint32_t   )" << endl
18       << " - nb_word               (uint32_t   )" << endl
19       << " - size_word             (uint32_t   )" << endl
20       << " - nb_bank               (uint32_t   )" << endl
21       << " - nb_port_read_by_bank  (uint32_t   )" << endl
22       << " - nb_port_write_by_bank (uint32_t   )" << endl
23       << " - crossbar              (Tcrossbar_t)" << endl
24       << "" << endl;
25
26  for (int i=0; i<argc; i++)
27    cerr << argv[i] << " ";
28  cerr << endl;
29
30  exit (1);
31}
32
33#ifndef SYSTEMC
34int main    (int argc, char * argv[])
35#else
36int sc_main (int argc, char * argv[])
37#endif
38{
39  if (argc < 2+NB_PARAMS)
40    usage (argc, argv);
41
42  const string   name      = argv[1];
43  const uint32_t    nb_port_read          = atoi(argv[2]);
44  const uint32_t    nb_port_write         = atoi(argv[3]);
45  const uint32_t    nb_word               = atoi(argv[4]);
46  const uint32_t    size_word             = atoi(argv[5]);
47  const uint32_t    nb_bank               = atoi(argv[6]);
48  const uint32_t    nb_port_read_by_bank  = atoi(argv[7]);
49  const uint32_t    nb_port_write_by_bank = atoi(argv[8]);
50  const Tcrossbar_t crossbar              = fromString<Tcrossbar_t>(argv[9]);
51
52  try 
53    {
54      morpheo::behavioural::generic::registerfile::registerfile_multi_banked::Parameters * param = new morpheo::behavioural::generic::registerfile::registerfile_multi_banked::Parameters (nb_port_read         ,
55                                                                                                                                                                                           nb_port_write        ,
56                                                                                                                                                                                           nb_word              ,
57                                                                                                                                                                                           size_word            ,
58                                                                                                                                                                                           nb_bank              ,
59                                                                                                                                                                                           nb_port_read_by_bank ,
60                                                                                                                                                                                           nb_port_write_by_bank,
61                                                                                                                                                                                           crossbar             );
62     
63      cout << param->print(1);
64     
65      test (name,param);
66    }
67  catch (morpheo::ErrorMorpheo & error)
68    {
69      cout << "<" << name << "> : " <<  error.what ();
70      exit (EXIT_FAILURE);
71    }
72  catch (...)
73    {
74      cerr << "<" << name << "> : This test must generate a error" << endl;
75      exit (EXIT_FAILURE);
76    }
77
78  return (EXIT_SUCCESS);
79}
80
Note: See TracBrowser for help on using the repository browser.