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

Subversion Repositories mips789

[/] [mips789/] [branches/] [mcupro/] [verilog/] [mips_core/] [mem_module.v] - Blame information for rev 59

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

Line No. Rev Author Line
1 2 mcupro
/////////////////////////////////////////////////////////////////////
2
////  Author: Liwei                                              ////
3
////                                                             ////
4
////                                                             ////
5
////  If you encountered any problem, please contact :           ////
6
////  Email: mcupro@yahoo.com.hk or mcupro@opencores.org         ////
7
////                                                             ////
8
////  Downloaded from:                                           ////
9
////     http://www.opencores.org/pdownloads.cgi/list/mips789    ////
10
/////////////////////////////////////////////////////////////////////
11
////                                                             ////
12
//// Copyright (C) 2006-2007 Liwei                               ////
13
////                         mcupro@yahoo.com.hk                 ////
14
////                                                             ////
15
////                                                             ////
16
//// This source file may be used and distributed freely without ////
17
//// restriction provided that this copyright statement is not   ////
18
//// removed from the file and any derivative work contains the  ////
19
//// original copyright notice and the associated disclaimer.    ////
20
////                                                             ////
21
//// Please let the author know if it is used                    ////
22
//// for commercial purpose.                                     ////
23
////                                                             ////
24
////     THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY     ////
25
//// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED   ////
26
//// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS   ////
27
//// FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR      ////
28
//// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,         ////
29
//// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES    ////
30
//// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE   ////
31
//// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR        ////
32
//// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF  ////
33
//// LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT  ////
34
//// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT  ////
35
//// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE         ////
36
//// POSSIBILITY OF SUCH DAMAGE.                                 ////
37
////                                                             ////
38
/////////////////////////////////////////////////////////////////////
39
////                                                             ////
40
////                                                             ////
41
//// Date of Creation: 2007.8.1                                  ////
42
////                                                             ////
43
//// Version: 0.0.1                                              ////
44
////                                                             ////
45
//// Description:                                                ////
46
////                                                             ////
47
////                                                             ////
48
/////////////////////////////////////////////////////////////////////
49
////                                                             ////
50
//// Change log:                                                 ////
51
////                                                             ////
52
/////////////////////////////////////////////////////////////////////
53
 
54
 
55
 
56
module mem_module1 (clk,din,dmem_addr_i,dmem_ctl,zZ_din,Zz_addr,Zz_dout,Zz_wr_en,dout) ;
57
 
58
// ------------ Port declarations --------- //
59
input clk;
60
wire clk;
61
input [31:0] din;
62
wire [31:0] din;
63
input [31:0] dmem_addr_i;
64
wire [31:0] dmem_addr_i;
65
input [3:0] dmem_ctl;
66
wire [3:0] dmem_ctl;
67
input [31:0] zZ_din;
68
wire [31:0] zZ_din;
69
output [31:0] Zz_addr;
70
wire [31:0] Zz_addr;
71
output [31:0] Zz_dout;
72
wire [31:0] Zz_dout;
73
output [3:0] Zz_wr_en;
74
wire [3:0] Zz_wr_en;
75
output [31:0] dout;
76
wire [31:0] dout;
77
 
78
// ----------- Signal declarations -------- //
79
wire [3:0] BUS512;
80
wire [1:0] BUS629;
81
wire [31:0] BUS650;
82
 
83
// -------- Component instantiations -------//
84
 
85
infile_dmem_ctl_reg dmem_ctl_post
86
(
87
        .byte_addr_o(BUS629),
88
        .clk(clk),
89
        .ctl_i(dmem_ctl),
90
        .ctl_o(BUS512),
91
        .dmem_addr_i(BUS650)
92
);
93
 
94
 
95
 
96
mem_addr_ctl i_mem_addr_ctl
97
(
98
        .addr_i(BUS650),
99
        .ctl(dmem_ctl),
100
        .wr_en(Zz_wr_en)
101
);
102
 
103
 
104
 
105
mem_din_ctl i_mem_din_ctl
106
(
107
        .ctl(dmem_ctl),
108
        .din(din),
109
        .dout(Zz_dout)
110
);
111
 
112
 
113
 
114
mem_dout_ctl i_mem_dout_ctl
115
(
116
        .byte_addr(BUS629),
117
        .ctl(BUS512),
118
        .din(zZ_din),
119
        .dout(dout)
120
);
121
 
122
 
123
 
124
// ----------- Terminals assignment --------//
125
//             ---- Input terminals ---         //
126
assign BUS650[31:0] = dmem_addr_i[31:0];
127
 
128
//                 ---- Output terminals ---        //
129
assign Zz_addr[31:0] = BUS650[31:0];
130
 
131
endmodule

powered by: WebSVN 2.1.0

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