source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Dependency_checking_unit/SelfTest/src/test.cpp

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

1) Commit_unit : remove read information of ROB

  • Property svn:keywords set to Id
File size: 26.3 KB
Line 
1/*
2 * $Id: test.cpp 121 2009-05-27 10:13:56Z rosiere $
3 *
4 * [ Description ]
5 *
6 * Test
7 */
8
9#define NB_ITERATION  32
10#define CYCLE_MAX     (128*NB_ITERATION)
11
12#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Dependency_checking_unit/SelfTest/include/test.h"
13#include "Common/include/Test.h"
14#include "Behavioural/include/Allocation.h"
15#include <list>
16
17void test (string name,
18           morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::dependency_checking_unit::Parameters * _param)
19{
20  msg(_("<%s> : Simulation SystemC.\n"),name.c_str());
21
22#ifdef STATISTICS
23  morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,50);
24#endif
25
26  Tusage_t _usage = USE_ALL;
27
28//   _usage = usage_unset(_usage,USE_SYSTEMC              );
29//   _usage = usage_unset(_usage,USE_VHDL                 );
30//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH       );
31//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT);
32//   _usage = usage_unset(_usage,USE_POSITION             );
33//   _usage = usage_unset(_usage,USE_STATISTICS           );
34//   _usage = usage_unset(_usage,USE_INFORMATION          );
35
36  Dependency_checking_unit * _Dependency_checking_unit = new Dependency_checking_unit
37    (name.c_str(),
38#ifdef STATISTICS
39     _parameters_statistics,
40#endif
41     _param,
42     _usage);
43 
44#ifdef SYSTEMC
45  /*********************************************************************
46   * Déclarations des signaux
47   *********************************************************************/
48
49  string rename;
50
51  sc_clock              *  in_CLOCK  = new sc_clock ("clock", 1.0, 0.5);         
52  sc_signal<Tcontrol_t> *  in_NRESET = new sc_signal<Tcontrol_t> ("NRESET");
53
54//   ALLOC1_SC_SIGNAL( in_RENAME_IN_VAL                ," in_RENAME_IN_VAL                ",Tcontrol_t        ,_param->_nb_inst_insert);
55//   ALLOC1_SC_SIGNAL(out_RENAME_IN_ACK                ,"out_RENAME_IN_ACK                ",Tcontrol_t        ,_param->_nb_inst_insert);
56  ALLOC1_SC_SIGNAL( in_RENAME_IN_FRONT_END_ID       ," in_RENAME_IN_FRONT_END_ID       ",Tcontext_t        ,_param->_nb_inst_insert);
57  ALLOC1_SC_SIGNAL( in_RENAME_IN_CONTEXT_ID         ," in_RENAME_IN_CONTEXT_ID         ",Tcontext_t        ,_param->_nb_inst_insert);
58  ALLOC1_SC_SIGNAL( in_RENAME_IN_READ_RA            ," in_RENAME_IN_READ_RA            ",Tcontrol_t        ,_param->_nb_inst_insert);
59  ALLOC1_SC_SIGNAL( in_RENAME_IN_NUM_REG_RA_LOG     ," in_RENAME_IN_NUM_REG_RA_LOG     ",Tgeneral_address_t,_param->_nb_inst_insert);
60  ALLOC1_SC_SIGNAL( in_RENAME_IN_NUM_REG_RA_PHY     ," in_RENAME_IN_NUM_REG_RA_PHY     ",Tgeneral_address_t,_param->_nb_inst_insert);
61  ALLOC1_SC_SIGNAL( in_RENAME_IN_READ_RB            ," in_RENAME_IN_READ_RB            ",Tcontrol_t        ,_param->_nb_inst_insert);
62  ALLOC1_SC_SIGNAL( in_RENAME_IN_NUM_REG_RB_LOG     ," in_RENAME_IN_NUM_REG_RB_LOG     ",Tgeneral_address_t,_param->_nb_inst_insert);
63  ALLOC1_SC_SIGNAL( in_RENAME_IN_NUM_REG_RB_PHY     ," in_RENAME_IN_NUM_REG_RB_PHY     ",Tgeneral_address_t,_param->_nb_inst_insert);
64  ALLOC1_SC_SIGNAL( in_RENAME_IN_READ_RC            ," in_RENAME_IN_READ_RC            ",Tcontrol_t        ,_param->_nb_inst_insert);
65  ALLOC1_SC_SIGNAL( in_RENAME_IN_NUM_REG_RC_LOG     ," in_RENAME_IN_NUM_REG_RC_LOG     ",Tspecial_address_t,_param->_nb_inst_insert);
66  ALLOC1_SC_SIGNAL( in_RENAME_IN_NUM_REG_RC_PHY     ," in_RENAME_IN_NUM_REG_RC_PHY     ",Tspecial_address_t,_param->_nb_inst_insert);
67  ALLOC1_SC_SIGNAL( in_RENAME_IN_WRITE_RD           ," in_RENAME_IN_WRITE_RD           ",Tcontrol_t        ,_param->_nb_inst_insert);
68  ALLOC1_SC_SIGNAL( in_RENAME_IN_NUM_REG_RD_LOG     ," in_RENAME_IN_NUM_REG_RD_LOG     ",Tgeneral_address_t,_param->_nb_inst_insert);
69  ALLOC1_SC_SIGNAL( in_RENAME_IN_NUM_REG_RD_PHY_OLD ," in_RENAME_IN_NUM_REG_RD_PHY_OLD ",Tgeneral_address_t,_param->_nb_inst_insert);
70  ALLOC1_SC_SIGNAL( in_RENAME_IN_NUM_REG_RD_PHY_NEW ," in_RENAME_IN_NUM_REG_RD_PHY_NEW ",Tgeneral_address_t,_param->_nb_inst_insert);
71  ALLOC1_SC_SIGNAL( in_RENAME_IN_WRITE_RE           ," in_RENAME_IN_WRITE_RE           ",Tcontrol_t        ,_param->_nb_inst_insert);
72  ALLOC1_SC_SIGNAL( in_RENAME_IN_NUM_REG_RE_LOG     ," in_RENAME_IN_NUM_REG_RE_LOG     ",Tspecial_address_t,_param->_nb_inst_insert);
73  ALLOC1_SC_SIGNAL( in_RENAME_IN_NUM_REG_RE_PHY_OLD ," in_RENAME_IN_NUM_REG_RE_PHY_OLD ",Tspecial_address_t,_param->_nb_inst_insert);
74  ALLOC1_SC_SIGNAL( in_RENAME_IN_NUM_REG_RE_PHY_NEW ," in_RENAME_IN_NUM_REG_RE_PHY_NEW ",Tspecial_address_t,_param->_nb_inst_insert);
75//   ALLOC1_SC_SIGNAL(out_RENAME_OUT_VAL               ,"out_RENAME_OUT_VAL               ",Tcontrol_t        ,_param->_nb_inst_insert);
76//   ALLOC1_SC_SIGNAL( in_RENAME_OUT_ACK               ," in_RENAME_OUT_ACK               ",Tcontrol_t        ,_param->_nb_inst_insert);
77  ALLOC1_SC_SIGNAL(out_RENAME_OUT_FRONT_END_ID      ,"out_RENAME_OUT_FRONT_END_ID      ",Tcontext_t        ,_param->_nb_inst_insert);
78  ALLOC1_SC_SIGNAL(out_RENAME_OUT_CONTEXT_ID        ,"out_RENAME_OUT_CONTEXT_ID        ",Tcontext_t        ,_param->_nb_inst_insert);
79  ALLOC1_SC_SIGNAL(out_RENAME_OUT_READ_RA           ,"out_RENAME_OUT_READ_RA           ",Tcontrol_t        ,_param->_nb_inst_insert);
80  ALLOC1_SC_SIGNAL(out_RENAME_OUT_NUM_REG_RA_LOG    ,"out_RENAME_OUT_NUM_REG_RA_LOG    ",Tgeneral_address_t,_param->_nb_inst_insert);
81  ALLOC1_SC_SIGNAL(out_RENAME_OUT_NUM_REG_RA_PHY    ,"out_RENAME_OUT_NUM_REG_RA_PHY    ",Tgeneral_address_t,_param->_nb_inst_insert);
82  ALLOC1_SC_SIGNAL(out_RENAME_OUT_READ_RB           ,"out_RENAME_OUT_READ_RB           ",Tcontrol_t        ,_param->_nb_inst_insert);
83  ALLOC1_SC_SIGNAL(out_RENAME_OUT_NUM_REG_RB_LOG    ,"out_RENAME_OUT_NUM_REG_RB_LOG    ",Tgeneral_address_t,_param->_nb_inst_insert);
84  ALLOC1_SC_SIGNAL(out_RENAME_OUT_NUM_REG_RB_PHY    ,"out_RENAME_OUT_NUM_REG_RB_PHY    ",Tgeneral_address_t,_param->_nb_inst_insert);
85  ALLOC1_SC_SIGNAL(out_RENAME_OUT_READ_RC           ,"out_RENAME_OUT_READ_RC           ",Tcontrol_t        ,_param->_nb_inst_insert);
86  ALLOC1_SC_SIGNAL(out_RENAME_OUT_NUM_REG_RC_LOG    ,"out_RENAME_OUT_NUM_REG_RC_LOG    ",Tspecial_address_t,_param->_nb_inst_insert);
87  ALLOC1_SC_SIGNAL(out_RENAME_OUT_NUM_REG_RC_PHY    ,"out_RENAME_OUT_NUM_REG_RC_PHY    ",Tspecial_address_t,_param->_nb_inst_insert);
88  ALLOC1_SC_SIGNAL(out_RENAME_OUT_WRITE_RD          ,"out_RENAME_OUT_WRITE_RD          ",Tcontrol_t        ,_param->_nb_inst_insert);
89  ALLOC1_SC_SIGNAL(out_RENAME_OUT_NUM_REG_RD_LOG    ,"out_RENAME_OUT_NUM_REG_RD_LOG    ",Tgeneral_address_t,_param->_nb_inst_insert);
90  ALLOC1_SC_SIGNAL(out_RENAME_OUT_NUM_REG_RD_PHY_OLD,"out_RENAME_OUT_NUM_REG_RD_PHY_OLD",Tgeneral_address_t,_param->_nb_inst_insert);
91  ALLOC1_SC_SIGNAL(out_RENAME_OUT_NUM_REG_RD_PHY_NEW,"out_RENAME_OUT_NUM_REG_RD_PHY_NEW",Tgeneral_address_t,_param->_nb_inst_insert);
92  ALLOC1_SC_SIGNAL(out_RENAME_OUT_WRITE_RE          ,"out_RENAME_OUT_WRITE_RE          ",Tcontrol_t        ,_param->_nb_inst_insert);
93  ALLOC1_SC_SIGNAL(out_RENAME_OUT_NUM_REG_RE_LOG    ,"out_RENAME_OUT_NUM_REG_RE_LOG    ",Tspecial_address_t,_param->_nb_inst_insert);
94  ALLOC1_SC_SIGNAL(out_RENAME_OUT_NUM_REG_RE_PHY_OLD,"out_RENAME_OUT_NUM_REG_RE_PHY_OLD",Tspecial_address_t,_param->_nb_inst_insert);
95  ALLOC1_SC_SIGNAL(out_RENAME_OUT_NUM_REG_RE_PHY_NEW,"out_RENAME_OUT_NUM_REG_RE_PHY_NEW",Tspecial_address_t,_param->_nb_inst_insert);
96 
97  /********************************************************
98   * Instanciation
99   ********************************************************/
100 
101  msg(_("<%s> : Instanciation of _Dependency_checking_unit.\n"),name.c_str());
102
103  (*(_Dependency_checking_unit->in_CLOCK))        (*(in_CLOCK));
104  (*(_Dependency_checking_unit->in_NRESET))       (*(in_NRESET));
105
106//   INSTANCE1_SC_SIGNAL(_Dependency_checking_unit, in_RENAME_IN_VAL                ,_param->_nb_inst_insert);
107//   INSTANCE1_SC_SIGNAL(_Dependency_checking_unit,out_RENAME_IN_ACK                ,_param->_nb_inst_insert);
108  if (_param->_have_port_front_end_id)
109  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit, in_RENAME_IN_FRONT_END_ID       ,_param->_nb_inst_insert);
110  if (_param->_have_port_context_id)
111  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit, in_RENAME_IN_CONTEXT_ID         ,_param->_nb_inst_insert);
112  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit, in_RENAME_IN_READ_RA            ,_param->_nb_inst_insert);
113  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit, in_RENAME_IN_NUM_REG_RA_LOG     ,_param->_nb_inst_insert);
114  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit, in_RENAME_IN_NUM_REG_RA_PHY     ,_param->_nb_inst_insert);
115  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit, in_RENAME_IN_READ_RB            ,_param->_nb_inst_insert);
116  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit, in_RENAME_IN_NUM_REG_RB_LOG     ,_param->_nb_inst_insert);
117  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit, in_RENAME_IN_NUM_REG_RB_PHY     ,_param->_nb_inst_insert);
118  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit, in_RENAME_IN_READ_RC            ,_param->_nb_inst_insert);
119  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit, in_RENAME_IN_NUM_REG_RC_LOG     ,_param->_nb_inst_insert);
120  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit, in_RENAME_IN_NUM_REG_RC_PHY     ,_param->_nb_inst_insert);
121  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit, in_RENAME_IN_WRITE_RD           ,_param->_nb_inst_insert);
122  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit, in_RENAME_IN_NUM_REG_RD_LOG     ,_param->_nb_inst_insert);
123  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit, in_RENAME_IN_NUM_REG_RD_PHY_OLD ,_param->_nb_inst_insert);
124  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit, in_RENAME_IN_NUM_REG_RD_PHY_NEW ,_param->_nb_inst_insert);
125  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit, in_RENAME_IN_WRITE_RE           ,_param->_nb_inst_insert);
126  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit, in_RENAME_IN_NUM_REG_RE_LOG     ,_param->_nb_inst_insert);
127  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit, in_RENAME_IN_NUM_REG_RE_PHY_OLD ,_param->_nb_inst_insert);
128  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit, in_RENAME_IN_NUM_REG_RE_PHY_NEW ,_param->_nb_inst_insert);
129
130//   INSTANCE1_SC_SIGNAL(_Dependency_checking_unit,out_RENAME_OUT_VAL               ,_param->_nb_inst_insert);
131//   INSTANCE1_SC_SIGNAL(_Dependency_checking_unit, in_RENAME_OUT_ACK               ,_param->_nb_inst_insert);
132  if (_param->_have_port_front_end_id)
133  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit,out_RENAME_OUT_FRONT_END_ID      ,_param->_nb_inst_insert);
134  if (_param->_have_port_context_id)
135  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit,out_RENAME_OUT_CONTEXT_ID        ,_param->_nb_inst_insert);
136  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit,out_RENAME_OUT_READ_RA           ,_param->_nb_inst_insert);
137#ifdef DEBUG
138  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit,out_RENAME_OUT_NUM_REG_RA_LOG    ,_param->_nb_inst_insert);
139#endif
140  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit,out_RENAME_OUT_NUM_REG_RA_PHY    ,_param->_nb_inst_insert);
141  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit,out_RENAME_OUT_READ_RB           ,_param->_nb_inst_insert);
142#ifdef DEBUG
143  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit,out_RENAME_OUT_NUM_REG_RB_LOG    ,_param->_nb_inst_insert);
144#endif
145  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit,out_RENAME_OUT_NUM_REG_RB_PHY    ,_param->_nb_inst_insert);
146  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit,out_RENAME_OUT_READ_RC           ,_param->_nb_inst_insert);
147#ifdef DEBUG
148  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit,out_RENAME_OUT_NUM_REG_RC_LOG    ,_param->_nb_inst_insert);
149#endif
150  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit,out_RENAME_OUT_NUM_REG_RC_PHY    ,_param->_nb_inst_insert);
151  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit,out_RENAME_OUT_WRITE_RD          ,_param->_nb_inst_insert);
152  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit,out_RENAME_OUT_NUM_REG_RD_LOG    ,_param->_nb_inst_insert);
153  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit,out_RENAME_OUT_NUM_REG_RD_PHY_OLD,_param->_nb_inst_insert);
154  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit,out_RENAME_OUT_NUM_REG_RD_PHY_NEW,_param->_nb_inst_insert);
155  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit,out_RENAME_OUT_WRITE_RE          ,_param->_nb_inst_insert);
156  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit,out_RENAME_OUT_NUM_REG_RE_LOG    ,_param->_nb_inst_insert);
157  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit,out_RENAME_OUT_NUM_REG_RE_PHY_OLD,_param->_nb_inst_insert);
158  INSTANCE1_SC_SIGNAL(_Dependency_checking_unit,out_RENAME_OUT_NUM_REG_RE_PHY_NEW,_param->_nb_inst_insert);
159
160  msg(_("<%s> : Start Simulation ............\n"),name.c_str());
161   
162  Time * _time = new Time();
163
164  /********************************************************
165   * Simulation - Begin
166   ********************************************************/
167
168  // Initialisation
169
170  const uint32_t seed = 0;
171//const uint32_t seed = static_cast<uint32_t>(time(NULL));
172
173  srand(seed);
174
175  int32_t percent_transaction_read  = 75;
176  int32_t percent_transaction_write = 75;
177
178  SC_START(0);
179  LABEL("Initialisation");
180
181  LABEL("Reset");
182  in_NRESET->write(0);
183  SC_START(5);
184  in_NRESET->write(1); 
185
186  LABEL("Loop of Test");
187
188  for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
189    {
190      LABEL("Iteration %d",iteration);
191
192      Tgeneral_address_t rat_gpr [_param->_nb_front_end][_param->_max_nb_context][_param->_nb_general_register_logic];
193      Tspecial_address_t rat_spr [_param->_nb_front_end][_param->_max_nb_context][_param->_nb_special_register_logic];
194      std::list<Tgeneral_address_t> free_list_gpr [_param->_nb_front_end][_param->_max_nb_context];
195      std::list<Tspecial_address_t> free_list_spr [_param->_nb_front_end][_param->_max_nb_context]; 
196     
197      for (uint32_t x=0; x< _param->_nb_front_end; x++)
198        for (uint32_t y=0; y<_param->_max_nb_context; y++)
199          {
200            for (uint32_t i=0; i<_param->_nb_general_register_logic; i++)
201              rat_gpr [x][y][i] = i;
202            for (uint32_t i=_param->_nb_general_register_logic; i<_param->_nb_general_register; i++)
203              free_list_gpr[x][y].push_back(i);
204            for (uint32_t i=0; i<_param->_nb_special_register_logic; i++)
205              rat_spr [x][y][i] = i;
206            for (uint32_t i=_param->_nb_special_register_logic; i<_param->_nb_special_register; i++)
207              free_list_spr[x][y].push_back(i);
208          }
209
210      int32_t nb_request = 32;
211
212      while (nb_request >= 0)
213        {
214//        uint32_t nb_in_val  = rand()%_param->_nb_inst_insert;
215//        uint32_t nb_out_ack = rand()%_param->_nb_inst_insert;
216
217          std::list<Tgeneral_address_t>::iterator it_gpr [_param->_nb_front_end][_param->_max_nb_context];
218          std::list<Tspecial_address_t>::iterator it_spr [_param->_nb_front_end][_param->_max_nb_context];
219         
220          for (uint32_t x=0; x< _param->_nb_front_end; x++)
221            for (uint32_t y=0; y<_param->_max_nb_context; y++)
222              {
223                it_gpr [x][y] = free_list_gpr [x][y].begin();
224                it_spr [x][y] = free_list_spr [x][y].begin();
225              }
226
227          for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
228            {
229              Tcontext_t front_end_id= rand()%_param->_nb_front_end;
230              Tcontext_t context_id  = rand()%_param->_max_nb_context;
231
232              Tgeneral_address_t ra_log   = rand()%_param->_nb_general_register_logic;
233              Tgeneral_address_t rb_log   = rand()%_param->_nb_general_register_logic;
234              Tspecial_address_t rc_log   = rand()%_param->_nb_special_register_logic;
235              Tgeneral_address_t rd_log   = rand()%_param->_nb_general_register_logic;
236              Tspecial_address_t re_log   = rand()%_param->_nb_special_register_logic;
237              Tcontrol_t         read_ra  = ((rand()%100)<percent_transaction_read );
238              Tcontrol_t         read_rb  = ((rand()%100)<percent_transaction_read );
239              Tcontrol_t         read_rc  = ((rand()%100)<percent_transaction_read );
240              Tcontrol_t         write_rd = ((rand()%100)<percent_transaction_write)and (i < free_list_gpr [front_end_id][context_id].size());
241              Tcontrol_t         write_re = ((rand()%100)<percent_transaction_write)and (i < free_list_spr [front_end_id][context_id].size());
242
243//            in_RENAME_IN_VAL                [i]->write(i<nb_in_val                              );
244              in_RENAME_IN_FRONT_END_ID       [i]->write(front_end_id                             );
245              in_RENAME_IN_CONTEXT_ID         [i]->write(context_id                               );
246              in_RENAME_IN_READ_RA            [i]->write(read_ra                                  );
247              in_RENAME_IN_NUM_REG_RA_LOG     [i]->write(ra_log                                   );
248              in_RENAME_IN_NUM_REG_RA_PHY     [i]->write(rat_gpr[front_end_id][context_id][ra_log]);
249              in_RENAME_IN_READ_RB            [i]->write(read_rb                                  );
250              in_RENAME_IN_NUM_REG_RB_LOG     [i]->write(rb_log                                   );
251              in_RENAME_IN_NUM_REG_RB_PHY     [i]->write(rat_gpr[front_end_id][context_id][rb_log]);
252              in_RENAME_IN_READ_RC            [i]->write(read_rc                                  );
253              in_RENAME_IN_NUM_REG_RC_LOG     [i]->write(rc_log                                   );
254              in_RENAME_IN_NUM_REG_RC_PHY     [i]->write(rat_spr[front_end_id][context_id][rc_log]);
255              in_RENAME_IN_WRITE_RD           [i]->write(write_rd                                 );
256              in_RENAME_IN_NUM_REG_RD_LOG     [i]->write(rd_log                                   );
257              in_RENAME_IN_NUM_REG_RD_PHY_OLD [i]->write(rat_gpr[front_end_id][context_id][rd_log]);
258              in_RENAME_IN_NUM_REG_RD_PHY_NEW [i]->write((write_rd)?*it_gpr[front_end_id][context_id]:0);
259              in_RENAME_IN_WRITE_RE           [i]->write(write_re                                 );
260              in_RENAME_IN_NUM_REG_RE_LOG     [i]->write(re_log                                   );
261              in_RENAME_IN_NUM_REG_RE_PHY_OLD [i]->write(rat_spr[front_end_id][context_id][re_log]);
262              in_RENAME_IN_NUM_REG_RE_PHY_NEW [i]->write((write_re)?*it_spr[front_end_id][context_id]:0);
263
264//            in_RENAME_OUT_ACK               [i]->write(i<nb_out_ack                             );
265
266              LABEL("Rename_in  [%d]",i);
267              LABEL(" * FRONT_END_ID       : %d",front_end_id                             );
268              LABEL(" * CONTEXT_ID         : %d",context_id                               );
269              LABEL(" * READ_RA            : %d",read_ra                                  );
270              LABEL(" * NUM_REG_RA_LOG     : %d",ra_log                                   );
271              LABEL(" * NUM_REG_RA_PHY     : %d",rat_gpr[front_end_id][context_id][ra_log]);
272              LABEL(" * READ_RB            : %d",read_rb                                  );
273              LABEL(" * NUM_REG_RB_LOG     : %d",rb_log                                   );
274              LABEL(" * NUM_REG_RB_PHY     : %d",rat_gpr[front_end_id][context_id][rb_log]);
275              LABEL(" * READ_RC            : %d",read_rc                                  );
276              LABEL(" * NUM_REG_RC_LOG     : %d",rc_log                                   );
277              LABEL(" * NUM_REG_RC_PHY     : %d",rat_spr[front_end_id][context_id][rc_log]);
278              LABEL(" * WRITE_RD           : %d",write_rd                                 );
279              LABEL(" * NUM_REG_RD_LOG     : %d",rd_log                                   );
280              LABEL(" * NUM_REG_RD_PHY_OLD : %d",rat_gpr[front_end_id][context_id][rd_log]);
281              LABEL(" * NUM_REG_RD_PHY_NEW : %d",(write_rd)?*it_gpr[front_end_id][context_id]:0);
282              LABEL(" * WRITE_RE           : %d",write_re                                 );
283              LABEL(" * NUM_REG_RE_LOG     : %d",re_log                                   );
284              LABEL(" * NUM_REG_RE_PHY_OLD : %d",rat_spr[front_end_id][context_id][re_log]);
285              LABEL(" * NUM_REG_RE_PHY_NEW : %d",(write_re)?*it_spr[front_end_id][context_id]:0);
286             
287
288              if (write_rd)
289                it_gpr[front_end_id][context_id] ++;
290              if (write_re)
291                it_spr[front_end_id][context_id] ++;
292            }
293
294          SC_START(0);
295         
296          for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
297            {
298//            if ( in_RENAME_IN_VAL  [i]->read() ==
299//                out_RENAME_IN_ACK  [i]->read() ==
300//                out_RENAME_OUT_VAL [i]->read() ==
301//                 in_RENAME_OUT_ACK [i]->read() == 1)
302                {
303                  nb_request --;
304
305                  LABEL("Rename_out [%d]",i);
306
307                  Tcontext_t front_end_id= (_param->_have_port_front_end_id)?in_RENAME_IN_FRONT_END_ID [i]->read():0;
308                  Tcontext_t context_id  = (_param->_have_port_context_id  )?in_RENAME_IN_CONTEXT_ID   [i]->read():0;
309                 
310                  if (_param->_have_port_front_end_id)
311                  TEST(Tcontext_t        ,out_RENAME_OUT_FRONT_END_ID       [i]->read(), front_end_id);
312                  if (_param->_have_port_context_id)
313                  TEST(Tcontext_t        ,out_RENAME_OUT_CONTEXT_ID         [i]->read(), context_id);
314
315
316                  Tcontrol_t         read_ra            = in_RENAME_IN_READ_RA            [i]->read();
317                  Tgeneral_address_t num_reg_ra_log     = in_RENAME_IN_NUM_REG_RA_LOG     [i]->read();
318                  Tcontrol_t         read_rb            = in_RENAME_IN_READ_RB            [i]->read();
319                  Tgeneral_address_t num_reg_rb_log     = in_RENAME_IN_NUM_REG_RB_LOG     [i]->read();
320                  Tcontrol_t         read_rc            = in_RENAME_IN_READ_RC            [i]->read();
321                  Tspecial_address_t num_reg_rc_log     = in_RENAME_IN_NUM_REG_RC_LOG     [i]->read();
322                  Tcontrol_t         write_rd           = in_RENAME_IN_WRITE_RD           [i]->read();
323                  Tgeneral_address_t num_reg_rd_log     = in_RENAME_IN_NUM_REG_RD_LOG     [i]->read();
324                  Tgeneral_address_t num_reg_rd_phy_old = in_RENAME_IN_NUM_REG_RD_PHY_OLD [i]->read();
325                  Tgeneral_address_t num_reg_rd_phy_new = in_RENAME_IN_NUM_REG_RD_PHY_NEW [i]->read();
326                  Tcontrol_t         write_re           = in_RENAME_IN_WRITE_RE           [i]->read();
327                  Tspecial_address_t num_reg_re_log     = in_RENAME_IN_NUM_REG_RE_LOG     [i]->read();
328                  Tspecial_address_t num_reg_re_phy_old = in_RENAME_IN_NUM_REG_RE_PHY_OLD [i]->read();
329                  Tspecial_address_t num_reg_re_phy_new = in_RENAME_IN_NUM_REG_RE_PHY_NEW [i]->read();
330
331                  TEST(Tcontrol_t        ,out_RENAME_OUT_READ_RA            [i]->read(), read_ra           );
332#ifdef DEBUG
333                  TEST(Tgeneral_address_t,out_RENAME_OUT_NUM_REG_RA_LOG     [i]->read(), num_reg_ra_log    );
334#endif
335                  if (read_ra)
336                  TEST(Tgeneral_address_t,out_RENAME_OUT_NUM_REG_RA_PHY     [i]->read(), rat_gpr[front_end_id][context_id][num_reg_ra_log]);
337                  TEST(Tcontrol_t        ,out_RENAME_OUT_READ_RB            [i]->read(), read_rb           );
338#ifdef DEBUG
339                  TEST(Tgeneral_address_t,out_RENAME_OUT_NUM_REG_RB_LOG     [i]->read(), num_reg_rb_log    );
340#endif
341                  if (read_rb)
342                  TEST(Tgeneral_address_t,out_RENAME_OUT_NUM_REG_RB_PHY     [i]->read(), rat_gpr[front_end_id][context_id][num_reg_rb_log]);
343                  TEST(Tcontrol_t        ,out_RENAME_OUT_READ_RC            [i]->read(), read_rc           );
344#ifdef DEBUG
345                  TEST(Tspecial_address_t,out_RENAME_OUT_NUM_REG_RC_LOG     [i]->read(), num_reg_rc_log    );
346#endif
347                  if (read_rc)
348                  TEST(Tspecial_address_t,out_RENAME_OUT_NUM_REG_RC_PHY     [i]->read(), rat_spr[front_end_id][context_id][num_reg_rc_log]);
349                  TEST(Tcontrol_t        ,out_RENAME_OUT_WRITE_RD           [i]->read(), write_rd          );
350                  TEST(Tgeneral_address_t,out_RENAME_OUT_NUM_REG_RD_LOG     [i]->read(), num_reg_rd_log    );
351                  if (write_rd)
352                    {
353                  TEST(Tgeneral_address_t,out_RENAME_OUT_NUM_REG_RD_PHY_OLD [i]->read(), rat_gpr[front_end_id][context_id][num_reg_rd_log]);
354                  TEST(Tgeneral_address_t,out_RENAME_OUT_NUM_REG_RD_PHY_NEW [i]->read(), free_list_gpr[front_end_id][context_id].front());
355                    }
356                  TEST(Tcontrol_t        ,out_RENAME_OUT_WRITE_RE           [i]->read(), write_re          );
357                  TEST(Tspecial_address_t,out_RENAME_OUT_NUM_REG_RE_LOG     [i]->read(), num_reg_re_log    );
358                  if (write_re)
359                    {
360                  TEST(Tspecial_address_t,out_RENAME_OUT_NUM_REG_RE_PHY_OLD [i]->read(), rat_spr[front_end_id][context_id][num_reg_re_log]);
361                  TEST(Tspecial_address_t,out_RENAME_OUT_NUM_REG_RE_PHY_NEW [i]->read(), free_list_spr[front_end_id][context_id].front());
362                    }
363
364                  if (write_rd)
365                    {
366                      free_list_gpr[front_end_id][context_id].pop_front();
367                      free_list_gpr[front_end_id][context_id].push_back(num_reg_rd_phy_old);
368                      rat_gpr      [front_end_id][context_id][num_reg_rd_log] = num_reg_rd_phy_new;
369                    }
370                  if (write_re)
371                    {
372                      free_list_spr[front_end_id][context_id].pop_front();
373                      free_list_spr[front_end_id][context_id].push_back(num_reg_re_phy_old);
374                      rat_spr      [front_end_id][context_id][num_reg_re_log] = num_reg_re_phy_new;
375                    }
376                 
377                }
378            }
379          SC_START(1);
380        }
381    }
382
383  /********************************************************
384   * Simulation - End
385   ********************************************************/
386
387  TEST_OK ("End of Simulation");
388  delete _time;
389
390  msg(_("<%s> : ............ Stop Simulation\n"),name.c_str());
391
392  delete in_CLOCK;
393  delete in_NRESET;
394
395//   delete []  in_RENAME_IN_VAL                ;
396//   delete [] out_RENAME_IN_ACK                ;
397  if (_param->_have_port_front_end_id)
398  delete []  in_RENAME_IN_FRONT_END_ID       ;
399  if (_param->_have_port_context_id)
400  delete []  in_RENAME_IN_CONTEXT_ID         ;
401  delete []  in_RENAME_IN_READ_RA            ;
402  delete []  in_RENAME_IN_NUM_REG_RA_LOG     ;
403  delete []  in_RENAME_IN_NUM_REG_RA_PHY     ;
404  delete []  in_RENAME_IN_READ_RB            ;
405  delete []  in_RENAME_IN_NUM_REG_RB_LOG     ;
406  delete []  in_RENAME_IN_NUM_REG_RB_PHY     ;
407  delete []  in_RENAME_IN_READ_RC            ;
408  delete []  in_RENAME_IN_NUM_REG_RC_LOG     ;
409  delete []  in_RENAME_IN_NUM_REG_RC_PHY     ;
410  delete []  in_RENAME_IN_WRITE_RD           ;
411  delete []  in_RENAME_IN_NUM_REG_RD_LOG     ;
412  delete []  in_RENAME_IN_NUM_REG_RD_PHY_OLD ;
413  delete []  in_RENAME_IN_NUM_REG_RD_PHY_NEW ;
414  delete []  in_RENAME_IN_WRITE_RE           ;
415  delete []  in_RENAME_IN_NUM_REG_RE_LOG     ;
416  delete []  in_RENAME_IN_NUM_REG_RE_PHY_OLD ;
417  delete []  in_RENAME_IN_NUM_REG_RE_PHY_NEW ;
418//   delete [] out_RENAME_OUT_VAL               ;
419//   delete []  in_RENAME_OUT_ACK               ;
420  if (_param->_have_port_front_end_id)
421  delete [] out_RENAME_OUT_FRONT_END_ID      ;
422  if (_param->_have_port_context_id)
423  delete [] out_RENAME_OUT_CONTEXT_ID        ;
424  delete [] out_RENAME_OUT_READ_RA           ;
425  delete [] out_RENAME_OUT_NUM_REG_RA_LOG    ;
426  delete [] out_RENAME_OUT_NUM_REG_RA_PHY    ;
427  delete [] out_RENAME_OUT_READ_RB           ;
428  delete [] out_RENAME_OUT_NUM_REG_RB_LOG    ;
429  delete [] out_RENAME_OUT_NUM_REG_RB_PHY    ;
430  delete [] out_RENAME_OUT_READ_RC           ;
431  delete [] out_RENAME_OUT_NUM_REG_RC_LOG    ;
432  delete [] out_RENAME_OUT_NUM_REG_RC_PHY    ;
433  delete [] out_RENAME_OUT_WRITE_RD          ;
434  delete [] out_RENAME_OUT_NUM_REG_RD_LOG    ;
435  delete [] out_RENAME_OUT_NUM_REG_RD_PHY_OLD;
436  delete [] out_RENAME_OUT_NUM_REG_RD_PHY_NEW;
437  delete [] out_RENAME_OUT_WRITE_RE          ;
438  delete [] out_RENAME_OUT_NUM_REG_RE_LOG    ;
439  delete [] out_RENAME_OUT_NUM_REG_RE_PHY_OLD;
440  delete [] out_RENAME_OUT_NUM_REG_RE_PHY_NEW;
441
442#endif
443
444  delete _Dependency_checking_unit;
445#ifdef STATISTICS
446  delete _parameters_statistics;
447#endif
448}
Note: See TracBrowser for help on using the repository browser.