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

Last change on this file since 72 was 72, checked in by rosiere, 16 years ago
  • SystemC de l'unite fonctionnelle.
  • gestion des groupes / instructions custom
File size: 2.8 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 10
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  err (_("  * nb_operation        (uint32_t)\n"));
26  err (_("  * nb_type             (uint32_t)\n"));
27  exit (1);
28}
29
30#ifndef SYSTEMC
31int main    (int argc, char * argv[])
32#else
33int sc_main (int argc, char * argv[])
34#endif
35{
36  if (argc != 2+NB_PARAMS)
37    usage (argc, argv);
38
39  uint32_t       x = 1;
40
41  const string   name                =      argv[x++];
42  const uint32_t nb_context          = atoi(argv[x++]);
43  const uint32_t nb_front_end        = atoi(argv[x++]);
44  const uint32_t nb_ooo_engine       = atoi(argv[x++]);
45  const uint32_t nb_packet           = atoi(argv[x++]);
46  const uint32_t size_general_data   = atoi(argv[x++]);
47  const uint32_t nb_general_register = atoi(argv[x++]);
48  const uint32_t size_special_data   = atoi(argv[x++]);
49  const uint32_t nb_special_register = atoi(argv[x++]);
50  const uint32_t nb_operation        = atoi(argv[x++]);
51  const uint32_t nb_type             = atoi(argv[x++]);
52
53  execute_timing_t * timing = new execute_timing_t [MAX_OPERATION];
54
55  for (uint32_t i=0; i< MAX_OPERATION; i++)
56    timing[i]._delay = timing[i]._latence = 1;
57
58  try 
59    {
60      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
61        (nb_context          ,
62         nb_front_end        ,
63         nb_ooo_engine       ,
64         nb_packet           ,
65         size_general_data   ,
66         nb_general_register ,
67         size_special_data   ,
68         nb_special_register ,
69         nb_operation        ,
70         nb_type             ,
71         timing              ,
72         &(morpheo::behavioural::custom::example_get_custom_information)
73        );
74     
75      msg(_("%s"),param->print(1).c_str());
76     
77      test (name,param);
78    }
79  catch (morpheo::ErrorMorpheo & error)
80    {
81      msg (_("<%s> : %s.\n"),name.c_str(), error.what ());
82      exit (EXIT_FAILURE);
83    }
84  catch (...)
85    {
86      err (_("<%s> : This test must generate a error.\n"),name.c_str());
87      exit (EXIT_FAILURE);
88    }
89
90  delete timing;
91 
92  return (EXIT_SUCCESS);
93}
94
Note: See TracBrowser for help on using the repository browser.