Electronics > FPGA

Best RETARGETABLE C compiler for FPGA CPU projects?

(1/11) > >>

plainsteve:
One of my bucket list items is to create a CPU (on FPGA) which can play Doom at 320x200(or 240) and then move to Quake 1 at 640x480.  One major setback is a lack of a C compiler which is accessible enough to actually retarget by a person who does not wish to spend his career as a compiler specialist.  I've looked at LLVM on and off over the last 6 years, but their documentation is awful and I don't have the time to chip away at that behemoth.

Can you suggest a decent quality C compiler that is retargetable by someone knowledgeable about compilers but not an expert?

Thanks!

ataradov:
Realistically any advanced compiler will require a lot of effort to retarget.

TCC seems like your best bet, but I'm not sure it actually supports enough of C to compile Quake.  I bet Doom won't be a problem though.

As an alternative you can create a core for already existing architecture (like RISC-V). This will move the project forward fast and if you still feel like doing it, you can replace the core at a later time when all the peripherals are working.

Berni:
Yeah if you are using a FPGA then its best to just make the softcore CPU compatible with some sort of existing instruction set. There are a lot of instruction sets out there so im sure you will find one that works for what you are trying to make.

Just make sure to use a instruction set that is reasonably high level language friendly so that the compiler will have a easy time making fast optimized code for it. So you may need to chose a bit more complex of a cpu core or you might have to run your softcore CPU at a fairly high speed to compensate for the slow software.

rstofer:
It would be best to just use a core provided by the FPGA manufacturers like Intel (Altera) NIOS or Xilinx MicroBlaze.

If you really want to do it the hard way with a custom core, consider using LCC.

https://en.wikipedia.org/wiki/LCC_(compiler)

https://www.amazon.com/Retargetable-Compiler-Design-Implementation/dp/0805316701

langwadt:

--- Quote from: rstofer on January 17, 2020, 11:29:27 pm ---It would be best to just use a core provided by the FPGA manufacturers like Intel (Altera) NIOS or Xilinx MicroBlaze.

If you really want to do it the hard way with a custom core, consider using LCC.

https://en.wikipedia.org/wiki/LCC_(compiler)

https://www.amazon.com/Retargetable-Compiler-Design-Implementation/dp/0805316701

--- End quote ---

here's an example of an FPGA cpu core and LCC, http://www.fpgacpu.org/xsoc/index.html


Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod