พยายามทำความเข้าใจข้อผิดพลาดในการจำลองด้วย 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 ได้แล้วด้วยการประกาศสัญญาณ แต่อันที่ 2 ยังสับสนอยู่ ฉันได้ลองเชื่อมโยงการประกาศและช่วงบิตแล้ว แต่ก็ยังทำให้ฉันมีปัญหาเดียวกัน - person Gaddi; 25.11.2015
comment
ใช่ มีปัญหากับประเภทนี้ด้วย และฉันได้เพิ่มประโยคในคำตอบเกี่ยวกับเรื่องนี้ - person Morten Zilmer; 25.11.2015