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


Subject: Re: CP-007 and CP-008: textio for std_logic_1164
From: Peter Ashenden (peter@ashenden.com.au)
Date: Thu Feb 20 2003 - 03:29:26 PST


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

-- 
Dr. Peter J. Ashenden                        peter@ashenden.com.au
Ashenden Designs Pty. Ltd.                   www.ashenden.com.au
PO Box 640                                   Ph:  +61 8 8339 7532
Stirling, SA 5152                            Fax: +61 8 8339 2616
Australia                                    Mobile: +61 414 70 9106



This archive was generated by hypermail 2b28 : Thu Feb 20 2003 - 03:33:17 PST