Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > TextIO Tutorial

Reply
Thread Tools

TextIO Tutorial

 
 
Dek
Guest
Posts: n/a
 
      05-07-2009
On 5 Mag, 17:55, JimLewis <j...@synthworks.com> wrote:
> This needs a small modification for your code:
>
> > This one handles spaces on the same line as the name, but is much more
> > tedious

>
> > Main : Process

>
> > begin
> > * write(WriteBuf, String'("Enter File Name to Read: ")) ;
> > * writeline(OUTPUT, WriteBuf) ;
> > * Readline (INPUT, ReadBuf) ;
> > * i := 1 ;
> > * loop
> > * * Read(ReadBuf, InputString(i), Valid) ;

>
> * * * exit when not Valid or InputString(i) = ' ' or InputString(i) =
> HT ;
>
> > * * i := i + 1 ;
> > * end loop ;
> > * if i = 1 then wait; end if ; * -- add error handling here
> > * file_open(TestFile, InputString(1 to i-1), READ_MODE) ;

>
> Cheers,
> Jim
> SynthWorks VHDL Training



Thanks all, it seems a good idea, but finally I used Tcl, it's quite
simple

Bye

Dek
 
Reply With Quote
 
 
 
 
Mike Treseler
Guest
Posts: n/a
 
      05-07-2009
Dek wrote:

> Thanks all, it seems a good idea, but finally I used Tcl, it's quite
> simple


Glad you saw the light.
tcl is much better at text than vhdl,
as is python, bash script, emacs-lisp, perl, ...

-- Mike Treseler
 
Reply With Quote
 
 
 
 
Dek
Guest
Posts: n/a
 
      05-11-2009
On 7 Mag, 18:42, Mike Treseler <mtrese...@gmail.com> wrote:
> Dek wrote:
> > Thanks all, it seems a good idea, but finally I used Tcl, it's quite
> > simple

>
> Glad you saw the light.
> tcl is much better at text than vhdl,
> as is python, bash script, emacs-lisp, perl, ...
>
> * * * * * *-- Mike Treseler



Hemm... actually I used Tcl just as a macro to be used with modelsim
(as HT-Lab suggested); in my VHDL TextIO is still present, but since I
use the files name as generics, they don't have to be constrained
anymore.

Maybe, as you say, I did better if I used just Tcl or Python or so on,
but I want to take confidence with VHDL for further applications, and
I had data from an actual detector already stored in .txt files.
Anyway I think it's nice to know how TextIO works because, even if
it's not very powerful, it gives you the chance to understeand how an
hardware model would work on data already stored; and I don't think
this is a so rare application.
 
Reply With Quote
 
Mike Treseler
Guest
Posts: n/a
 
      05-11-2009
>> Dek wrote:
>>> Thanks all, it seems a good idea, but finally I used Tcl, it's quite
>>> simple


Dek wrote:

> Hemm... actually I used Tcl just as a macro to be used with modelsim
> (as HT-Lab suggested); in my VHDL TextIO is still present, but since I
> use the files name as generics, they don't have to be constrained
> anymore.


Sorry that I misinterpreted your posting.
Congratulations for conquering textio.

> Maybe, as you say, I did better if I used just Tcl or Python or so on,
> but I want to take confidence with VHDL for further applications, and
> I had data from an actual detector already stored in .txt files.


I prefer to convert existing text files to vhdl packages
using a scripting language, since I am using one anyway
to run modelsim. This isn't better, just different.

-- Mike Treseler
 
Reply With Quote
 
vhdldevelopper vhdldevelopper is offline
Junior Member
Join Date: Mar 2010
Posts: 2
 
      03-23-2010
Hi all,
I'm new in vhdl and I want to read from a file which contain numbers
separated by POINT not by White space ( as the textio procedure works by default ), it's like this
44.123.25.254
44.123.25.253
44.123.25.250

I wanna to compare such line withe an other variable like this

entity start is

generic( File_string : string := "C:\IP\IP.txt" );

port(
in : in std_logic_vector(32 downto 0)
);

end entity

archtecture arch of start is

signal L :std_logic_vector(32 downto 0);
begin
P : process


FILE inFile : TEXT IS IN File_string;

VARIABLE inLine : LINE;

begin
****
****
****




Can you tell me how can I do to compare the Input value with such line
with READLINE
Are we obligated to peass by READ after READLINE or a simple READLINE it's enought?
thx..
 
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
std.textio and ieee.std_logic_textio procedure overloading Magne Munkejord VHDL 1 08-23-2006 05:24 PM
vhdl textio and escape sequences Olaf Petzold VHDL 1 11-28-2005 06:22 PM
Vhdl testbench with textio package Teten VHDL 0 09-01-2005 08:43 PM
textio error Pasacco VHDL 3 05-03-2005 08:06 AM
the textio lib and std_logic_textio Pedro Claro VHDL 3 07-28-2003 04:08 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57