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

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

1) Stat_list : fix retire old and new register bug
2) Stat_list : remove read_counter and valid flag, because validation of destination is in retire step (not in commit step)
3) Model : add class Model (cf Morpheo.sim)
4) Allocation : alloc_interface_begin and alloc_interface_end to delete temporary array.
5) Script : add distexe.sh
6) Add Comparator, Multiplier, Divider. But this component are not implemented
7) Software : add Dhrystone

  • Property svn:keywords set to Id
File size: 23.6 KB
Line 
1/*
2 * $Id: test.cpp 112 2009-03-18 22:36: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
90  ALLOC1_SC_SIGNAL(out_DEPTH_CURRENT                                  ,"out_DEPTH_CURRENT                                  ",Tdepth_t  ,_param->_nb_context);
91  ALLOC1_SC_SIGNAL(out_DEPTH_MIN                                      ,"out_DEPTH_MIN                                      ",Tdepth_t  ,_param->_nb_context);
92  ALLOC1_SC_SIGNAL(out_DEPTH_MAX                                      ,"out_DEPTH_MAX                                      ",Tdepth_t  ,_param->_nb_context);
93  ALLOC1_SC_SIGNAL(out_DEPTH_FULL                                     ,"out_DEPTH_FULL                                     ",Tcontrol_t,_param->_nb_context);
94  ALLOC1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_VAL                      ," in_DEPTH_PREDICTION_UNIT_VAL                      ",Tcontrol_t,_param->_nb_context);
95  ALLOC1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_CURRENT                  ," in_DEPTH_PREDICTION_UNIT_CURRENT                  ",Tdepth_t  ,_param->_nb_context);
96  ALLOC1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_MIN                      ," in_DEPTH_PREDICTION_UNIT_MIN                      ",Tdepth_t  ,_param->_nb_context);
97  ALLOC1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_MAX                      ," in_DEPTH_PREDICTION_UNIT_MAX                      ",Tdepth_t  ,_param->_nb_context);
98  ALLOC1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_FULL                     ," in_DEPTH_PREDICTION_UNIT_FULL                     ",Tcontrol_t,_param->_nb_context);
99  ALLOC1_SC_SIGNAL(out_DEPTH_CONTEXT_STATE_MIN                        ,"out_DEPTH_CONTEXT_STATE_MIN                        ",Tdepth_t  ,_param->_nb_context);
100  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]);
101  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]);
102  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]);
103
104  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]);
105  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]);
106
107  ALLOC1_SC_SIGNAL(out_NB_INST_DECOD_ALL                              ,"out_NB_INST_DECOD_ALL                              ",Tcounter_t,_param->_nb_context);
108  ALLOC1_SC_SIGNAL( in_NB_INST_DECOD_UNIT_DECOD_ALL                   ," in_NB_INST_DECOD_UNIT_DECOD_ALL                   ",Tcounter_t,_param->_nb_context);
109  ALLOC1_SC_SIGNAL(out_NB_INST_CONTEXT_STATE_DECOD_ALL                ,"out_NB_INST_CONTEXT_STATE_DECOD_ALL                ",Tcounter_t,_param->_nb_context);
110 
111  /********************************************************
112   * Instanciation
113   ********************************************************/
114 
115  msg(_("<%s> : Instanciation of _Front_end_Glue.\n"),name.c_str());
116
117  (*(_Front_end_Glue->in_CLOCK))        (*(in_CLOCK));
118  (*(_Front_end_Glue->in_NRESET))       (*(in_NRESET));
119
120  if (_param->_have_port_context_id)
121  INSTANCE2_SC_SIGNAL(_Front_end_Glue,out_IFETCH_DECOD_UNIT_CONTEXT_ID                     ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
122  if (_param->_have_port_context_id)
123  INSTANCE2_SC_SIGNAL(_Front_end_Glue,out_DECOD_CONTEXT_ID                                 ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
124  if (_param->_have_port_context_id)
125  INSTANCE2_SC_SIGNAL(_Front_end_Glue, in_DECOD_DECOD_UNIT_CONTEXT_ID                      ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
126
127  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_BRANCH_COMPLETE_VAL                              ,_param->_nb_inst_branch_complete);
128  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_BRANCH_COMPLETE_ACK                              ,_param->_nb_inst_branch_complete);
129  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_BRANCH_COMPLETE_MISS_PREDICTION                  ,_param->_nb_inst_branch_complete);
130  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_BRANCH_COMPLETE_PREDICTION_UNIT_VAL              ,_param->_nb_inst_branch_complete);
131  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_BRANCH_COMPLETE_PREDICTION_UNIT_ACK              ,_param->_nb_inst_branch_complete);
132  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_BRANCH_COMPLETE_PREDICTION_UNIT_MISS_PREDICTION  ,_param->_nb_inst_branch_complete);
133  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_BRANCH_COMPLETE_CONTEXT_STATE_VAL                ,_param->_nb_inst_branch_complete);
134  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_BRANCH_COMPLETE_CONTEXT_STATE_ACK                ,_param->_nb_inst_branch_complete);
135  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_BRANCH_COMPLETE_CONTEXT_STATE_MISS_PREDICTION    ,_param->_nb_inst_branch_complete);
136
137  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_VAL                                        ,_param->_nb_context);
138  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_EVENT_ACK                                        ,_param->_nb_context);
139  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_ADDRESS                                    ,_param->_nb_context);
140  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_ADDRESS_NEXT                               ,_param->_nb_context);
141  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_ADDRESS_NEXT_VAL                           ,_param->_nb_context);
142  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_IS_DS_TAKE                                 ,_param->_nb_context);
143  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_IFETCH_UNIT_VAL                            ,_param->_nb_context);
144  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_EVENT_IFETCH_UNIT_ACK                            ,_param->_nb_context);
145  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_IFETCH_UNIT_ADDRESS                        ,_param->_nb_context);
146  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_IFETCH_UNIT_ADDRESS_NEXT                   ,_param->_nb_context);
147  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_IFETCH_UNIT_ADDRESS_NEXT_VAL               ,_param->_nb_context);
148  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_IFETCH_UNIT_IS_DS_TAKE                     ,_param->_nb_context);
149  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_PREDICTION_UNIT_VAL                        ,_param->_nb_context);
150  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_EVENT_PREDICTION_UNIT_ACK                        ,_param->_nb_context);
151  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_PREDICTION_UNIT_TYPE                       ,_param->_nb_context);
152  if (_param->_have_port_depth)
153  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_PREDICTION_UNIT_DEPTH                      ,_param->_nb_context);
154  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_EVENT_CONTEXT_STATE_VAL                          ,_param->_nb_context);
155  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_EVENT_CONTEXT_STATE_ACK                          ,_param->_nb_context);
156  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_EVENT_CONTEXT_STATE_ADDRESS                      ,_param->_nb_context);
157  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_EVENT_CONTEXT_STATE_ADDRESS_NEXT                 ,_param->_nb_context);
158  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_EVENT_CONTEXT_STATE_ADDRESS_NEXT_VAL             ,_param->_nb_context);
159  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_EVENT_CONTEXT_STATE_IS_DS_TAKE                   ,_param->_nb_context);
160  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_EVENT_CONTEXT_STATE_TYPE                         ,_param->_nb_context);
161  if (_param->_have_port_depth)
162  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_EVENT_CONTEXT_STATE_DEPTH                        ,_param->_nb_context);
163
164  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_DEPTH_PREDICTION_UNIT_VAL                        ,_param->_nb_context);
165  if (_param->_have_port_depth)
166    {
167  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_DEPTH_MIN                                        ,_param->_nb_context);
168  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_DEPTH_PREDICTION_UNIT_CURRENT                    ,_param->_nb_context);
169  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_DEPTH_PREDICTION_UNIT_MIN                        ,_param->_nb_context);
170  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_DEPTH_CONTEXT_STATE_MIN                          ,_param->_nb_context);
171  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_DEPTH_MAX                                        ,_param->_nb_context);
172  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_DEPTH_PREDICTION_UNIT_MAX                        ,_param->_nb_context);
173  INSTANCE2_SC_SIGNAL(_Front_end_Glue,out_DEPTH_DECOD_UNIT_MAX                             ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
174    }
175  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_DEPTH_FULL                                       ,_param->_nb_context);
176  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_DEPTH_PREDICTION_UNIT_FULL                       ,_param->_nb_context);
177  INSTANCE2_SC_SIGNAL(_Front_end_Glue,out_DEPTH_DECOD_UNIT_FULL                            ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
178
179  INSTANCE2_SC_SIGNAL(_Front_end_Glue,out_CONTEXT_DECOD_UNIT_DEPTH_VAL                     ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
180  for (uint32_t i=0; i<_param->_nb_decod_unit; ++i)
181    for (uint32_t j=0; j<_param->_decod_unit_nb_context [i]; ++j)
182      if (_param->_have_port_depth)
183        {
184          INSTANCE0_SC_SIGNAL(_Front_end_Glue,out_DEPTH_DECOD_UNIT_MIN  [i][j]);
185          INSTANCE0_SC_SIGNAL(_Front_end_Glue,out_CONTEXT_DECOD_UNIT_DEPTH [i][j]);
186        }
187
188  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_NB_INST_DECOD_ALL                                ,_param->_nb_context);
189  INSTANCE1_SC_SIGNAL(_Front_end_Glue, in_NB_INST_DECOD_UNIT_DECOD_ALL                     ,_param->_nb_context);
190  INSTANCE1_SC_SIGNAL(_Front_end_Glue,out_NB_INST_CONTEXT_STATE_DECOD_ALL                  ,_param->_nb_context);
191
192  msg(_("<%s> : Start Simulation ............\n"),name.c_str());
193   
194  Time * _time = new Time();
195
196  /********************************************************
197   * Simulation - Begin
198   ********************************************************/
199
200  // Initialisation
201
202  const uint32_t seed = 0;
203//const uint32_t seed = static_cast<uint32_t>(time(NULL));
204
205  srand(seed);
206
207  SC_START(0);
208  LABEL("Initialisation");
209
210  LABEL("Reset");
211  in_NRESET->write(0);
212  SC_START(5);
213  in_NRESET->write(1); 
214
215  LABEL("Loop of Test");
216
217  for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
218    {
219      LABEL("Iteration %d",iteration);
220
221      SC_START(1);
222    }
223
224  /********************************************************
225   * Simulation - End
226   ********************************************************/
227
228  TEST_OK ("End of Simulation");
229  delete _time;
230
231  msg(_("<%s> : ............ Stop Simulation\n"),name.c_str());
232
233  delete in_CLOCK;
234  delete in_NRESET;
235
236  DELETE2_SC_SIGNAL(out_IFETCH_DECOD_UNIT_CONTEXT_ID                     ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
237
238  DELETE2_SC_SIGNAL(out_DECOD_CONTEXT_ID                                 ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
239  DELETE2_SC_SIGNAL( in_DECOD_DECOD_UNIT_CONTEXT_ID                      ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
240
241  DELETE1_SC_SIGNAL( in_BRANCH_COMPLETE_VAL                              ,_param->_nb_inst_branch_complete);
242  DELETE1_SC_SIGNAL(out_BRANCH_COMPLETE_ACK                              ,_param->_nb_inst_branch_complete);
243  DELETE1_SC_SIGNAL(out_BRANCH_COMPLETE_MISS_PREDICTION                  ,_param->_nb_inst_branch_complete);
244  DELETE1_SC_SIGNAL(out_BRANCH_COMPLETE_PREDICTION_UNIT_VAL              ,_param->_nb_inst_branch_complete);
245  DELETE1_SC_SIGNAL( in_BRANCH_COMPLETE_PREDICTION_UNIT_ACK              ,_param->_nb_inst_branch_complete);
246  DELETE1_SC_SIGNAL( in_BRANCH_COMPLETE_PREDICTION_UNIT_MISS_PREDICTION  ,_param->_nb_inst_branch_complete);
247  DELETE1_SC_SIGNAL(out_BRANCH_COMPLETE_CONTEXT_STATE_VAL                ,_param->_nb_inst_branch_complete);
248  DELETE1_SC_SIGNAL( in_BRANCH_COMPLETE_CONTEXT_STATE_ACK                ,_param->_nb_inst_branch_complete);
249  DELETE1_SC_SIGNAL(out_BRANCH_COMPLETE_CONTEXT_STATE_MISS_PREDICTION    ,_param->_nb_inst_branch_complete);
250
251  DELETE1_SC_SIGNAL(out_EVENT_VAL                                        ,_param->_nb_context);
252  DELETE1_SC_SIGNAL( in_EVENT_ACK                                        ,_param->_nb_context);
253  DELETE1_SC_SIGNAL(out_EVENT_ADDRESS                                    ,_param->_nb_context);
254  DELETE1_SC_SIGNAL(out_EVENT_ADDRESS_NEXT                               ,_param->_nb_context);
255  DELETE1_SC_SIGNAL(out_EVENT_ADDRESS_NEXT_VAL                           ,_param->_nb_context);
256  DELETE1_SC_SIGNAL(out_EVENT_IS_DS_TAKE                                 ,_param->_nb_context);
257  DELETE1_SC_SIGNAL(out_EVENT_IFETCH_UNIT_VAL                            ,_param->_nb_context);
258  DELETE1_SC_SIGNAL( in_EVENT_IFETCH_UNIT_ACK                            ,_param->_nb_context);
259  DELETE1_SC_SIGNAL(out_EVENT_IFETCH_UNIT_ADDRESS                        ,_param->_nb_context);
260  DELETE1_SC_SIGNAL(out_EVENT_IFETCH_UNIT_ADDRESS_NEXT                   ,_param->_nb_context);
261  DELETE1_SC_SIGNAL(out_EVENT_IFETCH_UNIT_ADDRESS_NEXT_VAL               ,_param->_nb_context);
262  DELETE1_SC_SIGNAL(out_EVENT_IFETCH_UNIT_IS_DS_TAKE                     ,_param->_nb_context);
263  DELETE1_SC_SIGNAL(out_EVENT_PREDICTION_UNIT_VAL                        ,_param->_nb_context);
264  DELETE1_SC_SIGNAL( in_EVENT_PREDICTION_UNIT_ACK                        ,_param->_nb_context);
265  DELETE1_SC_SIGNAL(out_EVENT_PREDICTION_UNIT_TYPE                       ,_param->_nb_context);
266  DELETE1_SC_SIGNAL(out_EVENT_PREDICTION_UNIT_DEPTH                      ,_param->_nb_context);
267  DELETE1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_VAL                          ,_param->_nb_context);
268  DELETE1_SC_SIGNAL(out_EVENT_CONTEXT_STATE_ACK                          ,_param->_nb_context);
269  DELETE1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_ADDRESS                      ,_param->_nb_context);
270  DELETE1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_ADDRESS_NEXT                 ,_param->_nb_context);
271  DELETE1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_ADDRESS_NEXT_VAL             ,_param->_nb_context);
272  DELETE1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_IS_DS_TAKE                   ,_param->_nb_context);
273  DELETE1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_TYPE                         ,_param->_nb_context);
274  DELETE1_SC_SIGNAL( in_EVENT_CONTEXT_STATE_DEPTH                        ,_param->_nb_context);
275
276  DELETE1_SC_SIGNAL(out_DEPTH_MIN                                        ,_param->_nb_context);
277  DELETE1_SC_SIGNAL(out_DEPTH_MAX                                        ,_param->_nb_context);
278  DELETE1_SC_SIGNAL(out_DEPTH_FULL                                       ,_param->_nb_context);
279  DELETE1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_VAL                        ,_param->_nb_context);
280  DELETE1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_CURRENT                    ,_param->_nb_context);
281  DELETE1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_MIN                        ,_param->_nb_context);
282  DELETE1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_MAX                        ,_param->_nb_context);
283  DELETE1_SC_SIGNAL( in_DEPTH_PREDICTION_UNIT_FULL                       ,_param->_nb_context);
284  DELETE1_SC_SIGNAL(out_DEPTH_CONTEXT_STATE_MIN                          ,_param->_nb_context);
285
286  DELETE2_SC_SIGNAL(out_DEPTH_DECOD_UNIT_MIN                             ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
287  DELETE2_SC_SIGNAL(out_DEPTH_DECOD_UNIT_MAX                             ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
288  DELETE2_SC_SIGNAL(out_DEPTH_DECOD_UNIT_FULL                            ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
289
290  DELETE2_SC_SIGNAL(out_CONTEXT_DECOD_UNIT_DEPTH_VAL                     ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
291  DELETE2_SC_SIGNAL(out_CONTEXT_DECOD_UNIT_DEPTH                         ,_param->_nb_decod_unit,_param->_decod_unit_nb_context [it1]);
292
293  DELETE1_SC_SIGNAL(out_NB_INST_DECOD_ALL                                ,_param->_nb_context);
294  DELETE1_SC_SIGNAL( in_NB_INST_DECOD_UNIT_DECOD_ALL                     ,_param->_nb_context);
295  DELETE1_SC_SIGNAL(out_NB_INST_CONTEXT_STATE_DECOD_ALL                  ,_param->_nb_context);
296    }
297#endif
298
299  delete _Front_end_Glue;
300#ifdef STATISTICS
301  delete _parameters_statistics;
302#endif
303}
Note: See TracBrowser for help on using the repository browser.