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

Subversion Repositories mlite

[/] [mlite/] [trunk/] [vhdl/] [shifter.vhd] - Diff between revs 132 and 139

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

Rev 132 Rev 139
Line 30... Line 30...
signal shift1L, shift2L, shift4L, shift8L, shift16L : std_logic_vector(31 downto 0);
signal shift1L, shift2L, shift4L, shift8L, shift16L : std_logic_vector(31 downto 0);
signal shift1R, shift2R, shift4R, shift8R, shift16R : std_logic_vector(31 downto 0);
signal shift1R, shift2R, shift4R, shift8R, shift16R : std_logic_vector(31 downto 0);
signal fills : std_logic_vector(31 downto 16);
signal fills : std_logic_vector(31 downto 16);
 
 
begin
begin
   fills <= "1111111111111111" when shift_func = SHIFT_RIGHT_SIGNED and value(31) = '1' else
   fills <= "1111111111111111" when shift_func = SHIFT_RIGHT_SIGNED
            "0000000000000000";
                                    and value(31) = '1'
 
                                                                                 else "0000000000000000";
   shift1L <= value(30 downto 0) & '0' when shift_amount(0) = '1' else value;
   shift1L <= value(30 downto 0) & '0' when shift_amount(0) = '1' else value;
   shift2L <= shift1L(29 downto 0) & "00" when shift_amount(1) = '1' else shift1L;
   shift2L <= shift1L(29 downto 0) & "00" when shift_amount(1) = '1' else shift1L;
   shift4L <= shift2L(27 downto 0) & "0000" when shift_amount(2) = '1' else shift2L;
   shift4L <= shift2L(27 downto 0) & "0000" when shift_amount(2) = '1' else shift2L;
   shift8L <= shift4L(23 downto 0) & "00000000" when shift_amount(3) = '1' else shift4L;
   shift8L <= shift4L(23 downto 0) & "00000000" when shift_amount(3) = '1' else shift4L;
   shift16L <= shift8L(15 downto 0) & ZERO(15 downto 0) when shift_amount(4) = '1' else shift8L;
   shift16L <= shift8L(15 downto 0) & ZERO(15 downto 0) when shift_amount(4) = '1' else shift8L;
Line 44... Line 45...
   shift2R <= fills(31 downto 30) & shift1R(31 downto 2) when shift_amount(1) = '1' else shift1R;
   shift2R <= fills(31 downto 30) & shift1R(31 downto 2) when shift_amount(1) = '1' else shift1R;
   shift4R <= fills(31 downto 28) & shift2R(31 downto 4) when shift_amount(2) = '1' else shift2R;
   shift4R <= fills(31 downto 28) & shift2R(31 downto 4) when shift_amount(2) = '1' else shift2R;
   shift8R <= fills(31 downto 24) & shift4R(31 downto 8)  when shift_amount(3) = '1' else shift4R;
   shift8R <= fills(31 downto 24) & shift4R(31 downto 8)  when shift_amount(3) = '1' else shift4R;
   shift16R <= fills(31 downto 16) & shift8R(31 downto 16) when shift_amount(4) = '1' else shift8R;
   shift16R <= fills(31 downto 16) & shift8R(31 downto 16) when shift_amount(4) = '1' else shift8R;
 
 
-- synthesis translate_off
 
GENERIC_SHIFTER: if shifter_type = "DEFAULT" generate
GENERIC_SHIFTER: if shifter_type = "DEFAULT" generate
-- synthesis translate_on
 
 
 
   c_shift <= shift16L when shift_func = SHIFT_LEFT_UNSIGNED else
   c_shift <= shift16L when shift_func = SHIFT_LEFT_UNSIGNED else
              shift16R when shift_func = SHIFT_RIGHT_UNSIGNED or shift_func = SHIFT_RIGHT_SIGNED else
              shift16R when shift_func = SHIFT_RIGHT_UNSIGNED or
 
                                                shift_func = SHIFT_RIGHT_SIGNED else
              ZERO;
              ZERO;
 
 
-- synthesis translate_off
 
end generate;
end generate;
-- synthesis translate_on
 
 
 
-- synopsys synthesis_off
 
 
 
AREA_OPTIMIZED_SHIFTER: if shifter_type = "AREA_OPTIMIZED" generate
 
 
 
 
AREA_OPTIMIZED_SHIFTER: if shifter_type /= "DEFAULT" generate
   c_shift <= shift16L when shift_func = SHIFT_LEFT_UNSIGNED else (others => 'Z');
   c_shift <= shift16L when shift_func = SHIFT_LEFT_UNSIGNED else (others => 'Z');
   c_shift <= shift16R when shift_func = SHIFT_RIGHT_UNSIGNED or
   c_shift <= shift16R when shift_func = SHIFT_RIGHT_UNSIGNED or
                            shift_func = SHIFT_RIGHT_SIGNED else (others => 'Z');
                            shift_func = SHIFT_RIGHT_SIGNED else (others => 'Z');
   c_shift <= ZERO     when shift_func = SHIFT_NOTHING else (others => 'Z');
   c_shift <= ZERO     when shift_func = SHIFT_NOTHING else (others => 'Z');
 
 
end generate;
end generate;
 
 
-- synopsys synthesis_on
 
 
 
end; --architecture logic
end; --architecture logic
 
 
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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