我正在编写一个 vhdl 代码来读取图像文件。我将图像文件转换为具有 65536 行的记事本文件。即,256 X 256 像素。现在,当我运行代码时,我收到一条错误消息:
Fatal error in ForLoop loop at C:/MentorGraphics/modeltech_6.5c/win32/test.vhd line 39
# HDL call sequence:
# Stopped at C:/MentorGraphics/modeltech_6.5c/win32/test.vhd 39 ForLoop loop
为什么会这样。我附上下面的代码:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use std.textio.all;
entity IMAGE_READ is
Port ( CLK : in STD_LOGIC;
IMAGE_LOAD : IN STD_LOGIC:='1';
IMAGE_DONE : OUT STD_LOGIC);
end entity;
architecture Behavioral of IMAGE_READ is
type image is array (1 to 256,1 to 256) of std_logic_vector(7 downto 0);
file IMAGE_FILE:text open read_mode is "D:\Documents\ORIGINAL IMAGE.txt";
begin
PROCESS(CLK,ROW,COLUMN,IMAGE_LOAD)
variable LINE_NUMBER:line;
variable TEMP_PIXEL_VALUE: bit_vector(7 downto 0);
variable image_matrix:IMAGE;
BEGIN
if (clk'event and clk = '1') then
IF(IMAGE_LOAD='1') THEN
for i in 1 to 256 loop
for j in 1 to 256 loop
readline (IMAGE_FILE, LINE_NUMBER);
read (LINE_NUMBER, TEMP_PIXEL_VALUE);
image_matrix(i,j) := to_stdlogicvector(TEMP_PIXEL_VALUE);
if(i=256 and j=256) then
TEMP_image_done:='1';
image_done<='1';
else
TEMP_image_done:='0';
image_done<='0';
end if;
END LOOP;
END LOOP;
END IF;
END IF;
END PROCESS;
end Behavioral;
如何纠正它?