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

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

1) Stat_list : fix retire old and new register bug
2) Stat_list : remove read_counter and valid flag, because validation of destination is in retire step (not in commit step)
3) Model : add class Model (cf Morpheo.sim)
4) Allocation : alloc_interface_begin and alloc_interface_end to delete temporary array.
5) Script : add distexe.sh
6) Add Comparator, Multiplier, Divider. But this component are not implemented
7) Software : add Dhrystone

  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1/*
2 * $Id: main.cpp 112 2009-03-18 22:36:26Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Generic/Comparator/SelfTest/include/test.h"
9#include "Behavioural/include/Selftest.h"
10
11#define NB_PARAMS 3
12
13void usage (int argc, char * argv[])
14{
15  err (_("<Usage> %s name_instance list_params.\n"),argv[0]);
16  err (_("list_params is :\n"));
17  err (_(" * size_data (uint32_t            )\n"));
18  err (_(" * is_signed (bool                )\n"));
19  err (_(" * type      (Tcomparator_scheme_t)\n"));
20
21
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 != static_cast<int>(2+NB_PARAMS))
32    usage (argc, argv);
33
34  uint32_t x = 1;
35
36  uint32_t             _size_data;
37  bool                 _is_signed;
38  Tcomparator_scheme_t _type;
39
40  SELFTEST0(_size_data,uint32_t            ,argv,x);
41  SELFTEST0(_is_signed,bool                ,argv,x);
42  SELFTEST0(_type     ,Tcomparator_scheme_t,argv,x);
43
44  string name = argv[x++];
45
46  int _return = EXIT_SUCCESS;
47  try 
48    {
49      morpheo::behavioural::generic::comparator::Parameters * param = new morpheo::behavioural::generic::comparator::Parameters
50        (
51         _size_data,
52         _is_signed,
53         _type     ,
54         true //is_toplevel
55        );
56     
57      msg(_("%s"),param->print(0).c_str());
58     
59      test (name,param);
60    }
61  catch (morpheo::ErrorMorpheo & error)
62    {
63      msg (_("<%s> :\n%s"),name.c_str(), error.what ());
64      _return = EXIT_FAILURE;
65    }
66 
67  try 
68    {
69      if (_return == EXIT_SUCCESS)
70        TEST_OK("Comparator : no error");
71      else
72        TEST_KO("Comparator : a lot of error");
73    }
74  catch (morpheo::ErrorMorpheo & error)
75    {
76//       msg (_("<%s> :\n%s"),name.c_str(), error.what ());
77      _return = EXIT_FAILURE;
78    }
79
80  return (_return);
81}
Note: See TracBrowser for help on using the repository browser.