The image attribute converts vhdl types to string equivalents.
This is built into the language for some types.
I expect that to_string is an example function
that does something similar, maybe on some other type.
-- Mike Treseler
to_string is overloadable, so for types for which the default is not
sufficient, we can overload the implicitly defined to_string in the
appropriate packages (which was done in the IEEE 1076-2008 revision).
For more on VHDL-2008, see our website:
http://www.synthworks.com/papers
Best,
Jim
P.S.
A little status on IEEE 1076-2008, it has passed ballot and
will be reviewed by REVCOM later this month. With their
approval (which is expected), it will then become 1076-2008.
From there IEEE will add a few pages (the forward matter stuff
documenting the working group members, the ballot group members, etc)
and then publish the document.
Since much of this standard was released by the Accellera working
group in July of 2006, vendors have already been working on the
features. As a user, I would submit requests for your favorite
features to be implemented to encourage them along in the process.
to_string by default supports scalars and "one-dimensional array
type[s] whose element type is a character type that contains only
character literals".
While 'image could have been simplified and extended, it still
would not be overloadable, which is the big benefit of to_string.
I expect this to be handy in report statements and the built-in
write (not textio). For example
write(OUTPUT, "Error: data value mismatch." &
"Expected value: " & to_string(Expected_Slv) &
"Actual value: " & to_string(Expected_Slv) & LF ) ;
In the context of write, writeline and report, LF was extended to
be a marker character to indicate produce an appropriate newline
for the OS you are using - in a similar fashion to \n in C except
that it cannot be quoted and put directly in a string.
Cheers,
Jim