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

Subversion Repositories ao486

[/] [ao486/] [trunk/] [syn/] [components/] [sd_card/] [slow_mem/] [slow_mem.v] - Blame information for rev 8

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 8 alfik
 
2
module slow_mem(
3
    input               clk,
4
    input               rst_n,
5
 
6
    input       [9:0]   avs_address,
7
    input               avs_read,
8
    output      [7:0]   avs_readdata,
9
    input               avs_write,
10
    input       [7:0]   avs_writedata,
11
    output              avs_waitrequest
12
);
13
 
14
reg [5:0] wait_cnt;
15
always @(posedge clk or negedge rst_n) begin
16
    if(rst_n == 1'b0)   wait_cnt <= 6'd0;
17
    else                wait_cnt <= wait_cnt + 6'd1;
18
end
19
 
20
assign avs_waitrequest = ~(wait_cnt == 4'd0);
21
 
22
altsyncram line_ram_inst(
23
    .clock0     (clk),
24
    .address_a  (avs_address),
25
    .wren_a     (avs_write && ~(avs_waitrequest)),
26
    .data_a     (avs_writedata),
27
 
28
    .clock1     (clk),
29
    .address_b  (avs_address),
30
    .q_b        (avs_readdata)
31
);
32
defparam    line_ram_inst.operation_mode = "DUAL_PORT",
33
            line_ram_inst.width_a = 8,
34
            line_ram_inst.widthad_a = 10,
35
            line_ram_inst.width_b = 8,
36
            line_ram_inst.widthad_b = 10;
37
 
38
endmodule

powered by: WebSVN 2.1.0

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