On Thu, 16 Sep 2010 05:09:28 +0200 (CEST), Tristan Gingold <[email protected]> wrote: >> ok, here is one of the little dirty secrets of GHDL that I found >> the hard way : when a VHDL function returns a string, well, >> it is transformed into a procedure with a hidden additional argument ! > Correct. Note that returning a string is a feature not available in C or > in verilog. And to implement it you have to deal with memory management. yes, I have examined this and I understand why you don't document it. yet... It's so useful ! :-)
>> Since this ABI/API is very useful and (AFAIK) undocumented, >> I have put example code there : http://ygdes.com/GHDL/ghdl_env/ >> Use wisely and carefully, > Yes, as there is no warranties that this ABI is stable. fortunately, and hopefully, such "dirty" code only resides in version-specific packages that provide the functionality to VHDL code. So whenever the ABI changes, only the packet has to be adapted, not the VHDL code. So I did risky things, I know, but 1) it is a limited risk, 2) it is necessary and useful This string memory management thing is probably the main reason why GHDL is "slow". However, without this complex machinery, it would not be possible to provide the features that make VHDL (and GDL) so powerful ! I will appreciate to help you whenever you want to use a more efficient system, I have a few ideas. The more I look at it, the more I appreciate GHDL ! > Tristan. yg _______________________________________________ Ghdl-discuss mailing list [email protected] https://mail.gna.org/listinfo/ghdl-discuss
