OpenCores
URL https://opencores.org/ocsvn/ht_tunnel/ht_tunnel/trunk

Subversion Repositories ht_tunnel

[/] [ht_tunnel/] [tags/] [START/] [bench/] [vc_ht_tunnel_l1_tb/] [main.cpp] - Blame information for rev 21

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 acastong
//main.cpp for vc_ht_tunnel_l1 testbench
2
 
3
/* ***** BEGIN LICENSE BLOCK *****
4
 * Version: MPL 1.1
5
 *
6
 * The contents of this file are subject to the Mozilla Public License Version
7
 * 1.1 (the "License"); you may not use this file except in compliance with
8
 * the License. You may obtain a copy of the License at
9
 * http://www.mozilla.org/MPL/
10
 *
11
 * Software distributed under the License is distributed on an "AS IS" basis,
12
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13
 * for the specific language governing rights and limitations under the
14
 * License.
15
 *
16
 * The Original Code is HyperTransport Tunnel IP Core.
17
 *
18
 * The Initial Developer of the Original Code is
19
 * Ecole Polytechnique de Montreal.
20
 * Portions created by the Initial Developer are Copyright (C) 2005
21
 * the Initial Developer. All Rights Reserved.
22
 *
23
 * Contributor(s):
24
 *   Ami Castonguay <acastong@grm.polymtl.ca>
25
 *
26
 * Alternatively, the contents of this file may be used under the terms
27
 * of the Polytechnique HyperTransport Tunnel IP Core Source Code License
28
 * (the  "PHTICSCL License", see the file PHTICSCL.txt), in which case the
29
 * provisions of PHTICSCL License are applicable instead of those
30
 * above. If you wish to allow use of your version of this file only
31
 * under the terms of the PHTICSCL License and not to allow others to use
32
 * your version of this file under the MPL, indicate your decision by
33
 * deleting the provisions above and replace them with the notice and
34
 * other provisions required by the PHTICSCL License. If you do not delete
35
 * the provisions above, a recipient may use your version of this file
36
 * under either the MPL or the PHTICSCL License."
37
 *
38
 * ***** END LICENSE BLOCK ***** */
39
 
40
#ifdef MTI_SYSTEMC
41
//For ModelSim simulation, top simulation must be contained within
42
//a module instanciated in a .h
43
#include "main.h"
44
//Directive to mark the top level of the simulated design
45
SC_MODULE_EXPORT(top);
46
 
47
//MTI_SYSTEMC does not work on all version of ModelSim, this is a fallback
48
#elif MTI2_SYSTEMC
49
 
50
//For ModelSim simulation, top simulation must be contained within
51
//a module instanciated in a .h
52
#include "main.h"
53
//Directive to mark the top level of the simulated design
54
SC_MODULE_EXPORT(top);
55
 
56
//If not in ModelSim simulation, proceed with the standard procedure
57
#else
58
 
59
#include "../../rtl/systemc/core_synth/synth_datatypes.h"
60
 
61
#include <iostream>
62
#include <string>
63
#include <sstream>
64
#include <iomanip>
65
#include <ctime>
66
 
67
#include "../../rtl/systemc/vc_ht_tunnel_l1/vc_ht_tunnel_l1.h"
68
#include "../../rtl/systemc/flow_control_l2/user_fifo_l3.h"
69
#include "../../rtl/systemc/flow_control_l2/history_buffer_l3.h"
70
#include "vc_ht_tunnel_l1_tb.h"
71
 
72
using namespace std;
73
 
