Luke Kenneth Casson Leighton
2011-Aug-20 22:37 UTC
[LLVMdev] Xilinx zynq-7000 (7030) as a Gallium3D LLVM FPGA target
i was just writing this: http://www.gp32x.com/board/index.php?/topic/60228-replicating-the-success-of-the-openpandora-discussion-v20/ when something that just occurred to me, half way through, and i would greatly appreciate some help evaluating whether it's feasible. put these together: http://www.xilinx.com/products/silicon-devices/epp/zynq-7000/index.htm http://llvm.org/releases/2.7/docs/ReleaseNotes.html http://en.wikipedia.org/wiki/Gallium3D#LLVM_usage http://wiki.opengraphics.org and it may be the case that completing the software for the OpenGraphics Project is a matter of hitting "compile". not only that, but a fully FSF Hardware-Endorseable Laptop with decent 3D Graphics Engine would be as equally simple (the only FSF Hardware-Endorsed laptop product is that Loongson Leemote, by virtue of it having a 2D PCI Graphics IC and a 900mhz MIPS). the logic goes as follows: * one of the Gallium3D targets is LLVM. * one of LLVM's targets is Xilinx FPGAs (MicroBlaze). * the zynq-7000 7030 has 125k FPGA Logic Gates (and more) * with a TFP410 as the DVI driver, the OGP is done! now, given that this appears to be "too easy", i'd really _really_ appreciate some help checking the facts. and, also, if it turns out to be feasible, assessing roughly what the performance might be. also, most importantly: what am i missing? :) many many thanks, l.
Nick Lewycky
2011-Aug-20 23:48 UTC
[LLVMdev] Xilinx zynq-7000 (7030) as a Gallium3D LLVM FPGA target
Luke Kenneth Casson Leighton wrote:> i was just writing this: > http://www.gp32x.com/board/index.php?/topic/60228-replicating-the-success-of-the-openpandora-discussion-v20/ > > when something that just occurred to me, half way through, and i would > greatly appreciate some help evaluating whether it's feasible. > > put these together: > http://www.xilinx.com/products/silicon-devices/epp/zynq-7000/index.htm > http://llvm.org/releases/2.7/docs/ReleaseNotes.html > http://en.wikipedia.org/wiki/Gallium3D#LLVM_usage > http://wiki.opengraphics.org > > and it may be the case that completing the software for the > OpenGraphics Project is a matter of hitting "compile". not only that, > but a fully FSF Hardware-Endorseable Laptop with decent 3D Graphics > Engine would be as equally simple (the only FSF Hardware-Endorsed > laptop product is that Loongson Leemote, by virtue of it having a 2D > PCI Graphics IC and a 900mhz MIPS). > > the logic goes as follows: > * one of the Gallium3D targets is LLVM. > * one of LLVM's targets is Xilinx FPGAs (MicroBlaze). > * the zynq-7000 7030 has 125k FPGA Logic Gates (and more) > * with a TFP410 as the DVI driver, the OGP is done! > > now, given that this appears to be "too easy", i'd really _really_ > appreciate some help checking the facts. and, also, if it turns out > to be feasible, assessing roughly what the performance might be. > > also, most importantly: what am i missing? :)The way in which Gallium3D targets LLVM, is that it waits until it receives the shader program from the application, then compiles that down to LLVM IR. That's too late to start synthesizing hardware (unless you're planning to ship an FPGA as the graphics card, in which case reprogramming is still too slow, and it'll be too expensive). A more accurate approach would be to say, "Well, Mesa is a software implementation of the whole OpenGL stack, right? Why not compile it to verilog using something like c-to-verilog.com (also powered by LLVM) then synthesize that?" The answer is that the resulting code will be far too inefficient to make a useful modern graphics card, and even if it were, you'll have to do lots of work to make it communicate of PCI and DVI, etc. Hardware isn't POSIX after all. Nick> > many many thanks, > > l. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Luke Kenneth Casson Leighton
2011-Aug-21 00:13 UTC
[LLVMdev] Xilinx zynq-7000 (7030) as a Gallium3D LLVM FPGA target
On Sun, Aug 21, 2011 at 12:48 AM, Nick Lewycky <nicholas at mxc.ca> wrote:> The way in which Gallium3D targets LLVM, is that it waits until it receives > the shader program from the application, then compiles that down to LLVM IR. > That's too late to start synthesizing hardware (unless you're planning to > ship an FPGA as the graphics card, in which case reprogramming is still too > slow, and it'll be too expensive).nick.... the Zynq-7000 series of Dual-Core Cortex A9 800mhz 28nm CPUs have an on-board Series 7 Artix-7 or Kinect-7 FPGA (depending on the Zynq range). and that's on the same silicon IC :) so, price is not an object any more [assuming reasonable volume]. here's the eetimes article which mentions that the low-end version of the 7000 series will be under $USD 15 in mass-volume: http://www.eetimes.com/electronics-news/4213637/Xilinx-provides-first-product-details-for-EPP-ARM-based-devices so - does that change things at all? :) i assumed that it would be possible to push other sections of the gallium3d code through the LLVM wringer (so to speak). not just the shader program. i've seen papers for example - someone won 3rd prize from a competition by xilinx, he was a Seoul University student, managed to implement parts of OpenGL ES 1.1 in an FPGA, by porting MesaGL to it. got fair performance, too. i always wondered what happened to his code, and if he would be required to comply with the GPL / LGPL... anyway, yes: what's possible, and where can people find out more about how gallium3d uses LLVM? and (for those people not familiar with 3D), why is the shader program not "static" i.e. why is a compiler needed at runtime at _all_? (if there's an answer already somewhere on a wiki, already, that'd be great). and: would moving this compiler onto the FPGA (so that it interprets the shader program), making it an interpreter instead, be a viable option? just throwing ideas out, here. btw i'm familiar with the dynamic architecture of 3D engines, but many people who might be reading this (from the archives) are not. i've seen the hardware block diagram for the PowerVR SGX engine, for example and it's... interesting, to say the least :) l.