RVSCC/rtl/pipelined_control_unit.sv

37 lines
846 B
Systemverilog
Raw Normal View History

`include "timescale.sv"
2022-12-24 01:13:40 +00:00
module pipelined_control_unit (
2023-01-29 04:55:22 +00:00
input logic [6:0] opcode,
input logic [2:0] funct_3,
input logic [6:0] funct_7,
2022-12-24 01:13:40 +00:00
output logic reg_write,
2023-01-29 04:55:22 +00:00
output logic [1:0] result_src,
2022-12-24 01:13:40 +00:00
output logic mem_write,
output logic branch,
2023-01-29 04:55:22 +00:00
output logic [2:0] alu_ctrl,
2022-12-24 01:13:40 +00:00
output logic alu_src,
2023-01-29 04:55:22 +00:00
output logic [1:0] imm_src
2022-12-24 01:13:40 +00:00
);
2023-01-29 04:55:22 +00:00
logic [1:0] alu_op;
main_decoder main_decoder (
.opcode(opcode),
.branch(branch),
.jump(jump),
.result_src(result_src),
.mem_write(mem_write),
.alu_src(alu_src),
.imm_src(imm_src),
.reg_write(reg_write),
.alu_op(alu_op)
2023-01-29 04:55:22 +00:00
);
alu_decoder alu_decoder (
.opcode(opcode[5]),
.funct_3(funct_3),
.funct_7_5(funct_7[5]),
.alu_op(alu_op),
.alu_ctrl(alu_ctrl),
.branch_neg(branch_neg)
2023-01-29 04:55:22 +00:00
);
2022-12-24 01:13:40 +00:00
endmodule