source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/SelfTest/src/test.cpp @ 110

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

1) OOO_egine : add stat to depiste low perf source
2) Commit : add stat
3) LSU_Pointer : retire - always ack (else combinatory loop). insert - max nb_inst_memory
4) TopLevel? : add debug_idle_time to stop combinatory loop.
5) Issue_queue : add reexecute_queue, new implementation (routage after issue_queue)
6) Decod / Predictor : add "can_continue"

  • Property svn:keywords set to Id
File size: 3.0 KB
Line 
1/*
2 * $Id: test.cpp 110 2009-02-19 16:31:47Z rosiere $
3 *
4 * [ Description ]
5 *
6 * Test
7 */
8
9#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/SelfTest/include/test.h"
10#include "Behavioural/include/Allocation.h"
11
12void test (string name,
13           morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::Parameters * _param)
14{
15  msg(_("<%s> : Simulation SystemC.\n"),name.c_str());
16 
17  if (setlocale (LC_ALL, "") == NULL)
18    msg(_("setlocale ko.\n"));
19
20#ifdef STATISTICS
21  morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,CYCLE_MAX);
22#endif
23
24  Tusage_t _usage = USE_ALL;
25
26//   _usage = usage_unset(_usage,USE_SYSTEMC              );
27//   _usage = usage_unset(_usage,USE_VHDL                 );
28//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH       );
29//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT);
30//   _usage = usage_unset(_usage,USE_POSITION             );
31//   _usage = usage_unset(_usage,USE_STATISTICS           );
32//   _usage = usage_unset(_usage,USE_INFORMATION          );
33
34  Meta_Predictor * _Meta_Predictor = new Meta_Predictor
35    (name.c_str(),
36#ifdef STATISTICS
37     _parameters_statistics,
38#endif
39     _param,
40     _usage);
41 
42#ifdef SYSTEMC
43  if (usage_is_set(_usage,USE_SYSTEMC))
44    {
45  /*********************************************************************
46   * Déclarations des signaux
47   *********************************************************************/
48  string rename;
49
50  sc_clock              *  in_CLOCK  = new sc_clock ("clock", 1.0, 0.5);         
51  sc_signal<Tcontrol_t> *  in_NRESET = new sc_signal<Tcontrol_t> ("NRESET");
52 
53  /********************************************************
54   * Instanciation
55   ********************************************************/
56 
57  msg(_("<%s> : Instanciation of _Meta_Predictor.\n"),name.c_str());
58
59  (*(_Meta_Predictor->in_CLOCK))        (*(in_CLOCK));
60  (*(_Meta_Predictor->in_NRESET))       (*(in_NRESET));
61
62
63  msg(_("<%s> : Start Simulation ............\n"),name.c_str());
64   
65  Time * _time = new Time();
66
67  /********************************************************
68   * Simulation - Begin
69   ********************************************************/
70
71  // Initialisation
72
73  const uint32_t seed = 0;
74//const uint32_t seed = static_cast<uint32_t>(time(NULL));
75
76  srand(seed);
77
78  SC_START(0);
79  LABEL("Initialisation");
80
81  LABEL("Reset");
82  in_NRESET->write(0);
83  SC_START(5);
84  in_NRESET->write(1); 
85
86  LABEL("Loop of Test");
87
88  for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
89    {
90      LABEL("Iteration %d",iteration);
91
92      SC_START(1);
93    }
94
95  /********************************************************
96   * Simulation - End
97   ********************************************************/
98
99  TEST_OK ("End of Simulation");
100  delete _time;
101
102  msg(_("<%s> : ............ Stop Simulation\n"),name.c_str());
103
104  delete in_CLOCK;
105  delete in_NRESET;
106    }
107#endif
108
109  delete _Meta_Predictor;
110#ifdef STATISTICS
111  delete _parameters_statistics;
112#endif
113}
Note: See TracBrowser for help on using the repository browser.