-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathddr_top_tb.v
648 lines (558 loc) · 23.3 KB
/
ddr_top_tb.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
//*****************************************************************************
// (c) Copyright 2009 - 2011 Xilinx, Inc. All rights reserved.
//
// This file contains confidential and proprietary information
// of Xilinx, Inc. and is protected under U.S. and
// international copyright and other intellectual property
// laws.
//
// DISCLAIMER
// This disclaimer is not a license and does not grant any
// rights to the materials distributed herewith. Except as
// otherwise provided in a valid license issued to you by
// Xilinx, and to the maximum extent permitted by applicable
// law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
// WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
// AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
// BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
// INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
// (2) Xilinx shall not be liable (whether in contract or tort,
// including negligence, or under any other theory of
// liability) for any loss or damage of any kind or nature
// related to, arising under or in connection with these
// materials, including for any direct, or any indirect,
// special, incidental, or consequential loss or damage
// (including loss of data, profits, goodwill, or any type of
// loss or damage suffered as a result of any action brought
// by a third party) even if such damage or loss was
// reasonably foreseeable or Xilinx had been advised of the
// possibility of the same.
//
// CRITICAL APPLICATIONS
// Xilinx products are not designed or intended to be fail-
// safe, or for use in any application requiring fail-safe
// performance, such as life-support or safety devices or
// systems, Class III medical devices, nuclear facilities,
// applications related to the deployment of airbags, or any
// other applications that could lead to death, personal
// injury, or severe property or environmental damage
// (individually and collectively, "Critical
// Applications"). Customer assumes the sole risk and
// liability of any use of Xilinx products in Critical
// Applications, subject only to applicable laws and
// regulations governing limitations on product liability.
//
// THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
// PART OF THIS FILE AT ALL TIMES.
//
//*****************************************************************************
// ____ ____
// / /\/ /
// /___/ \ / Vendor : Xilinx
// \ \ \/ Version : 4.2
// \ \ Application : MIG
// / / Filename : sim_tb_top.v
// /___/ /\ Date Last Modified : $Date: 2011/06/07 13:45:16 $
// \ \ / \ Date Created : Fri Oct 14 2011
// \___\/\___\
//
// Device : 7 Series
// Design Name : DDR2 SDRAM
// Purpose :
// Top-level testbench for testing DDR3.
// Instantiates:
// 1. IP_TOP (top-level representing FPGA, contains core,
// clocking, built-in testbench/memory checker and other
// support structures)
// 2. DDR3 Memory
// 3. Miscellaneous clock generation and reset logic
// 4. For ECC ON case inserts error on LSB bit
// of data from DRAM to FPGA.
// Reference :
// Revision History :
//*****************************************************************************
`timescale 1ps/100fs
module ddr_top_tb;
//***************************************************************************
// The following parameters refer to width of various ports
//***************************************************************************
parameter BANK_WIDTH = 3;
// # of memory Bank Address bits.
parameter CK_WIDTH = 1;
// # of CK/CK# outputs to memory.
parameter COL_WIDTH = 10;
// # of memory Column Address bits.
parameter CS_WIDTH = 1;
// # of unique CS outputs to memory.
parameter nCS_PER_RANK = 1;
// # of unique CS outputs per rank for phy
parameter CKE_WIDTH = 1;
// # of CKE outputs to memory.
parameter DM_WIDTH = 2;
// # of DM (data mask)
parameter DQ_WIDTH = 16;
// # of DQ (data)
parameter DQS_WIDTH = 2;
parameter DQS_CNT_WIDTH = 1;
// = ceil(log2(DQS_WIDTH))
parameter DRAM_WIDTH = 8;
// # of DQ per DQS
parameter ECC = "OFF";
parameter RANKS = 1;
// # of Ranks.
parameter ODT_WIDTH = 1;
// # of ODT outputs to memory.
parameter ROW_WIDTH = 13;
// # of memory Row Address bits.
parameter ADDR_WIDTH = 27;
// # = RANK_WIDTH + BANK_WIDTH
// + ROW_WIDTH + COL_WIDTH;
// Chip Select is always tied to low for
// single rank devices
//***************************************************************************
// The following parameters are mode register settings
//***************************************************************************
parameter BURST_MODE = "8";
// DDR3 SDRAM:
// Burst Length (Mode Register 0).
// # = "8", "4", "OTF".
// DDR2 SDRAM:
// Burst Length (Mode Register).
// # = "8", "4".
//***************************************************************************
// The following parameters are multiplier and divisor factors for PLLE2.
// Based on the selected design frequency these parameters vary.
//***************************************************************************
// parameter CLKIN_PERIOD = 4999;
parameter CLKIN_PERIOD = 10000;
// Input Clock Period
//***************************************************************************
// Simulation parameters
//***************************************************************************
parameter SIM_BYPASS_INIT_CAL = "FAST";
// # = "SIM_INIT_CAL_FULL" - Complete
// memory init &
// calibration sequence
// # = "SKIP" - Not supported
// # = "FAST" - Complete memory init & use
// abbreviated calib sequence
//***************************************************************************
// IODELAY and PHY related parameters
//***************************************************************************
parameter TCQ = 100;
//***************************************************************************
// IODELAY and PHY related parameters
//***************************************************************************
parameter RST_ACT_LOW = 1;
// =1 for active low reset,
// =0 for active high.
//***************************************************************************
// Referece clock frequency parameters
//***************************************************************************
parameter REFCLK_FREQ = 200.0;
// IODELAYCTRL reference clock frequency
//***************************************************************************
// System clock frequency parameters
//***************************************************************************
parameter tCK = 3333;
// memory tCK paramter.
// # = Clock Period in pS.
//***************************************************************************
// Debug and Internal parameters
//***************************************************************************
parameter DEBUG_PORT = "OFF";
// # = "ON" Enable debug signals/controls.
// = "OFF" Disable debug signals/controls.
//***************************************************************************
// Debug and Internal parameters
//***************************************************************************
parameter DRAM_TYPE = "DDR2";
//**************************************************************************//
// Local parameters Declarations
//**************************************************************************//
localparam real TPROP_DQS = 0.00;
// Delay for DQS signal during Write Operation
localparam real TPROP_DQS_RD = 0.00;
// Delay for DQS signal during Read Operation
localparam real TPROP_PCB_CTRL = 0.00;
// Delay for Address and Ctrl signals
localparam real TPROP_PCB_DATA = 0.00;
// Delay for data signal during Write operation
localparam real TPROP_PCB_DATA_RD = 0.00;
// Delay for data signal during Read operation
localparam MEMORY_WIDTH = 16;
localparam NUM_COMP = DQ_WIDTH/MEMORY_WIDTH;
localparam ECC_TEST = "OFF" ;
localparam ERR_INSERT = (ECC_TEST == "ON") ? "OFF" : ECC ;
localparam real REFCLK_PERIOD = (1000000.0/(2*REFCLK_FREQ));
localparam RESET_PERIOD = 200000; //in pSec
localparam INPUT_INIT_PERIOD = 20000; //in pSec
localparam real SYSCLK_PERIOD = tCK;
//**************************************************************************//
// Wire Declarations
//**************************************************************************//
reg sys_rst_n;
// wire sys_rst;
reg sys_clk_i;
// reg clk_ref_i;
wire ddr2_reset_n;
wire [DQ_WIDTH-1:0] ddr2_dq_fpga;
wire [DQS_WIDTH-1:0] ddr2_dqs_p_fpga;
wire [DQS_WIDTH-1:0] ddr2_dqs_n_fpga;
wire [ROW_WIDTH-1:0] ddr2_addr_fpga;
wire [BANK_WIDTH-1:0] ddr2_ba_fpga;
wire ddr2_ras_n_fpga;
wire ddr2_cas_n_fpga;
wire ddr2_we_n_fpga;
wire [CKE_WIDTH-1:0] ddr2_cke_fpga;
wire [CK_WIDTH-1:0] ddr2_ck_p_fpga;
wire [CK_WIDTH-1:0] ddr2_ck_n_fpga;
wire init_calib_complete;
//wire tg_compare_error;
wire [(CS_WIDTH*nCS_PER_RANK)-1:0] ddr2_cs_n_fpga;
wire [DM_WIDTH-1:0] ddr2_dm_fpga;
wire [ODT_WIDTH-1:0] ddr2_odt_fpga;
reg [(CS_WIDTH*nCS_PER_RANK)-1:0] ddr2_cs_n_sdram_tmp;
reg [DM_WIDTH-1:0] ddr2_dm_sdram_tmp;
reg [ODT_WIDTH-1:0] ddr2_odt_sdram_tmp;
wire [DQ_WIDTH-1:0] ddr2_dq_sdram;
reg [ROW_WIDTH-1:0] ddr2_addr_sdram;
reg [BANK_WIDTH-1:0] ddr2_ba_sdram;
reg ddr2_ras_n_sdram;
reg ddr2_cas_n_sdram;
reg ddr2_we_n_sdram;
wire [(CS_WIDTH*nCS_PER_RANK)-1:0] ddr2_cs_n_sdram;
wire [ODT_WIDTH-1:0] ddr2_odt_sdram;
reg [CKE_WIDTH-1:0] ddr2_cke_sdram;
wire [DM_WIDTH-1:0] ddr2_dm_sdram;
wire [DQS_WIDTH-1:0] ddr2_dqs_p_sdram;
wire [DQS_WIDTH-1:0] ddr2_dqs_n_sdram;
reg [CK_WIDTH-1:0] ddr2_ck_p_sdram;
reg [CK_WIDTH-1:0] ddr2_ck_n_sdram;
reg btnc, btnu, btnr, btnl;
wire led16_b;
wire [7:0] led;
reg [15:0] sw;
//**************************************************************************//
// Task for setting address
task set_address(input [26:0] addr);
begin
#100000 // 100 ns
sw = {21'b0, addr[26:16]};
#100000 // 100 ns
btnu = 1'b1;
#100000 // 100 ns
btnu = 1'b0;
#100000 // 100 ns
sw = addr[15:0];
#100000 // 100 ns
btnc = 1'b1;
#100000 // 100 ns
btnc = 1'b0;
end
endtask
// Task for performing a write
task write_data(input [7:0] data);
begin
#100000 // 100 ns
sw = data;
#100000 // 100 ns
btnl = 1'b1;
#100000 // 100 ns
btnl = 1'b0;
end
endtask
// Task for performing a write
task read_data();
begin
#100000 // 100 ns
btnr = 1'b1;
#100000 // 100 ns
btnr = 1'b0;
end
endtask
//**************************************************************************//
// Reset Generation
//**************************************************************************//
initial begin
sys_rst_n = 1'b0;
#RESET_PERIOD
sys_rst_n = 1'b1;
end
// assign sys_rst = RST_ACT_LOW ? sys_rst_n : ~sys_rst_n;
//**************************************************************************//
// Clock Generation
//**************************************************************************//
initial
sys_clk_i = 1'b0;
always
sys_clk_i = #(CLKIN_PERIOD/2.0) ~sys_clk_i;
// Top-level inputs
initial begin
// Set initial values for inputs sime time after global reset
wait (sys_rst_n == 1'b1);
#(INPUT_INIT_PERIOD)
btnc = 1'b0;
btnu = 1'b0;
btnr = 1'b0;
btnl = 1'b0;
sw = 16'h0;
// Wait for calibration to complete
wait (init_calib_complete == 1'b1);
#(INPUT_INIT_PERIOD)
set_address(27'h00000000);
#1000000 // 1000 ns
write_data(8'h12);
#1000000 // 1000 ns
set_address(27'h00000001);
#1000000 // 1000 ns
write_data(8'h34);
#1000000 // 1000 ns
set_address(27'h00000000);
#1000000 // 1000 ns
read_data();
#1000000 // 1000 ns
set_address(27'h00000001);
#1000000 // 1000 ns
read_data();
end
// initial
// clk_ref_i = 1'b0;
// always
// clk_ref_i = #REFCLK_PERIOD ~clk_ref_i;
always @( * ) begin
ddr2_ck_p_sdram <= #(TPROP_PCB_CTRL) ddr2_ck_p_fpga;
ddr2_ck_n_sdram <= #(TPROP_PCB_CTRL) ddr2_ck_n_fpga;
ddr2_addr_sdram <= #(TPROP_PCB_CTRL) ddr2_addr_fpga;
ddr2_ba_sdram <= #(TPROP_PCB_CTRL) ddr2_ba_fpga;
ddr2_ras_n_sdram <= #(TPROP_PCB_CTRL) ddr2_ras_n_fpga;
ddr2_cas_n_sdram <= #(TPROP_PCB_CTRL) ddr2_cas_n_fpga;
ddr2_we_n_sdram <= #(TPROP_PCB_CTRL) ddr2_we_n_fpga;
ddr2_cke_sdram <= #(TPROP_PCB_CTRL) ddr2_cke_fpga;
end
always @( * )
ddr2_cs_n_sdram_tmp <= #(TPROP_PCB_CTRL) ddr2_cs_n_fpga;
assign ddr2_cs_n_sdram = ddr2_cs_n_sdram_tmp;
always @( * )
ddr2_dm_sdram_tmp <= #(TPROP_PCB_DATA) ddr2_dm_fpga;//DM signal generation
assign ddr2_dm_sdram = ddr2_dm_sdram_tmp;
always @( * )
ddr2_odt_sdram_tmp <= #(TPROP_PCB_CTRL) ddr2_odt_fpga;
assign ddr2_odt_sdram = ddr2_odt_sdram_tmp;
// Controlling the bi-directional BUS
genvar dqwd;
generate
for (dqwd = 1;dqwd < DQ_WIDTH;dqwd = dqwd+1) begin : dq_delay
WireDelay #
(
.Delay_g (TPROP_PCB_DATA),
.Delay_rd (TPROP_PCB_DATA_RD),
.ERR_INSERT ("OFF")
)
u_delay_dq
(
.A (ddr2_dq_fpga[dqwd]),
.B (ddr2_dq_sdram[dqwd]),
.reset (sys_rst_n),
.phy_init_done (init_calib_complete)
);
end
// For ECC ON case error is inserted on LSB bit from DRAM to FPGA
WireDelay #
(
.Delay_g (TPROP_PCB_DATA),
.Delay_rd (TPROP_PCB_DATA_RD),
.ERR_INSERT ("OFF")
)
u_delay_dq_0
(
.A (ddr2_dq_fpga[0]),
.B (ddr2_dq_sdram[0]),
.reset (sys_rst_n),
.phy_init_done (init_calib_complete)
);
endgenerate
genvar dqswd;
generate
for (dqswd = 0;dqswd < DQS_WIDTH;dqswd = dqswd+1) begin : dqs_delay
WireDelay #
(
.Delay_g (TPROP_DQS),
.Delay_rd (TPROP_DQS_RD),
.ERR_INSERT ("OFF")
)
u_delay_dqs_p
(
.A (ddr2_dqs_p_fpga[dqswd]),
.B (ddr2_dqs_p_sdram[dqswd]),
.reset (sys_rst_n),
.phy_init_done (init_calib_complete)
);
WireDelay #
(
.Delay_g (TPROP_DQS),
.Delay_rd (TPROP_DQS_RD),
.ERR_INSERT ("OFF")
)
u_delay_dqs_n
(
.A (ddr2_dqs_n_fpga[dqswd]),
.B (ddr2_dqs_n_sdram[dqswd]),
.reset (sys_rst_n),
.phy_init_done (init_calib_complete)
);
end
endgenerate
//===========================================================================
// FPGA Memory Controller
//===========================================================================
//example_top #
ddr_top #
(
//.SIMULATION (SIMULATION),
//.PORT_MODE (PORT_MODE),
//.DATA_MODE (DATA_MODE),
// .TST_MEM_INSTR_MODE (TST_MEM_INSTR_MODE),
// .EYE_TEST (EYE_TEST),
// .DATA_PATTERN (DATA_PATTERN),
// .CMD_PATTERN (CMD_PATTERN),
// .BEGIN_ADDRESS (BEGIN_ADDRESS),
// .END_ADDRESS (END_ADDRESS),
// .PRBS_EADDR_MASK_POS (PRBS_EADDR_MASK_POS),
// .BANK_WIDTH (BANK_WIDTH),
// .COL_WIDTH (COL_WIDTH),
// .CS_WIDTH (CS_WIDTH),
// .DQ_WIDTH (DQ_WIDTH),
// .DQS_WIDTH (DQS_WIDTH),
// .DQS_CNT_WIDTH (DQS_CNT_WIDTH),
// .DRAM_WIDTH (DRAM_WIDTH),
// .ECC_TEST (ECC_TEST),
// .RANKS (RANKS),
// .ROW_WIDTH (ROW_WIDTH),
// .ADDR_WIDTH (ADDR_WIDTH),
// .BURST_MODE (BURST_MODE),
// .TCQ (TCQ),
// .DEBUG_PORT (DEBUG_PORT)
// .RST_ACT_LOW (RST_ACT_LOW)
)
u_ip_top
(
.CLK100MHZ(sys_clk_i),
.CPU_RESETN(sys_rst_n),
.SW(sw),
.BTNC(btnc),
.BTNU(btnu),
.BTNR(btnr),
.BTNL(btnl),
.LED(led),
.LED16_B(led16_b),
// DDR ports
.ddr2_dq (ddr2_dq_fpga),
.ddr2_dqs_n (ddr2_dqs_n_fpga),
.ddr2_dqs_p (ddr2_dqs_p_fpga),
.ddr2_addr (ddr2_addr_fpga),
.ddr2_ba (ddr2_ba_fpga),
.ddr2_ras_n (ddr2_ras_n_fpga),
.ddr2_cas_n (ddr2_cas_n_fpga),
.ddr2_we_n (ddr2_we_n_fpga),
.ddr2_ck_p (ddr2_ck_p_fpga),
.ddr2_ck_n (ddr2_ck_n_fpga),
.ddr2_cke (ddr2_cke_fpga),
.ddr2_cs_n (ddr2_cs_n_fpga),
.ddr2_dm (ddr2_dm_fpga),
.ddr2_odt (ddr2_odt_fpga)
// .sys_clk_i (sys_clk_i),
// .init_calib_complete (init_calib_complete),
// .tg_compare_error (tg_compare_error),
// .sys_rst (sys_rst)
);
assign init_calib_complete = led16_b;
//**************************************************************************//
// Memory Models instantiations
//**************************************************************************//
genvar r,i;
generate
for (r = 0; r < CS_WIDTH; r = r + 1) begin: mem_rnk
if(DQ_WIDTH/16) begin: mem
for (i = 0; i < NUM_COMP; i = i + 1) begin: gen_mem
ddr2_model u_comp_ddr2
(
.ck (ddr2_ck_p_sdram[0+(NUM_COMP*r)]),
.ck_n (ddr2_ck_n_sdram[0+(NUM_COMP*r)]),
.cke (ddr2_cke_sdram[0+(NUM_COMP*r)]),
.cs_n (ddr2_cs_n_sdram[0+(NUM_COMP*r)]),
.ras_n (ddr2_ras_n_sdram),
.cas_n (ddr2_cas_n_sdram),
.we_n (ddr2_we_n_sdram),
.dm_rdqs (ddr2_dm_sdram[(2*(i+1)-1):(2*i)]),
.ba (ddr2_ba_sdram),
.addr (ddr2_addr_sdram),
.dq (ddr2_dq_sdram[16*(i+1)-1:16*(i)]),
.dqs (ddr2_dqs_p_sdram[(2*(i+1)-1):(2*i)]),
.dqs_n (ddr2_dqs_n_sdram[(2*(i+1)-1):(2*i)]),
.rdqs_n (),
.odt (ddr2_odt_sdram[0+(NUM_COMP*r)])
);
end
end
if (DQ_WIDTH%16) begin: gen_mem_extrabits
ddr2_model u_comp_ddr2
(
.ck (ddr2_ck_p_sdram[0+(NUM_COMP*r)]),
.ck_n (ddr2_ck_n_sdram[0+(NUM_COMP*r)]),
.cke (ddr2_cke_sdram[0+(NUM_COMP*r)]),
.cs_n (ddr2_cs_n_sdram[0+(NUM_COMP*r)]),
.ras_n (ddr2_ras_n_sdram),
.cas_n (ddr2_cas_n_sdram),
.we_n (ddr2_we_n_sdram),
.dm_rdqs ({ddr2_dm_sdram[DM_WIDTH-1],ddr2_dm_sdram[DM_WIDTH-1]}),
.ba (ddr2_ba_sdram),
.addr (ddr2_addr_sdram),
.dq ({ddr2_dq_sdram[DQ_WIDTH-1:(DQ_WIDTH-8)],
ddr2_dq_sdram[DQ_WIDTH-1:(DQ_WIDTH-8)]}),
.dqs ({ddr2_dqs_p_sdram[DQS_WIDTH-1],
ddr2_dqs_p_sdram[DQS_WIDTH-1]}),
.dqs_n ({ddr2_dqs_n_sdram[DQS_WIDTH-1],
ddr2_dqs_n_sdram[DQS_WIDTH-1]}),
.rdqs_n (),
.odt (ddr2_odt_sdram[0+(NUM_COMP*r)])
);
end
end
endgenerate
//***************************************************************************
// Reporting the test case status
// Status reporting logic exists both in simulation test bench (sim_tb_top)
// and sim.do file for ModelSim. Any update in simulation run time or time out
// in this file need to be updated in sim.do file as well.
//***************************************************************************
initial
begin : Logging
fork
begin : calibration_done
wait (init_calib_complete);
$display("Calibration Done");
#50000000.0;
// if (!tg_compare_error) begin
// $display("TEST PASSED");
// end
// else begin
// $display("TEST FAILED: DATA ERROR");
// end
// disable calib_not_done;
// $finish;
end
begin : calib_not_done
if (SIM_BYPASS_INIT_CAL == "SIM_INIT_CAL_FULL")
#2500000000.0;
else
#1000000000.0;
if (!init_calib_complete) begin
$display("TEST FAILED: INITIALIZATION DID NOT COMPLETE");
end
disable calibration_done;
$finish;
end
join
end
endmodule