Попытка понять ошибки моделирования с помощью Xilinx

Я получаю некоторые ошибки, которые я не могу понять, и надеялся, что смогу получить помощь.

ERROR: [VRFC 10-469] cannot update 'in' object shift_reg [C:/Users/Darren/Desktop/project_6_1_3/project_6_1_3.srcs/sources_1/new/1Bit_delay_register.vhd:25]
ERROR: [VRFC 10-925] indexed name is not a std_logic_vector [C:/Users/Darren/Desktop/project_6_1_3/project_6_1_3.srcs/sources_1/new/1Bit_delay_register.vhd:27]
ERROR: [VRFC 10-1504] unit simple_one_bit_serial_shift_register_behavior ignored due to previous errors [C:/Users/Darren/Desktop/project_6_1_3/project_6_1_3.srcs/sources_1/new/1Bit_delay_register.vhd:16]
INFO: [VRFC 10-240] VHDL file C:/Users/Darren/Desktop/project_6_1_3/project_6_1_3.srcs/sources_1/new/1Bit_delay_register.vhd ignored due to errors

Я пытался изменить код, чтобы он подходил, но ничего не работает! это код:

    library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;

entity simple_one_bit_serial_shift_register is
   port(
      clk      : in  std_logic;
      reset      : in  std_logic;
      shift_in  : in  std_logic_vector(31 downto 0);
      shift_reg  : in std_logic_vector(1 downto 0);
      shift_out : out std_logic_vector(31 downto 0)
   );
end simple_one_bit_serial_shift_register;

architecture simple_one_bit_serial_shift_register_behavior of simple_one_bit_serial_shift_register is 
begin

--signal shift_reg : std_logic_vector(31 downto 0);
--signal shift_in : std_logic;
--signal shift_out : std_logic;
process (clk) 
    begin
    if rising_edge(clk) then
        shift_reg <= shift_reg(30 downto 0) & shift_in;
    end if;
    shift_out <= shift_reg(31);
end process;
end simple_one_bit_serial_shift_register_behavior

;


person Gaddi    schedule 25.11.2015    source источник


Ответы (1)


В строке 25 входной порт shift_reg назначается с помощью shift_reg <= ..., но это недопустимо назначать входному порту.

В строке 27 есть ссылка на бит 31 в shift_reg(31), но shift_reg имеет только индекс 1 и 0 в объявлении с shift_reg : in std_logic_vector(1 downto 0);. И индексирование одного бита, такого как (31), имеет тип std_logic, который не соответствует типу std_logic_vector цели shift_out.

person Morten Zilmer    schedule 25.11.2015
comment
Спасибо за прояснение, мне удалось решить проблему строки 25, объявив сигнал, но вторая все еще сбивает с толку. Я пытался изменить объявления и диапазоны битов, но это все еще дает мне ту же проблему. - person Gaddi; 25.11.2015
comment
Правильно, с типом тоже проблема, и я добавил предложение в ответ об этом. - person Morten Zilmer; 25.11.2015