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

Subversion Repositories pcie_ds_dma

[/] [pcie_ds_dma/] [trunk/] [core/] [wishbone/] [testbecnh/] [dev_test_gen/] [sim/] [tb.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dsmv
//////////////////////////////////////////////////////////////////////////////////
2
// Company:         ;)
3
// Engineer:        Kuzmi4
4
// 
5
// Create Date:     14:39:52 05/19/2010 
6
// Design Name:     
7
// Module Name:     tb/block_test_generate_wb
8
// Project Name:    DS_DMA
9
// Target Devices:  no
10
// Tool versions:   any with SV support
11
// Description: 
12
//                  
13
//                  Simple TB, waveform oriented ;)
14
//
15
// Revision: 
16
// Revision 0.01 - File Created
17
//
18
//////////////////////////////////////////////////////////////////////////////////
19
`timescale 1ns / 1ps
20
 
21
`include "ds_dma_test_gen_burst_master_if.v"
22
 
23
module tb;
24
//////////////////////////////////////////////////////////////////////////////////
25
//
26
parameter   p_Tclk  =   10ns;
27
parameter   p_Trst  =   120ns;
28
//////////////////////////////////////////////////////////////////////////////////
29
    // Declare SYS_CON stuff:
30
    reg     s_sys_clk;
31
    reg     s_sys_rst;
32
        // Declare 
33
    logic   [63:0]  sv_ds_dma_income_data_0;
34
    logic   [63:0]  sv_ds_dma_income_data_1 [512];
35
//////////////////////////////////////////////////////////////////////////////////
36
//
37
ds_dma_test_gen_burst_master_if     DS_DMA_BM_IF(s_sys_clk);
38
//////////////////////////////////////////////////////////////////////////////////
39
//
40
// System Clock:
41
//
42
always
43
begin   :   SYS_CLK
44
    #(p_Tclk/2) s_sys_clk <= !s_sys_clk;
45
end
46
//////////////////////////////////////////////////////////////////////////////////
47
//
48
// Local Initial PowerOnReset:
49
//
50
initial
51
begin   :   init_POR
52
    //
53
    $timeformat(-9, 3, " ns", 10);
54
    //
55
    s_sys_clk   <= 0;
56
    s_sys_rst   <= 0;
57
 
58
    DS_DMA_BM_IF.init();
59
 
60
    // PowerOnReset case
61
    s_sys_rst   <= 1; #p_Trst;
62
    s_sys_rst   <= 0;
63
 
64
end
65
//////////////////////////////////////////////////////////////////////////////////
66
//
67
// Test:
68
//
69
initial
70
begin   :   TB
71
    //
72
    do @(posedge s_sys_clk);
73
    while (s_sys_rst); #1us;
74
    #1us;
75
    force DUT.sv_test_gen_ctrl  = 16'h22;
76
    force DUT.sv_test_gen_size  = 16'h01;
77
    force DUT.sv_test_gen_cnt1  = 16'h00;
78
    force DUT.sv_test_gen_cnt2  = 16'h00; #6us;
79
    //
80
    repeat (2)
81
        DS_DMA_BM_IF.read_512_word(sv_ds_dma_income_data_1); #100ns;
82
    //
83
    force DUT.sv_test_gen_ctrl  = 16'h00;
84
    DS_DMA_BM_IF.read_512_word(sv_ds_dma_income_data_1); #100ns;
85
    #6us;
86
    $finish(2);
87
end
88
//////////////////////////////////////////////////////////////////////////////////
89
//
90
// Instantiate DUT
91
//
92
block_test_generate_wb  DUT
93
(
94
//
95
// SYS_CON
96
.i_clk  (s_sys_clk),
97
.i_rst  (s_sys_rst),
98
//
99
// WB CFG SLAVE IF
100
.iv_wbs_cfg_addr     (),
101
.iv_wbs_cfg_data     (),
102
.iv_wbs_cfg_sel      (),
103
.i_wbs_cfg_we        (),
104
.i_wbs_cfg_cyc       (),
105
.i_wbs_cfg_stb       (),
106
.iv_wbs_cfg_cti      (),
107
.iv_wbs_cfg_bte      (),
108
 
109
.ov_wbs_cfg_data     (),
110
.o_wbs_cfg_ack       (),
111
.o_wbs_cfg_err       (),
112
.o_wbs_cfg_rty       (),
113
//
114
// WB BURST SLAVE IF (READ-ONLY IF)
115
.iv_wbs_burst_addr   (DS_DMA_BM_IF.ov_wbs_burst_addr),
116
.iv_wbs_burst_sel    (DS_DMA_BM_IF.ov_wbs_burst_sel),
117
.i_wbs_burst_we      (DS_DMA_BM_IF.o_wbs_burst_we),
118
.i_wbs_burst_cyc     (DS_DMA_BM_IF.o_wbs_burst_cyc),
119
.i_wbs_burst_stb     (DS_DMA_BM_IF.o_wbs_burst_stb),
120
.iv_wbs_burst_cti    (DS_DMA_BM_IF.ov_wbs_burst_cti),
121
.iv_wbs_burst_bte    (DS_DMA_BM_IF.ov_wbs_burst_bte),
122
 
123
.ov_wbs_burst_data   (DS_DMA_BM_IF.iv_wbs_burst_data),
124
.o_wbs_burst_ack     (DS_DMA_BM_IF.i_wbs_burst_ack),
125
.o_wbs_burst_err     (DS_DMA_BM_IF.i_wbs_burst_err),
126
.o_wbs_burst_rty     (DS_DMA_BM_IF.i_wbs_burst_rty),
127
//
128
// WB IRQ lines
129
.o_wbs_irq_0         (),
130
.o_wbs_irq_dmar      ()
131
);
132
//////////////////////////////////////////////////////////////////////////////////
133
endmodule

powered by: WebSVN 2.1.0

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