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

Subversion Repositories wf3d

[/] [wf3d/] [trunk/] [implement/] [rtl/] [axi_cmn/] [fm_dma.v] - Blame information for rev 9

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 specular
//=======================================================================
2
// Project Monophony
3
//   Wire-Frame 3D Graphics Accelerator IP Core
4
//
5
// File:
6
//   fm_dma.v
7
//
8
// Abstract:
9
//   DMA controller for buffer clear
10
//
11
// Author:
12 9 specular
//   Kenji Ishimaru (info.info.wf3d@gmail.com)
13 5 specular
//
14
//======================================================================
15
//
16
// Copyright (c) 2016, Kenji Ishimaru
17
// All rights reserved.
18
//
19
// Redistribution and use in source and binary forms, with or without
20
// modification, are permitted provided that the following conditions are met:
21
//
22
//  -Redistributions of source code must retain the above copyright notice,
23
//   this list of conditions and the following disclaimer.
24
//  -Redistributions in binary form must reproduce the above copyright notice,
25
//   this list of conditions and the following disclaimer in the documentation
26
//   and/or other materials provided with the distribution.
27
//
28
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
30
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
31
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
32
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
33
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
34
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
35
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
36
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
37
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
38
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39
//
40
// Revision History
41
 
42
module fm_dma (
43
    clk_core,
44
    rst_x,
45
    // DMA
46
    i_dma_start,
47
    i_dma_mode,
48
    o_dma_end,
49
    i_dma_top_address0,
50
    i_dma_top_address1,
51
    i_dma_top_address2,
52
    i_dma_top_address3,
53
    i_dma_length,
54
    i_dma_be,
55
    i_dma_wd0,
56
    i_dma_wd1,
57
    // memory access
58
    o_req_mem,
59
    o_wr_mem,
60
    o_adrs_mem,
61
    o_len_mem,
62
    i_ack_mem,
63
    o_strw_mem,
64
    o_be_mem,
65
    o_wd_mem,
66
    i_ackw_mem
67
);
68
//////////////////////////////////
69
// I/O port definition
70
//////////////////////////////////
71
`include "polyphony_params.v"
72
    input           clk_core;
73
    input           rst_x;
74
    // DMA
75
    input           i_dma_start;
76
    input  [3:0]    i_dma_mode;
77
    output          o_dma_end;
78
    input  [19:0]   i_dma_top_address0;
79
    input  [19:0]   i_dma_top_address1;
80
    input  [19:0]   i_dma_top_address2;
81
    input  [19:0]   i_dma_top_address3;
82
    input  [17:0]   i_dma_length;
83
    input  [3:0]    i_dma_be;
84
    input  [31:0]   i_dma_wd0;
85
    input  [31:0]   i_dma_wd1;
86
    // sdram interface
87
    output          o_req_mem;
88
    output          o_wr_mem;
89
    output [P_IB_ADDR_WIDTH-1:0]  o_adrs_mem;
90
    output [P_IB_LEN_WIDTH-1:0]   o_len_mem;
91
    input           i_ack_mem;
92
    output          o_strw_mem;
93
    output [P_IB_BE_WIDTH-1:0]    o_be_mem;
94
    output [P_IB_DATA_WIDTH-1:0]  o_wd_mem;
95
    input           i_ackw_mem;
96
 
97
    // dma
98
    wire            w_req_dma;
99
    wire            w_wr_dma;
100
    wire   [P_IB_ADDR_WIDTH-1:0]  w_adrs_dma;
101
    wire   [P_IB_LEN_WIDTH-1:0]   w_len_dma;
102
    wire            w_ack_dma;
103
    wire            w_strw_dma;
104
    wire   [P_IB_BE_WIDTH-1:0]    w_be_dma;
105
    wire   [P_IB_DATA_WIDTH-1:0]  w_wd_dma;
106
    wire            w_ackw_dma;
107
//////////////////////////////////
108
// assign
109
//////////////////////////////////
110
 
111
//////////////////////////////////
112
// module instance
113
//////////////////////////////////
114
    fm_dispatch_dma dispatch_dma (
115
        .clk_core(clk_core),
116
        .rst_x(rst_x),
117
        // system port
118
        .i_dma_start(i_dma_start),
119
        .i_dma_mode(i_dma_mode),
120
        .o_dma_end(o_dma_end),
121
        .i_dma_top_address0(i_dma_top_address0),
122
        .i_dma_top_address1(i_dma_top_address1),
123
        .i_dma_top_address2(i_dma_top_address2),
124
        .i_dma_top_address3(i_dma_top_address3),
125
        .i_dma_length(i_dma_length),
126
        .i_dma_be(i_dma_be),
127
        .i_dma_wd0(i_dma_wd0),
128
        .i_dma_wd1(i_dma_wd1),
129
        // memory port
130
        .o_req(w_req_dma),
131
        .o_wr(w_wr_dma),
132
        .o_adrs(w_adrs_dma),
133
        .o_len(w_len_dma),
134
        .i_ack(w_ack_dma),
135
        .o_strw(w_strw_dma),
136
        .o_be(w_be_dma),
137
        .o_wd(w_wd_dma),
138
        .i_ackw(w_ackw_dma)
139
    );
140
 
141
    fm_cmn_if_ff_out #(P_IB_ADDR_WIDTH,
142
                       P_IB_DATA_WIDTH,
143
                       P_IB_LEN_WIDTH) if_ff_out (
144
        .clk_core(clk_core),
145
        .rst_x(rst_x),
146
        // local interface
147
        .i_req(w_req_dma),
148
        .i_wr(w_wr_dma),
149
        .i_adrs(w_adrs_dma),
150
        .i_len(w_len_dma),
151
        .o_ack(w_ack_dma),
152
        .i_strw(w_strw_dma),
153
        .i_be(w_be_dma),
154
        .i_dbw(w_wd_dma),
155
        .o_ackw(w_ackw_dma),
156
        .o_strr(),
157
        .o_dbr(),
158
        // F/F interface
159
        .o_req(o_req_mem),
160
        .o_wr(o_wr_mem),
161
        .o_adrs(o_adrs_mem),
162
        .o_len(o_len_mem),
163
        .i_ack(i_ack_mem),
164
        .o_strw(o_strw_mem),
165
        .o_be(o_be_mem),
166
        .o_dbw(o_wd_mem),
167
        .i_ackw(i_ackw_mem),
168
        .i_strr(1'b0),
169
        .i_dbr({P_IB_DATA_WIDTH{1'b0}})
170
    );
171
 
172
endmodule

powered by: WebSVN 2.1.0

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