[HH] c++ strings?

Matthew Gillen me at mattgillen.net
Tue Nov 27 16:27:04 EST 2012


On 11/27/2012 03:30 PM, Greg London wrote:
> I've finally gotten a few cycles to work on this again,
> and I am getting a weird error message:
>
> ::import "DPI" function void Note( string const &msg);
> ::                                              |
> ::ncvlog: *E,CNSTRF (topmodule.v,2|46): The keyword 'const' must
> ::        be followed by 'ref' in formal argument lists.
>
> The import "DPI" thing is how I'm supposed to tell my verilog
> simulator what the C functions will look like.
>
> This might be a problem with the verilog simulator (which is being a bear
> to work with) but I just wanted to check if anyone recognized
> the "'const' must be followed by 'ref'" message and saw something
> stupid that I was missing?

Maybe their macro isn't tolerant of all legal C++ syntax.  Try putting 
the ampersand immediately after the 'const':
   void Note( string const& msg);

HTH,
Matt



More information about the Hardwarehacking mailing list