Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > READ FROM FILE

Reply
Thread Tools

READ FROM FILE

 
 
sarma.nedunuri@gmail.com
Guest
Posts: n/a
 
      02-14-2006
I have a XST 1923 error during synthesis of the following code

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use std.textio.all;
use work.txt_util.all;


entity FILE_READ is
generic (
stim_file: string := "sim.dat"
);
port(
CLK : in std_logic;
OUTPUT : out std_logic_vector(4 downto 0)

);
end FILE_READ;



architecture read_from_file of FILE_READ is

file stimulus: TEXT open read_mode is stim_file;

--signal pp:std_logic;
begin

-- read data and control information from a file

receive_data: process(CLK)

variable l: line;
variable s: string(1 to 10);

begin


while (not endfile(stimulus)) loop -- read digital data from input
file
readline(stimulus, l);
exit when endfile (stimulus);
read(l, s);
OUTPUT <= to_std_logic_vector(s);

if CLK='1' and Clk'event then --introduce a delay
pp<='1' ;
end if;

end loop;

print("I@FILE_READ: reached end of "& stim_file);

end process receive_data;

end read_from_file;


YOU CAN make SIM.DAT file using the following contents

11111
11001
11010

I am using XST

Thanks for help

 
Reply With Quote
 
 
 
 
Andy Peters
Guest
Posts: n/a
 
      02-16-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> I have a XST 1923 error during synthesis of the following code
>
> library IEEE;
> use IEEE.STD_LOGIC_1164.ALL;
> use IEEE.STD_LOGIC_ARITH.ALL;
> use IEEE.STD_LOGIC_UNSIGNED.ALL;
> use std.textio.all;
> use work.txt_util.all;
>
>
> entity FILE_READ is
> generic (
> stim_file: string := "sim.dat"
> );
> port(
> CLK : in std_logic;
> OUTPUT : out std_logic_vector(4 downto 0)
>
> );
> end FILE_READ;
>
>
> I am using XST


If you'd bothered to read the XST manual, you would learn that what you
are trying to do is not allowed.

-a

 
Reply With Quote
 
 
 
 
sarma.nedunuri@gmail.com
Guest
Posts: n/a
 
      03-11-2006
Andy

XST 8 does allow the textio features

s

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
File.read(fname) vs. File.read(fname,File.size(fname)) Alex Dowad Ruby 4 05-01-2010 08:20 AM
file.read() doesn't read the whole file Sreejith K Python 24 03-24-2009 12:20 PM
How to read from a file, stored the data in an array, and return number of records read back to main tyeung168@gmail.com C++ 2 02-27-2007 07:12 AM
Database file and folder are not read only but error message says it is read only?? keithb ASP .Net 2 06-07-2006 03:40 PM
jython/python: read file and allow read to be terminated py Python 0 01-27-2006 08:41 PM



Advertisments