aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlavian Kaufmann <flavian@flaviankaufmann.ch>2024-05-14 06:49:00 +0200
committerFlavian Kaufmann <flavian@flaviankaufmann.ch>2024-05-14 06:49:00 +0200
commit48b36fddef862c3cd5efbdd3ed3e86b179ac117b (patch)
tree7f5140dca9623f30c6b66f6ab0fd413fbad3782f
parent59bc2fc1f75dbda7f8c36409bcf3f5198bfc3eaa (diff)
downloadriscv_cpu-48b36fddef862c3cd5efbdd3ed3e86b179ac117b.tar.gz
riscv_cpu-48b36fddef862c3cd5efbdd3ed3e86b179ac117b.zip
declaration before use
-rw-r--r--src/cpu.v42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/cpu.v b/src/cpu.v
index 879e8f8..b6e3f51 100644
--- a/src/cpu.v
+++ b/src/cpu.v
@@ -5,27 +5,6 @@ module cpu (
);
-control_unit control_unit (
- .clk(clk),
- .rstn(rstn),
- .instr(instr),
- .imm_src(imm_src),
- .alu_zero(alu_zero),
- .pc_we(pc_we),
- .mem_addr_src(mem_addr_src),
- .mem_we(mem_we),
- .instr_we(instr_we),
- .result_src(result_src),
- .alu_op(alu_op),
- .alu_a_src(alu_a_src),
- .alu_b_src(alu_b_src),
- .rf_we(rf_we),
- .ra1(ra1),
- .ra2(ra2),
- .wa3(wa3)
-);
-
-
wire [31:0] pc, pc_buf;
wire pc_we;
@@ -59,6 +38,27 @@ wire [1:0] result_src;
wire [31:0] result;
+control_unit control_unit (
+ .clk(clk),
+ .rstn(rstn),
+ .instr(instr),
+ .imm_src(imm_src),
+ .alu_zero(alu_zero),
+ .pc_we(pc_we),
+ .mem_addr_src(mem_addr_src),
+ .mem_we(mem_we),
+ .instr_we(instr_we),
+ .result_src(result_src),
+ .alu_op(alu_op),
+ .alu_a_src(alu_a_src),
+ .alu_b_src(alu_b_src),
+ .rf_we(rf_we),
+ .ra1(ra1),
+ .ra2(ra2),
+ .wa3(wa3)
+);
+
+
pc_reg pc_reg (
.clk(clk),
.rstn(rstn),