Re: [vhdl-200x-ft] Question on FT-08

From: Jim Lewis <Jim@SynthWorks.com>
Date: Fri Jun 25 2004 - 13:35:15 PDT

David,
OOPS I forgot to answer the STRLEN question:
>> 2)
>> -- Read and Write procedures for String values
>> procedure SREAD (L: inout LINE; VALUE: out STRING; STRLEN: out
>> natural; GOOD : out BOOLEAN);
>> procedure SREAD (L: inout LINE; VALUE: out STRING; STRLEN: out
>> natural);
>>
>> There already is a "READ" for type string, but there is no output
>> "STRLEN".
>> You can get the length by just looking at the 'lenght of the string
>> returned.
>> Why do we need the extra function.
>
> Current limitation of reading tokens with read is that
> each token would need to be the same length or have an
> appropriate number of blanks following the token.
>
> From FT08 write up:
> The procedure sread reads a token. Skips leading white space.
> Reads characters until input_string_length or white space or end
> of line are reached. If a less then the number of characters
> asked for in the read procedure are available the right most characters
> of the object are filled with spaces.

STRLEN is intended to indicate the size of the object placed in
value. Of course, this could be calculated by finding the first
blank in the string. Perhaps many uses would use the entire
VALUE and not need to know the length.
Do we want to provide both STRLEN return value and one without it:

procedure SREAD (L: inout LINE; VALUE: out STRING; STRLEN: out natural; GOOD : out BOOLEAN);
procedure SREAD (L: inout LINE; VALUE: out STRING; STRLEN: out natural);

procedure SREAD (L: inout LINE; VALUE: out STRING; GOOD : out BOOLEAN);
procedure SREAD (L: inout LINE; VALUE: out STRING);

Do we need the good parameter? If STRLEN is 0, we did not get
anything? What happens in the last sread if strlen is 0?
Is it a run time error like other routines that return nothing?
It does not need to be since all blanks could indicate we
are ok.

BTW, the entire request for FT08 came from me, so any confusion
is my fault.

Cheers,
Jim

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jim Lewis
Director of Training             mailto:Jim@SynthWorks.com
SynthWorks Design Inc.           http://www.SynthWorks.com
1-503-590-4787
Expert VHDL Training for Hardware Design and Verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Received on Fri Jun 25 13:35:18 2004

This archive was generated by hypermail 2.1.8 : Fri Jun 25 2004 - 13:35:20 PDT