source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/SelfTest/src/main.cpp @ 111

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

1) Decod_queue : multi implementation (one_fifo, multi_fifo)
2) Issue_queue : multi implementation (in_order, out_of_order)
3) Direction : Add Meta predictor
4) Context_State : re add Branch_complete, More priority to Load miss (is not speculative)
5) Return_Address_Stack : update reg_PREDICT pointer on decod miss prediction
6) UPT : Fix bug in multi event
7) Prediction_glue : in read_stack case, insert in UPT pc_next
8) Rename select : when rob have an event (need flush), read_r{a,b,c} and write_r{d,e} is set at 0

  • Property svn:keywords set to Id
File size: 2.4 KB
Line 
1/*
2 * $Id: main.cpp 111 2009-02-27 18:37:40Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/SelfTest/include/test.h"
9
10#define NB_PARAMS 5
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 (_(" * nb_context                        (uint32_t             )\n"));
17  err (_(" * nb_inst_decod                     (uint32_t             )\n"));
18  err (_(" * size_queue                        (uint32_t             )\n"));
19  err (_(" * queue_scheme                      (Tdecod_queue_scheme_t)\n"));
20  err (_(" * size_general_data                 (uint32_t             )\n"));
21  err (_(" * nb_branch_speculated [nb_context] (uint32_t             )\n"));
22
23  exit (1);
24}
25
26#ifndef SYSTEMC
27int main    (int argc, char * argv[])
28#else
29int sc_main (int argc, char * argv[])
30#endif
31{
32  if (argc < static_cast<int>(2+NB_PARAMS))
33    usage (argc, argv);
34
35  uint32_t x = 1;
36
37  string name = argv[x++];
38  uint32_t _nb_context        = fromString<uint32_t>(argv[x++]);
39  uint32_t _nb_inst_decod     = fromString<uint32_t>(argv[x++]);
40  uint32_t _size_queue        = fromString<uint32_t>(argv[x++]);
41  Tdecod_queue_scheme_t _queue_scheme = fromString<Tdecod_queue_scheme_t>(argv[x++]);
42  uint32_t _size_general_data = fromString<uint32_t>(argv[x++]);
43
44  if (argc != static_cast<int>(2+NB_PARAMS+_nb_context))
45    usage (argc, argv);
46
47  uint32_t * _nb_branch_speculated = new uint32_t [_nb_context];
48  for (uint32_t i=0; i<_nb_context; i++)
49    _nb_branch_speculated [i] = fromString<uint32_t>(argv[x++]);
50
51  int _return = EXIT_SUCCESS;
52  try 
53    {
54      morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Parameters * param = new morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Parameters
55        (_nb_context       ,
56         _nb_inst_decod    ,
57         _size_queue       ,
58         _queue_scheme     ,
59         _size_general_data,
60         _nb_branch_speculated,
61         true // is_toplevel
62         );
63     
64      msg(_("%s"),param->print(1).c_str());
65     
66      test (name,param);
67    }
68  catch (morpheo::ErrorMorpheo & error)
69    {
70      msg (_("<%s> :\n%s"),name.c_str(), error.what ());
71      _return = EXIT_FAILURE;
72    }
73  catch (...)
74    {
75      err (_("<%s> : This test must generate a error.\n"),name.c_str());
76      _return = EXIT_FAILURE;
77    }
78
79  delete [] _nb_branch_speculated;
80
81  return (_return);
82}
Note: See TracBrowser for help on using the repository browser.