textio doubt 
Author Message
 textio doubt


In  textio package, what is condition for which "good" returns true value in
read (l, v, good). Is that implies end of line?

plz clarify

srinivas turaga

Fri, 21 Oct 2005 20:11:05 GMT  
 textio doubt
>In  textio package, what is condition for which "good" returns true value in
>read (l, v, good). Is that implies end of line?

If this is a homework, then the instructor is asking you to look into the body
of the procedure and figure it out.  If you're an engineer, then you should
look into the body the procedure,

 procedure READ(L:inout LINE; VALUE: out bit_vector; GOOD : out BOOLEAN)
        alias    val  : bit_vector(1 to VALUE'length) is VALUE;
        variable vpos : integer := 0;   -- Index of last valid bit in val.
        variable lpos : integer;        -- Index of next unused char in L.
        if L /= NULL then
            lpos := L'left;
            Skip_white(L, lpos);
            while lpos <= L'right and vpos < VALUE'length loop
                if L(lpos) = '0' then
                    vpos := vpos + 1;
                    val(vpos) := '0';
                elsif L(lpos) = '1' then
                    vpos := vpos + 1;
                    val(vpos) := '1';
                    exit;       -- Bit values must be '0' or '1'.
                end if;
                lpos := lpos + 1;
            end loop;
        end if;

        if vpos = VALUE'length then
            GOOD := TRUE;
            Shrink_line(L, lpos);
            GOOD := FALSE;
        end if;
Basically, GOOD is true if the number of characters in the line match the
length of the OUT result vector.
Ben Cohen     Publisher, Trainer, Consultant    (310) 721-4830  

Author of following textbooks:
* Real Chip Design and Verification Using Verilog and VHDL, 2002 isbn
* Component Design by Example ",  2001 isbn  0-9705394-0-1
* VHDL Coding Styles and Methodologies, 2nd Edition, 1999 isbn 0-7923-8474-1
* VHDL Answers to Frequently Asked Questions, 2nd Edition, isbn 0-7923-8115

Fri, 21 Oct 2005 23:50:36 GMT  
 [ 2 post ] 

 Relevant Pages 

1. RE : Verilog Textio using PLI ( Read.c) .

2. Textio in Verilog

3. Xilinx and std.textio.lib

4. textio package

5. Textio in Quartus2

6. can the pointer in TEXTIO moves BACKWORDS?

7. get to know the textio file

8. VHDL textio

9. Textio/ Write?

10. Convert time to string for textio?

11. TextIO

12. ignoring comments when using TEXTIO.


Powered by phpBB® Forum Software