简体   繁体   中英

Trying to understand simulation errors with Xilinx

I am getting some erros that I cant make sense and was hoping I could get some help.

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

I have tried altering the code to suit but nothing works ! this is the code:

    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

;

In line 25 the input shift_reg port is assigned, using shift_reg <= ... , but it is not legal to assign to an input port.

In line 27 there is reference to bit 31 in shift_reg(31) , but shift_reg only has index 1 and 0 in declaration with shift_reg : in std_logic_vector(1 downto 0); . And indexing a single bit like (31) has type std_logic , which does not match the std_logic_vector type of target shift_out .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM