View Single Post
  #3 (permalink)  
Old 11-28-2007, 11:22 PM
Mike Treseler
Guest
 
Posts: n/a
Default Re: return a variable size string

Amal wrote:

> But in this case I cannot call deallocate(L) explicitly before the
> function returns. Do simulators release the storage after the
> function returns?


I don't know, because I find that writing
my own string conversion functions is more
efficient than tinkering with std.textio.
Here's some examples:
http://home.comcast.net/~mike_treseler/min_vec_len.vhd

I do use std.textio.write to print strings to
modelsim's standard output (std.textio.output) like this:

procedure echo (
arg : in string := "") is
begin
std.textio.write(std.textio.output, arg);
end procedure echo;

Then I can say something like this in a testbench

echo("The answer is " & odd2string(my_oddity) & LF & LF);

-- Mike Treseler

Reply With Quote