source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Select/Select_Priority_Fixed/SelfTest/src/main.cpp @ 15

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

Interface normalisé
Début du banc de registres multi niveaux

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