aboutsummaryrefslogtreecommitdiff
path: root/src/control_unit.v
diff options
context:
space:
mode:
authorFlavian Kaufmann <flavian@flaviankaufmann.ch>2024-05-13 07:46:45 +0200
committerFlavian Kaufmann <flavian@flaviankaufmann.ch>2024-05-13 07:46:45 +0200
commit48205bf3e8d421b6aa0474a4d120ae5faaaaa670 (patch)
treeb8831bc5ad48d3375a5b05d6d532e2b3e0f2e490 /src/control_unit.v
parentdeb7d0a6fc76d5250c238d479cf97d4755abef01 (diff)
downloadriscv_cpu-48205bf3e8d421b6aa0474a4d120ae5faaaaa670.tar.gz
riscv_cpu-48205bf3e8d421b6aa0474a4d120ae5faaaaa670.zip
refactoring, runs now on fpga
Diffstat (limited to 'src/control_unit.v')
-rw-r--r--src/control_unit.v15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/control_unit.v b/src/control_unit.v
index f6d99ec..9431c25 100644
--- a/src/control_unit.v
+++ b/src/control_unit.v
@@ -1,18 +1,25 @@
module control_unit (
input clk,
input rstn,
+
input [31:0] instr,
input alu_zero,
+
output reg [2:0] imm_src,
output pc_we,
+
output reg mem_addr_src,
output reg mem_we,
+
output reg instr_we,
- output reg [1:0] result_src,
- output [3:0] alu_op,
+
+ output reg rf_we,
+
output reg [1:0] alu_a_src,
output reg [1:0] alu_b_src,
- output reg rf_we
+ output [3:0] alu_op,
+
+ output reg [1:0] result_src
);
parameter s00_fetch = 4'h0,
@@ -268,7 +275,7 @@ always @ (*) begin
endcase
end
-alu_op_decode aod (
+alu_op_decode alu_op_decode (
.opcode(opcode),
.alu_ctrl(alu_ctrl),
.funct3(funct3),