source: trunk/IPs/systemC/processor/Morpheo/Behavioural/New_Component/SelfTest/src/main.cpp @ 50

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

Changement dans le répertoire "New_Component" afin que les composants nouvellement crées peuvent compiler

File size: 1.3 KB
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/@DIRECTORY/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_data     (unsigned int)" << endl
17//     << " - nb_port       (unsigned int)" << endl;
18       << "" << endl;
19
20  for (int i=0; i<argc; i++)
21    cerr << argv[i] << " ";
22  cerr << endl;
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  const string   name      = argv[1];
37//const uint32_t size_data = atoi(argv[2]);
38//const uint32_t nb_port   = atoi(argv[3]);
39
40  try 
41    {
42      morpheo::behavioural::@NAMESPACE_USE::Parameters * param = new morpheo::behavioural::@NAMESPACE_USE::Parameters
43        (//size_data,
44         //nb_port 
45        );
46     
47      cout << param->print(1);
48     
49      test (name,param);
50    }
51  catch (morpheo::ErrorMorpheo & error)
52    {
53      cout << "<" << name << "> : " <<  error.what ();
54      exit (EXIT_FAILURE);
55    }
56  catch (...)
57    {
58      cerr << "<" << name << "> : This test must generate a error" << endl;
59      exit (EXIT_FAILURE);
60    }
61
62  return (EXIT_SUCCESS);
63}
64
Note: See TracBrowser for help on using the repository browser.