![]() |
|
|
|
#1 |
|
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... shashankrsharma Last edited by shashankrsharma : 03-01-2009 at 05:15 PM. |
|
|
|
|
|
|
#2 | |
|
Junior Member
Join Date: Mar 2009
Posts: 2
|
Quote:
Yes, check out the following libraries LIBRARY IEEE; USE ieee.std_logic_textio.all; LIBRARY std; USE std.textio.all; ice |
|
|
|
|
|
|
#3 | |
|
Junior Member
Join Date: Mar 2009
Posts: 6
|
Quote:
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 I know ppl rarely use such an concept, so if any one know plse do help ![]() shashankrsharma |
|
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Mar 2009
Posts: 6
|
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; /////////////////////////////////////////////////////////////// shashankrsharma |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A Great gift for ipod users:ImTOO iPod Computer Transfer | candycaw | Software | 4 | 11-26-2007 06:59 AM |
| Classic Original Broadcasts Trading List - Updated ( w/o/c ) | porkys1982@sbcglobal.net | DVD Video | 0 | 12-05-2005 03:38 AM |
| Classic Original Broadcasts Trading List - Updated ( w/o/c ) | porkys1982@sbcglobal.net | DVD Video | 0 | 11-19-2005 04:46 PM |
| Original Airings : The A-Team , M*A*S*H , Taxi , Barney Miller , WKRP | porkys1982@sbcglobal.net | DVD Video | 0 | 08-15-2005 03:09 AM |