diff options
author | Flavian Kaufmann <flavian@flaviankaufmann.ch> | 2024-05-14 06:49:00 +0200 |
---|---|---|
committer | Flavian Kaufmann <flavian@flaviankaufmann.ch> | 2024-05-14 06:49:00 +0200 |
commit | 48b36fddef862c3cd5efbdd3ed3e86b179ac117b (patch) | |
tree | 7f5140dca9623f30c6b66f6ab0fd413fbad3782f | |
parent | 59bc2fc1f75dbda7f8c36409bcf3f5198bfc3eaa (diff) | |
download | riscv_cpu-48b36fddef862c3cd5efbdd3ed3e86b179ac117b.tar.gz riscv_cpu-48b36fddef862c3cd5efbdd3ed3e86b179ac117b.zip |
declaration before use
-rw-r--r-- | src/cpu.v | 42 |
1 files changed, 21 insertions, 21 deletions
@@ -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), |