source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/SelfTest/src/test.cpp @ 119

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

1) Prediction unit : static prediction not blocking

  • Property svn:keywords set to Id
File size: 23.9 KB
Line 
1/*
2 * $Id: test.cpp 119 2009-05-25 17:40:26Z rosiere $
3 *
4 * [ Description ]
5 *
6 * Test
7 */
8
9#include "Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/SelfTest/include/test.h"
10#include "Behavioural/include/Allocation.h"
11
12void test (string name,
13           morpheo::behavioural::core::multi_front_end::front_end::front_end_glue::Parameters * _param)
14{
15  msg(_("<%s> : Simulation SystemC.\n"),name.c_str());
16
17#ifdef STATISTICS
18  morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,CYCLE_MAX);
19#endif
20
21  Tusage_t _usage = USE_ALL;
22
23//   _usage = usage_unset(_usage,USE_SYSTEMC              );
24//   _usage = usage_unset(_usage,USE_VHDL                 );
25//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH       );
26//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT);
27//   _usage = usage_unset(_usage,USE_POSITION             );
28//   _usage = usage_unset(_usage,USE_STATISTICS           );
29//   _usage = usage_unset(_usage,USE_INFORMATION          );
30
31  Front_end_Glue * _Front_end_Glue = new Front_end_Glue
32    (name.c_str(),
33#ifdef STATISTICS
34     _parameters_statistics,
35#endif
36     _param,
37     _usage);
38 
39#ifdef SYSTEMC
40  if (usage_is_set(_usage,USE_SYSTEMC))
41    {
42  /*********************************************************************
43   * Déclarations des signaux
44   *********************************************************************/
45  string rename;
46
47  sc_clock              *  in_CLOCK  = new sc_clock ("clock", 1.0, 0.5);         
48  sc_signal<Tcontrol_t> *  in_NRESET = new sc_signal<Tcontrol_t> ("NRESET");
49
50  ALLOC2_SC_SIGNAL(out_IFETCH_DECOD_UNIT_CONTEXT_ID                   ,"out_IFETCH_DECOD_UNIT_CONTEXT_ID                   ",Tcontext_t,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
51
52  ALLOC2_SC_SIGNAL(out_DECOD_CONTEXT_ID                               ,"out_DECOD_CONTEXT_ID                               ",Tcontext_t,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
53  ALLOC2_SC_SIGNAL( in_DECOD_DECOD_UNIT_CONTEXT_ID                    ," in_DECOD_DECOD_UNIT_CONTEXT_ID                    ",Tcontext_t,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
54
55  ALLOC1_SC_SIGNAL( in_BRANCH_COMPLETE_VAL                            ," in_BRANCH_COMPLETE_VAL                            ",Tcontrol_t,_param->_nb_inst_branch_complete);
56  ALLOC1_SC_SIGNAL(out_BRANCH_COMPLETE_ACK                            ,"out_BRANCH_COMPLETE_ACK                            ",Tcontrol_t,_param->_nb_inst_branch_complete);
57  ALLOC1_SC_SIGNAL(out_BRANCH_COMPLETE_MISS_PREDICTION                ,"out_BRANCH_COMPLETE_MISS_PREDICTION                ",Tcontrol_t,_param->_nb_inst_branch_complete);
58  ALLOC1_SC_SIGNAL(out_BRANCH_COMPLETE_PREDICTION_UNIT_VAL            ,"out_BRANCH_COMPLETE_PREDICTION_UNIT_VAL            ",Tcontrol_t,_param->_nb_inst_branch_complete);
59  ALLOC1_SC_SIGNAL( in_BRANCH_COMPLETE_PREDICTION_UNIT_ACK            ," in_BRANCH_COMPLETE_PREDICTION_UNIT_ACK            ",Tcontrol_t,_param->_nb_inst_branch_complete);
60  ALLOC1_SC_SIGNAL( in_BRANCH_COMPLETE_PREDICTION_UNIT_MISS_PREDICTION," in_BRANCH_COMPLETE_PREDICTION_UNIT_MISS_PREDICTION",Tcontrol_t,_param->_nb_inst_branch_complete);
61  ALLOC1_SC_SIGNAL(out_BRANCH_COMPLETE_CONTEXT_STATE_VAL              ,"out_BRANCH_COMPLETE_CONTEXT_STATE_VAL              ",Tcontrol_t,_param->_nb_inst_branch_complete);
62  ALLOC1_SC_SIGNAL( in_BRANCH_COMPLETE_CONTEXT_STATE_ACK              ," in_BRANCH_COMPLETE_CONTEXT_STATE_ACK              ",Tcontrol_t,_param->_nb_inst_branch_complete);
63  ALLOC1_SC_SIGNAL(out_BRANCH_COMPLETE_CONTEXT_STATE_MISS_PREDICTION  ,"out_BRANCH_COMPLETE_CONTEXT_STATE_MISS_PREDICTION  ",Tcontrol_t,_param->_nb_inst_branch_complete);
64
65  ALLOC1_SC_SIGNAL(out_EVENT_VAL                                      ,"out_EVENT_VAL                                      ",Tcontrol_t,_param->_nb_context);
66  ALLOC1_SC_SIGNAL( in_EVENT_ACK                                      ," in_EVENT_ACK                                      ",Tcontrol_t,_param->_nb_context);
67  ALLOC1_SC_SIGNAL(out_EVENT_ADDRESS                                  ,"out_EVENT_ADDRESS                                  ",Taddress_t,_param->_nb_context);
68  ALLOC1_SC_SIGNAL(out_EVENT_ADDRESS_NEXT                             ,"out_EVENT_ADDRESS_NEXT                             ",Taddress_t,_param->_nb_context);
69  ALLOC1_SC_SIGNAL(out_EVENT_ADDRESS_NEXT_VAL                         ,"out_EVENT_ADDRESS_NEXT_VAL                         ",Tcontrol_t,_param->_nb_context);
70  ALLOC1_SC_SIGNAL(out_EVENT_IS_DS_TAKE                               ,"out_EVENT_IS_DS_TAKE                               ",Tcontrol_t,_param->_nb_context);
71  ALLOC1_SC_SIGNAL(out_EVENT_IFETCH_UNIT_VAL                          ,"out_EVENT_IFETCH_UNIT_VAL                          ",Tcontrol_t,_param->_nb_context);
72  ALLOC1_SC_SIGNAL( in_EVENT_IFETCH_UNIT_ACK                          ," in_EVENT_IFETCH_UNIT_ACK                          ",Tcontrol_t,_param->_nb_context);
73  ALLOC1_SC_SIGNAL(out_EVENT_IFETCH_UNIT_ADDRESS                      ,"out_EVENT_IFETCH_UNIT_ADDRESS                      ",Taddress_t,_param->_nb_context);
74  ALLOC1_SC_SIGNAL(out_EVENT_IFETCH_UNIT_ADDRESS_NEXT                 ,"out_EVENT_IFETCH_UNIT_ADDRESS_NEXT                 ",Taddress_t,_param->_nb_context);
75  ALLOC1_SC_SIGNAL(out_EVENT_IFETCH_UNIT_ADDRESS_NEXT_VAL             ,"out_EVENT_IFETCH_UNIT_ADDRESS_NEXT_VAL             ",Tcontrol_t,_param->_nb_context);
76  ALLOC1_SC_SIGNAL(out_EVENT_IFETCH_UNIT_IS_DS_TAKE                   ,"out_EVENT_IFETCH_UNIT_IS_DS_TAKE                   ",Tcontrol_t,_param->_nb_context);
77  ALLOC1_SC_SIGNAL(out_EVENT_PREDICTION_UNIT_VAL                      ,"out_EVENT_PREDICTION_UNIT_VAL                      ",Tcontrol_t,_param->_nb_context);
78  ALLOC1_SC_SIGNAL( in_EVENT_PREDICTION_UNIT_ACK                      ," in_EVENT_PREDICTION_UNIT_ACK                      ",Tcontrol_t,_param->_nb_context);
79  ALLOC1_SC_SIGNAL(out_EVENT_PREDICTION_UNIT_TYPE                     ,"out_EVENT_PREDICTION_UNIT_TYPE                     ",Tevent_type_t,_param->_nb_context);
80  ALLOC1_SC_SIGNAL(out_EVENT_PREDICTION_UNIT_DEPTH                    ,"out_EVENT_PREDICTION_UNIT_DEPTH                    ",Tdepth_t  ,_param->_nb_context);
81  ALLOC1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_VAL                        ," in_EVENT_CONTEXT_STATE_VAL                        ",Tcontrol_t,_param->_nb_context);
82  ALLOC1_SC_SIGNAL(out_EVENT_CONTEXT_STATE_ACK                        ,"out_EVENT_CONTEXT_STATE_ACK                        ",Tcontrol_t,_param->_nb_context);
83  ALLOC1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_ADDRESS                    ," in_EVENT_CONTEXT_STATE_ADDRESS                    ",Taddress_t,_param->_nb_context);
84  ALLOC1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_ADDRESS_NEXT               ," in_EVENT_CONTEXT_STATE_ADDRESS_NEXT               ",Taddress_t,_param->_nb_context);
85  ALLOC1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_ADDRESS_NEXT_VAL           ," in_EVENT_CONTEXT_STATE_ADDRESS_NEXT_VAL           ",Tcontrol_t,_param->_nb_context);
86  ALLOC1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_IS_DS_TAKE                 ," in_EVENT_CONTEXT_STATE_IS_DS_TAKE                 ",Tcontrol_t,_param->_nb_context);
87  ALLOC1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_TYPE                       ," in_EVENT_CONTEXT_STATE_TYPE                       ",Tevent_type_t,_param->_nb_context);
88  ALLOC1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_DEPTH                      ," in_EVENT_CONTEXT_STATE_DEPTH                      ",Tdepth_t  ,_param->_nb_context);
89  ALLOC1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_FLUSH_ONLY                 ," in_EVENT_CONTEXT_STATE_FLUSH_ONLY                 ",Tcontrol_t,_param->_nb_context);
90
91  ALLOC1_SC_SIGNAL(out_DEPTH_CURRENT                                  ,"out_DEPTH_CURRENT                                  ",Tdepth_t  ,_param->_nb_context);
92  ALLOC1_SC_SIGNAL(out_DEPTH_MIN                                      ,"out_DEPTH_MIN                                      ",Tdepth_t  ,_param->_nb_context);
93  ALLOC1_SC_SIGNAL(out_DEPTH_MAX                                      ,"out_DEPTH_MAX                                      ",Tdepth_t  ,_param->_nb_context);
94  ALLOC1_SC_SIGNAL(out_DEPTH_FULL                                     ,"out_DEPTH_FULL                                     ",Tcontrol_t,_param->_nb_context);
95  ALLOC1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_VAL                      ," in_DEPTH_PREDICTION_UNIT_VAL                      ",Tcontrol_t,_param->_nb_context);
96  ALLOC1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_CURRENT                  ," in_DEPTH_PREDICTION_UNIT_CURRENT                  ",Tdepth_t  ,_param->_nb_context);
97  ALLOC1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_MIN                      ," in_DEPTH_PREDICTION_UNIT_MIN                      ",Tdepth_t  ,_param->_nb_context);
98  ALLOC1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_MAX                      ," in_DEPTH_PREDICTION_UNIT_MAX                      ",Tdepth_t  ,_param->_nb_context);
99  ALLOC1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_FULL                     ," in_DEPTH_PREDICTION_UNIT_FULL                     ",Tcontrol_t,_param->_nb_context);
100  ALLOC1_SC_SIGNAL(out_DEPTH_CONTEXT_STATE_MIN                        ,"out_DEPTH_CONTEXT_STATE_MIN                        ",Tdepth_t  ,_param->_nb_context);
101  ALLOC2_SC_SIGNAL(out_DEPTH_DECOD_UNIT_MIN                           ,"out_DEPTH_DECOD_UNIT_MIN                           ",Tdepth_t  ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
102  ALLOC2_SC_SIGNAL(out_DEPTH_DECOD_UNIT_MAX                           ,"out_DEPTH_DECOD_UNIT_MAX                           ",Tdepth_t  ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
103  ALLOC2_SC_SIGNAL(out_DEPTH_DECOD_UNIT_FULL                          ,"out_DEPTH_DECOD_UNIT_FULL                          ",Tcontrol_t,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
104
105  ALLOC2_SC_SIGNAL(out_CONTEXT_DECOD_UNIT_DEPTH_VAL                   ,"out_CONTEXT_DECOD_UNIT_DEPTH_VAL                   ",Tcontrol_t,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
106  ALLOC2_SC_SIGNAL(out_CONTEXT_DECOD_UNIT_DEPTH                       ,"out_CONTEXT_DECOD_UNIT_DEPTH                       ",Tdepth_t  ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
107
108  ALLOC1_SC_SIGNAL(out_NB_INST_DECOD_ALL                              ,"out_NB_INST_DECOD_ALL                              ",Tcounter_t,_param->_nb_context);
109  ALLOC1_SC_SIGNAL( in_NB_INST_DECOD_UNIT_DECOD_ALL                   ," in_NB_INST_DECOD_UNIT_DECOD_ALL                   ",Tcounter_t,_param->_nb_context);
110  ALLOC1_SC_SIGNAL(out_NB_INST_CONTEXT_STATE_DECOD_ALL                ,"out_NB_INST_CONTEXT_STATE_DECOD_ALL                ",Tcounter_t,_param->_nb_context);
111 
112  /********************************************************
113   * Instanciation
114   ********************************************************/
115 
116  msg(_("<%s> : Instanciation of _Front_end_Glue.\n"),name.c_str());
117
118  (*(_Front_end_Glue->in_CLOCK))        (*(in_CLOCK));
119  (*(_Front_end_Glue->in_NRESET))       (*(in_NRESET));
120
121  if (_param->_have_port_context_id)
122  INSTANCE2_SC_SIGNAL(_Front_end_Glue,out_IFETCH_DECOD_UNIT_CONTEXT_ID                     ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
123  if (_param->_have_port_context_id)
124  INSTANCE2_SC_SIGNAL(_Front_end_Glue,out_DECOD_CONTEXT_ID                                 ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
125  if (_param->_have_port_context_id)
126  INSTANCE2_SC_SIGNAL(_Front_end_Glue, in_DECOD_DECOD_UNIT_CONTEXT_ID                      ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
127
128  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_BRANCH_COMPLETE_VAL                              ,_param->_nb_inst_branch_complete);
129  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_BRANCH_COMPLETE_ACK                              ,_param->_nb_inst_branch_complete);
130  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_BRANCH_COMPLETE_MISS_PREDICTION                  ,_param->_nb_inst_branch_complete);
131  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_BRANCH_COMPLETE_PREDICTION_UNIT_VAL              ,_param->_nb_inst_branch_complete);
132  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_BRANCH_COMPLETE_PREDICTION_UNIT_ACK              ,_param->_nb_inst_branch_complete);
133  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_BRANCH_COMPLETE_PREDICTION_UNIT_MISS_PREDICTION  ,_param->_nb_inst_branch_complete);
134  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_BRANCH_COMPLETE_CONTEXT_STATE_VAL                ,_param->_nb_inst_branch_complete);
135  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_BRANCH_COMPLETE_CONTEXT_STATE_ACK                ,_param->_nb_inst_branch_complete);
136  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_BRANCH_COMPLETE_CONTEXT_STATE_MISS_PREDICTION    ,_param->_nb_inst_branch_complete);
137
138  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_VAL                                        ,_param->_nb_context);
139  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_EVENT_ACK                                        ,_param->_nb_context);
140  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_ADDRESS                                    ,_param->_nb_context);
141  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_ADDRESS_NEXT                               ,_param->_nb_context);
142  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_ADDRESS_NEXT_VAL                           ,_param->_nb_context);
143  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_IS_DS_TAKE                                 ,_param->_nb_context);
144  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_IFETCH_UNIT_VAL                            ,_param->_nb_context);
145  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_EVENT_IFETCH_UNIT_ACK                            ,_param->_nb_context);
146  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_IFETCH_UNIT_ADDRESS                        ,_param->_nb_context);
147  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_IFETCH_UNIT_ADDRESS_NEXT                   ,_param->_nb_context);
148  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_IFETCH_UNIT_ADDRESS_NEXT_VAL               ,_param->_nb_context);
149  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_IFETCH_UNIT_IS_DS_TAKE                     ,_param->_nb_context);
150  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_PREDICTION_UNIT_VAL                        ,_param->_nb_context);
151  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_EVENT_PREDICTION_UNIT_ACK                        ,_param->_nb_context);
152  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_PREDICTION_UNIT_TYPE                       ,_param->_nb_context);
153  if (_param->_have_port_depth)
154  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_PREDICTION_UNIT_DEPTH                      ,_param->_nb_context);
155  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_EVENT_CONTEXT_STATE_VAL                          ,_param->_nb_context);
156  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_CONTEXT_STATE_ACK                          ,_param->_nb_context);
157  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_EVENT_CONTEXT_STATE_ADDRESS                      ,_param->_nb_context);
158  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_EVENT_CONTEXT_STATE_ADDRESS_NEXT                 ,_param->_nb_context);
159  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_EVENT_CONTEXT_STATE_ADDRESS_NEXT_VAL             ,_param->_nb_context);
160  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_EVENT_CONTEXT_STATE_IS_DS_TAKE                   ,_param->_nb_context);
161  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_EVENT_CONTEXT_STATE_TYPE                         ,_param->_nb_context);
162  if (_param->_have_port_depth)
163  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_EVENT_CONTEXT_STATE_DEPTH                        ,_param->_nb_context);
164  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_EVENT_CONTEXT_STATE_FLUSH_ONLY                   ,_param->_nb_context);
165
166  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_DEPTH_PREDICTION_UNIT_VAL                        ,_param->_nb_context);
167  if (_param->_have_port_depth)
168    {
169  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_DEPTH_MIN                                        ,_param->_nb_context);
170  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_DEPTH_PREDICTION_UNIT_CURRENT                    ,_param->_nb_context);
171  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_DEPTH_PREDICTION_UNIT_MIN                        ,_param->_nb_context);
172  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_DEPTH_CONTEXT_STATE_MIN                          ,_param->_nb_context);
173  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_DEPTH_MAX                                        ,_param->_nb_context);
174  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_DEPTH_PREDICTION_UNIT_MAX                        ,_param->_nb_context);
175  INSTANCE2_SC_SIGNAL(_Front_end_Glue,out_DEPTH_DECOD_UNIT_MAX                             ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
176    }
177  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_DEPTH_FULL                                       ,_param->_nb_context);
178  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_DEPTH_PREDICTION_UNIT_FULL                       ,_param->_nb_context);
179  INSTANCE2_SC_SIGNAL(_Front_end_Glue,out_DEPTH_DECOD_UNIT_FULL                            ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
180
181  INSTANCE2_SC_SIGNAL(_Front_end_Glue,out_CONTEXT_DECOD_UNIT_DEPTH_VAL                     ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
182  for (uint32_t i=0; i<_param->_nb_decod_unit; ++i)
183    for (uint32_t j=0; j<_param->_decod_unit_nb_context [i]; ++j)
184      if (_param->_have_port_depth)
185        {
186          INSTANCE0_SC_SIGNAL(_Front_end_Glue,out_DEPTH_DECOD_UNIT_MIN  [i][j]);
187          INSTANCE0_SC_SIGNAL(_Front_end_Glue,out_CONTEXT_DECOD_UNIT_DEPTH [i][j]);
188        }
189
190  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_NB_INST_DECOD_ALL                                ,_param->_nb_context);
191  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_NB_INST_DECOD_UNIT_DECOD_ALL                     ,_param->_nb_context);
192  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_NB_INST_CONTEXT_STATE_DECOD_ALL                  ,_param->_nb_context);
193
194  msg(_("<%s> : Start Simulation ............\n"),name.c_str());
195   
196  Time * _time = new Time();
197
198  /********************************************************
199   * Simulation - Begin
200   ********************************************************/
201
202  // Initialisation
203
204  const uint32_t seed = 0;
205//const uint32_t seed = static_cast<uint32_t>(time(NULL));
206
207  srand(seed);
208
209  SC_START(0);
210  LABEL("Initialisation");
211
212  LABEL("Reset");
213  in_NRESET->write(0);
214  SC_START(5);
215  in_NRESET->write(1); 
216
217  LABEL("Loop of Test");
218
219  for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
220    {
221      LABEL("Iteration %d",iteration);
222
223      SC_START(1);
224    }
225
226  /********************************************************
227   * Simulation - End
228   ********************************************************/
229
230  TEST_OK ("End of Simulation");
231  delete _time;
232
233  msg(_("<%s> : ............ Stop Simulation\n"),name.c_str());
234
235  delete in_CLOCK;
236  delete in_NRESET;
237
238  DELETE2_SC_SIGNAL(out_IFETCH_DECOD_UNIT_CONTEXT_ID                     ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
239
240  DELETE2_SC_SIGNAL(out_DECOD_CONTEXT_ID                                 ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
241  DELETE2_SC_SIGNAL( in_DECOD_DECOD_UNIT_CONTEXT_ID                      ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
242
243  DELETE1_SC_SIGNAL( in_BRANCH_COMPLETE_VAL                              ,_param->_nb_inst_branch_complete);
244  DELETE1_SC_SIGNAL(out_BRANCH_COMPLETE_ACK                              ,_param->_nb_inst_branch_complete);
245  DELETE1_SC_SIGNAL(out_BRANCH_COMPLETE_MISS_PREDICTION                  ,_param->_nb_inst_branch_complete);
246  DELETE1_SC_SIGNAL(out_BRANCH_COMPLETE_PREDICTION_UNIT_VAL              ,_param->_nb_inst_branch_complete);
247  DELETE1_SC_SIGNAL( in_BRANCH_COMPLETE_PREDICTION_UNIT_ACK              ,_param->_nb_inst_branch_complete);
248  DELETE1_SC_SIGNAL( in_BRANCH_COMPLETE_PREDICTION_UNIT_MISS_PREDICTION  ,_param->_nb_inst_branch_complete);
249  DELETE1_SC_SIGNAL(out_BRANCH_COMPLETE_CONTEXT_STATE_VAL                ,_param->_nb_inst_branch_complete);
250  DELETE1_SC_SIGNAL( in_BRANCH_COMPLETE_CONTEXT_STATE_ACK                ,_param->_nb_inst_branch_complete);
251  DELETE1_SC_SIGNAL(out_BRANCH_COMPLETE_CONTEXT_STATE_MISS_PREDICTION    ,_param->_nb_inst_branch_complete);
252
253  DELETE1_SC_SIGNAL(out_EVENT_VAL                                        ,_param->_nb_context);
254  DELETE1_SC_SIGNAL( in_EVENT_ACK                                        ,_param->_nb_context);
255  DELETE1_SC_SIGNAL(out_EVENT_ADDRESS                                    ,_param->_nb_context);
256  DELETE1_SC_SIGNAL(out_EVENT_ADDRESS_NEXT                               ,_param->_nb_context);
257  DELETE1_SC_SIGNAL(out_EVENT_ADDRESS_NEXT_VAL                           ,_param->_nb_context);
258  DELETE1_SC_SIGNAL(out_EVENT_IS_DS_TAKE                                 ,_param->_nb_context);
259  DELETE1_SC_SIGNAL(out_EVENT_IFETCH_UNIT_VAL                            ,_param->_nb_context);
260  DELETE1_SC_SIGNAL( in_EVENT_IFETCH_UNIT_ACK                            ,_param->_nb_context);
261  DELETE1_SC_SIGNAL(out_EVENT_IFETCH_UNIT_ADDRESS                        ,_param->_nb_context);
262  DELETE1_SC_SIGNAL(out_EVENT_IFETCH_UNIT_ADDRESS_NEXT                   ,_param->_nb_context);
263  DELETE1_SC_SIGNAL(out_EVENT_IFETCH_UNIT_ADDRESS_NEXT_VAL               ,_param->_nb_context);
264  DELETE1_SC_SIGNAL(out_EVENT_IFETCH_UNIT_IS_DS_TAKE                     ,_param->_nb_context);
265  DELETE1_SC_SIGNAL(out_EVENT_PREDICTION_UNIT_VAL                        ,_param->_nb_context);
266  DELETE1_SC_SIGNAL( in_EVENT_PREDICTION_UNIT_ACK                        ,_param->_nb_context);
267  DELETE1_SC_SIGNAL(out_EVENT_PREDICTION_UNIT_TYPE                       ,_param->_nb_context);
268  DELETE1_SC_SIGNAL(out_EVENT_PREDICTION_UNIT_DEPTH                      ,_param->_nb_context);
269  DELETE1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_VAL                          ,_param->_nb_context);
270  DELETE1_SC_SIGNAL(out_EVENT_CONTEXT_STATE_ACK                          ,_param->_nb_context);
271  DELETE1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_ADDRESS                      ,_param->_nb_context);
272  DELETE1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_ADDRESS_NEXT                 ,_param->_nb_context);
273  DELETE1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_ADDRESS_NEXT_VAL             ,_param->_nb_context);
274  DELETE1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_IS_DS_TAKE                   ,_param->_nb_context);
275  DELETE1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_TYPE                         ,_param->_nb_context);
276  DELETE1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_DEPTH                        ,_param->_nb_context);
277  DELETE1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_FLUSH_ONLY                   ,_param->_nb_context);
278
279  DELETE1_SC_SIGNAL(out_DEPTH_MIN                                        ,_param->_nb_context);
280  DELETE1_SC_SIGNAL(out_DEPTH_MAX                                        ,_param->_nb_context);
281  DELETE1_SC_SIGNAL(out_DEPTH_FULL                                       ,_param->_nb_context);
282  DELETE1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_VAL                        ,_param->_nb_context);
283  DELETE1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_CURRENT                    ,_param->_nb_context);
284  DELETE1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_MIN                        ,_param->_nb_context);
285  DELETE1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_MAX                        ,_param->_nb_context);
286  DELETE1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_FULL                       ,_param->_nb_context);
287  DELETE1_SC_SIGNAL(out_DEPTH_CONTEXT_STATE_MIN                          ,_param->_nb_context);
288
289  DELETE2_SC_SIGNAL(out_DEPTH_DECOD_UNIT_MIN                             ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
290  DELETE2_SC_SIGNAL(out_DEPTH_DECOD_UNIT_MAX                             ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
291  DELETE2_SC_SIGNAL(out_DEPTH_DECOD_UNIT_FULL                            ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
292
293  DELETE2_SC_SIGNAL(out_CONTEXT_DECOD_UNIT_DEPTH_VAL                     ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
294  DELETE2_SC_SIGNAL(out_CONTEXT_DECOD_UNIT_DEPTH                         ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
295
296  DELETE1_SC_SIGNAL(out_NB_INST_DECOD_ALL                                ,_param->_nb_context);
297  DELETE1_SC_SIGNAL( in_NB_INST_DECOD_UNIT_DECOD_ALL                     ,_param->_nb_context);
298  DELETE1_SC_SIGNAL(out_NB_INST_CONTEXT_STATE_DECOD_ALL                  ,_param->_nb_context);
299    }
300#endif
301
302  delete _Front_end_Glue;
303#ifdef STATISTICS
304  delete _parameters_statistics;
305#endif
306}
Note: See TracBrowser for help on using the repository browser.