Forum Discussion

EEren's avatar
EEren
Icon for Occasional Contributor rankOccasional Contributor
6 years ago

Shift Left

signal set_rx_stat    : std_logic := '0';
shared variable mailbox_idx : integer range 0 to 255 := 0;
 
variable set_bits : std_logic_vector(31 downto 0) := X"00000000";
 
set_bits :=   std_logic_vector ( shift_left ( to_unsigned(set_rx_stat,1), mailbox_idx ) );

I get an error

Error (10476): VHDL error at reg_file.vhd(1178): type of identifier "set_rx_stat" does not agree with its usage as "natural" type

Why?

According to the function

function SHIFT_LEFT (ARG: UNSIGNED; COUNT: NATURAL) return UNSIGNED;

All types cast properly.

1 Reply

  • There's something not correlated in the error message. The variable "set_rx_stat" is supposed to be assigned to "ARG" in the function where it should be unsigned type. Do you have the cast function "to_unsigned" ?