source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Queue/SelfTest/src/main.cpp @ 101

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

1) Add soc test
2) fix bug (Pc management, Decod and execute, Update prediction ...)

  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1/*
2 * $Id: main.cpp 101 2009-01-15 17:19:08Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Generic/Queue/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       << " - size_queue      (uint32_t)" << endl
17       << " - size_data       (uint32_t)" << endl
18       << " - nb_port_slot    (uint32_t)" << endl
19       << " - have_port_write (bool    )" << endl
20       << " - have_port_read  (bool    )" << 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  uint32_t       x = 1;
40 
41  const string   name            =      argv[x++];
42  const uint32_t size_queue      = fromString<uint32_t>(argv[x++]);
43  const uint32_t size_data       = fromString<uint32_t>(argv[x++]);
44  const uint32_t nb_port_slot    = fromString<uint32_t>(argv[x++]);
45  const bool     have_port_write = fromString<bool>(argv[x++]);
46  const bool     have_port_read  = fromString<bool>(argv[x++]);
47  try 
48    {
49      morpheo::behavioural::generic::queue::Parameters * param = new morpheo::behavioural::generic::queue::Parameters
50        (size_queue,
51         size_data ,
52         nb_port_slot,
53         have_port_write,
54         have_port_read
55        );
56     
57      cout << param->print(1);
58     
59      test (name,param);
60    }
61  catch (morpheo::ErrorMorpheo & error)
62    {
63      cout << "<" << name << "> : " <<  error.what ();
64      exit (EXIT_FAILURE);
65    }
66  catch (...)
67    {
68      cerr << "<" << name << "> : This test must generate a error" << endl;
69      exit (EXIT_FAILURE);
70    }
71
72  return (EXIT_SUCCESS);
73}
74
Note: See TracBrowser for help on using the repository browser.