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

Subversion Repositories mips789

[/] [mips789/] [tags/] [v001/] [verilog/] [mips_core/] [EXEC_stage.v] - Blame information for rev 2

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 exec_stage1
57
(
58
clk,rst,spc_cls_i,alu_func,
59
dmem_fw_ctl,ext_i,fw_alu,fw_dmem,
60
muxa_ctl_i,muxa_fw_ctl,muxb_ctl_i,
61
muxb_fw_ctl,pc_i,rs_i,rt_i,alu_ur_o,
62
dmem_data_ur_o,zz_spc_o
63
);
64
 
65
input clk;
66
wire clk;
67
input rst;
68
wire rst;
69
input spc_cls_i;
70
wire spc_cls_i;
71
input [4:0] alu_func;
72
wire [4:0] alu_func;
73
input [2:0] dmem_fw_ctl;
74
wire [2:0] dmem_fw_ctl;
75
input [31:0] ext_i;
76
wire [31:0] ext_i;
77
input [31:0] fw_alu;
78
wire [31:0] fw_alu;
79
input [31:0] fw_dmem;
80
wire [31:0] fw_dmem;
81
input [1:0] muxa_ctl_i;
82
wire [1:0] muxa_ctl_i;
83
input [2:0] muxa_fw_ctl;
84
wire [2:0] muxa_fw_ctl;
85
input [1:0] muxb_ctl_i;
86
wire [1:0] muxb_ctl_i;
87
input [2:0] muxb_fw_ctl;
88
wire [2:0] muxb_fw_ctl;
89
input [31:0] pc_i;
90
wire [31:0] pc_i;
91
input [31:0] rs_i;
92
wire [31:0] rs_i;
93
input [31:0] rt_i;
94
wire [31:0] rt_i;
95
output [31:0] alu_ur_o;
96
wire [31:0] alu_ur_o;
97
output [31:0] dmem_data_ur_o;
98
wire [31:0] dmem_data_ur_o;
99
output [31:0] zz_spc_o;
100
wire [31:0] zz_spc_o;
101
 
102
wire [31:0] BUS2332;
103
wire [31:0] BUS2446;
104
wire [31:0] BUS468;
105
wire [31:0] BUS476;
106
 
107
 
108
big_alu MIPS_alu
109
(
110
        .a(BUS476),
111
        .b(BUS468),
112
        .c(alu_ur_o),
113
        .clk(clk),
114
        .ctl(alu_func),
115
        .rst(rst)
116
);
117
 
118
 
119
 
120
add32 add4
121
(
122
        .d_i(pc_i),
123
        .d_o(BUS2446)
124
);
125
 
126
 
127
 
128
dmem_data_mux dmem_data_mux
129
(
130
        .data_o(dmem_data_ur_o),
131
        .fw_alu(fw_alu),
132
        .fw_ctl(dmem_fw_ctl),
133
        .fw_dmem(fw_dmem),
134
        .rt(rt_i)
135
);
136
 
137
 
138
 
139
alu_muxa i_alu_muxa
140
(
141
        .a_o(BUS476),
142
        .ctl(muxa_ctl_i),
143
        .ext(ext_i),
144
        .fw_alu(fw_alu),
145
        .fw_ctl(muxa_fw_ctl),
146
        .fw_mem(fw_dmem),
147
        .pc(BUS2332),
148
        .rs(rs_i),
149
        .spc(zz_spc_o)
150
);
151
 
152
 
153
 
154
alu_muxb i_alu_muxb
155
(
156
        .b_o(BUS468),
157
        .ctl(muxb_ctl_i),
158
        .ext(ext_i),
159
        .fw_alu(fw_alu),
160
        .fw_ctl(muxb_fw_ctl),
161
        .fw_mem(fw_dmem),
162
        .rt(rt_i)
163
);
164
 
165
 
166
 
167
r32_reg pc_nxt
168
(
169
        .clk(clk),
170
        .r32_i(BUS2446),
171
        .r32_o(BUS2332)
172
);
173
 
174
 
175
 
176
r32_reg_cls spc
177
(
178
        .clk(clk),
179
        .cls(spc_cls_i),
180
        .r32_i(pc_i),
181
        .r32_o(zz_spc_o)
182
);
183
 
184
 
185
 
186
endmodule

powered by: WebSVN 2.1.0

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