74
// Main fonction
75
int sc_main( int argc, char* argv[] )
76
{
77
 
78
    sc_clock clk("CLOCK",1,SC_NS);
79
 
80
        //------------------------------------------
81
        // Instanciation de FLOW CONTROL
82
        //------------------------------------------
83
        vc_ht_tunnel_l1* the_ht_tunnel = new vc_ht_tunnel_l1("the_ht_tunnel");
84
        vc_ht_tunnel_l1_tb * tb = new vc_ht_tunnel_l1_tb("vc_ht_tunnel_l1_tb");
85
 
86
        // ***************************************************
87
        //  Signals
88
        // ***************************************************  
89
        /// The Clock, LDTSTOP and reset signals
90
        sc_signal<bool>                 resetx;
91
        sc_signal<bool>                 pwrok;
92
        sc_signal<bool>                 ldtstopx;
93
 
94
        //Link0 signals
95
        //sc_signal<bool >              receive_clk0;
96
        sc_signal<bool>                                         phy0_available_lk0;
97
        sc_signal<sc_bv<CAD_IN_DEPTH> >         phy0_ctl_lk0;
98
        sc_signal<sc_bv<CAD_IN_DEPTH> >         phy0_cad_lk0[CAD_IN_WIDTH];
99
 
100
        //sc_signal< bool >     transmit_clk0;
101
        sc_signal<sc_bv<CAD_OUT_DEPTH> >        lk0_ctl_phy0;
102
        sc_signal<sc_bv<CAD_OUT_DEPTH> >        lk0_cad_phy0[CAD_OUT_WIDTH];
103
        sc_signal<bool>                                         phy0_consume_lk0;
104
 
105
        sc_signal<bool>                 lk0_disable_drivers_phy0;
106
        sc_signal<bool>                 lk0_disable_receivers_phy0;
107
 
108
#ifndef INTERNAL_SHIFTER_ALIGNMENT
109
        ///High speed deserializer should stall shifting bits for lk_deser_stall_cycles_phy cycles
110
        /** Cannot be asserted with a lk_deser_stall_cycles_phy value of 0*/
111
        sc_signal<bool > lk0_deser_stall_phy0;
112
        ///Number of bit times to stall deserializing incoming data when lk_deser_stall_phy is asserted
113
        sc_signal<sc_uint<LOG2_CAD_IN_DEPTH> > lk0_deser_stall_cycles_phy0;
114
#endif
115
 
116
        //Link1 signals
117
        //sc_signal<bool >              receive_clk1;
118
        sc_signal<bool>                                         phy1_available_lk1;
119
        sc_signal<sc_bv<CAD_IN_DEPTH> >         phy1_ctl_lk1;
120
        sc_signal<sc_bv<CAD_IN_DEPTH> >         phy1_cad_lk1[CAD_IN_WIDTH];
121
 
122
        //sc_signal< bool >     transmit_clk0;
123
        sc_signal<sc_bv<CAD_OUT_DEPTH> >        lk1_ctl_phy1;
124
        sc_signal<sc_bv<CAD_OUT_DEPTH> >        lk1_cad_phy1[CAD_OUT_WIDTH];
125
        sc_signal<bool>                                         phy1_consume_lk1;
126
 
127
        sc_signal<bool>                 lk1_disable_drivers_phy1;
128
        sc_signal<bool>                 lk1_disable_receivers_phy1;
129
 
130
#ifndef INTERNAL_SHIFTER_ALIGNMENT
131
        ///High speed deserializer should stall shifting bits for lk_deser_stall_cycles_phy cycles
132
        /** Cannot be asserted with a lk_deser_stall_cycles_phy value of 0*/
133
        sc_signal<bool > lk1_deser_stall_phy1;
134
        ///Number of bit times to stall deserializing incoming data when lk_deser_stall_phy is asserted
135
        sc_signal<sc_uint<LOG2_CAD_IN_DEPTH> > lk1_deser_stall_cycles_phy1;
136
#endif
137
 
138
        /////////////////////////////////////////////////////
139
        // Interface to UserInterface memory - synchronous
140
        /////////////////////////////////////////////////////
141
 
142
        sc_signal<bool> ui_memory_write0;
143
        sc_signal<bool> ui_memory_write1;//20
144
        sc_signal<sc_bv<USER_MEMORY_ADDRESS_WIDTH> > ui_memory_write_address;
145
        sc_signal<sc_bv<32> > ui_memory_write_data;
146
 
147
        sc_signal<sc_bv<USER_MEMORY_ADDRESS_WIDTH> > ui_memory_read_address0;
148
        sc_signal<sc_bv<USER_MEMORY_ADDRESS_WIDTH> > ui_memory_read_address1;
149
        sc_signal<sc_bv<32> > ui_memory_read_data0;
150
        sc_signal<sc_bv<32> > ui_memory_read_data1;
151
 
152
#ifdef RETRY_MODE_ENABLED
153
        //////////////////////////////////////////
154
        //      Memory interface flowcontrol0- synchronous
155
        /////////////////////////////////////////
156
        sc_signal<bool> history_memory_write0;
157
        sc_signal<sc_uint<LOG2_HISTORY_MEMORY_SIZE> > history_memory_write_address0;
158
        sc_signal<sc_bv<32> > history_memory_write_data0;
159
        sc_signal<sc_uint<LOG2_HISTORY_MEMORY_SIZE> > history_memory_read_address0;//30
160
        sc_signal<sc_bv<32> > history_memory_output0;
161
 
162
        //////////////////////////////////////////
163
        //      Memory interface flowcontrol1- synchronous
164
        /////////////////////////////////////////
165
        sc_signal<bool> history_memory_write1;
166
        sc_signal<sc_uint<LOG2_HISTORY_MEMORY_SIZE> > history_memory_write_address1;
167
        sc_signal<sc_bv<32> > history_memory_write_data1;
168
        sc_signal<sc_uint<LOG2_HISTORY_MEMORY_SIZE> > history_memory_read_address1;
169
        sc_signal<sc_bv<32> > history_memory_output1;
170
 
171
#endif
172
 
173
        ////////////////////////////////////
174
        // Memory interface databuffer0 - synchronous
175
        ////////////////////////////////////
176
 
177
        sc_signal<bool> memory_write0;
178
        sc_signal<sc_uint<2> > memory_write_address_vc0;
179
        sc_signal<sc_uint<BUFFERS_ADDRESS_WIDTH> > memory_write_address_buffer0;
180
        sc_signal<sc_uint<4> > memory_write_address_pos0;//40
181
        sc_signal<sc_bv<32> > memory_write_data0;
182
 
183
        sc_signal<sc_uint<2> > memory_read_address_vc0[2];
184
        sc_signal<sc_uint<BUFFERS_ADDRESS_WIDTH> >memory_read_address_buffer0[2];
185
        sc_signal<sc_uint<4> > memory_read_address_pos0[2];//50
186
 
187
        sc_signal<sc_bv<32> > memory_output0[2];
188
 
189
        //////////////////////////////////////
190
        // Memory interface databuffer1 - synchronous
191
        ////////////////////////////////////
192
 
193
        sc_signal<bool> memory_write1;
194
        sc_signal<sc_uint<2> > memory_write_address_vc1;
195
        sc_signal<sc_uint<BUFFERS_ADDRESS_WIDTH> > memory_write_address_buffer1;
196
        sc_signal<sc_uint<4> > memory_write_address_pos1;
197
        sc_signal<sc_bv<32> > memory_write_data1;
198
 
199
        sc_signal<sc_uint<2> > memory_read_address_vc1[2];
200
        sc_signal<sc_uint<BUFFERS_ADDRESS_WIDTH> >memory_read_address_buffer1[2];
201
        sc_signal<sc_uint<4> > memory_read_address_pos1[2];
202
 
203
        sc_signal<sc_bv<32> > memory_output1[2];
204
 
205
 
206
        ///////////////////////////////////////
207
        // Interface to command memory 0
208
        ///////////////////////////////////////
209
        sc_signal<sc_bv<CMD_BUFFER_MEM_WIDTH> > ro0_command_packet_wr_data;
210
        sc_signal<bool > ro0_command_packet_write;
211
        sc_signal<sc_uint<LOG2_NB_OF_BUFFERS+2> > ro0_command_packet_wr_addr;
212
        sc_signal<sc_uint<LOG2_NB_OF_BUFFERS+2> > ro0_command_packet_rd_addr[2];
213
        sc_signal<sc_bv<CMD_BUFFER_MEM_WIDTH> > command_packet_rd_data_ro0[2];
214
 
215
        ///////////////////////////////////////
216
        // Interface to command memory 1
217
        ///////////////////////////////////////
218
        sc_signal<sc_bv<CMD_BUFFER_MEM_WIDTH> > ro1_command_packet_wr_data;
219
        sc_signal<bool > ro1_command_packet_write;
220
        sc_signal<sc_uint<LOG2_NB_OF_BUFFERS+2> > ro1_command_packet_wr_addr;
221
        sc_signal<sc_uint<LOG2_NB_OF_BUFFERS+2> > ro1_command_packet_rd_addr[2];
222
        sc_signal<sc_bv<CMD_BUFFER_MEM_WIDTH> > command_packet_rd_data_ro1[2];
223
 
224
 
225
        //************************************
226
        // Reset generated by link
227
        //************************************
228
        //sc_signal<bool>               warmrstx;
229
        //sc_signal<bool>               coldrstx;
230
 
231
        //sc_signal<bool>               dummy_warmrstx;
232
        //sc_signal<bool>               dummy_coldrstx;
233
 
234
        //******************************************
235
        //                      Signals to User
236
        //******************************************
237
        //------------------------------------------
238
        // Signals to send received packets to User
239
        //------------------------------------------
240
 
241
 
242
        /**The actual control/data packet to the user*/
243
        sc_signal<sc_bv<64> >           ui_packet_usr;
244
 
245
        /**The virtual channel of the ctl/data packet*/
246
        sc_signal<VirtualChannel>       ui_vc_usr;
247
 
248
        /**The side from which came the packet*/
249
        sc_signal< bool >                       ui_side_usr;
250
 
251
        /**If the packet is a direct_route packet - only valid for
252
           requests (posted and non-posted) */
253
        sc_signal<bool>                 ui_directroute_usr;
254
 
255
        /**If this is the last part of the packet*/
256
        sc_signal< bool >                       ui_eop_usr;
257
 
258
        /**If there is another packet available*/
259
        sc_signal< bool >                       ui_available_usr;
260
 
261
        /**If what is read is 64 bits or 32 bits*/
262
        sc_signal< bool >                       ui_output_64bits_usr;
263
 
264
        /**To allow the user to consume the packets*/
265
        sc_signal< bool >                       usr_consume_ui;
266
 
267
 
268
        //------------------------------------------
269
        // Signals to allow the User to send packets
270
        //------------------------------------------
271
 
272
        /**The actual control/data packet from the user*/
273
        sc_signal<sc_bv<64> >           usr_packet_ui;
274
 
275
        /**If there is another packet available*/
276
        sc_signal< bool >                       usr_available_ui;
277
 
278
        /**
279
        The side to send the packet if it is a response
280
        This bit is ignored if the packet is not a response
281
        since the side to send a request is determined automatically
282
        taking in acount DirectRoute functionnality.
283
        */
284
        sc_signal< bool >                       usr_side_ui;
285
 
286
        /**If the packet is trying to be sent to a VC that is full,
287
        We let the user know that he is doing something illegal
288
        Packet is not consumed if this is 1
289
        */
290
        //sc_signal < bool >            ui_invalid_usr;
291
 
292
        /**Which what type of ctl packets can be sent to side0*/
293
        sc_signal<sc_bv<6> >            ui_freevc0_usr;
294
        /**Which what type of ctl packets can be sent to side0*/
295
        sc_signal<sc_bv<6> >            ui_freevc1_usr;
296
 
297
        //-----------------------------------------------
298
        // Content of CSR that might be useful to user
299
        //-----------------------------------------------
300
        /** Signals table containing all 40 bits Base Addresses from BARs implemented */
301
        sc_signal<sc_bv<40> > csr_bar[NbRegsBars];
302
        /** Signal from register Interface->Command->csr_unit_id */
303
        sc_signal<sc_bv<5> > csr_unit_id;
304
 
305
        //------------------------------------------
306
        // Signals to affect CSR
307
        //------------------------------------------
308
        sc_signal<bool> usr_receivedResponseError_csr;
309
 
310
        //--------------------------------------------------------
311
        // Interface for having registers outside CSR if necessary
312
        //--------------------------------------------------------
313
 
314
        ///Signals to allow external registers with minimal logic
315
        /**
316
                Connect usr_read_data_csr to zeroes if not used!
317
        */
318
        //@{
319
        sc_signal<sc_uint<6> >  csr_read_addr_usr;
320
        sc_signal<sc_bv<32> >   usr_read_data_csr;
321
        sc_signal<bool >        csr_write_usr;
322
        sc_signal<sc_uint<6> >  csr_write_addr_usr;
323
        sc_signal<sc_bv<32> >   csr_write_data_usr;
324
        /**Every bit is a byte mask for the dword to write*/
325
        sc_signal<sc_bv<4> >    csr_write_mask_usr;
326
        //@}
327
 
328
        // ***************************************************
329
        //  LINKING DUT
330
        // ***************************************************  
331
 
332
        the_ht_tunnel->clk(clk);
333
        the_ht_tunnel->resetx(resetx);
334
        the_ht_tunnel->pwrok(pwrok);
335
        the_ht_tunnel->ldtstopx(ldtstopx);
336
 
337
        the_ht_tunnel->phy0_available_lk0(phy0_available_lk0);
338
        the_ht_tunnel->phy0_ctl_lk0(phy0_ctl_lk0);
339
 
340
        for(int n = 0; n < CAD_IN_WIDTH; n++){
341
                the_ht_tunnel->phy0_cad_lk0[n](phy0_cad_lk0[n]);
342
                the_ht_tunnel->lk0_cad_phy0[n](lk0_cad_phy0[n]);
343
                the_ht_tunnel->phy1_cad_lk1[n](phy1_cad_lk1[n]);
344
                the_ht_tunnel->lk1_cad_phy1[n](lk1_cad_phy1[n]);
345
        }
346
 
347
        the_ht_tunnel->lk0_ctl_phy0(lk0_ctl_phy0);
348
        the_ht_tunnel->phy0_consume_lk0(phy0_consume_lk0);
349
 
350
        the_ht_tunnel->lk0_disable_drivers_phy0(lk0_disable_drivers_phy0);
351
        the_ht_tunnel->lk0_disable_receivers_phy0(lk0_disable_receivers_phy0);
352
 
353
#ifndef INTERNAL_SHIFTER_ALIGNMENT
354
        the_ht_tunnel->lk0_deser_stall_phy0(lk0_deser_stall_phy0);
355
        the_ht_tunnel->lk0_deser_stall_cycles_phy0(lk0_deser_stall_cycles_phy0);
356
#endif
357
 
358
        the_ht_tunnel->phy1_available_lk1(phy1_available_lk1);
359
        the_ht_tunnel->phy1_ctl_lk1(phy1_ctl_lk1);
360
 
361
        the_ht_tunnel->lk1_ctl_phy1(lk1_ctl_phy1);
362
        the_ht_tunnel->phy1_consume_lk1(phy1_consume_lk1);
363
 
364
        the_ht_tunnel->lk1_disable_drivers_phy1(lk1_disable_drivers_phy1);
365
        the_ht_tunnel->lk1_disable_receivers_phy1(lk1_disable_receivers_phy1);
366
 
367
#ifndef INTERNAL_SHIFTER_ALIGNMENT
368
        the_ht_tunnel->lk1_deser_stall_phy1(lk1_deser_stall_phy1);
369
        the_ht_tunnel->lk1_deser_stall_cycles_phy1(lk1_deser_stall_cycles_phy1);
370
#endif
371
 
372
        the_ht_tunnel->ui_memory_write0(ui_memory_write0);
373
        the_ht_tunnel->ui_memory_write1(ui_memory_write1);//20
374
        the_ht_tunnel->ui_memory_write_address(ui_memory_write_address);
375
        the_ht_tunnel->ui_memory_write_data(ui_memory_write_data);
376
 
377
        the_ht_tunnel->ui_memory_read_address0(ui_memory_read_address0);
378
        the_ht_tunnel->ui_memory_read_address1(ui_memory_read_address1);
379
        the_ht_tunnel->ui_memory_read_data0(ui_memory_read_data0);
380
        the_ht_tunnel->ui_memory_read_data1(ui_memory_read_data1);
381
 
382
#ifdef RETRY_MODE_ENABLED
383
        the_ht_tunnel->history_memory_write0(history_memory_write0);
384
        the_ht_tunnel->history_memory_write_address0(history_memory_write_address0);
385
        the_ht_tunnel->history_memory_write_data0(history_memory_write_data0);
386
        the_ht_tunnel->history_memory_read_address0(history_memory_read_address0);//30
387
        the_ht_tunnel->history_memory_output0(history_memory_output0);
388
 
389
        the_ht_tunnel->history_memory_write1(history_memory_write1);
390
        the_ht_tunnel->history_memory_write_address1(history_memory_write_address1);
391
        the_ht_tunnel->history_memory_write_data1(history_memory_write_data1);
392
        the_ht_tunnel->history_memory_read_address1(history_memory_read_address1);
393
        the_ht_tunnel->history_memory_output1(history_memory_output1);
394
 
395
#endif
396
 
397
 
398
        the_ht_tunnel->memory_write0(memory_write0);
399
        the_ht_tunnel->memory_write_address_vc0(memory_write_address_vc0);
400
        the_ht_tunnel->memory_write_address_buffer0(memory_write_address_buffer0);
401
        the_ht_tunnel->memory_write_address_pos0(memory_write_address_pos0);//40
402
        the_ht_tunnel->memory_write_data0(memory_write_data0);
403
 
404
        the_ht_tunnel->memory_read_address_vc0[0](memory_read_address_vc0[0]);
405
        the_ht_tunnel->memory_read_address_buffer0[0](memory_read_address_buffer0[0]);
406
        the_ht_tunnel->memory_read_address_pos0[0](memory_read_address_pos0[0]);//50
407
        the_ht_tunnel->memory_output0[0](memory_output0[0]);
408
 
409
        the_ht_tunnel->memory_read_address_vc0[1](memory_read_address_vc0[1]);
410
        the_ht_tunnel->memory_read_address_buffer0[1](memory_read_address_buffer0[1]);
411
        the_ht_tunnel->memory_read_address_pos0[1](memory_read_address_pos0[1]);//50
412
        the_ht_tunnel->memory_output0[1](memory_output0[1]);
413
 
414
 
415
        the_ht_tunnel->memory_write1(memory_write1);
416
        the_ht_tunnel->memory_write_address_vc1(memory_write_address_vc1);
417
        the_ht_tunnel->memory_write_address_buffer1(memory_write_address_buffer1);
418
        the_ht_tunnel->memory_write_address_pos1(memory_write_address_pos1);
419
        the_ht_tunnel->memory_write_data1(memory_write_data1);
420
 
421
        the_ht_tunnel->memory_read_address_vc1[0](memory_read_address_vc1[0]);
422
        the_ht_tunnel->memory_read_address_buffer1[0](memory_read_address_buffer1[0]);
423
        the_ht_tunnel->memory_read_address_pos1[0](memory_read_address_pos1[0]);
424
        the_ht_tunnel->memory_output1[0](memory_output1[0]);
425
 
426
        the_ht_tunnel->memory_read_address_vc1[1](memory_read_address_vc1[1]);
427
        the_ht_tunnel->memory_read_address_buffer1[1](memory_read_address_buffer1[1]);
428
        the_ht_tunnel->memory_read_address_pos1[1](memory_read_address_pos1[1]);
429
        the_ht_tunnel->memory_output1[1](memory_output1[1]);
430
 
431
        the_ht_tunnel->ro0_command_packet_wr_data(ro0_command_packet_wr_data);
432
        the_ht_tunnel->ro0_command_packet_write(ro0_command_packet_write);
433
        the_ht_tunnel->ro0_command_packet_wr_addr(ro0_command_packet_wr_addr);
434
        the_ht_tunnel->ro0_command_packet_rd_addr[0](ro0_command_packet_rd_addr[0]);
435
        the_ht_tunnel->command_packet_rd_data_ro0[0](command_packet_rd_data_ro0[0]);
436
        the_ht_tunnel->ro0_command_packet_rd_addr[1](ro0_command_packet_rd_addr[1]);
437
        the_ht_tunnel->command_packet_rd_data_ro0[1](command_packet_rd_data_ro0[1]);
438
 
439
        the_ht_tunnel->ro1_command_packet_wr_data(ro1_command_packet_wr_data);
440
        the_ht_tunnel->ro1_command_packet_write(ro1_command_packet_write);
441
        the_ht_tunnel->ro1_command_packet_wr_addr(ro1_command_packet_wr_addr);
442
        the_ht_tunnel->ro1_command_packet_rd_addr[0](ro1_command_packet_rd_addr[0]);
443
        the_ht_tunnel->command_packet_rd_data_ro1[0](command_packet_rd_data_ro1[0]);
444
        the_ht_tunnel->ro1_command_packet_rd_addr[1](ro1_command_packet_rd_addr[1]);
445
        the_ht_tunnel->command_packet_rd_data_ro1[1](command_packet_rd_data_ro1[1]);
446
 
447
        the_ht_tunnel->ui_packet_usr(ui_packet_usr);
448
        the_ht_tunnel->ui_vc_usr(ui_vc_usr);
449
        the_ht_tunnel->ui_side_usr(ui_side_usr);
450
#ifdef ENABLE_DIRECTROUTE
451
        the_ht_tunnel->ui_directroute_usr(ui_directroute_usr);
452
#endif
453
        the_ht_tunnel->ui_eop_usr(ui_eop_usr);
454
        the_ht_tunnel->ui_available_usr(ui_available_usr);
455
        the_ht_tunnel->ui_output_64bits_usr(ui_output_64bits_usr);
456
        the_ht_tunnel->usr_consume_ui(usr_consume_ui);
457
        the_ht_tunnel->usr_packet_ui(usr_packet_ui);
458
        the_ht_tunnel->usr_available_ui(usr_available_ui);
459
        the_ht_tunnel->usr_side_ui(usr_side_ui);
460
        the_ht_tunnel->ui_freevc0_usr(ui_freevc0_usr);
461
        the_ht_tunnel->ui_freevc1_usr(ui_freevc1_usr);
462
        for(int n = 0; n < NbRegsBars; n++)
463
                the_ht_tunnel->csr_bar[n](csr_bar[n]);
464
        the_ht_tunnel->csr_unit_id(csr_unit_id);
465
        the_ht_tunnel->usr_receivedResponseError_csr(usr_receivedResponseError_csr);
466
 
467
        the_ht_tunnel->csr_read_addr_usr(csr_read_addr_usr);
468
        the_ht_tunnel->usr_read_data_csr(usr_read_data_csr);
469
        the_ht_tunnel->csr_write_usr(csr_write_usr);
470
        the_ht_tunnel->csr_write_addr_usr(csr_write_addr_usr);
471
        the_ht_tunnel->csr_write_data_usr(csr_write_data_usr);
472
        the_ht_tunnel->csr_write_mask_usr(csr_write_mask_usr);
473
 
474
        // ***************************************************
475
        //  LINKING TB
476
        // ***************************************************  
477
 
478
        tb->clk(clk);
479
        tb->resetx(resetx);
480
        tb->pwrok(pwrok);
481
        tb->ldtstopx(ldtstopx);
482
 
483
        tb->phy0_available_lk0(phy0_available_lk0);
484
        tb->phy0_ctl_lk0(phy0_ctl_lk0);
485
 
486
        for(int n = 0; n < CAD_IN_WIDTH; n++){
487
                tb->phy0_cad_lk0[n](phy0_cad_lk0[n]);
488
                tb->lk0_cad_phy0[n](lk0_cad_phy0[n]);
489
                tb->phy1_cad_lk1[n](phy1_cad_lk1[n]);
490
                tb->lk1_cad_phy1[n](lk1_cad_phy1[n]);
491
        }
492
 
493
        tb->lk0_ctl_phy0(lk0_ctl_phy0);
494
        tb->phy0_consume_lk0(phy0_consume_lk0);
495
 
496
        tb->lk0_disable_drivers_phy0(lk0_disable_drivers_phy0);
497
        tb->lk0_disable_receivers_phy0(lk0_disable_receivers_phy0);
498
 
499
        tb->phy1_available_lk1(phy1_available_lk1);
500
        tb->phy1_ctl_lk1(phy1_ctl_lk1);
501
 
502
        tb->lk1_ctl_phy1(lk1_ctl_phy1);
503
        tb->phy1_consume_lk1(phy1_consume_lk1);
504
 
505
        tb->lk1_disable_drivers_phy1(lk1_disable_drivers_phy1);
506
        tb->lk1_disable_receivers_phy1(lk1_disable_receivers_phy1);
507
 
508
        tb->ui_memory_write0(ui_memory_write0);
509
        tb->ui_memory_write1(ui_memory_write1);//20
510
        tb->ui_memory_write_address(ui_memory_write_address);
511
        tb->ui_memory_write_data(ui_memory_write_data);
512
 
513
        tb->ui_memory_read_address0(ui_memory_read_address0);
514
        tb->ui_memory_read_address1(ui_memory_read_address1);
515
        tb->ui_memory_read_data0(ui_memory_read_data0);
516
        tb->ui_memory_read_data1(ui_memory_read_data1);
517
 
518
#ifdef RETRY_MODE_ENABLED
519
        tb->history_memory_write0(history_memory_write0);
520
        tb->history_memory_write_address0(history_memory_write_address0);
521
        tb->history_memory_write_data0(history_memory_write_data0);
522
        tb->history_memory_read_address0(history_memory_read_address0);//30
523
        tb->history_memory_output0(history_memory_output0);
524
 
525
        tb->history_memory_write1(history_memory_write1);
526
        tb->history_memory_write_address1(history_memory_write_address1);
527
        tb->history_memory_write_data1(history_memory_write_data1);
528
        tb->history_memory_read_address1(history_memory_read_address1);
529
        tb->history_memory_output1(history_memory_output1);
530
 
531
#endif
532
 
533
 
534
        tb->memory_write0(memory_write0);
535
        tb->memory_write_address_vc0(memory_write_address_vc0);
536
        tb->memory_write_address_buffer0(memory_write_address_buffer0);
537
        tb->memory_write_address_pos0(memory_write_address_pos0);//40
538
        tb->memory_write_data0(memory_write_data0);
539
 
540
        tb->memory_read_address_vc0[0](memory_read_address_vc0[0]);
541
        tb->memory_read_address_buffer0[0](memory_read_address_buffer0[0]);
542
        tb->memory_read_address_pos0[0](memory_read_address_pos0[0]);//50
543
        tb->memory_output0[0](memory_output0[0]);
544
 
545
        tb->memory_read_address_vc0[1](memory_read_address_vc0[1]);
546
        tb->memory_read_address_buffer0[1](memory_read_address_buffer0[1]);
547
        tb->memory_read_address_pos0[1](memory_read_address_pos0[1]);//50
548
        tb->memory_output0[1](memory_output0[1]);
549
 
550
 
551
        tb->memory_write1(memory_write1);
552
        tb->memory_write_address_vc1(memory_write_address_vc1);
553
        tb->memory_write_address_buffer1(memory_write_address_buffer1);
554
        tb->memory_write_address_pos1(memory_write_address_pos1);
555
        tb->memory_write_data1(memory_write_data1);
556
 
557
        tb->memory_read_address_vc1[0](memory_read_address_vc1[0]);
558
        tb->memory_read_address_buffer1[0](memory_read_address_buffer1[0]);
559
        tb->memory_read_address_pos1[0](memory_read_address_pos1[0]);
560
        tb->memory_output1[0](memory_output1[0]);
561
 
562
        tb->memory_read_address_vc1[1](memory_read_address_vc1[1]);
563
        tb->memory_read_address_buffer1[1](memory_read_address_buffer1[1]);
564
        tb->memory_read_address_pos1[1](memory_read_address_pos1[1]);
565
        tb->memory_output1[1](memory_output1[1]);
566
 
567
        tb->ro0_command_packet_wr_data(ro0_command_packet_wr_data);
568
        tb->ro0_command_packet_write(ro0_command_packet_write);
569
        tb->ro0_command_packet_wr_addr(ro0_command_packet_wr_addr);
570
        tb->ro0_command_packet_rd_addr[0](ro0_command_packet_rd_addr[0]);
571
        tb->command_packet_rd_data_ro0[0](command_packet_rd_data_ro0[0]);
572
        tb->ro0_command_packet_rd_addr[1](ro0_command_packet_rd_addr[1]);
573
        tb->command_packet_rd_data_ro0[1](command_packet_rd_data_ro0[1]);
574
 
575
        tb->ro1_command_packet_wr_data(ro1_command_packet_wr_data);
576
        tb->ro1_command_packet_write(ro1_command_packet_write);
577
        tb->ro1_command_packet_wr_addr(ro1_command_packet_wr_addr);
578
        tb->ro1_command_packet_rd_addr[0](ro1_command_packet_rd_addr[0]);
579
        tb->command_packet_rd_data_ro1[0](command_packet_rd_data_ro1[0]);
580
        tb->ro1_command_packet_rd_addr[1](ro1_command_packet_rd_addr[1]);
581
        tb->command_packet_rd_data_ro1[1](command_packet_rd_data_ro1[1]);
582
 
583
        tb->ui_packet_usr(ui_packet_usr);
584
        tb->ui_vc_usr(ui_vc_usr);
585
        tb->ui_side_usr(ui_side_usr);
586
        tb->ui_directroute_usr(ui_directroute_usr);
587
        tb->ui_eop_usr(ui_eop_usr);
588
        tb->ui_available_usr(ui_available_usr);
589
        tb->ui_output_64bits_usr(ui_output_64bits_usr);
590
        tb->usr_consume_ui(usr_consume_ui);
591
        tb->usr_packet_ui(usr_packet_ui);
592
        tb->usr_available_ui(usr_available_ui);
593
        tb->usr_side_ui(usr_side_ui);
594
        tb->ui_freevc0_usr(ui_freevc0_usr);
595
        tb->ui_freevc1_usr(ui_freevc1_usr);
596
        tb->usr_receivedResponseError_csr(usr_receivedResponseError_csr);
597
 
598
 
599
        // ***************************************************
600
        //  Tracing signals
601
        // ***************************************************  
602
 
603
        sc_trace_file *tf = sc_create_vcd_trace_file("sim_vc_ht_tunnel_l1");
604
 
605
        sc_trace(tf,clk,"clk");
606
        sc_trace(tf,resetx,"resetx");
607
        sc_trace(tf,pwrok,"pwrok");
608
        sc_trace(tf,ldtstopx,"ldtstopx");
609
 
610
        sc_trace(tf,phy0_available_lk0,"phy0_available_lk0");
611
        sc_trace(tf,phy0_ctl_lk0,"phy0_ctl_lk0");
612
 
613
        for(int n = 0; n < CAD_IN_WIDTH; n++){
614
                ostringstream o;
615
                o << "phy0_cad_lk0(" << n << ")";
616
                sc_trace(tf,phy0_cad_lk0[n],o.str().c_str());
617
                o.str("");
618
                o << "lk0_cad_phy0(" << n << ")";
619
                sc_trace(tf,lk0_cad_phy0[n],o.str().c_str());
620
                o.str("");
621
                o << "phy1_cad_lk1(" << n << ")";
622
                sc_trace(tf,phy1_cad_lk1[n],o.str().c_str());
623
                o.str("");
624
                o << "lk1_cad_phy1(" << n << ")";
625
                sc_trace(tf,lk1_cad_phy1[n],o.str().c_str());
626
        }
627
 
628
        sc_trace(tf,lk0_ctl_phy0,"lk0_ctl_phy0");
629
        sc_trace(tf,phy0_consume_lk0,"phy0_consume_lk0");
630
 
631
        sc_trace(tf,lk0_disable_drivers_phy0,"lk0_disable_drivers_phy0");
632
        sc_trace(tf,lk0_disable_receivers_phy0,"lk0_disable_receivers_phy0");
633
 
634
        sc_trace(tf,phy1_available_lk1,"phy1_available_lk1");
635
        sc_trace(tf,phy1_ctl_lk1,"phy1_ctl_lk1");
636
 
637
        sc_trace(tf,lk1_ctl_phy1,"lk1_ctl_phy1");
638
        sc_trace(tf,phy1_consume_lk1,"phy1_consume_lk1");
639
 
640
        sc_trace(tf,lk1_disable_drivers_phy1,"lk1_disable_drivers_phy1");
641
        sc_trace(tf,lk1_disable_receivers_phy1,"lk1_disable_receivers_phy1");
642
 
643
 
644
/*      sc_trace(tf,ui_memory_write0,"ui_memory_write0");
645
        sc_trace(tf,ui_memory_write1,"ui_memory_write1");
646
        sc_trace(tf,ui_memory_write_address,"ui_memory_write_address");
647
        sc_trace(tf,ui_memory_write_data,"ui_memory_write_data");
648
 
649
        sc_trace(tf,ui_memory_read_address0,"ui_memory_read_address0");
650
        sc_trace(tf,ui_memory_read_address1,"ui_memory_read_address1");
651
        sc_trace(tf,ui_memory_read_data0,"ui_memory_read_data0");
652
        sc_trace(tf,ui_memory_read_data1,"ui_memory_read_data1");
653
        */
654
 
655
#ifdef RETRY_MODE_ENABLED
656
        /*
657
        sc_trace(tf,history_memory_write0,"history_memory_write0");
658
        sc_trace(tf,history_memory_write_address0,"history_memory_write_address0");
659
        sc_trace(tf,history_memory_write_data0,"history_memory_write_data0");
660
        sc_trace(tf,history_memory_read_address0,"history_memory_read_address0");
661
        sc_trace(tf,history_memory_output0,"history_memory_output0");*/
662
 
663
/*      sc_trace(tf,history_memory_write1,"history_memory_write1");
664
        sc_trace(tf,history_memory_write_address1,"history_memory_write_address1");
665
        sc_trace(tf,history_memory_write_data1,"history_memory_write_data1");
666
        sc_trace(tf,history_memory_read_address1,"history_memory_read_address1");
667
        sc_trace(tf,history_memory_output1,"history_memory_output1");
668
*/
669
#endif
670
 
671
        sc_trace(tf,memory_write0,"memory_write0");
672
        sc_trace(tf,memory_write_address_vc0,"memory_write_address_vc0");
673
        sc_trace(tf,memory_write_address_buffer0,"memory_write_address_buffer0");
674
        sc_trace(tf,memory_write_address_pos0,"memory_write_address_pos0");
675
        sc_trace(tf,memory_write_data0,"memory_write_data0");
676
 
677
        sc_trace(tf,memory_read_address_vc0[0],"memory_read_address_vc0(0)");
678
        sc_trace(tf,memory_read_address_buffer0[0],"memory_read_address_buffer0(0)");
679
        sc_trace(tf,memory_read_address_pos0[0],"memory_read_address_pos0(0)");
680
        sc_trace(tf,memory_output0[0],"memory_output0(0)");
681
 
682
        /*
683
        sc_trace(tf,memory_read_address_vc0[1],"memory_read_address_vc0(1)");
684
        sc_trace(tf,memory_read_address_buffer0[1],"memory_read_address_buffer0(1)");
685
        sc_trace(tf,memory_read_address_pos0[1],"memory_read_address_pos0(1)");
686
        sc_trace(tf,memory_output0[1],"memory_output0(1)");
687
 
688
 
689
        sc_trace(tf,memory_write1,"memory_write1");
690
        sc_trace(tf,memory_write_address_vc1,"memory_write_address_vc1");
691
        sc_trace(tf,memory_write_address_buffer1,"memory_write_address_buffer1");
692
        sc_trace(tf,memory_write_address_pos1,"memory_write_address_pos1");
693
        sc_trace(tf,memory_write_data1,"memory_write_data1");
694
 
695
        sc_trace(tf,memory_read_address_vc1[0],"memory_read_address_vc1(0)");
696
        sc_trace(tf,memory_read_address_buffer1[0],"memory_read_address_buffer1(0)");
697
        sc_trace(tf,memory_read_address_pos1[0],"memory_read_address_pos1(0)");
698
        sc_trace(tf,memory_output1[0],"memory_output1(0)");
699
 
700
        sc_trace(tf,memory_read_address_vc1[1],"memory_read_address_vc1(1)");
701
        sc_trace(tf,memory_read_address_buffer1[1],"memory_read_address_buffer1(1)");
702
        sc_trace(tf,memory_read_address_pos1[1],"memory_read_address_pos1(1)");
703
        sc_trace(tf,memory_output1[1],"memory_output1(1)");
704
 
705
        */
706
        sc_trace(tf,ui_packet_usr,"ui_packet_usr");
707
        sc_trace(tf,ui_vc_usr,"ui_vc_usr");
708
        sc_trace(tf,ui_side_usr,"ui_side_usr");
709
        sc_trace(tf,ui_directroute_usr,"ui_directroute_usr");
710
        sc_trace(tf,ui_eop_usr,"ui_eop_usr");
711
        sc_trace(tf,ui_available_usr,"ui_available_usr");
712
        sc_trace(tf,ui_output_64bits_usr,"ui_output_64bits_usr");
713
        sc_trace(tf,usr_consume_ui,"usr_consume_ui");
714
        sc_trace(tf,usr_packet_ui,"usr_packet_ui");
715
        sc_trace(tf,usr_available_ui,"usr_available_ui");
716
        sc_trace(tf,usr_side_ui,"usr_side_ui");
717
        sc_trace(tf,ui_freevc0_usr,"ui_freevc0_usr");
718
        sc_trace(tf,ui_freevc1_usr,"ui_freevc1_usr");
719
        sc_trace(tf,usr_receivedResponseError_csr,"usr_receivedResponseError_csr");
720
 
721
        sc_trace(tf,the_ht_tunnel->the_decoder0_l2->cd_datalen_db,"DECODER.cd_datalen_db");
722
        sc_trace(tf,the_ht_tunnel->the_decoder0_l2->cd_data_db,"DECODER.cd_data_db");
723
#ifdef RETRY_MODE_ENABLED
724
        sc_trace(tf,the_ht_tunnel->the_decoder0_l2->cd_drop_db,"DECODER.cd_drop_db");
725
        sc_trace(tf,the_ht_tunnel->the_decoder0_l2->csr_retry,"DECODER.csr_retry");
726
#endif
727
        sc_trace(tf,the_ht_tunnel->the_decoder0_l2->cd_getaddr_db,"DECODER.cd_getaddr_db");
728
        sc_trace(tf,the_ht_tunnel->the_decoder0_l2->cd_vctype_db,"DECODER.cd_vctype_db");
729
        sc_trace(tf,the_ht_tunnel->the_decoder0_l2->cd_write_db,"DECODER.cd_write_db");
730
        sc_trace(tf,the_ht_tunnel->the_decoder0_l2->cd_protocol_error_csr,"DECODER.cd_protocol_error_csr");
731
        sc_trace(tf,the_ht_tunnel->the_decoder0_l2->lk_available_cd,"DECODER.lk_available_cd");
732
        sc_trace(tf,the_ht_tunnel->the_decoder0_l2->lk_dword_cd,"DECODER.lk_dword_cd");
733
        sc_trace(tf,the_ht_tunnel->the_decoder0_l2->lk_lctl_cd,"DECODER.lk_lctl_cd");
734
        sc_trace(tf,the_ht_tunnel->the_decoder0_l2->lk_hctl_cd,"DECODER.lk_hctl_cd");
735
        sc_trace(tf,the_ht_tunnel->the_decoder0_l2->cd_available_ro,"DECODER.cd_available_ro");
736
        sc_trace(tf,the_ht_tunnel->the_decoder0_l2->cd_packet_ro,"DECODER.cd_packet_ro");
737
 
738
#ifdef RETRY_MODE_ENABLED
739
        sc_trace(tf,the_ht_tunnel->the_link0_l2->cd_initiate_retry_disconnect,"LINK.cd_initiate_retry_disconnect");
740
        sc_trace(tf,the_ht_tunnel->the_link0_l2->lk_initiate_retry_disconnect,"LINK.lk_initiate_retry_disconnect");
741
#endif
742
        sc_trace(tf,the_ht_tunnel->the_link0_l2->cd_initiate_nonretry_disconnect_lk,"LINK.cd_initiate_nonretry_disconnect_lk");
743
        sc_trace(tf,the_ht_tunnel->the_link0_l2->tx_crc_count,"LINK.tx_crc_count");
744
 
745
        sc_trace(tf,the_ht_tunnel->the_csr_l2->csr_unit_id,"CSR.csr_unit_id");
746
        sc_trace(tf,the_ht_tunnel->the_csr_l2->csr_bar[0],"CSR.csr_bar0");
747
        sc_trace(tf,the_ht_tunnel->the_csr_l2->csr_io_space_enable,"CSR.csr_io_space_enable");
748
        sc_trace(tf,the_ht_tunnel->the_csr_l2->csr_memory_space_enable,"CSR.csr_memory_space_enable");
749
        sc_trace(tf,the_ht_tunnel->the_csr_l2->csr_request_databuffer0_access_ui,"CSR.csr_request_databuffer0_access_ui");
750
        sc_trace(tf,the_ht_tunnel->the_csr_l2->ro0_available_csr,"CSR.ro0_available_csr");
751
        sc_trace(tf,the_ht_tunnel->the_csr_l2->csr_ack_ro0,"CSR.csr_ack_ro0");
752
#ifdef RETRY_MODE_ENABLED
753
        sc_trace(tf,the_ht_tunnel->the_csr_l2->csr_retry0,"CSR.csr_retry0");
754
        sc_trace(tf,the_ht_tunnel->the_csr_l2->csr_retry1,"CSR.csr_retry1");
755
#endif
756
        sc_trace(tf,the_ht_tunnel->the_csr_l2->csr_erase_db0,"CSR.csr_erase_db0");
757
        sc_trace(tf,the_ht_tunnel->the_csr_l2->csr_read_db0,"CSR.csr_read_db0");
758
        sc_trace(tf,the_ht_tunnel->the_csr_l2->csr_address_db0,"CSR.csr_address_db0");
759
        sc_trace(tf,the_ht_tunnel->the_csr_l2->csr_vctype_db0,"CSR.csr_vctype_db0");
760
 
761
        sc_trace(tf,the_ht_tunnel->the_csr_l2->csr_extented_ctl_lk0,"CSR.csr_extented_ctl_lk0");
762
        sc_trace(tf,the_ht_tunnel->the_csr_l2->csr_available_fc0,"CSR.csr_available_fc0");
763
        sc_trace(tf,the_ht_tunnel->the_csr_l2->csr_dword_fc0,"CSR.csr_dword_fc0");
764
        sc_trace(tf,the_ht_tunnel->the_csr_l2->fc0_ack_csr,"CSR.fc0_ack_csr");
765
 
766
        sc_trace(tf,the_ht_tunnel->the_csr_l2->csr_extented_ctl_lk1,"CSR.csr_extented_ctl_lk1");
767
        sc_trace(tf,the_ht_tunnel->the_csr_l2->csr_available_fc1,"CSR.csr_available_fc1");
768
        sc_trace(tf,the_ht_tunnel->the_csr_l2->csr_dword_fc1,"CSR.csr_dword_fc1");
769
        sc_trace(tf,the_ht_tunnel->the_csr_l2->fc1_ack_csr,"CSR.fc1_ack_csr");
770
 
771
 
772
        sc_trace(tf,the_ht_tunnel->the_userinterface_l2->ro0_available_ui,"UI.ro0_available_ui");
773
        sc_trace(tf,the_ht_tunnel->the_userinterface_l2->ro0_packet_ui,"UI.ro0_packet_ui");
774
        sc_trace(tf,the_ht_tunnel->the_userinterface_l2->ui_ack_ro0,"UI.ui_ack_ro0");
775
        sc_trace(tf,the_ht_tunnel->the_userinterface_l2->ui_available_fc0,"UI.ui_available_fc0");
776
        sc_trace(tf,the_ht_tunnel->the_userinterface_l2->fc0_consume_data_ui,"UI.fc0_consume_data_ui");
777
 
778
        sc_trace(tf,the_ht_tunnel->the_userinterface_l2->ui_read_db0,"UI.ui_read_db0");
779
        sc_trace(tf,the_ht_tunnel->the_userinterface_l2->ui_erase_db0,"UI.ui_erase_db0");
780
        sc_trace(tf,the_ht_tunnel->the_userinterface_l2->ui_address_db0,"UI.ui_address_db0");
781
        sc_trace(tf,the_ht_tunnel->the_userinterface_l2->ui_vctype_db0,"UI.ui_vctype_db0");
782
        sc_trace(tf,the_ht_tunnel->the_userinterface_l2->db0_data_ui,"UI.db0_data_ui");
783
 
784
#ifdef RETRY_MODE_ENABLED
785
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->the_history_buffer->history_playback_done,"HISTORY.history_playback_done");
786
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->the_history_buffer->begin_history_playback,"HISTORY.begin_history_playback");
787
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->the_history_buffer->stop_history_playback,"HISTORY.stop_history_playback");
788
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->the_history_buffer->history_playback_ready,"HISTORY.history_playback_ready");
789
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->the_history_buffer->consume_history,"HISTORY.consume_history");
790
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->the_history_buffer->room_available_in_history,"HISTORY.room_available_in_history");
791
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->the_history_buffer->add_to_history,"HISTORY.add_to_history");
792
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->the_history_buffer->new_history_entry,"HISTORY.new_history_entry");
793
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->the_history_buffer->new_history_entry_size_m1,"HISTORY.new_history_entry_size_m1");
794
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->the_history_buffer->fc_dword_lk,"HISTORY.fc_dword_lk");
795
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->the_history_buffer->nop_received,"HISTORY.nop_received");
796
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->the_history_buffer->ack_value,"HISTORY.ack_value");
797
#endif
798
 
