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

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

1) add counters_t type for interface
2) fix in check load in load_store_unit
3) add parameters (but not yet implemented)
4) change environment and add script (distcc_env.sh ...)
5) add warning if an unser change rename flag with l.mtspr instruction
6) ...

  • Property svn:keywords set to Id
File size: 2.5 KB
RevLine 
[88]1/*
2 * $Id: sc_main.cpp 138 2010-05-12 17:34:01Z 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
[113]46#ifdef MTI_SYSTEMC
47  // accessing command-line arguments with modelsim
48  int argc;
49  const char * const * argv;
50
51  argc = sc_argc ();
52  argv = sc_argv ();
53#endif
54
[138]55  msgInformation(" ");
[88]56  for (int32_t i=0; i<argc; ++i)
[138]57    msg("%s ",argv[i]);
58  msg("\n");
[113]59 
[88]60  //==============================================================================
61  //===== [ Parameters ]==========================================================
62  //==============================================================================
[113]63 
[88]64  if (argc != 9)
65    usage (argc, argv);
[113]66 
[88]67  uint32_t x = 1;
68  string   filename_simulator = argv[x++];
69  string   filename_generator = argv[x++];
70  string   filename_instance  = argv[x++];
71  string   filename_software  = argv[x++];
72  uint32_t nb_cache_dedicated = fromString<uint32_t>(argv[x++]);
73  uint32_t nb_cache_shared    = fromString<uint32_t>(argv[x++]);
74  uint32_t cache_size         = fromString<uint32_t>(argv[x++]);
75  uint32_t cache_ratio        = fromString<uint32_t>(argv[x++]);
76
77  morpheo::behavioural::custom::custom_information_t (*get_custom_information) (void) = NULL;
78
79  int _return = test (filename_simulator ,
80                      filename_generator ,
81                      filename_instance  ,
82                      filename_software  ,
83                      nb_cache_dedicated ,
84                      nb_cache_shared    ,
85                      cache_size         ,
86                      cache_ratio        ,
87                      get_custom_information);
88
[138]89  msgInformation("  * return : %d\n",_return);
90  msgInformation("<sc_main> End\n");
[88]91
[113]92#ifndef MTI_SYSTEMC
[88]93  return _return;
[113]94#endif
[115]95};
Note: See TracBrowser for help on using the repository browser.