diff --git a/RTL/cpu/core_alu.sv b/RTL/cpu/core_alu.sv index 0213317..fd49176 100644 --- a/RTL/cpu/core_alu.sv +++ b/RTL/cpu/core_alu.sv @@ -25,7 +25,7 @@ always_comb o_branch_jalr <= 1'b1; o_branch_jalr_target <= num1_plus_imm; end - 7'b1100011 : begin // BRANCHç±? + 7'b1100011 : begin // BRANCH绫? case(i_funct3) 3'b000 : o_branch_jalr <= (i_num1u == i_num2u); // BEQ 3'b001 : o_branch_jalr <= (i_num1u != i_num2u); // BNE @@ -37,7 +37,7 @@ always_comb endcase o_branch_jalr_target <= pc_plus_imm; end - default : begin // ä¸è·³è½? + default : begin // 涓嶈烦æž? o_branch_jalr <= 1'b0; o_branch_jalr_target <= 0; end @@ -45,24 +45,24 @@ always_comb always_comb casex({i_funct7,i_funct3,i_opcode}) - // JAL类与JALRç±? + // JAL, JALR 17'bxxxxxxx_xxx_110x111 : o_res <= i_pc + 4; // JAL, JALR - // LUIç±? + // LUI 17'bxxxxxxx_xxx_0110111 : o_res <= i_immu; // LUI - // AUIPCç±? + // AUIPC 17'bxxxxxxx_xxx_0010111 : o_res <= pc_plus_imm ; // AUIPC - // 算术ç±? + // 算术类 17'b0000000_000_0110011 : o_res <= i_num1u + i_num2u; // ADD 17'bxxxxxxx_000_0010011 : o_res <= num1_plus_imm ; // ADDI 17'b0100000_000_0110011 : o_res <= i_num1u - i_num2u; // SUB - // 逻辑ç±? + // 逻辑类 17'b0000000_100_0110011 : o_res <= i_num1u ^ i_num2u; // XOR 17'bxxxxxxx_100_0010011 : o_res <= i_num1u ^ i_immu ; // XORI 17'b0000000_110_0110011 : o_res <= i_num1u | i_num2u; // OR 17'bxxxxxxx_110_0010011 : o_res <= i_num1u | i_immu ; // ORI 17'b0000000_111_0110011 : o_res <= i_num1u & i_num2u; // AND 17'bxxxxxxx_111_0010011 : o_res <= i_num1u & i_immu ; // ANDI - // ä½ç§»ç±? + // 移ä½ç±» 17'b0000000_001_0110011 : o_res <= i_num1u << shamt_rs ; // SLL 17'b0000000_001_0010011 : o_res <= i_num1u << shamt_imm; // SLLI 17'b0000000_101_0110011 : o_res <= i_num1u >> shamt_rs ; // SRL @@ -75,12 +75,12 @@ always_comb o_res <= i_num1u >> shamt_imm; for(int i=0;i