799
        sc_trace(tf,the_ht_tunnel->the_errorhandler0_l2->ro_available_fwd,"ERROR.ro_available_fwd");
800
        sc_trace(tf,the_ht_tunnel->the_errorhandler0_l2->ro_packet_fwd,"ERROR.ro_packet_fwd");
801
        sc_trace(tf,the_ht_tunnel->the_errorhandler0_l2->eh_ack_ro,"ERROR.eh_ack_ro");
802
        sc_trace(tf,the_ht_tunnel->the_errorhandler0_l2->eh_available_fc,"ERROR.eh_available_fc");
803
 
804
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->the_user_fifo->fifo_user_available,
805
                "FIFO.fifo_user_available");
806
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->the_user_fifo->ui_available_fc,
807
                "FIFO.ui_available_fc");
808
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->the_user_fifo->consume_user_fifo,
809
                "FIFO.consume_user_fifo");
810
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->the_user_fifo->buffer_count_posted,
811
                "FIFO.buffer_count_posted");
812
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->the_user_fifo->buffer_count_nposted,
813
                "FIFO.buffer_count_nposted");
814
 
815
        sc_trace(tf,the_ht_tunnel->the_reordering0_l2->ro_available_fwd,"REORDERING.ro_available_fwd");
816
        sc_trace(tf,the_ht_tunnel->the_reordering0_l2->ro_packet_fwd,"REORDERING.ro_packet_fwd");
817
 
818
 
819
        /*sc_trace(tf,the_ht_tunnel->the_flow_control1_l2->eh_available_fc,"FLOW1.eh_available_fc");
820
        sc_trace(tf,the_ht_tunnel->the_flow_control1_l2->ui_available_fc,"FLOW1.ui_available_fc");
821
        sc_trace(tf,the_ht_tunnel->the_flow_control1_l2->csr_available_fc,"FLOW1.csr_available_fc");
822
        sc_trace(tf,the_ht_tunnel->the_flow_control1_l2->ro_available_fwd,"FLOW1.ro_available_fwd");
823
        sc_trace(tf,the_ht_tunnel->the_flow_control1_l2->fc_dword_lk,"FLOW1.fc_dword_lk");*/
824
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->lk_consume_fc,"FLOW0.lk_consume_fc");
825
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->fc_dword_lk,"FLOW0.fc_dword_lk");
826
 
827
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->ro_available_fwd,"FLOW0.ro_available_fwd");
828
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->ro_packet_fwd,"FLOW0.ro_packet_fwd");
829
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->fwd_ack_ro,"FLOW0.fwd_ack_ro");
830
 
831
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->eh_available_fc,"FLOW0.eh_available_fc");
832
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->fc_ack_eh,"FLOW0.fc_ack_eh");
833
 
834
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->csr_available_fc,"FLOW0.csr_available_fc");
835
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->fc_ack_csr,"FLOW0.fc_ack_csr");
836
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->csr_dword_fc,"FLOW0.csr_dword_fc");
837
 
838
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->fc_nop_sent,"FLOW0.fc_nop_sent");
839
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->db_nop_req_fc,"FLOW0.db_nop_req_fc");
840
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->ro_nop_req_fc,"FLOW0.ro_nop_req_fc");
841
 
842
#ifdef RETRY_MODE_ENABLED
843
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->fc_disconnect_lk,"FLOW0.fc_disconnect_lk");
844
        sc_trace(tf,the_ht_tunnel->the_flow_control0_l2->lk_rx_connected,"FLOW0.lk_rx_connected");
845
#endif
846
 
847
        //------------------------------------------
848
        // start the simulation
849
        //------------------------------------------
850
 
851
        cout << "Starting simulation" << endl;
852
 
853
        int sim_time = 1200;
854
 
855
        sc_start(sim_time);
856
 
857
        printf("End of simulation\n");
858
        sc_close_vcd_trace_file(tf);
859
 
860
        delete the_ht_tunnel;
861
        return 0;
862
}
863
 
864
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.