On Fri, 2006-10-20 at 13:02 -0500, tsuraan wrote:

> Of course, it's generally wise to convert recursive algorithms in C to
> explicitly iterative ones to avoid stack overflow, but sometimes it's
> just easiest to express things factorially.  Can that be done in
> Verilog?  I suppose you'd have to create some stack (ring buffer?) to
> store your previous data and always use that? 

Yep, keep track of your stack manually.  FPGAs have very nice memory
blocks you can use for that purpose.

> The reason I ask is because I'm working on a pixel-perfect cubic
> bezier curve rederer, and once it's done in C I'd like to try doing it
> in Verilog, but I have no idea how to express my recursive algorithm
> in hardware.  TrueType fonts use bezier curves, so I figured it would
> be cool to have the ability to accelerate them in hardware :) 

Convert the C code to using an explicit stack first, then convert it to
Verilog.

(If the recursion is only needed to evaluate constants then you can
actually write recursive code in verilog but I haven't seen this used
ever.)

-Peter

_______________________________________________
Open-graphics mailing list
[email protected]
http://lists.duskglow.com/mailman/listinfo/open-graphics
List service provided by Duskglow Consulting, LLC (www.duskglow.com)

Reply via email to