-
Notifications
You must be signed in to change notification settings - Fork 2
/
dma_ahb_simple.v
executable file
·117 lines (116 loc) · 4.12 KB
/
dma_ahb_simple.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
//--------------------------------------------------------
// Copyright (c) 2014 by Ando Ki.
// All right reserved.
// Licensed under the 2-clause BSD license as stated by the author in the README.md file (https://github.com/adki/AMBA_AXI_AHB_APB/blob/20bf0295b217a961aa1cfa85f1c7b546b2a2a480/README.md?plain=1#L8).
//--------------------------------------------------------
// dma_ahb_simple.v
//--------------------------------------------------------
// VERSION = 2014.04.29.
//--------------------------------------------------------
// Note:
//--------------------------------------------------------
`include "dma_ahb_csr_ahb.v"
`include "dma_ahb_master.v"
`timescale 1ns/1ns
module dma_ahb_simple
(
input wire HRESETn
, input wire HCLK
//---------------------------------------------------
, input wire S_HSEL
, input wire [31:0] S_HADDR
, input wire [ 1:0] S_HTRANS
, input wire S_HWRITE
, input wire [ 2:0] S_HSIZE
, input wire [ 2:0] S_HBURST
, input wire [31:0] S_HWDATA
, output wire [31:0] S_HRDATA
, output wire [ 1:0] S_HRESP
, input wire S_HREADYin
, output wire S_HREADYout
//---------------------------------------------------
, output wire IRQ
//---------------------------------------------------
// bus interface
, output wire M_HBUSREQ
, input wire M_HGRANT
, output wire [31:0] M_HADDR
, output wire [ 1:0] M_HTRANS
, output wire M_HWRITE
, output wire [ 2:0] M_HSIZE
, output wire [ 2:0] M_HBURST
, output wire [ 3:0] M_HPROT
, output wire [31:0] M_HWDATA
, input wire [31:0] M_HRDATA
, input wire [ 1:0] M_HRESP
, input wire M_HREADY
//---------------------------------------------------
);
//-----------------------------------------------------
wire DMA_EN ; // synchronous reset
wire DMA_GO ;
wire DMA_BUSY ;
wire DMA_DONE ;
wire [31:0] DMA_SRC ; // source address
wire [31:0] DMA_DST ; // destination address
wire [15:0] DMA_BNUM ; // num of bytes to move
wire [ 4:0] DMA_BURST; // burst length 1, 4, 8 , 16
//-----------------------------------------------------
dma_ahb_csr_ahb
u_csr (
.HRESETn (HRESETn )
, .HCLK (HCLK )
, .HSEL (S_HSEL )
, .HADDR (S_HADDR )
, .HTRANS (S_HTRANS )
, .HWRITE (S_HWRITE )
, .HSIZE (S_HSIZE )
, .HBURST (S_HBURST )
, .HWDATA (S_HWDATA )
, .HRDATA (S_HRDATA )
, .HRESP (S_HRESP )
, .HREADYin (S_HREADYin )
, .HREADYout (S_HREADYout)
, .IRQ (IRQ )
, .DMA_EN (DMA_EN )
, .DMA_GO (DMA_GO )
, .DMA_BUSY (DMA_BUSY )
, .DMA_DONE (DMA_DONE )
, .DMA_SRC (DMA_SRC )
, .DMA_DST (DMA_DST )
, .DMA_BNUM (DMA_BNUM )
, .DMA_BURST (DMA_BURST )
);
//-----------------------------------------------------
dma_ahb_master
u_master (
.HRESETn (HRESETn )
, .HCLK (HCLK )
, .HBUSREQ (M_HBUSREQ )
, .HGRANT (M_HGRANT )
, .HADDR (M_HADDR )
, .HTRANS (M_HTRANS )
, .HWRITE (M_HWRITE )
, .HSIZE (M_HSIZE )
, .HBURST (M_HBURST )
, .HPROT (M_HPROT )
, .HWDATA (M_HWDATA )
, .HRDATA (M_HRDATA )
, .HRESP (M_HRESP )
, .HREADY (M_HREADY )
, .DMA_EN (DMA_EN )
, .DMA_GO (DMA_GO )
, .DMA_BUSY (DMA_BUSY )
, .DMA_DONE (DMA_DONE )
, .DMA_SRC (DMA_SRC )
, .DMA_DST (DMA_DST )
, .DMA_BNUM (DMA_BNUM )
, .DMA_BURST (DMA_BURST )
);
//-----------------------------------------------------
endmodule
//--------------------------------------------------------
// Revision History
//
// 2014.04.29: Start by Ando Ki (adki@dynalith.com)
//--------------------------------------------------------