Name: Bubba 2011-04-07 20:11
I need to read in integer values from a text file, my current test text file just consists of the following:
1 2 3
4 5 6
7 8 9
I'm using Xilinx Webpack 10.1 (old I know, but that's what my school uses and I need to keep the same version for compatibility) and I keep getting an error that says "read of integer is not supported" and cannot for the life of me figure out why...Source code below, any help is appreciated :)
use STD.TEXTIO.all;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.STD_LOGIC_TEXTIO.ALL;
use IEEE.numeric_bit.ALL;
use IEEE.numeric_std.ALL;
entity ConvInput is
end ConvInput;
architecture Behavioral of ConvInput is
TYPE matrix2 IS ARRAY(0 to 2, 0 to 2) of integer;
SIGNAL matrixk : matrix2;
FILE k: TEXT IS IN "conv.txt";
SIGNAL init : BIT := '1';
begin
init_memory: PROCESS (init)
VARIABLE intk : integer := 0;
VARIABLE buffk : line;
VARIABLE spacek : CHARACTER;
VARIABLE rowk : INTEGER := 0;
VARIABLE spot : INTEGER := 0;
BEGIN
IF init='1' THEN init <= '0';
if rowk < 3 then
readline(k, buffk);
for k in 0 to 2 loop
read (buffk,intk);
read (buffk,spacek);
matrixK(rowk, k) <= intk;
end loop;
rowk := rowk + 1;
else
spot := spot + 1;
end if;
end if;
end process;
end Behavioral;
1 2 3
4 5 6
7 8 9
I'm using Xilinx Webpack 10.1 (old I know, but that's what my school uses and I need to keep the same version for compatibility) and I keep getting an error that says "read of integer is not supported" and cannot for the life of me figure out why...Source code below, any help is appreciated :)
use STD.TEXTIO.all;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use IEEE.STD_LOGIC_TEXTIO.ALL;
use IEEE.numeric_bit.ALL;
use IEEE.numeric_std.ALL;
entity ConvInput is
end ConvInput;
architecture Behavioral of ConvInput is
TYPE matrix2 IS ARRAY(0 to 2, 0 to 2) of integer;
SIGNAL matrixk : matrix2;
FILE k: TEXT IS IN "conv.txt";
SIGNAL init : BIT := '1';
begin
init_memory: PROCESS (init)
VARIABLE intk : integer := 0;
VARIABLE buffk : line;
VARIABLE spacek : CHARACTER;
VARIABLE rowk : INTEGER := 0;
VARIABLE spot : INTEGER := 0;
BEGIN
IF init='1' THEN init <= '0';
if rowk < 3 then
readline(k, buffk);
for k in 0 to 2 loop
read (buffk,intk);
read (buffk,spacek);
matrixK(rowk, k) <= intk;
end loop;
rowk := rowk + 1;
else
spot := spot + 1;
end if;
end if;
end process;
end Behavioral;