Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > File Transfer

Reply
Thread Tools

File Transfer

 
 
shashankrsharma shashankrsharma is offline
Junior Member
Join Date: Mar 2009
Posts: 6
 
      03-01-2009
This Quote is regarding File Read operation into std_logic_vector.

Is it possible to read a .txt or .doc file and convert the data inside it to binary (output: out std_logic_vector) and see in Test bench Waveform in VHDL???
The output is of fixed length 150 downto 0, This is the packet data Which is further processed in MATLAB.. Plse help me in this issue...
 

Last edited by shashankrsharma; 03-01-2009 at 05:15 PM..
Reply With Quote
 
 
 
 
ice ice is offline
Junior Member
Join Date: Mar 2009
Posts: 2
 
      03-03-2009
Quote:
Originally Posted by shashankrsharma
This Quote is regarding File Read operation into std_logic_vector.

Is it possible to read a .txt or .doc file and convert the data inside it to binary (output: out std_logic_vector) and see in Test bench Waveform in VHDL???
The output is of fixed length 150 downto 0, This is the packet data Which is further processed in MATLAB.. Plse help me in this issue...

Yes, check out the following libraries

LIBRARY IEEE;
USE ieee.std_logic_textio.all;
LIBRARY std;
USE std.textio.all;
 
Reply With Quote
 
 
 
 
shashankrsharma shashankrsharma is offline
Junior Member
Join Date: Mar 2009
Posts: 6
 
      03-04-2009
Quote:
Originally Posted by ice
Yes, check out the following libraries

LIBRARY IEEE;
USE ieee.std_logic_textio.all;
LIBRARY std;
USE std.textio.all;
Thanks folks,
I have used the above lib, but the file reads the data into LINE data type,
how to convert the data present in LINE to STD_LOGIC_VECTOR(150 down to 0)??

I also faced another problem , later This code is to be simulated in MATLAB using Xilinx blockset, so i used BLACKBOX to call the program, but while execution there is a error reported -> "CODE ERROR" stating IN and OUT keyword should not be used for FILE decleration..so how to correct that error??
I know ppl rarely use such an concept, so if any one know plse do help
 
Reply With Quote
 
shashankrsharma shashankrsharma is offline
Junior Member
Join Date: Mar 2009
Posts: 6
 
      03-05-2009
this code is helpfull to copy contents from one file to another, but how to copy the contents in the std_logic_vector???
check for the code->
/////////////////////////////////////////////////////////////////////
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;


library std;
use std.textio.all;

entity fileaccess is
port(clk : in std_logic);
end fileaccess;

architecture Behavioral of fileaccess is
file myfile:text is IN "in.txt";
file outfile:text is out "out.txt";
begin
process(clk)
variable eol:boolean;
variable ilin,tempout:line;
variable header,headerout:string(35 downto 1);
variable tmp : integer;
begin
for tmp in 1 to 3 loop-- to copy 3 lines
readline(myfile,ilin);
read(ilin,header,eol);

--headerout:=To_StdLogicVector(header);--????? how to do this
--headerout<=to_std_logic_vector(header(1));--?????

write(tempout,header);
writeline(outfile,tempout);
end loop;
end process;
end behavioral;
///////////////////////////////////////////////////////////////
 
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
Call transfer full consult is not working properly, blind transfer isworking instead alexsaiz82 Cisco 1 10-09-2008 12:08 AM
WinXP File Transfer-Cannot retrieve USMT2.UNC file =?Utf-8?B?Sm9obg==?= Microsoft Certification 0 01-18-2006 06:46 PM
FTP File Transfer; file contents getting changed ? Sriram Java 14 09-13-2004 10:45 AM
Very slow file transfer on wireless-g ad-hoc network =?Utf-8?B?S2VpdGg=?= Wireless Networking 0 09-07-2004 01:07 AM
006~ASP 0230~Server.Transfer Error~The call to Server.Transfer failed while load Jim ASP General 1 01-28-2004 06:37 PM



Advertisments