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

Last change on this file since 113 was 113, checked in by rosiere, 15 years ago

1) Add modelsim simulation systemC
2) Modelsim cosimulation systemC / VHDL is not finish !!!! (cf execute_queue and write_unit)
3) Add multi architecture
5) Add template for comparator, multiplier and divider
6) Change Message
Warning) Various test macro have change, many selftest can't compile

  • Property svn:keywords set to Id
File size: 3.5 KB
Line 
1/*
2 * $Id: sc_main.cpp 113 2009-04-14 18:39:12Z rosiere $
3 *
4 * [ Description ]
5 *
6 * Platforms : Morpheo + Environment
7 */
8
9#include "../include/test.h"
10
11using namespace std;
12using namespace morpheo;
13
14void usage (int argc
15#ifdef MTI_SYSTEMC
16            ,const char * const * argv
17#else
18            ,char * argv[]
19#endif
20            )
21{
22  cerr <<  "<Usage> " << argv[0] << endl
23       <<  "In input stream : " << endl
24       <<  " * filename_simulator   (string  )" << endl
25       <<  " * filename_generator   (string  )" << endl
26       <<  " * filename_instance    (string  )" << endl
27       <<  " * filename_software    (string  )" << endl
28       <<  " * nb_cache_dedicated   (uint32_t)" << endl
29       <<  " * nb_cache_shared      (uint32_t)" << endl
30       <<  " * size cache L1 (byte) (uint32_t)" << endl
31       <<  " * ratio cache          (uint32_t)" << endl;
32  exit (EXIT_FAILURE);
33}
34
35#ifdef MTI_SYSTEMC
36SC_MODULE_EXPORT(top);
37
38top::top (sc_module_name name)
39#else
40int sc_main (int argc, char * argv[])
41#endif
42{
43  cout << "<sc_main> Begin" << endl;
44
45#ifdef MTI_SYSTEMC
46  // accessing command-line arguments with modelsim
47  int argc;
48  const char * const * argv;
49
50  argc = sc_argc ();
51  argv = sc_argv ();
52#endif
53
54  for (int32_t i=0; i<argc; ++i)
55    cout << argv[i] << " ";
56  cout << endl;
57 
58  //==============================================================================
59  //===== [ Parameters ]==========================================================
60  //==============================================================================
61 
62  if (argc != 9)
63    usage (argc, argv);
64 
65  uint32_t x = 1;
66  string   filename_simulator = argv[x++];
67  string   filename_generator = argv[x++];
68  string   filename_instance  = argv[x++];
69  string   filename_software  = argv[x++];
70  uint32_t nb_cache_dedicated = fromString<uint32_t>(argv[x++]);
71  uint32_t nb_cache_shared    = fromString<uint32_t>(argv[x++]);
72  uint32_t cache_size         = fromString<uint32_t>(argv[x++]);
73  uint32_t cache_ratio        = fromString<uint32_t>(argv[x++]);
74 
75//   string   filename_simulator;
76//   string   filename_generator;
77//   string   filename_instance ;
78//   string   filename_software ;
79//   uint32_t nb_cache_dedicated;
80//   uint32_t nb_cache_shared   ;
81//   uint32_t cache_size        ;
82//   uint32_t cache_ratio       ;
83
84//   cout <<  "get filename_simulator   ? " << endl;
85//   cin >> filename_simulator ;
86
87//   cout <<  "get filename_generator   ? " << endl;
88//   cin >> filename_generator ;
89
90//   cout <<  "get filename_instance    ? " << endl;
91//   cin >> filename_instance  ;
92
93//   cout <<  "get filename_software    ? " << endl;
94//   cin >> filename_software  ;
95
96//   cout <<  "get nb_cache_dedicated   ? " << endl;
97//   cin >> nb_cache_dedicated ;
98
99//   cout <<  "get nb_cache_shared      ? " << endl;
100//   cin >> nb_cache_shared    ;
101
102//   cout <<  "get size cache L1 (byte) ? " << endl;
103//   cin >> cache_size         ;
104
105//   cout <<  "get ratio cache          ? " << endl;
106//   cin >> cache_ratio        ;
107
108  morpheo::behavioural::custom::custom_information_t (*get_custom_information) (void) = NULL;
109
110  int _return = test (filename_simulator ,
111                      filename_generator ,
112                      filename_instance  ,
113                      filename_software  ,
114                      nb_cache_dedicated ,
115                      nb_cache_shared    ,
116                      cache_size         ,
117                      cache_ratio        ,
118                      get_custom_information);
119
120  cout << "  * return : " << _return << endl; 
121  cout << "<sc_main> End" << endl; 
122
123#ifndef MTI_SYSTEMC
124  return _return;
125#endif
126}
Note: See TracBrowser for help on using the repository browser.