-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontroller.v
More file actions
47 lines (40 loc) · 1.07 KB
/
controller.v
File metadata and controls
47 lines (40 loc) · 1.07 KB
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
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 22.06.2025 04:00:48
// Design Name:
// Module Name: controller
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module controller (
input [6:0] op,
input [2:0] funct3,
input funct7b5,
input Zero, ALUR31,
output [1:0] ResultSrc,
output MemWrite,
output PCSrc, ALUSrc,
output RegWrite, Jump, Jalr,
output [1:0] ImmSrc,
output [3:0] ALUControl
);
wire [1:0] ALUOp;
wire Branch;
main_decoder md (op, funct3, Zero, ALUR31, ResultSrc, MemWrite, Branch,
ALUSrc, RegWrite, Jump, Jalr, ImmSrc, ALUOp);
alu_decoder ad (op[5], funct3, funct7b5, ALUOp, ALUControl);
// for jump and branch
assign PCSrc = Branch | Jump;
endmodule