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

Subversion Repositories mips789

[/] [mips789/] [tags/] [arelease/] [rtl/] [verilog/] [ram_module.v] - Blame information for rev 56

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

Line No. Rev Author Line
1 35 mcupro
/******************************************************************
2
 *                                                                *
3
 *    Author: Liwei                                               *
4
 *                                                                *
5
 *    This file is part of the "mips789" project.                 *
6
 *    Downloaded from:                                            *
7
 *    http://www.opencores.org/pdownloads.cgi/list/mips789        *
8
 *                                                                *
9
 *    If you encountered any problem, please contact me via       *
10
 *    Email:mcupro@opencores.org  or mcupro@163.com               *
11
 *                                                                *
12
 ******************************************************************/
13
 
14
 
15 10 mcupro
module mem_array
16
    (
17
        input clk,
18
        input [31:0] pc_i,
19
        output [31:0] ins_o,
20
        input [3:0] wren,
21
        input [31:0]din,
22 35 mcupro
        input [31:0]data_addr_i,
23 10 mcupro
        output [31:0]dout
24
    );
25 35 mcupro
    wire [31:0] data_addr;
26 10 mcupro
    wire [31:0]dout_w;
27
    assign dout = dout_w;
28 35 mcupro
    assign data_addr=data_addr_i[31:2];
29
    wire [29:0]pc= pc_i[31:2];
30 10 mcupro
 
31 35 mcupro
    ram2048x8_3 ram3(
32 10 mcupro
                    .data_a(32'b0),
33
                    .wren_a(1'b0),
34 35 mcupro
                    .address_a(pc),
35 10 mcupro
                    .data_b(din[31:24]),
36 35 mcupro
                    .address_b(data_addr),
37 10 mcupro
                    .wren_b(wren[3]),
38
                    .clock(clk),
39
                    .q_a(ins_o[31:24]),
40
                    .q_b(dout_w[31:24])
41
                );
42
 
43 35 mcupro
    ram2048x8_2 ram2(
44 10 mcupro
                    .data_a(32'b0),
45
                    .wren_a(1'b0),
46 35 mcupro
                    .address_a(pc),
47 10 mcupro
                    .data_b(din[23:16]),
48 35 mcupro
                    .address_b(data_addr),
49 10 mcupro
                    .wren_b(wren[2]),
50
                    .clock(clk),
51
                    .q_a(ins_o[23:16]),
52
                    .q_b(dout_w[23:16])
53
                );
54
 
55 35 mcupro
    ram2048x8_1 ram1(
56 10 mcupro
                    .data_a(32'b0),
57
                    .wren_a(1'b0),
58 35 mcupro
                    .address_a(pc),
59 10 mcupro
                    .data_b(din[15:8]),
60 35 mcupro
                    .address_b(data_addr),
61 10 mcupro
                    .wren_b(wren[1]),
62
                    .clock(clk),
63
                    .q_a(ins_o[15:8]),
64
                    .q_b(dout_w[15:8])
65
                );
66
 
67 35 mcupro
    ram2048x8_0 ram0(
68 10 mcupro
                    .data_a(32'b0),
69
                    .wren_a(1'b0),
70 35 mcupro
                    .address_a(pc),
71 10 mcupro
                    .data_b(din[7:0]),
72 35 mcupro
                    .address_b(data_addr),
73 10 mcupro
                    .wren_b(wren[0]),
74
                    .clock(clk),
75
                    .q_a(ins_o[7:0]),
76
                    .q_b(dout_w[7:0])
77
                );
78
 
79
endmodule

powered by: WebSVN 2.1.0

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