source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/SelfTest/src/main.cpp @ 113

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

1) Add modelsim simulation systemC
2) Modelsim cosimulation systemC / VHDL is not finish !!!! (cf execute_queue and write_unit)
3) Add multi architecture
5) Add template for comparator, multiplier and divider
6) Change Message
Warning) Various test macro have change, many selftest can't compile

  • Property svn:keywords set to Id
File size: 2.1 KB
Line 
1/*
2 * $Id: main.cpp 113 2009-04-14 18:39:12Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue/SelfTest/include/test.h"
9#include "Behavioural/include/Selftest.h"
10#define NB_PARAMS 4
11
12void usage (int argc, char * argv[])
13{
14  err (_("<Usage> %s name_instance list_params.\n"),argv[0]);
15  err (_("list_params is :\n"));
16  err (_(" * size_queue                    (uint32_t)\n"));
17  err (_(" * nb_instruction                (uint32_t)\n"));
18  err (_(" * size_branch_update_prediction (uint32_t)\n"));
19  err (_(" * size_general_data             (uint32_t)\n"));
20
21  exit (1);
22}
23
24#ifndef SYSTEMC
25int main    (int argc, char * argv[])
26#else
27int sc_main (int argc, char * argv[])
28#endif
29{
30  if (argc != static_cast<int>(2+NB_PARAMS))
31    usage (argc, argv);
32
33  uint32_t x = 1;
34
35  string   name;
36  uint32_t _size_queue                   ;
37  uint32_t _nb_instruction               ;
38  uint32_t _size_branch_update_prediction;
39  uint32_t _size_general_data            ;
40
41  SELFTEST0( name                         ,string ,argv,x);
42  SELFTEST0(_size_queue                   ,uint32_t,argv,x);
43  SELFTEST0(_nb_instruction               ,uint32_t,argv,x);
44  SELFTEST0(_size_branch_update_prediction,uint32_t,argv,x);
45  SELFTEST0(_size_general_data            ,uint32_t,argv,x);
46
47  int _return = EXIT_SUCCESS;
48  try 
49    {
50      morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::Parameters * param = new morpheo::behavioural::core::multi_front_end::front_end::ifetch_unit::ifetch_queue::Parameters
51        (_size_queue                    ,
52         _nb_instruction                ,
53         _size_branch_update_prediction ,
54         _size_general_data             ,
55         true // is_toplevel
56         );
57     
58      msg(_("%s"),param->print(1).c_str());
59     
60      test (name,param);
61    }
62  catch (morpheo::ErrorMorpheo & error)
63    {
64      msg (_("<%s> :\n%s"),name.c_str(), error.what ());
65      _return = EXIT_FAILURE;
66    }
67  catch (...)
68    {
69      err (_("<%s> : This test must generate a error.\n"),name.c_str());
70      _return = EXIT_FAILURE;
71    }
72
73  return (_return);
74}
Note: See TracBrowser for help on using the repository browser.