OpenCores
URL https://opencores.org/ocsvn/neorv32/neorv32/trunk

Subversion Repositories neorv32

[/] [neorv32/] [trunk/] [rtl/] [core/] [neorv32_cpu_alu.vhd] - Diff between revs 24 and 25

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 24 Rev 25
Line 125... Line 125...
      when "00"   => opa <= rs1_i;
      when "00"   => opa <= rs1_i;
      when "01"   => opa <= pc2_i;
      when "01"   => opa <= pc2_i;
      when others => opa <= csr_i;
      when others => opa <= csr_i;
    end case;
    end case;
    -- opb (second ALU input operand) --
    -- opb (second ALU input operand) --
    case ctrl_i(ctrl_alu_opb_mux_msb_c downto ctrl_alu_opb_mux_lsb_c) is
    if (ctrl_i(ctrl_alu_opb_mux_c) = '0') then
      when "00"   => opb <= rs2_i;
      opb <= rs2_i;
      when "01"   => opb <= imm_i;
    else
      when others => opb <= rs1_i;
      opb <= imm_i;
    end case;
    end if;
    -- opc (second operand for comparison and SUB) --
    -- opc (second operand for comparison and SUB) --
    if (ctrl_i(ctrl_alu_opc_mux_c) = '0') then
    if (ctrl_i(ctrl_alu_opc_mux_c) = '0') then
      opc <= imm_i;
      opc <= imm_i;
    else
    else
      opc <= rs2_i;
      opc <= rs2_i;
Line 249... Line 249...
  cp_res <= cp0_data_i or cp1_data_i; -- only the selcted cp may output data != 0
  cp_res <= cp0_data_i or cp1_data_i; -- only the selcted cp may output data != 0
 
 
 
 
  -- ALU Function Select --------------------------------------------------------------------
  -- ALU Function Select --------------------------------------------------------------------
  -- -------------------------------------------------------------------------------------------
  -- -------------------------------------------------------------------------------------------
  alu_function_mux: process(ctrl_i, opa, opb, add_res, sub_res, cmp_less, shifter)
  alu_function_mux: process(ctrl_i, opa, opb, add_res, sub_res, cmp_less, shifter.sreg)
  begin
  begin
    case ctrl_i(ctrl_alu_cmd2_c downto ctrl_alu_cmd0_c) is
    case ctrl_i(ctrl_alu_cmd2_c downto ctrl_alu_cmd0_c) is
      when alu_cmd_xor_c   => alu_res <= opa xor opb;
      when alu_cmd_xor_c   => alu_res <= opa xor opb;
      when alu_cmd_or_c    => alu_res <= opa or  opb;
      when alu_cmd_or_c    => alu_res <= opa or  opb;
      when alu_cmd_and_c   => alu_res <= opa and opb;
      when alu_cmd_and_c   => alu_res <= opa and opb;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.