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

Subversion Repositories hpdmc

[/] [hpdmc/] [trunk/] [hpdmc_ddr32/] [rtl/] [hpdmc_busif.v] - Blame information for rev 21

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 21 lekernel
/*
2
 * Milkymist VJ SoC
3
 * Copyright (C) 2007, 2008, 2009 Sebastien Bourdeauducq
4
 *
5
 * This program is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation, version 3 of the License.
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
 */
17
 
18
/* Simple FML interface for HPDMC */
19
 
20
module hpdmc_busif #(
21
        parameter sdram_depth = 26
22
) (
23
        input sys_clk,
24
        input sdram_rst,
25
 
26
        input [sdram_depth-1:0] fml_adr,
27
        input fml_stb,
28
        input fml_we,
29
        output fml_ack,
30
 
31
        output mgmt_stb,
32
        output mgmt_we,
33
        output [sdram_depth-3-1:0] mgmt_address, /* in 64-bit words */
34
        input mgmt_ack,
35
 
36
        input data_ack
37
);
38
 
39
reg mgmt_stb_en;
40
 
41
assign mgmt_stb = fml_stb & mgmt_stb_en;
42
assign mgmt_we = fml_we;
43
assign mgmt_address = fml_adr[sdram_depth-1:3];
44
 
45
assign fml_ack = data_ack;
46
 
47
always @(posedge sys_clk) begin
48
        if(sdram_rst)
49
                mgmt_stb_en = 1'b1;
50
        else begin
51
                if(mgmt_ack)
52
                        mgmt_stb_en = 1'b0;
53
                if(data_ack)
54
                        mgmt_stb_en = 1'b1;
55
        end
56
end
57
 
58
endmodule

powered by: WebSVN 2.1.0

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