<div dir="ltr">boost::format works by operator overloading of the '%' operator (modulus normally).<div>You can define your own overloads that would stub it out, and then #define format() to stub it out.</div><div>(unless Xilinx's compiler is stumbling on the operator overloads themselves!)</div><div><br></div><div>Alternatively, it strikes me as *possibly* not that long a task to create a set of regex's for search and replace to convert to sprintf.</div><div>The way I would go about that is to come up with a regex that matches a format() call with one replacement (one '%' after the format), and then one for 2 replacements, 3 replacements, etc.</div><div>This should drastically cut down on the work to convert to sprintf.  Note that there may well be a way to do this all with one regex but my regex-fu is not that strong.</div><div><br></div><div>-Jon</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 1, 2015 at 12:30 PM, Greg London <span dir="ltr"><<a href="mailto:email@greglondon.com" target="_blank">email@greglondon.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
I have some c++ code that I've been developing for hardware simulation<br>
over the years.<br>
<br>
Very recently I got some cycles to try and port this code as an<br>
executable to the Zedboard, which uses the Xilinx ZYNQ chip, which<br>
has an ARM processor and FPGA fabric. This would give us probably<br>
a couple orders of magnitude in faster executions. And would save<br>
a lot of money in not needing simulation licenses.<br>
<br>
The problem is the Xilinx tools do not seem to like Boost::Format.<br>
<br>
My c++ code looks like this:<br>
<br>
   #include <boost/format.hpp><br>
   using boost::format;<br>
   using boost::io::group;<br>
   string mystr = (format("%s Timercount=%d") % msg % count ) .str();<br>
<br>
<br>
Unfortunately, I've used boost::format everywhere.<br>
If it was rare, I'd just manually go through it and<br>
convert it to sprintf() or something.<br>
But its literally used thousands of different places<br>
in my code.<br>
<br>
Anyway, I thought maybe there might be a way to roll my own<br>
version of format() so that it just calls sprintf().<br>
Except I never quite understood the percent separators<br>
in format.<br>
<br>
I basically need something like this:<br>
<br>
    string boost::format(%){<br>
       return sprintf(%);<br>
    }<br>
<br>
Worst comes to worse, it's an empty function.<br>
I just want to get something to compile on the FPGA.<br>
<br>
It would be nice if the IO could be sent to the<br>
terminal port, which means the stub would have to actually<br>
return something meaningful.  But really, the priority<br>
is just getting the code to do memory accesses and the<br>
IO is helpful but not absolutely required.<br>
<br>
Could someone point me to a solution for this?<br>
<br>
Thanks,<br>
Greg<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Hardwarehacking mailing list<br>
<a href="mailto:Hardwarehacking@blu.org">Hardwarehacking@blu.org</a><br>
<a href="http://lists.blu.org/mailman/listinfo/hardwarehacking" target="_blank">http://lists.blu.org/mailman/listinfo/hardwarehacking</a><br>
</blockquote></div><br></div>