source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/SelfTest/src/test.cpp @ 76

Last change on this file since 76 was 76, checked in by rosiere, 16 years ago

Add new component : Read_unit (no tested)
Change functionnal_unit : now use type and operation to execute the good function
Change New_Component's script

File size: 20.1 KB
Line 
1/*
2 * $Id$
3 *
4 * [ Description ]
5 *
6 * Test
7 */
8
9#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/SelfTest/include/test.h"
10#include "Common/include/Test.h"
11#include "Behavioural/include/Allocation.h"
12
13#define NB_ITERATION  1
14#define CYCLE_MAX     (128*NB_ITERATION)
15
16#define LABEL(str...)                                                   \
17  {                                                                     \
18    msg (_("{%d} "),static_cast<uint32_t>(sc_simulation_time()));       \
19    msg (str);                                                          \
20    msg (_("\n"));                                                      \
21  } while(0)
22
23#define SC_START(cycle_offset)                                                       \
24  do                                                                                 \
25    {                                                                                \
26      /*cout << "SC_START (begin)" << endl;*/                                        \
27                                                                                     \
28      uint32_t cycle_current = static_cast<uint32_t>(sc_simulation_time());          \
29      if (cycle_offset != 0)                                                         \
30        {                                                                            \
31          cout << "##########[ cycle "<< cycle_current+cycle_offset << " ]" << endl; \
32        }                                                                            \
33                                                                                     \
34      if (cycle_current > CYCLE_MAX)                                                 \
35        {                                                                            \
36          TEST_KO("Maximal cycles Reached");                                         \
37        }                                                                            \
38                                                                                     \
39      sc_start(cycle_offset);                                                        \
40                                                                                     \
41      /*cout << "SC_START (end  )" << endl;*/                                        \
42    } while(0)
43
44void test (string name,
45           morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::Parameters * _param)
46{
47  msg(_("<%s> : Simulation SystemC.\n"),name.c_str());
48
49#ifdef STATISTICS
50  morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,50);
51#endif
52
53  Read_unit * _Read_unit = new Read_unit (name.c_str(),
54#ifdef STATISTICS
55                                             _parameters_statistics,
56#endif
57                                             _param);
58 
59#ifdef SYSTEMC
60  /*********************************************************************
61   * Déclarations des signaux
62   *********************************************************************/
63  string rename;
64
65  sc_clock              *  in_CLOCK  = new sc_clock ("clock", 1.0, 0.5);         
66  sc_signal<Tcontrol_t> *  in_NRESET = new sc_signal<Tcontrol_t> ("NRESET");
67
68  ALLOC_SC_SIGNAL ( in_READ_UNIT_IN_VAL                   ," in_READ_UNIT_IN_VAL                   ",Tcontrol_t        );
69  ALLOC_SC_SIGNAL (out_READ_UNIT_IN_ACK                   ,"out_READ_UNIT_IN_ACK                   ",Tcontrol_t        );
70  ALLOC_SC_SIGNAL ( in_READ_UNIT_IN_CONTEXT_ID            ," in_READ_UNIT_IN_CONTEXT_ID            ",Tcontext_t        );
71  ALLOC_SC_SIGNAL ( in_READ_UNIT_IN_FRONT_END_ID          ," in_READ_UNIT_IN_FRONT_END_ID          ",Tcontext_t        );
72  ALLOC_SC_SIGNAL ( in_READ_UNIT_IN_OOO_ENGINE_ID         ," in_READ_UNIT_IN_OOO_ENGINE_ID         ",Tcontext_t        );
73  ALLOC_SC_SIGNAL ( in_READ_UNIT_IN_PACKET_ID             ," in_READ_UNIT_IN_PACKET_ID             ",Tpacket_t         );
74  ALLOC_SC_SIGNAL ( in_READ_UNIT_IN_OPERATION             ," in_READ_UNIT_IN_OPERATION             ",Toperation_t      );
75  ALLOC_SC_SIGNAL ( in_READ_UNIT_IN_TYPE                  ," in_READ_UNIT_IN_TYPE                  ",Ttype_t           );
76  ALLOC_SC_SIGNAL ( in_READ_UNIT_IN_STORE_QUEUE_PTR_WRITE ," in_READ_UNIT_IN_STORE_QUEUE_PTR_WRITE ",Tlsq_ptr_t        );
77  ALLOC_SC_SIGNAL ( in_READ_UNIT_IN_LOAD_QUEUE_PTR_WRITE  ," in_READ_UNIT_IN_LOAD_QUEUE_PTR_WRITE  ",Tlsq_ptr_t        );
78  ALLOC_SC_SIGNAL ( in_READ_UNIT_IN_HAS_IMMEDIAT          ," in_READ_UNIT_IN_HAS_IMMEDIAT          ",Tcontrol_t        );
79  ALLOC_SC_SIGNAL ( in_READ_UNIT_IN_IMMEDIAT              ," in_READ_UNIT_IN_IMMEDIAT              ",Tgeneral_data_t   );
80  ALLOC_SC_SIGNAL ( in_READ_UNIT_IN_READ_RA               ," in_READ_UNIT_IN_READ_RA               ",Tcontrol_t        );
81  ALLOC_SC_SIGNAL ( in_READ_UNIT_IN_NUM_REG_RA            ," in_READ_UNIT_IN_NUM_REG_RA            ",Tgeneral_address_t);
82  ALLOC_SC_SIGNAL ( in_READ_UNIT_IN_READ_RB               ," in_READ_UNIT_IN_READ_RB               ",Tcontrol_t        );
83  ALLOC_SC_SIGNAL ( in_READ_UNIT_IN_NUM_REG_RB            ," in_READ_UNIT_IN_NUM_REG_RB            ",Tgeneral_address_t);
84  ALLOC_SC_SIGNAL ( in_READ_UNIT_IN_READ_RC               ," in_READ_UNIT_IN_READ_RC               ",Tcontrol_t        );
85  ALLOC_SC_SIGNAL ( in_READ_UNIT_IN_NUM_REG_RC            ," in_READ_UNIT_IN_NUM_REG_RC            ",Tspecial_address_t);
86  ALLOC_SC_SIGNAL ( in_READ_UNIT_IN_WRITE_RD              ," in_READ_UNIT_IN_WRITE_RD              ",Tcontrol_t        );
87  ALLOC_SC_SIGNAL ( in_READ_UNIT_IN_NUM_REG_RD            ," in_READ_UNIT_IN_NUM_REG_RD            ",Tgeneral_address_t);
88  ALLOC_SC_SIGNAL ( in_READ_UNIT_IN_WRITE_RE              ," in_READ_UNIT_IN_WRITE_RE              ",Tcontrol_t        );
89  ALLOC_SC_SIGNAL ( in_READ_UNIT_IN_NUM_REG_RE            ," in_READ_UNIT_IN_NUM_REG_RE            ",Tspecial_address_t);
90  ALLOC1_SC_SIGNAL(out_READ_UNIT_OUT_VAL                  ,"out_READ_UNIT_OUT_VAL                  ",Tcontrol_t        ,_param->_nb_inst_retire);
91  ALLOC1_SC_SIGNAL( in_READ_UNIT_OUT_ACK                  ," in_READ_UNIT_OUT_ACK                  ",Tcontrol_t        ,_param->_nb_inst_retire);
92  ALLOC1_SC_SIGNAL(out_READ_UNIT_OUT_CONTEXT_ID           ,"out_READ_UNIT_OUT_CONTEXT_ID           ",Tcontext_t        ,_param->_nb_inst_retire);
93  ALLOC1_SC_SIGNAL(out_READ_UNIT_OUT_FRONT_END_ID         ,"out_READ_UNIT_OUT_FRONT_END_ID         ",Tcontext_t        ,_param->_nb_inst_retire);
94  ALLOC1_SC_SIGNAL(out_READ_UNIT_OUT_OOO_ENGINE_ID        ,"out_READ_UNIT_OUT_OOO_ENGINE_ID        ",Tcontext_t        ,_param->_nb_inst_retire);
95  ALLOC1_SC_SIGNAL(out_READ_UNIT_OUT_PACKET_ID            ,"out_READ_UNIT_OUT_PACKET_ID            ",Tpacket_t         ,_param->_nb_inst_retire);
96  ALLOC1_SC_SIGNAL(out_READ_UNIT_OUT_OPERATION            ,"out_READ_UNIT_OUT_OPERATION            ",Toperation_t      ,_param->_nb_inst_retire);
97  ALLOC1_SC_SIGNAL(out_READ_UNIT_OUT_TYPE                 ,"out_READ_UNIT_OUT_TYPE                 ",Ttype_t           ,_param->_nb_inst_retire);
98  ALLOC1_SC_SIGNAL(out_READ_UNIT_OUT_STORE_QUEUE_PTR_WRITE,"out_READ_UNIT_OUT_STORE_QUEUE_PTR_WRITE",Tlsq_ptr_t        ,_param->_nb_inst_retire);
99  ALLOC1_SC_SIGNAL(out_READ_UNIT_OUT_LOAD_QUEUE_PTR_WRITE ,"out_READ_UNIT_OUT_LOAD_QUEUE_PTR_WRITE ",Tlsq_ptr_t        ,_param->_nb_inst_retire);
100  ALLOC1_SC_SIGNAL(out_READ_UNIT_OUT_HAS_IMMEDIAT         ,"out_READ_UNIT_OUT_HAS_IMMEDIAT         ",Tcontrol_t        ,_param->_nb_inst_retire);
101  ALLOC1_SC_SIGNAL(out_READ_UNIT_OUT_IMMEDIAT             ,"out_READ_UNIT_OUT_IMMEDIAT             ",Tgeneral_data_t   ,_param->_nb_inst_retire);
102  ALLOC1_SC_SIGNAL(out_READ_UNIT_OUT_DATA_RA              ,"out_READ_UNIT_OUT_DATA_RA              ",Tgeneral_data_t   ,_param->_nb_inst_retire);
103  ALLOC1_SC_SIGNAL(out_READ_UNIT_OUT_DATA_RB              ,"out_READ_UNIT_OUT_DATA_RB              ",Tgeneral_data_t   ,_param->_nb_inst_retire);
104  ALLOC1_SC_SIGNAL(out_READ_UNIT_OUT_DATA_RC              ,"out_READ_UNIT_OUT_DATA_RC              ",Tspecial_data_t   ,_param->_nb_inst_retire);
105  ALLOC1_SC_SIGNAL(out_READ_UNIT_OUT_WRITE_RD             ,"out_READ_UNIT_OUT_WRITE_RD             ",Tcontrol_t        ,_param->_nb_inst_retire);
106  ALLOC1_SC_SIGNAL(out_READ_UNIT_OUT_NUM_REG_RD           ,"out_READ_UNIT_OUT_NUM_REG_RD           ",Tgeneral_address_t,_param->_nb_inst_retire);
107  ALLOC1_SC_SIGNAL(out_READ_UNIT_OUT_WRITE_RE             ,"out_READ_UNIT_OUT_WRITE_RE             ",Tcontrol_t        ,_param->_nb_inst_retire);
108  ALLOC1_SC_SIGNAL(out_READ_UNIT_OUT_NUM_REG_RE           ,"out_READ_UNIT_OUT_NUM_REG_RE           ",Tspecial_address_t,_param->_nb_inst_retire);
109  ALLOC1_SC_SIGNAL(out_GPR_READ_VAL                       ,"out_GPR_READ_VAL                       ",Tcontrol_t        ,_param->_nb_gpr_read);
110  ALLOC1_SC_SIGNAL( in_GPR_READ_ACK                       ," in_GPR_READ_ACK                       ",Tcontrol_t        ,_param->_nb_gpr_read);
111  ALLOC1_SC_SIGNAL(out_GPR_READ_OOO_ENGINE_ID             ,"out_GPR_READ_OOO_ENGINE_ID             ",Tcontext_t        ,_param->_nb_gpr_read);
112  ALLOC1_SC_SIGNAL(out_GPR_READ_NUM_REG                   ,"out_GPR_READ_NUM_REG                   ",Tgeneral_address_t,_param->_nb_gpr_read);
113  ALLOC1_SC_SIGNAL( in_GPR_READ_DATA                      ," in_GPR_READ_DATA                      ",Tgeneral_data_t   ,_param->_nb_gpr_read);
114  ALLOC1_SC_SIGNAL( in_GPR_READ_DATA_VAL                  ," in_GPR_READ_DATA_VAL                  ",Tcontrol_t        ,_param->_nb_gpr_read);
115  ALLOC1_SC_SIGNAL(out_SPR_READ_VAL                       ,"out_SPR_READ_VAL                       ",Tcontrol_t        ,_param->_nb_spr_read);
116  ALLOC1_SC_SIGNAL( in_SPR_READ_ACK                       ," in_SPR_READ_ACK                       ",Tcontrol_t        ,_param->_nb_spr_read);
117  ALLOC1_SC_SIGNAL(out_SPR_READ_OOO_ENGINE_ID             ,"out_SPR_READ_OOO_ENGINE_ID             ",Tcontext_t        ,_param->_nb_spr_read);
118  ALLOC1_SC_SIGNAL(out_SPR_READ_NUM_REG                   ,"out_SPR_READ_NUM_REG                   ",Tspecial_address_t,_param->_nb_spr_read);
119  ALLOC1_SC_SIGNAL( in_SPR_READ_DATA                      ," in_SPR_READ_DATA                      ",Tspecial_data_t   ,_param->_nb_spr_read);
120  ALLOC1_SC_SIGNAL( in_SPR_READ_DATA_VAL                  ," in_SPR_READ_DATA_VAL                  ",Tcontrol_t        ,_param->_nb_spr_read);
121  ALLOC1_SC_SIGNAL( in_GPR_WRITE_VAL                      ," in_GPR_WRITE_VAL                      ",Tcontrol_t        ,_param->_nb_gpr_write);
122  ALLOC1_SC_SIGNAL( in_GPR_WRITE_OOO_ENGINE_ID            ," in_GPR_WRITE_OOO_ENGINE_ID            ",Tcontext_t        ,_param->_nb_gpr_write);
123  ALLOC1_SC_SIGNAL( in_GPR_WRITE_NUM_REG                  ," in_GPR_WRITE_NUM_REG                  ",Tgeneral_address_t,_param->_nb_gpr_write);
124  ALLOC1_SC_SIGNAL( in_GPR_WRITE_DATA                     ," in_GPR_WRITE_DATA                     ",Tgeneral_data_t   ,_param->_nb_gpr_write);
125  ALLOC1_SC_SIGNAL( in_SPR_WRITE_VAL                      ," in_SPR_WRITE_VAL                      ",Tcontrol_t        ,_param->_nb_spr_write);
126  ALLOC1_SC_SIGNAL( in_SPR_WRITE_OOO_ENGINE_ID            ," in_SPR_WRITE_OOO_ENGINE_ID            ",Tcontext_t        ,_param->_nb_spr_write);
127  ALLOC1_SC_SIGNAL( in_SPR_WRITE_NUM_REG                  ," in_SPR_WRITE_NUM_REG                  ",Tspecial_address_t,_param->_nb_spr_write);
128  ALLOC1_SC_SIGNAL( in_SPR_WRITE_DATA                     ," in_SPR_WRITE_DATA                     ",Tspecial_data_t   ,_param->_nb_spr_write);
129  ALLOC1_SC_SIGNAL( in_BYPASS_WRITE_OOO_ENGINE_ID         ," in_BYPASS_WRITE_OOO_ENGINE_ID         ",Tcontext_t        ,_param->_nb_bypass_write);
130  ALLOC1_SC_SIGNAL( in_BYPASS_WRITE_GPR_VAL               ," in_BYPASS_WRITE_GPR_VAL               ",Tcontrol_t        ,_param->_nb_bypass_write);
131  ALLOC1_SC_SIGNAL( in_BYPASS_WRITE_GPR_NUM_REG           ," in_BYPASS_WRITE_GPR_NUM_REG           ",Tgeneral_address_t,_param->_nb_bypass_write);
132  ALLOC1_SC_SIGNAL( in_BYPASS_WRITE_GPR_DATA              ," in_BYPASS_WRITE_GPR_DATA              ",Tgeneral_data_t   ,_param->_nb_bypass_write);
133  ALLOC1_SC_SIGNAL( in_BYPASS_WRITE_SPR_VAL               ," in_BYPASS_WRITE_SPR_VAL               ",Tcontrol_t        ,_param->_nb_bypass_write);
134  ALLOC1_SC_SIGNAL( in_BYPASS_WRITE_SPR_NUM_REG           ," in_BYPASS_WRITE_SPR_NUM_REG           ",Tspecial_address_t,_param->_nb_bypass_write);
135  ALLOC1_SC_SIGNAL( in_BYPASS_WRITE_SPR_DATA              ," in_BYPASS_WRITE_SPR_DATA              ",Tspecial_data_t   ,_param->_nb_bypass_write);
136  ALLOC1_SC_SIGNAL( in_BYPASS_MEMORY_VAL                  ," in_BYPASS_MEMORY_VAL                  ",Tcontrol_t        ,_param->_nb_bypass_memory);
137  ALLOC1_SC_SIGNAL( in_BYPASS_MEMORY_OOO_ENGINE_ID        ," in_BYPASS_MEMORY_OOO_ENGINE_ID        ",Tcontext_t        ,_param->_nb_bypass_memory);
138  ALLOC1_SC_SIGNAL( in_BYPASS_MEMORY_NUM_REG              ," in_BYPASS_MEMORY_NUM_REG              ",Tgeneral_address_t,_param->_nb_bypass_memory);
139  ALLOC1_SC_SIGNAL( in_BYPASS_MEMORY_DATA                 ," in_BYPASS_MEMORY_DATA                 ",Tgeneral_data_t   ,_param->_nb_bypass_memory);
140 
141  /********************************************************
142   * Instanciation
143   ********************************************************/
144 
145  msg(_("<%s> : Instanciation of _Read_unit.\n"),name.c_str());
146
147  (*(_Read_unit->in_CLOCK))        (*(in_CLOCK));
148  (*(_Read_unit->in_NRESET))       (*(in_NRESET));
149
150  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_VAL                   );
151  INSTANCE_SC_SIGNAL (_Read_unit,out_READ_UNIT_IN_ACK                   );
152  if (_param->_have_port_context_id)
153  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_CONTEXT_ID            );
154  if (_param->_have_port_front_end_id)
155  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_FRONT_END_ID          );
156  if (_param->_have_port_ooo_engine_id)
157  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_OOO_ENGINE_ID         );
158  if (_param->_have_port_packet_id)
159  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_PACKET_ID             );
160  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_OPERATION             );
161  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_TYPE                  );
162  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_STORE_QUEUE_PTR_WRITE );
163  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_LOAD_QUEUE_PTR_WRITE  );
164  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_HAS_IMMEDIAT          );
165  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_IMMEDIAT              );
166  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_READ_RA               );
167  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_NUM_REG_RA            );
168  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_READ_RB               );
169  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_NUM_REG_RB            );
170  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_READ_RC               );
171  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_NUM_REG_RC            );
172  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_WRITE_RD              );
173  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_NUM_REG_RD            );
174  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_WRITE_RE              );
175  INSTANCE_SC_SIGNAL (_Read_unit, in_READ_UNIT_IN_NUM_REG_RE            );
176  INSTANCE1_SC_SIGNAL(_Read_unit,out_READ_UNIT_OUT_VAL                  ,_param->_nb_inst_retire);
177  INSTANCE1_SC_SIGNAL(_Read_unit, in_READ_UNIT_OUT_ACK                  ,_param->_nb_inst_retire);
178  if (_param->_have_port_context_id)
179  INSTANCE1_SC_SIGNAL(_Read_unit,out_READ_UNIT_OUT_CONTEXT_ID           ,_param->_nb_inst_retire);
180  if (_param->_have_port_front_end_id)
181  INSTANCE1_SC_SIGNAL(_Read_unit,out_READ_UNIT_OUT_FRONT_END_ID         ,_param->_nb_inst_retire);
182  if (_param->_have_port_ooo_engine_id)
183  INSTANCE1_SC_SIGNAL(_Read_unit,out_READ_UNIT_OUT_OOO_ENGINE_ID        ,_param->_nb_inst_retire);
184  if (_param->_have_port_packet_id)
185  INSTANCE1_SC_SIGNAL(_Read_unit,out_READ_UNIT_OUT_PACKET_ID            ,_param->_nb_inst_retire);
186  INSTANCE1_SC_SIGNAL(_Read_unit,out_READ_UNIT_OUT_OPERATION            ,_param->_nb_inst_retire);
187  INSTANCE1_SC_SIGNAL(_Read_unit,out_READ_UNIT_OUT_TYPE                 ,_param->_nb_inst_retire);
188  INSTANCE1_SC_SIGNAL(_Read_unit,out_READ_UNIT_OUT_STORE_QUEUE_PTR_WRITE,_param->_nb_inst_retire);
189  INSTANCE1_SC_SIGNAL(_Read_unit,out_READ_UNIT_OUT_LOAD_QUEUE_PTR_WRITE ,_param->_nb_inst_retire);
190  INSTANCE1_SC_SIGNAL(_Read_unit,out_READ_UNIT_OUT_HAS_IMMEDIAT         ,_param->_nb_inst_retire);
191  INSTANCE1_SC_SIGNAL(_Read_unit,out_READ_UNIT_OUT_IMMEDIAT             ,_param->_nb_inst_retire);
192  INSTANCE1_SC_SIGNAL(_Read_unit,out_READ_UNIT_OUT_DATA_RA              ,_param->_nb_inst_retire);
193  INSTANCE1_SC_SIGNAL(_Read_unit,out_READ_UNIT_OUT_DATA_RB              ,_param->_nb_inst_retire);
194  INSTANCE1_SC_SIGNAL(_Read_unit,out_READ_UNIT_OUT_DATA_RC              ,_param->_nb_inst_retire);
195  INSTANCE1_SC_SIGNAL(_Read_unit,out_READ_UNIT_OUT_WRITE_RD             ,_param->_nb_inst_retire);
196  INSTANCE1_SC_SIGNAL(_Read_unit,out_READ_UNIT_OUT_NUM_REG_RD           ,_param->_nb_inst_retire);
197  INSTANCE1_SC_SIGNAL(_Read_unit,out_READ_UNIT_OUT_WRITE_RE             ,_param->_nb_inst_retire);
198  INSTANCE1_SC_SIGNAL(_Read_unit,out_READ_UNIT_OUT_NUM_REG_RE           ,_param->_nb_inst_retire);
199  INSTANCE1_SC_SIGNAL(_Read_unit,out_GPR_READ_VAL                       ,_param->_nb_gpr_read);
200  INSTANCE1_SC_SIGNAL(_Read_unit, in_GPR_READ_ACK                       ,_param->_nb_gpr_read);
201  if (_param->_have_port_ooo_engine_id)
202  INSTANCE1_SC_SIGNAL(_Read_unit,out_GPR_READ_OOO_ENGINE_ID             ,_param->_nb_gpr_read);
203  INSTANCE1_SC_SIGNAL(_Read_unit,out_GPR_READ_NUM_REG                   ,_param->_nb_gpr_read);
204  INSTANCE1_SC_SIGNAL(_Read_unit, in_GPR_READ_DATA                      ,_param->_nb_gpr_read);
205  INSTANCE1_SC_SIGNAL(_Read_unit, in_GPR_READ_DATA_VAL                  ,_param->_nb_gpr_read);
206  INSTANCE1_SC_SIGNAL(_Read_unit,out_SPR_READ_VAL                       ,_param->_nb_spr_read);
207  INSTANCE1_SC_SIGNAL(_Read_unit, in_SPR_READ_ACK                       ,_param->_nb_spr_read);
208  if (_param->_have_port_ooo_engine_id)
209  INSTANCE1_SC_SIGNAL(_Read_unit,out_SPR_READ_OOO_ENGINE_ID             ,_param->_nb_spr_read);
210  INSTANCE1_SC_SIGNAL(_Read_unit,out_SPR_READ_NUM_REG                   ,_param->_nb_spr_read);
211  INSTANCE1_SC_SIGNAL(_Read_unit, in_SPR_READ_DATA                      ,_param->_nb_spr_read);
212  INSTANCE1_SC_SIGNAL(_Read_unit, in_SPR_READ_DATA_VAL                  ,_param->_nb_spr_read);
213  INSTANCE1_SC_SIGNAL(_Read_unit, in_GPR_WRITE_VAL                      ,_param->_nb_gpr_write);
214  if (_param->_have_port_ooo_engine_id)
215  INSTANCE1_SC_SIGNAL(_Read_unit, in_GPR_WRITE_OOO_ENGINE_ID            ,_param->_nb_gpr_write);
216  INSTANCE1_SC_SIGNAL(_Read_unit, in_GPR_WRITE_NUM_REG                  ,_param->_nb_gpr_write);
217  INSTANCE1_SC_SIGNAL(_Read_unit, in_GPR_WRITE_DATA                     ,_param->_nb_gpr_write);
218  INSTANCE1_SC_SIGNAL(_Read_unit, in_SPR_WRITE_VAL                      ,_param->_nb_spr_write);
219  if (_param->_have_port_ooo_engine_id)
220  INSTANCE1_SC_SIGNAL(_Read_unit, in_SPR_WRITE_OOO_ENGINE_ID            ,_param->_nb_spr_write);
221  INSTANCE1_SC_SIGNAL(_Read_unit, in_SPR_WRITE_NUM_REG                  ,_param->_nb_spr_write);
222  INSTANCE1_SC_SIGNAL(_Read_unit, in_SPR_WRITE_DATA                     ,_param->_nb_spr_write);
223  if (_param->_have_port_ooo_engine_id)
224  INSTANCE1_SC_SIGNAL(_Read_unit, in_BYPASS_WRITE_OOO_ENGINE_ID         ,_param->_nb_bypass_write);
225  INSTANCE1_SC_SIGNAL(_Read_unit, in_BYPASS_WRITE_GPR_VAL               ,_param->_nb_bypass_write);
226  INSTANCE1_SC_SIGNAL(_Read_unit, in_BYPASS_WRITE_GPR_NUM_REG           ,_param->_nb_bypass_write);
227  INSTANCE1_SC_SIGNAL(_Read_unit, in_BYPASS_WRITE_GPR_DATA              ,_param->_nb_bypass_write);
228  INSTANCE1_SC_SIGNAL(_Read_unit, in_BYPASS_WRITE_SPR_VAL               ,_param->_nb_bypass_write);
229  INSTANCE1_SC_SIGNAL(_Read_unit, in_BYPASS_WRITE_SPR_NUM_REG           ,_param->_nb_bypass_write);
230  INSTANCE1_SC_SIGNAL(_Read_unit, in_BYPASS_WRITE_SPR_DATA              ,_param->_nb_bypass_write);
231  INSTANCE1_SC_SIGNAL(_Read_unit, in_BYPASS_MEMORY_VAL                  ,_param->_nb_bypass_memory);
232  if (_param->_have_port_ooo_engine_id)
233  INSTANCE1_SC_SIGNAL(_Read_unit, in_BYPASS_MEMORY_OOO_ENGINE_ID        ,_param->_nb_bypass_memory);
234  INSTANCE1_SC_SIGNAL(_Read_unit, in_BYPASS_MEMORY_NUM_REG              ,_param->_nb_bypass_memory);
235  INSTANCE1_SC_SIGNAL(_Read_unit, in_BYPASS_MEMORY_DATA                 ,_param->_nb_bypass_memory);
236 
237  msg(_("<%s> : Start Simulation ............\n"),name.c_str());
238   
239  Time * _time = new Time();
240
241  /********************************************************
242   * Simulation - Begin
243   ********************************************************/
244
245  // Initialisation
246
247  const uint32_t seed = 0;
248//const uint32_t seed = static_cast<uint32_t>(time(NULL));
249
250  srand(seed);
251
252  SC_START(0);
253  LABEL("Initialisation");
254
255  LABEL("Reset");
256  in_NRESET->write(0);
257  SC_START(5);
258  in_NRESET->write(1); 
259
260  LABEL("Loop of Test");
261
262  for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++)
263    {
264      LABEL("Iteration %d",iteration);
265
266      SC_START(1);
267    }
268
269  /********************************************************
270   * Simulation - End
271   ********************************************************/
272
273  TEST_OK ("End of Simulation");
274  delete _time;
275
276  msg(_("<%s> : ............ Stop Simulation\n"),name.c_str());
277
278  delete in_CLOCK;
279  delete in_NRESET;
280#endif
281
282  delete _Read_unit;
283#ifdef STATISTICS
284  delete _parameters_statistics;
285#endif
286}
Note: See TracBrowser for help on using the repository browser.