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

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