Subject: Re: CP-007 and CP-008: textio for std_logic_1164
From: Rob Anderson (rob@reawebtech.com)
Date: Thu Feb 20 2003 - 09:48:35 PST
Yes, it would be nice to have a standard way to tell the
simulator that when it is writing text, it should
use one of two line delimiters. It should not just write
a file based on the current OS.
Unix was LF and DOS was CRLF, you can tell by the appearance
of ^M at the end of DOS lines under UNIX. Editors, eg. GVIM
do not have trouble reading either case on either system.
DOS tools do not seem to have trouble with missing <CR>, it
is usual to see problems on the unix side dealing with the
extra <CR>.
--Rob
Jim Lewis wrote:
> What I want is something that says newline. Where
> if I remember right, newline = LF for UNIX, and
> CR&LF or LF&CR for Windows (can't remember which).
>
> Perhaps, NL would be a better acronym. You could
> use your argument to say separate things for Unix and
> Windows are not needed.
>
> Cheers,
> Jim
>
> Peter Ashenden wrote:
>
>> On Thu, 2003-02-20 at 17:46, Jim Lewis wrote:
>>
>>
>>> With write, it would be nice to be able to insert the
>>> appropriate LF, CR, or CRLF depending on what the particular
>>> OS would prefer to see. To deal with this, I would like
>>> to define a string constant in std.textio named something like
>>> CRLF. With this, inserting a newline in either OS would become:
>>>
>>> write(Output, "%%%ERROR data value miscompare in CpuModel." &
>>> CRLF & " Actual data value = " & to_hstring(Data) &
>>> CRLF & " Expected data value = " & to_hstring(ExpData) &
>>> CRLF & " at time: " to_string(now, right, 12) ) ;
>>
>>
>>
>> You can already do this. Both CR and LF are enumeration values in
>> CHARACTER. You can concatenate a character to a string, so the
>> following would work:
>>
>> write(Output, "%%%ERROR data value miscompare in CpuModel." &
>> CR & LF & " Actual data value = " & to_hstring(Data) &
>> CR & LF & " Expected data value = " & to_hstring(ExpData) &
>> CR & LF & " at time: " to_string(now, right, 12) ) ;
>>
>> Cheers,
>>
>> PA
>
>
>
This archive was generated by hypermail 2b28 : Thu Feb 20 2003 - 09:50:34 PST