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

Last change on this file since 2 was 2, checked in by kane, 17 years ago

Import Morpheo

File size: 1.8 KB
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Generic/Shifter/SelfTest/include/test.h"
9
10#define NB_PARAMS 6
11
12void usage (string exec)
13{
14  cerr << "<Usage> " << exec << " name_instance list_params" << endl
15       << "list_params is :" << endl
16       << " - size_data   (unsigned int)" << endl
17       << " - nb_port     (unsigned int)" << endl
18       << " - shift_value (unsigned int)" << endl
19       << " - rotate      (unsigned int)" << endl
20       << " - direction   (unsigned int)" << endl
21       << " - carry       (unsigned int)" << endl;
22  exit (1);
23}
24
25#ifndef SYSTEMC
26int main    (int argc, char * argv[])
27#else
28int sc_main (int argc, char * argv[])
29#endif
30{
31  if (argc != 2+NB_PARAMS)
32    usage (argv[0]);
33
34  const string                                              name        = argv[1];
35  const uint32_t                                            size_data   = atoi(argv[2]);
36  const uint32_t                                            nb_port     = atoi(argv[3]);
37  const uint32_t                                            shift_value = atoi(argv[4]);
38  const morpheo::behavioural::generic::shifter::rotate_t    rotate      = static_cast<morpheo::behavioural::generic::shifter::rotate_t   >(atoi(argv[5]));
39  const morpheo::behavioural::generic::shifter::direction_t direction   = static_cast<morpheo::behavioural::generic::shifter::direction_t>(atoi(argv[6]));
40  const morpheo::behavioural::generic::shifter::carry_t     carry       = static_cast<morpheo::behavioural::generic::shifter::carry_t    >(atoi(argv[7]));
41
42  morpheo::behavioural::generic::shifter::Parameters param (size_data  ,
43                                                            nb_port    ,
44                                                            shift_value,
45                                                            rotate     ,
46                                                            direction  ,
47                                                            carry      );
48
49  test (name,param);
50
51  return (EXIT_SUCCESS);
52}
Note: See TracBrowser for help on using the repository browser.