{Spam?} Re: [vhdl-200x] Image attribute for array types

From: <tgingold@free.fr>
Date: Mon Jul 21 2014 - 12:44:57 PDT
> Is there any reason not to create a 'image attribute for composite
> types (arrays and records)?  Right now it only exists for scalar
> types like integer, real, etc.  One possible definition is a
> paren-enclosed, comma-delimited sequence of the element images from
> left to right (array) or first-to-last defined (record).  I believe
> this would make X'image a valid VHDL aggregate expression
> representing the current value of X.  It's easy to define,
> unambiguous, and quite general.

Arguments against (conservative view):

* You can easily write your own image/to_string function, given that
  it is defined for scalar types (but access).
* There is no natural format (particular for records)

> Example:
> 
> 
> process images is
>   variable ary : std_logic_vector(0 to 3) := b"011";
>   variable ln  : LINE;
> begin
>   write(ln, ary'image);
>   writeline(OUTPUT, ln);
> end process;
> -- Will print "('0','1','1')" according to my suggestion.

Not the best example as there is already hwrite or to_hstring for
std_logic_vector.

Regards,
Tristan.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Mon Jul 21 12:45:26 2014

This archive was generated by hypermail 2.1.8 : Mon Jul 21 2014 - 12:45:29 PDT