source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_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: 2.7 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/Functionnal_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_front_end        (uint32_t)\n"));
19  err (_("  * nb_ooo_engine       (uint32_t)\n"));
20  err (_("  * nb_packet           (uint32_t)\n"));
21  err (_("  * size_general_data   (uint32_t)\n"));
22  err (_("  * nb_general_register (uint32_t)\n"));
23  err (_("  * size_special_data   (uint32_t)\n"));
24  err (_("  * nb_special_register (uint32_t)\n"));
25  exit (1);
26}
27
28#ifndef SYSTEMC
29int main    (int argc, char * argv[])
30#else
31int sc_main (int argc, char * argv[])
32#endif
33{
34  if (argc != 2+NB_PARAMS)
35    usage (argc, argv);
36
37  uint32_t       x = 1;
38
39  const string   name                =      argv[x++];
40  const uint32_t nb_context          = atoi(argv[x++]);
41  const uint32_t nb_front_end        = atoi(argv[x++]);
42  const uint32_t nb_ooo_engine       = atoi(argv[x++]);
43  const uint32_t nb_packet           = atoi(argv[x++]);
44  const uint32_t size_general_data   = atoi(argv[x++]);
45  const uint32_t nb_general_register = atoi(argv[x++]);
46  const uint32_t size_special_data   = atoi(argv[x++]);
47  const uint32_t nb_special_register = atoi(argv[x++]);
48
49  execute_timing_t ** timing = new execute_timing_t * [MAX_TYPE];
50
51  for (uint32_t i=0; i< MAX_TYPE; i++)
52    {
53      timing [i]= new execute_timing_t [MAX_OPERATION];
54     
55      for (uint32_t j=0; j< MAX_OPERATION; j++)
56        timing[i][j]._delay = timing[i][j]._latence = 1;
57    }
58
59  try 
60    {
61      morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::functionnal_unit::Parameters * param = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::functionnal_unit::Parameters
62        (nb_context          ,
63         nb_front_end        ,
64         nb_ooo_engine       ,
65         nb_packet           ,
66         size_general_data   ,
67         nb_general_register ,
68         size_special_data   ,
69         nb_special_register ,
70         timing              ,
71         &(morpheo::behavioural::custom::example_get_custom_information)
72        );
73     
74      msg(_("%s"),param->print(1).c_str());
75     
76      test (name,param);
77    }
78  catch (morpheo::ErrorMorpheo & error)
79    {
80      msg (_("<%s> : %s.\n"),name.c_str(), error.what ());
81      exit (EXIT_FAILURE);
82    }
83  catch (...)
84    {
85      err (_("<%s> : This test must generate a error.\n"),name.c_str());
86      exit (EXIT_FAILURE);
87    }
88
89  delete timing;
90 
91  return (EXIT_SUCCESS);
92}
93
Note: See TracBrowser for help on using the repository browser.