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

Last change on this file since 57 was 57, checked in by rosiere, 17 years ago
  • VHDL - RegisterFile_Multi_Banked (only partial_crossbar)
  • SystemC - modif Component, interface and co -> ajout du type Tusage_T pour instancier un coposant mais ne demander que le VHDL ou le systemC.
  • Séminaire interne
File size: 1.5 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 = new morpheo::behavioural::generic::select::select_priority_fixed::Parameters
45        (nb_entity       ,
46         encoding_one_hot,
47         encoding_compact);
48     
49      cout << param->print(1);
50     
51      test (name,param);
52    }
53  catch (morpheo::ErrorMorpheo & error)
54    {
55      cout << "<" << name << "> : " <<  error.what ();
56      exit (EXIT_FAILURE);
57    }
58  catch (...)
59    {
60      cerr << "<" << name << "> : This test must generate a error" << endl;
61      exit (EXIT_FAILURE);
62    }
63
64  return (EXIT_SUCCESS);
65}
66
Note: See TracBrowser for help on using the repository browser.