Re: CP-007 and CP-008: textio for std_logic_1164


Subject: Re: CP-007 and CP-008: textio for std_logic_1164
From: Rob Anderson (rob@reawebtech.com)
Date: Wed Feb 19 2003 - 15:43:23 PST


Comments below:

Jim Lewis wrote:

>
>
> Peter Ashenden wrote:
>

> > For example, if we do a hex read into a 5-element vector and read 1F, we
> > get three extra 0 bits, but that's ok, since 1F can be represented in
> > five bits. On the other hand, if we read 3F, we get 001 as extra bits
> > and complain, since 3F needs at least six bits to represent it.
>
> This does exactly what I want with enhanced
> error protection.
>

I agree with this implementation, "warning". THen "error" if we hit
the end of line; probable we also want to skip whitespace
as a matter of course, but not the EOL.

Other issues:

Do we extend hex to include X,Z, etc? And, do we want to
select the case of hex digits (E.G. f vs F). perhaps a permissive
reader and case-controlled writer would be best.

Also, does a line end in <lf> or <cr> <lf> ? Perhaps there could
be a control for that as there is in some editors. It is annoying to
run a tool under cygwin then have to "d2u" the file. Possibly this
would be a VASG ISSUE.

>
> write(Output, to_string(now, right, 12) & " " & to_hstring(A_slv)) ;
>
> This to me would work quite well in lieu of printf.
> Perhaps in a VHDL sense, it is easier than printf.

I prefer this over printf. It is easy to control formatting in VHDL
with this approach. It allows you to control the exact position of
every character, something we have to do for finnicky file readers.
I would not use printf, it is too obscure, there are non-compatible
implementations all over the place.

--Rob

>
> Cheers,
> Jim
>
>



This archive was generated by hypermail 2b28 : Wed Feb 19 2003 - 15:45:16 PST