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

Subversion Repositories neorv32

[/] [neorv32/] [trunk/] [rtl/] [core/] [neorv32_cpu_alu.vhd] - Diff between revs 2 and 3

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

Rev 2 Rev 3
Line 163... Line 163...
  -- Iterative Shifter Unit -----------------------------------------------------------------
  -- Iterative Shifter Unit -----------------------------------------------------------------
  -- -------------------------------------------------------------------------------------------
  -- -------------------------------------------------------------------------------------------
  shifter_unit: process(rstn_i, clk_i)
  shifter_unit: process(rstn_i, clk_i)
  begin
  begin
    if (rstn_i = '0') then
    if (rstn_i = '0') then
      shift_sreg   <= (others => '-');
      shift_sreg   <= (others => '0');
      shift_cnt    <= (others => '0');
      shift_cnt    <= (others => '0');
      shift_cmd_ff <= '0';
      shift_cmd_ff <= '0';
    elsif rising_edge(clk_i) then
    elsif rising_edge(clk_i) then
      shift_cmd_ff <= shift_cmd;
      shift_cmd_ff <= shift_cmd;
      if (shift_start = '1') then -- trigger new shift
      if (shift_start = '1') then -- trigger new shift
Line 239... Line 239...
      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;
      when alu_cmd_shift_c => alu_res <= shift_sreg;
      when alu_cmd_shift_c => alu_res <= shift_sreg;
      when alu_cmd_slt_c   => alu_res <= (others => '0'); alu_res(0) <= cmp_less;
      when alu_cmd_slt_c   => alu_res <= (others => '0'); alu_res(0) <= cmp_less;
      when others          => alu_res <= (others => '-'); -- undefined
      when others          => alu_res <= (others => '0'); -- undefined
    end case;
    end case;
  end process alu_function_mux;
  end process alu_function_mux;
 
 
 
 
  -- ALU Result -----------------------------------------------------------------------------
  -- ALU Result -----------------------------------------------------------------------------

powered by: WebSVN 2.1.0

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