source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/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: 4.1 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/SelfTest/include/test.h"
9#include "Behavioural/Custom/include/Custom_example.h"
10
11#define NB_PARAMS 8
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 (_(" * nb_context                                 (uint32_t             )\n"));
18  err (_(" * nb_inst_fetch                 [nb_context] (uint32_t             )\n"));
19  err (_(" * nb_inst_decod                              (uint32_t             )\n"));
20  err (_(" * size_queue                                 (uint32_t             )\n"));
21  err (_(" * queue_scheme                               (Tdecod_queue_scheme_t)\n"));
22  err (_(" * size_general_data                          (uint32_t             )\n"));
23  err (_(" * nb_branch_speculated          [nb_context] (uint32_t             )\n"));
24  err (_(" * nb_context_select                          (uint32_t             )\n"));
25  err (_(" * select_priority                            (Tpriority_t          )\n"));
26  err (_(" * select_load_balancing                      (Tload_balancing_t    )\n"));
27
28  exit (1);
29}
30
31#ifndef SYSTEMC
32int main    (int argc, char * argv[])
33#else
34int sc_main (int argc, char * argv[])
35#endif
36{
37  if (argc <= static_cast<int>(2+NB_PARAMS))
38    usage (argc, argv);
39
40  uint32_t x = 1;
41
42  string name = argv[x++];
43
44  uint32_t            _nb_context                   = fromString<uint32_t         >(argv[x++]);
45
46  if (argc != static_cast<int>(2+NB_PARAMS+2*_nb_context))
47    usage (argc, argv);
48
49  uint32_t          * _nb_inst_fetch                = new uint32_t [_nb_context];
50  for (uint32_t i=0; i<_nb_context; i++)
51    _nb_inst_fetch        [i] = fromString<uint32_t>(argv[x++]);
52  uint32_t            _nb_inst_decod                = fromString<uint32_t         >(argv[x++]);
53  uint32_t            _size_queue                   = fromString<uint32_t         >(argv[x++]);
54  decod_queue::Tdecod_queue_scheme_t _queue_scheme  = fromString<decod_queue::Tdecod_queue_scheme_t>(argv[x++]);
55  uint32_t            _size_general_data            = fromString<uint32_t         >(argv[x++]);
56  uint32_t          * _nb_branch_speculated         = new uint32_t [_nb_context];
57  for (uint32_t i=0; i<_nb_context; i++)
58    _nb_branch_speculated [i] = fromString<uint32_t>(argv[x++]);
59  uint32_t            _nb_context_select            = fromString<uint32_t         >(argv[x++]);
60  Tpriority_t         _select_priority              = fromString<Tpriority_t      >(argv[x++]);
61  Tload_balancing_t   _select_load_balancing        = fromString<Tload_balancing_t>(argv[x++]);
62
63  bool             ** _instruction_implemeted = new bool * [_nb_context];
64  for (uint32_t i=0; i<_nb_context; i++)
65    {
66      _instruction_implemeted [i] = new bool [NB_INSTRUCTION];
67     
68      for (uint32_t j=0; j<NB_INSTRUCTION; j++)
69        _instruction_implemeted [i][j] = true;
70    }
71
72
73  int _return = EXIT_SUCCESS;
74  try 
75    {
76      morpheo::behavioural::core::multi_front_end::front_end::decod_unit::Parameters * param = new morpheo::behavioural::core::multi_front_end::front_end::decod_unit::Parameters
77        (_nb_context                   ,
78         _nb_inst_fetch                ,
79         _nb_inst_decod                ,
80         _size_queue                   ,
81         _queue_scheme                 ,
82         _size_general_data            ,
83         _nb_branch_speculated         ,
84         _nb_context_select            ,
85         _select_priority              ,
86         _select_load_balancing        ,
87         _instruction_implemeted       ,
88         &(morpheo::behavioural::custom::example_get_custom_information),
89         true
90         );
91     
92      msg(_("%s"),param->print(1).c_str());
93     
94      test (name,param);
95    }
96  catch (morpheo::ErrorMorpheo & error)
97    {
98      msg (_("<%s> :\n%s"),name.c_str(), error.what ());
99      _return = EXIT_FAILURE;
100    }
101  catch (...)
102    {
103      err (_("<%s> : This test must generate a error.\n"),name.c_str());
104      _return = EXIT_FAILURE;
105    }
106 
107  delete [] _nb_inst_fetch       ;
108  delete [] _nb_branch_speculated;
109  for (uint32_t i=0; i<_nb_context; i++)
110    delete [] _instruction_implemeted [i];
111  delete [] _instruction_implemeted;
112
113  return (_return);
114}
Note: See TracBrowser for help on using the repository browser.