Author Topic: Best RETARGETABLE C compiler for FPGA CPU projects?  (Read 7825 times)

0 Members and 2 Guests are viewing this topic.

Offline Berry Straw

  • Newbie
  • Posts: 1
  • Country: au
Re: Best RETARGETABLE C compiler for FPGA CPU projects?
« Reply #50 on: June 17, 2024, 02:28:32 pm »
 

Offline trossin

  • Newbie
  • Posts: 9
  • Country: us
    • Demoboy
Re: Best RETARGETABLE C compiler for FPGA CPU projects?
« Reply #51 on: June 17, 2024, 07:36:52 pm »
I’m not sure if this was said but instead of creating your own instruction set, reinvent the wheel and design your own implementation of a vintage processor. This way a C compiler will already exist. You can make it fun by amping up the implementation by adding multi-level caching, out of order execution and branch prediction logic. A killer 68000 would be fun as it at least has a large address space compared to a 6502.

Years ago I created a cycle and speed accurate hardware emulator of a 1970s vintage 1802 processor using a PIC microprocessor all in assembler. That was a fun project. I also wrote a toy C compiler for it which I’ll admit was painful.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4239
  • Country: nz
Re: Best RETARGETABLE C compiler for FPGA CPU projects?
« Reply #52 on: June 17, 2024, 11:27:02 pm »
I’m not sure if this was said but instead of creating your own instruction set, reinvent the wheel and design your own implementation of a vintage processor. This way a C compiler will already exist.

Absolutely the path of least resistance. But vintage processors are often not well supported by modern compilers -- or just are very difficult to support. It's easier to implement RISC-V RV32I than 6502. Or Arm, for that matter, but you can publish your RISC-V CPU without getting sued.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf