source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/src/main.cpp @ 77

Last change on this file since 77 was 77, checked in by rosiere, 16 years ago
  • Add two component :
    • network between read unit and execute unit
    • network between execute unit and write unit
  • remove parameters "nb_operation" and "nb_type"
  • in write_queue add the special case : load_speculative
File size: 3.6 KB
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/SelfTest/include/test.h"
9
10#define number_of_test 2
11
12#define NB_PARAMS 11
13
14void usage (int argc, char * argv[])
15{
16  cerr << "<Usage> " << argv[0] << " name_instance list_params" << endl
17       << "list_params is :" << endl
18       << " - size_store_queue        (uint32_t)" << endl
19       << " - size_load_queue         (uint32_t)" << endl
20       << " - size_speculative_access_queue (uint32_t)" << endl
21       << " - nb_port_check           (uint32_t)" << endl
22       << " - speculative_load        (uint32_t)" << endl
23       << " - nb_context              (uint32_t)" << endl
24       << " - nb_front_end            (uint32_t)" << endl
25       << " - nb_ooo_engine           (uint32_t)" << endl
26       << " - nb_packet               (uint32_t)" << endl
27       << " - size_general_data       (uint32_t)" << endl
28       << " - nb_general_register     (uint32_t)" << endl
29       << "" << endl;
30
31  for (int i=0; i<argc; i++)
32    cerr << argv[i] << " ";
33  cerr << endl;
34
35  exit (1);
36}
37
38#ifndef SYSTEMC
39int main    (int argc, char * argv[])
40#else
41int sc_main (int argc, char * argv[])
42#endif
43{
44  switch (number_of_test)
45    {
46    case 1 :
47      {
48       
49        if (argc != 2+NB_PARAMS)
50          usage (argc, argv);
51       
52        uint32_t x=1;
53       
54        const string              name                     = argv[x++];
55        const uint32_t            _size_store_queue        = atoi(argv[x++]);
56        const uint32_t            _size_load_queue         = atoi(argv[x++]);
57        const uint32_t            _size_speculative_access_queue = atoi(argv[x++]);
58        const uint32_t            _nb_port_check           = atoi(argv[x++]);
59        const Tspeculative_load_t _speculative_load        = fromString<Tspeculative_load_t>(argv[x++]);
60        const uint32_t            _nb_context              = atoi(argv[x++]);
61        const uint32_t            _nb_front_end            = atoi(argv[x++]);
62        const uint32_t            _nb_ooo_engine           = atoi(argv[x++]);
63        const uint32_t            _nb_packet               = atoi(argv[x++]);
64        const uint32_t            _size_general_data       = atoi(argv[x++]);
65        const uint32_t            _nb_general_register     = atoi(argv[x++]);
66       
67        try 
68          {
69            morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters * param = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Parameters
70              (
71               _size_store_queue       ,
72               _size_load_queue        ,
73               _size_speculative_access_queue,
74               _nb_port_check          ,
75               _speculative_load       ,
76               _nb_context             ,
77               _nb_front_end           ,
78               _nb_ooo_engine          ,
79               _nb_packet              ,
80               _size_general_data      ,
81               _nb_general_register    );
82           
83            cout << param->print(1);
84           
85            test1 (name,param);
86           
87          }
88        catch (morpheo::ErrorMorpheo & error)
89          {
90            cout << "<" << name << "> : " <<  error.what ();
91            exit (EXIT_FAILURE);
92          }
93        catch (...)
94          {
95            cerr << "<" << name << "> : This test must generate a error" << endl;
96            exit (EXIT_FAILURE);
97          }
98       
99        break;
100      }
101    case 2 :
102      {
103        try 
104          {
105            test2 ();
106          }
107        catch (morpheo::ErrorMorpheo & error)
108          {
109            cout << error.what ();
110            exit (EXIT_FAILURE);
111          }
112        catch (...)
113          {
114            cerr << "This test must generate a error" << endl;
115            exit (EXIT_FAILURE);
116          }
117       
118        break;
119      }
120    default :
121      {
122        std::cerr << "Invalid number of test" << std::endl;
123        exit (EXIT_FAILURE);
124
125        break;
126      }
127    }
128 
129  return (EXIT_SUCCESS);
130}
131
Note: See TracBrowser for help on using the repository browser.