1 |
6 |
qaztronic |
//////////////////////////////////////////////////////////////////////
|
2 |
|
|
//// ////
|
3 |
|
|
//// Copyright (C) 2009 Authors and OPENCORES.ORG ////
|
4 |
|
|
//// ////
|
5 |
|
|
//// This source file may be used and distributed without ////
|
6 |
|
|
//// restriction provided that this copyright statement is not ////
|
7 |
|
|
//// removed from the file and that any derivative work contains ////
|
8 |
|
|
//// the original copyright notice and the associated disclaimer. ////
|
9 |
|
|
//// ////
|
10 |
|
|
//// This source file is free software; you can redistribute it ////
|
11 |
|
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
12 |
|
|
//// Public License as published by the Free Software Foundation; ////
|
13 |
|
|
//// either version 2.1 of the License, or (at your option) any ////
|
14 |
|
|
//// later version. ////
|
15 |
|
|
//// ////
|
16 |
|
|
//// This source is distributed in the hope that it will be ////
|
17 |
|
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
18 |
|
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
19 |
|
|
//// PURPOSE. See the GNU Lesser General Public License for more ////
|
20 |
|
|
//// details. ////
|
21 |
|
|
//// ////
|
22 |
|
|
//// You should have received a copy of the GNU Lesser General ////
|
23 |
|
|
//// Public License along with this source; if not, download it ////
|
24 |
|
|
//// from http://www.opencores.org/lgpl.shtml ////
|
25 |
|
|
//// ////
|
26 |
|
|
//////////////////////////////////////////////////////////////////////
|
27 |
|
|
|
28 |
|
|
module asram_if(
|
29 |
|
|
inout [15:0] sram_dq, // SRAM Data bus 16 Bits
|
30 |
|
|
output [17:0] sram_addr, // SRAM Address bus 18 Bits
|
31 |
|
|
output sram_ub_n, // SRAM High-byte Data Mask
|
32 |
|
|
output sram_lb_n, // SRAM Low-byte Data Mask
|
33 |
|
|
output sram_we_n, // SRAM Write Enable
|
34 |
|
|
output sram_ce_n, // SRAM Chip Enable
|
35 |
|
|
output sram_oe_n, // SRAM Output Enable
|
36 |
|
|
input wb_clk_i, // WISHBONE interface
|
37 |
|
|
input wb_rst_i,
|
38 |
|
|
input [18:0] wb_adr_i,
|
39 |
|
|
input [31:0] wb_dat_i,
|
40 |
|
|
input wb_we_i,
|
41 |
|
|
input wb_stb_i,
|
42 |
|
|
input wb_cyc_i,
|
43 |
|
|
input [3:0] wb_sel_i,
|
44 |
|
|
output [31:0] wb_dat_o,
|
45 |
|
|
output wb_ack_o
|
46 |
|
|
);
|
47 |
|
|
|
48 |
|
|
|
49 |
|
|
//---------------------------------------------------
|
50 |
|
|
// wb_size_bridge
|
51 |
|
|
wire [15:0] wb_lo_dat_o;
|
52 |
|
|
wire [31:0] wb_lo_adr_o;
|
53 |
|
|
wire wb_lo_cyc_o;
|
54 |
|
|
wire wb_lo_stb_o;
|
55 |
|
|
wire wb_lo_we_o;
|
56 |
|
|
wire [1:0] wb_lo_sel_o;
|
57 |
|
|
wire wb_lo_ack_i = 1'b1;
|
58 |
|
|
wire wb_lo_err_i = 1'b0;
|
59 |
|
|
wire wb_lo_rty_i = 1'b0;
|
60 |
|
|
|
61 |
|
|
wb_size_bridge i_wb_size_bridge(
|
62 |
|
|
.wb_hi_clk_i(wb_clk_i),
|
63 |
|
|
.wb_hi_rst_i(wb_rst_i),
|
64 |
|
|
.wb_hi_dat_o(wb_dat_o),
|
65 |
|
|
.wb_hi_dat_i(wb_dat_i),
|
66 |
|
|
.wb_hi_adr_i( {13'h0000, wb_adr_i} ),
|
67 |
|
|
.wb_hi_cyc_i(wb_cyc_i),
|
68 |
|
|
.wb_hi_stb_i(wb_stb_i),
|
69 |
|
|
.wb_hi_we_i(wb_we_i),
|
70 |
|
|
.wb_hi_sel_i(wb_sel_i),
|
71 |
|
|
.wb_hi_ack_o(wb_ack_o),
|
72 |
|
|
.wb_hi_err_o(),
|
73 |
|
|
.wb_hi_rty_o(),
|
74 |
|
|
|
75 |
|
|
.wb_lo_clk_o(),
|
76 |
|
|
.wb_lo_rst_o(),
|
77 |
|
|
.wb_lo_dat_i(sram_dq),
|
78 |
|
|
.wb_lo_dat_o(wb_lo_dat_o),
|
79 |
|
|
.wb_lo_adr_o(wb_lo_adr_o),
|
80 |
|
|
.wb_lo_cyc_o(wb_lo_cyc_o),
|
81 |
|
|
.wb_lo_stb_o(wb_lo_stb_o),
|
82 |
|
|
.wb_lo_we_o(wb_lo_we_o),
|
83 |
|
|
.wb_lo_sel_o(wb_lo_sel_o),
|
84 |
|
|
.wb_lo_ack_i(wb_lo_ack_i),
|
85 |
|
|
.wb_lo_err_i(wb_lo_err_i),
|
86 |
|
|
.wb_lo_rty_i(wb_lo_rty_i),
|
87 |
|
|
|
88 |
|
|
.lo_byte_if_i(1'b0)
|
89 |
|
|
);
|
90 |
|
|
|
91 |
|
|
|
92 |
|
|
//---------------------------------------------------
|
93 |
|
|
// outputs
|
94 |
|
|
assign sram_dq = wb_lo_we_o ? wb_lo_dat_o : 16'hzz;
|
95 |
|
|
assign sram_addr = wb_lo_adr_o[18:1];
|
96 |
|
|
assign sram_ub_n = ~wb_lo_sel_o[1];
|
97 |
|
|
assign sram_lb_n = ~wb_lo_sel_o[0];
|
98 |
|
|
assign sram_we_n = ~wb_lo_we_o;
|
99 |
|
|
assign sram_ce_n = 1'b0;
|
100 |
|
|
assign sram_oe_n = wb_lo_we_o;
|
101 |
|
|
|
102 |
|
|
|
103 |
|
|
endmodule
|
104 |
|
|
|
105 |
|
|
|