source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/SelfTest/src/main.cpp @ 73

Last change on this file since 73 was 73, checked in by rosiere, 16 years ago

add two component :

  • Write Queue (in Moore version)
  • Execute Queue

add macro to help the interface allocation : Allocation.h

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_Write_unit/Write_unit/Write_queue/SelfTest/include/test.h"
9
10#define NB_PARAMS 12
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 (_(" * size_queue          (uint32_t)\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  err (_(" * nb_bypass_write     (uint32_t)\n"));
28
29  exit (1);
30}
31
32#ifndef SYSTEMC
33int main    (int argc, char * argv[])
34#else
35int sc_main (int argc, char * argv[])
36#endif
37{
38  if (argc != 2+NB_PARAMS)
39    usage (argc, argv);
40
41  uint32_t       x = 1;
42
43  const string   name                =      argv[x++];
44  const uint32_t size_queue          = atoi(argv[x++]);
45  const uint32_t nb_context          = atoi(argv[x++]);
46  const uint32_t nb_front_end        = atoi(argv[x++]);
47  const uint32_t nb_ooo_engine       = atoi(argv[x++]);
48  const uint32_t nb_packet           = atoi(argv[x++]);
49  const uint32_t size_general_data   = atoi(argv[x++]);
50  const uint32_t nb_general_register = atoi(argv[x++]);
51  const uint32_t size_special_data   = atoi(argv[x++]);
52  const uint32_t nb_special_register = atoi(argv[x++]);
53  const uint32_t nb_operation        = atoi(argv[x++]);
54  const uint32_t nb_type             = atoi(argv[x++]);
55  const uint32_t nb_bypass_write     = atoi(argv[x++]);
56
57  try 
58    {
59      morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::write_queue::Parameters * param = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::write_queue::Parameters
60        (size_queue         ,
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         nb_bypass_write    );
72     
73      msg(_("%s"),param->print(1).c_str());
74     
75      test (name,param);
76    }
77  catch (morpheo::ErrorMorpheo & error)
78    {
79      msg (_("<%s> : %s.\n"),name.c_str(), error.what ());
80      exit (EXIT_FAILURE);
81    }
82  catch (...)
83    {
84      err (_("<%s> : This test must generate a error.\n"),name.c_str());
85      exit (EXIT_FAILURE);
86    }
87
88  return (EXIT_SUCCESS);
89}
90
Note: See TracBrowser for help on using the repository browser.