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/] [ds_dma_test_gen_burst_master_if.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:     ds_dma_test_gen_burst_master_if
8
// Project Name:    DS_DMA
9
// Target Devices:  no
10
// Tool versions:   any with SV support
11
// Description:     
12
//                  
13
//
14
// Revision: 
15
// Revision 0.01 - File Created
16
//
17
//////////////////////////////////////////////////////////////////////////////////
18
 
19
interface ds_dma_test_gen_burst_master_if # ( parameter time pt_Tdly = 1ns )
20
(
21
    input   i_clk
22
);
23
//////////////////////////////////////////////////////////////////////////////////
24
    //
25
    // WB IF
26
    logic   [11:0]  ov_wbs_burst_addr;
27
    logic   [ 7:0]  ov_wbs_burst_sel;
28
    logic           o_wbs_burst_we;
29
    logic           o_wbs_burst_cyc;
30
    logic           o_wbs_burst_stb;
31
    logic   [ 2:0]  ov_wbs_burst_cti;
32
    logic   [ 1:0]  ov_wbs_burst_bte;
33
 
34
    logic   [63:0]  iv_wbs_burst_data;
35
    logic           i_wbs_burst_ack;
36
    logic           i_wbs_burst_err;
37
    logic           i_wbs_burst_rty;
38
 
39
//////////////////////////////////////////////////////////////////////////////////
40
//
41
// Define Clocking block:
42
//
43
default clocking cb @(posedge i_clk);
44
    default input #(pt_Tdly) output #(pt_Tdly);
45
    output ov_wbs_burst_addr, ov_wbs_burst_sel, o_wbs_burst_we, o_wbs_burst_cyc, o_wbs_burst_stb, ov_wbs_burst_cti, ov_wbs_burst_bte;
46
    input iv_wbs_burst_data, i_wbs_burst_ack, i_wbs_burst_err, i_wbs_burst_rty;
47
endclocking
48
//////////////////////////////////////////////////////////////////////////////////
49
//
50
// Tasks:
51
//
52
// Init DATA_OUT
53
task    init;
54
    //
55
    ov_wbs_burst_addr   <= 0;
56
    ov_wbs_burst_sel    <= 0;
57
    o_wbs_burst_we      <= 0;
58
    o_wbs_burst_cyc     <= 0;
59
    o_wbs_burst_stb     <= 0;
60
    ov_wbs_burst_cti    <= 0;
61
    ov_wbs_burst_bte    <= 0;
62
    //
63
endtask
64
//
65
task read_512_word (output [63:0] ov_data [512]);
66
    //
67
    int i=0, stb_counter=0;
68
    //
69
    @cb;
70
    cb.ov_wbs_burst_addr    <= 0;
71
    cb.ov_wbs_burst_sel     <= 0;
72
    cb.o_wbs_burst_we       <= 0;
73
    cb.o_wbs_burst_cyc      <= 0;
74
    cb.o_wbs_burst_stb      <= 0;
75
    cb.ov_wbs_burst_cti     <= 0;
76
    ov_wbs_burst_bte        <= 0;
77
    @cb;
78
    cb.ov_wbs_burst_sel     <= '1;
79
    cb.o_wbs_burst_cyc      <= 1;
80
    cb.o_wbs_burst_stb      <= 1;
81
    cb.ov_wbs_burst_cti     <= 3'b001;
82
    ov_wbs_burst_bte        <= 2'b01;
83
    i=0;
84
    stb_counter=0;
85
    // 
86
    do
87
        begin   :   GET_DATA
88
            @cb;
89
            if (cb.i_wbs_burst_ack)
90
                begin   :   DATA_COLLECT
91
                    // 
92
                    ov_data[i] = cb.iv_wbs_burst_data;
93
                    i++;
94
                    // 
95
                    if (i==511) // EndOfBurst
96
                        cb.ov_wbs_burst_cti     <= 3'b111;
97
                end
98
            /*
99
            if (stb_counter==5)
100
                begin   :   MASTER_DLY
101
                    cb.o_wbs_burst_stb      <= 0;
102
                    @cb;
103
                    @cb;
104
                    cb.o_wbs_burst_stb      <= 1;
105
                end
106
            stb_counter++;*/
107
        end
108
    while (i<512/*+1*/);
109
    // CLR on EXIT
110
    cb.ov_wbs_burst_sel     <= 0;
111
    cb.o_wbs_burst_cyc      <= 0;
112
    cb.o_wbs_burst_stb      <= 0;
113
    cb.ov_wbs_burst_cti     <= 0;
114
    ov_wbs_burst_bte        <= 0;
115
    // 
116
endtask
117
//////////////////////////////////////////////////////////////////////////////////
118
//
119
// Functions:
120
//
121
 
122
//////////////////////////////////////////////////////////////////////////////////
123
endinterface

powered by: WebSVN 2.1.0

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