I use the concatenation operator usually. For example:
shiftreg : std_logic_vector(D_WIDTH-1 downto 0);
shiftreg <= shiftreg(shiftreg'left-1-shift_offset downto 0) & data_i;
or
shiftreg <= shiftreg(shiftreg'left) & shiftreg(shiftreg'left-2-shift_offset downto 0) & data_i; (if it is an arithmetical left shift)
There is one more way without using either library functions or operators:
for i in 0 to shift_offset loop
shiftreg <= shiftreg(shiftreg'left-1 downto 0) & '0';
end loop;
or for arithmetic shift left:
for i in 0 to shift_offset loop
shiftreg(shiftreg'left-1 downto 0) <= shiftreg(shiftreg'left-2 downto 0) & '0';
end loop;
There also is the library function shift_left() and operators sll and sla. Firstly, there are problems with these operators, so it is better to use the shift_left() function. You can read about these problems there:
http://jdebp.eu./FGA/bit-shifts-in-vhdl.htmlIf you will pass a signed data to shift_left - it will be an arithmetic left shift. If you will pass an unsigned data to shift_left - it wil be a logical left shift.
-- there shiftreg : unsigned(D_WIDTH-1 downto 0) or shiftreg : signed(D_WIDTH-1 downto 0)
shiftreg <= shift_left(shiftreg, shift_offset);
If the shift_offset is an object of an array type, You need to convert it to integer (it would be better if to natural).
-- there shiftreg : unsigned(D_WIDTH-1 downto 0) or shiftreg : signed(D_WIDTH-1 downto 0)
shiftreg <= shift_left(shiftreg, to_integer(unsigned(shift_offset)));
If You want use sll and/or sla You must do it much carefully and with full understanding what do You really do. Sll may do an arithmetical shift for signed inputs, both sll and srl can take a negative shift, and do something with it in operators overloading. But all these may affect negatively to a synthesis. So it si better to use it in the same way as the shift_left() function.
To use these functions You need to use a corresponding package. numeric_std - for unsigned/signed which are inherited from std_logic_vector, numeric_bit - for unsigned/signed which areinherited from bit_vector.