forked from bumblebee17/5-Stage-Pipeline-Processor-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathID_IE.v
66 lines (63 loc) · 1.63 KB
/
ID_IE.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 22:54:50 05/26/2020
// Design Name:
// Module Name: ID_IE
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module ID_IE(flush,pc_in,clk,Read_data1_in,Read_data2_in,im_ext_in,im_addr_in,func_in,ctrl_sig_in,rd_in,rs_in,rt_in,rs_out,rt_out,ctrl_sig,Read_data1,Read_data2,im_ext,im_addr_out,func,rd,pc_out);
input clk,flush;
input [4:0] rd_in,rs_in,rt_in;
input [8:0] ctrl_sig_in;
input [31:0] Read_data1_in,Read_data2_in,im_ext_in,pc_in,im_addr_in;
input [5:0] func_in;
output reg[31:0] Read_data1,Read_data2,im_ext,pc_out,im_addr_out;
output reg[5:0] func;
output reg[8:0] ctrl_sig;
output reg[4:0] rd,rs_out,rt_out;
always@(clk)
begin
if(clk)
begin
if(flush) // if branch is taken then data will be flushed out from the latch
begin
Read_data1 <= 32'bx;
Read_data2 <= 32'bx;
im_ext <= 32'bx;
func <= 6'bx;
ctrl_sig <= 9'bx;
rd <= 5'bx;
pc_out <= 32'bx;
im_addr_out <= 32'bx;
rs_out <= 5'bx;
rs_out <= 5'bx;
end
else
begin
Read_data1 <= Read_data1_in;
Read_data2 <= Read_data2_in;
im_ext <= im_ext_in;
func <= func_in;
ctrl_sig <= ctrl_sig_in;
rd <= rd_in;
pc_out <= pc_in;
im_addr_out <= im_addr_in;
rs_out <= rs_in;
rt_out <= rt_in;
end
end
end
endmodule