-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMEMWB.v
More file actions
30 lines (27 loc) · 702 Bytes
/
MEMWB.v
File metadata and controls
30 lines (27 loc) · 702 Bytes
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
module MEMWB (
input clk,
input en,
input [3:0] ireg_write_addr,
input [7:0] ireg_write_data,
input ireg_write_en,
input imem_to_reg,
input [7:0] ialu_out,
input [7:0] inextPC,
output reg [3:0] oreg_write_addr,
output reg [7:0] oreg_write_data,
output reg oreg_write_en,
output reg omem_to_reg,
output reg [7:0] oalu_out,
output reg [7:0] onextPC
);
always @(posedge (clk)) begin
if (en) begin
oreg_write_addr <= ireg_write_addr;
oreg_write_data <= ireg_write_data;
oreg_write_en <= ireg_write_en;
omem_to_reg <= ireg_write_en;
oalu_out <= ialu_out;
onextPC <= inextPC;
end
end
endmodule