OpenCores
URL https://opencores.org/ocsvn/kiss-board/kiss-board/trunk

Subversion Repositories kiss-board

[/] [kiss-board/] [tags/] [initial/] [kiss-board_soc/] [src/] [extend/] [wb_dma/] [wb_dma_wb_mast.v] - Blame information for rev 3

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

Line No. Rev Author Line
1 2 fukuchi
/////////////////////////////////////////////////////////////////////
2
////                                                             ////
3
////  WISHBONE DMA WISHBONE Master Interface                     ////
4
////                                                             ////
5
////                                                             ////
6
////  Author: Rudolf Usselmann                                   ////
7
////          rudi@asics.ws                                      ////
8
////                                                             ////
9
////                                                             ////
10
////  Downloaded from: http://www.opencores.org/cores/wb_dma/    ////
11
////                                                             ////
12
/////////////////////////////////////////////////////////////////////
13
////                                                             ////
14
//// Copyright (C) 2000-2002 Rudolf Usselmann                    ////
15
////                         www.asics.ws                        ////
16
////                         rudi@asics.ws                       ////
17
////                                                             ////
18
//// This source file may be used and distributed without        ////
19
//// restriction provided that this copyright statement is not   ////
20
//// removed from the file and that any derivative work contains ////
21
//// the original copyright notice and the associated disclaimer.////
22
////                                                             ////
23
////     THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY     ////
24
//// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED   ////
25
//// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS   ////
26
//// FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR      ////
27
//// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,         ////
28
//// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES    ////
29
//// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE   ////
30
//// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR        ////
31
//// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF  ////
32
//// LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT  ////
33
//// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT  ////
34
//// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE         ////
35
//// POSSIBILITY OF SUCH DAMAGE.                                 ////
36
////                                                             ////
37
/////////////////////////////////////////////////////////////////////
38
 
39
//  CVS Log
40
//
41
//  $Id: wb_dma_wb_mast.v,v 1.1.1.1 2006-05-29 13:45:24 fukuchi Exp $
42
//
43
//  $Date: 2006-05-29 13:45:24 $
44
//  $Revision: 1.1.1.1 $
45
//  $Author: fukuchi $
46
//  $Locker:  $
47
//  $State: Exp $
48
//
49
// Change History:
50
//               $Log: not supported by cvs2svn $
51
//               Revision 1.2  2002/02/01 01:54:45  rudi
52
//
53
//               - Minor cleanup
54
//
55
//               Revision 1.1  2001/07/29 08:57:02  rudi
56
//
57
//
58
//               1) Changed Directory Structure
59
//               2) Added restart signal (REST)
60
//
61
//               Revision 1.2  2001/06/05 10:22:37  rudi
62
//
63
//
64
//               - Added Support of up to 31 channels
65
//               - Added support for 2,4 and 8 priority levels
66
//               - Now can have up to 31 channels
67
//               - Added many configuration items
68
//               - Changed reset to async
69
//
70
//               Revision 1.1.1.1  2001/03/19 13:11:05  rudi
71
//               Initial Release
72
//
73
//
74
//
75
 
76
`include "wb_dma_defines.v"
77
 
78
module wb_dma_wb_mast(clk, rst,
79
 
80
        wb_data_i, wb_data_o, wb_addr_o, wb_sel_o, wb_we_o, wb_cyc_o,
81
        wb_stb_o, wb_ack_i, wb_err_i, wb_rty_i,
82
 
83
        mast_go, mast_we, mast_adr, mast_din, mast_dout, mast_err,
84
        mast_drdy, mast_wait,
85
 
86
        pt_sel, mast_pt_in, mast_pt_out
87
        );
88
 
89
input           clk, rst;
90
 
91
// --------------------------------------
92
// WISHBONE INTERFACE 
93
 
94
input   [31:0]   wb_data_i;
95
output  [31:0]   wb_data_o;
96
output  [31:0]   wb_addr_o;
97
output  [3:0]    wb_sel_o;
98
output          wb_we_o;
99
output          wb_cyc_o;
100
output          wb_stb_o;
101
input           wb_ack_i;
102
input           wb_err_i;
103
input           wb_rty_i;
104
 
105
// --------------------------------------
106
// INTERNAL DMA INTERFACE 
107
input           mast_go;        // Perform a Master Cycle (as long as this
108
                                // line is asserted)
109
input           mast_we;        // Read/Write
110
input   [31:0]   mast_adr;       // Address for the transfer
111
input   [31:0]   mast_din;       // Internal Input Data
112
output  [31:0]   mast_dout;      // Internal Output Data
113
output          mast_err;       // Indicates an error has occurred
114
 
115
output          mast_drdy;      // Indicated that either data is available
116
                                // during a read, or that the master can accept
117
                                // the next data during a write
118
input           mast_wait;      // Tells the master to insert wait cycles
119
                                // because data can not be accepted/provided
120
 
121
// Pass Through Interface
122
input           pt_sel;         // Pass Through Mode Selected
123
input   [70:0]   mast_pt_in;     // Grouped WISHBONE inputs
124
output  [34:0]   mast_pt_out;    // Grouped WISHBONE outputs
125
 
126
////////////////////////////////////////////////////////////////////
127
//
128
// Local Wires
129
//
130
 
131
reg             mast_cyc, mast_stb;
132
reg             mast_we_r;
133
reg     [3:0]    mast_be;
134
reg     [31:0]   mast_dout;
135
 
136
////////////////////////////////////////////////////////////////////
137
//
138
// Pass-Through Interface
139
//
140
 
141
assign {wb_data_o, wb_addr_o, wb_sel_o, wb_we_o, wb_cyc_o, wb_stb_o} =
142
        pt_sel ? mast_pt_in :
143
        {mast_din, mast_adr, mast_be, mast_we_r, mast_cyc, mast_stb};
144
 
145
assign mast_pt_out = {wb_data_i, wb_ack_i, wb_err_i, wb_rty_i};
146
 
147
////////////////////////////////////////////////////////////////////
148
//
149
// DMA Engine Interface
150
//
151
 
152
always @(posedge clk)
153
        if(wb_ack_i)    mast_dout <= #1 wb_data_i;
154
 
155
always @(posedge clk)
156
        mast_be <= #1 4'hf;
157
 
158
always @(posedge clk)
159
        mast_we_r <= #1 mast_we;
160
 
161
always @(posedge clk)
162
        mast_cyc <= #1 mast_go;
163
 
164
always @(posedge clk)
165
        mast_stb <= #1 mast_go & !mast_wait;
166
 
167
assign mast_drdy = wb_ack_i;
168
assign mast_err  = wb_err_i;
169
 
170
endmodule

powered by: WebSVN 2.1.0

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