source: trunk/Platforms/Test/src/sc_main.cpp @ 143

Last change on this file since 143 was 142, checked in by rosiere, 14 years ago

1) Full parallel compilation
2) Add statistics in ROB : list instruction affinity

  • Property svn:keywords set to Id
File size: 2.6 KB
RevLine 
[88]1/*
2 * $Id: sc_main.cpp 142 2010-08-04 20:09:03Z rosiere $
3 *
4 * [ Description ]
5 *
6 * Platforms : Morpheo + Environment
7 */
8
9#include "../include/test.h"
10
11using namespace std;
12using namespace morpheo;
13
[113]14void usage (int argc
15#ifdef MTI_SYSTEMC
16            ,const char * const * argv
17#else
18            ,char * argv[]
19#endif
20            )
[88]21{
[138]22  msgError("<Usage> %s\n",argv[0]);
23  msgError("In input stream :\n");
24  msgError(" * filename_simulator   (string  )\n");
25  msgError(" * filename_generator   (string  )\n");
26  msgError(" * filename_instance    (string  )\n");
27  msgError(" * filename_software    (string  )\n");
28  msgError(" * nb_cache_dedicated   (uint32_t)\n");
29  msgError(" * nb_cache_shared      (uint32_t)\n");
30  msgError(" * size cache L1 (byte) (uint32_t)\n");
31  msgError(" * ratio cache          (uint32_t)\n");
32
[88]33  exit (EXIT_FAILURE);
[115]34};
[88]35
[113]36#ifdef MTI_SYSTEMC
37SC_MODULE_EXPORT(top);
38
39top::top (sc_module_name name)
40#else
[88]41int sc_main (int argc, char * argv[])
[113]42#endif
[88]43{
[138]44  msgInformation("<sc_main> Begin\n");
[88]45
[142]46  sc_report_handler::set_actions("/IEEE_Std_1666/deprecated", SC_DO_NOTHING);
47
[113]48#ifdef MTI_SYSTEMC
49  // accessing command-line arguments with modelsim
50  int argc;
51  const char * const * argv;
52
53  argc = sc_argc ();
54  argv = sc_argv ();
55#endif
56
[138]57  msgInformation(" ");
[88]58  for (int32_t i=0; i<argc; ++i)
[138]59    msg("%s ",argv[i]);
60  msg("\n");
[113]61 
[88]62  //==============================================================================
63  //===== [ Parameters ]==========================================================
64  //==============================================================================
[113]65 
[88]66  if (argc != 9)
67    usage (argc, argv);
[113]68 
[88]69  uint32_t x = 1;
70  string   filename_simulator = argv[x++];
71  string   filename_generator = argv[x++];
72  string   filename_instance  = argv[x++];
73  string   filename_software  = argv[x++];
74  uint32_t nb_cache_dedicated = fromString<uint32_t>(argv[x++]);
75  uint32_t nb_cache_shared    = fromString<uint32_t>(argv[x++]);
76  uint32_t cache_size         = fromString<uint32_t>(argv[x++]);
77  uint32_t cache_ratio        = fromString<uint32_t>(argv[x++]);
78
79  morpheo::behavioural::custom::custom_information_t (*get_custom_information) (void) = NULL;
80
81  int _return = test (filename_simulator ,
82                      filename_generator ,
83                      filename_instance  ,
84                      filename_software  ,
85                      nb_cache_dedicated ,
86                      nb_cache_shared    ,
87                      cache_size         ,
88                      cache_ratio        ,
89                      get_custom_information);
90
[138]91  msgInformation("  * return : %d\n",_return);
92  msgInformation("<sc_main> End\n");
[88]93
[113]94#ifndef MTI_SYSTEMC
[88]95  return _return;
[113]96#endif
[115]97};
Note: See TracBrowser for help on using the repository browser.