RISC-V Soft CPU on FireAnt (Trion T8 FPGA based Devboard)
bonfirecpu.eu/2019/11/24/bonfire-effinix.htmlPosted Nov 26, 2019, 2:07 PM UTC
Posted Nov 26, 2019, 2:07 PM UTC
I've been running the Bonfire on the Trenz MAX1000 and CYC1000.
Made an Avalon wrapper for the core and stuck it in Qsys with an Intel SDRAM controller. Added a bootloader (to pull SW image from the SPI flash) and Floating point IP cores to the Bonfire local memory area. It chugs away happily at 48MHz.
The good thing about Qsys is you can easily parse the generated system (it provides an XML for this purpose) for things like peripheral base addresses, part number and component parameters. Then generate a C header file containing all of these as #defines and derived values for your program. You can even do things like look up the maximum possible size of the FPGA configuration image and use that to choose a location for placing the SW image, then generate scripts for the programmer/assembler tools based on that.
A subtle feature of the MAX1000 and CYC1000 boards is they appear as two USB devices (uses FT2232H) so you get both JTAG for programming and serial UART for talking to it at runtime. They also have an ADC/accelerometer, all in all I think they are a great deal.
Oh and I finally managed to get a DWARF parser working with the Bonfire so I can get C source output, local and global variables in ModelSim.
Regarding these Chinese FPGAs, in general I don't think I would have the patience to fight the tools.
I've been running the Bonfire on the Trenz MAX1000 and CYC1000
Great. Is there some public repo with it?
Oh and I finally managed to get a DWARF parser working with the Bonfire so I can get C source output, local and global variables in ModelSim.
Can you elaborate a bit what you exactly what you have done?
No there's no public repo. The project is version controlled in Bazaar and there is no appetite to transfer it to GIT, it is also based on a combination of the Quartus GUI and a hierarchy of batch files calling the Quartus tools and C# programs, there are no make files used at all. What we could do is provide just the dwarf parser C# and VHDL testbench code if you wish to integrate this into your Bonfire projects.
Here is a screenshot of it in action.
How it works is roughly:
CYC1000
The latest lite/web/free Quarus releases don't appear to include Qsys. Is there some reasonable option for hobbyists to get Qsys support for CYC1000 or MAX1000 that I'm missing?
They just renamed it Platform Designer, it's the same thing as Qsys.
In case you aren't aware of how it works. You can add custom components by following a wizard and assigning ports to either be Avalon ports or "conduits" (random stuff that needs routing outside the Qsys generated entity).
So if you are making your own wrapper for the Bonfire say, you need to make a wrapper VHDL entity that converts the Wishbone signals to two Avalon memory mapped master interfaces (instruction and data), converting a Classic Wishbone cycle to the Avalon equivalent is easy the signals are very similar. Doing the same converion for burst mode is more difficult so I suggest you start with a non-bursting Avalon master and just take the performance hit. You can map the interrupts to an Avalon interrupt sink.
Then in Qsys/Platform Designer the wizard will detect the ports in your design and try to assign them to Avalon signals, you will probably need to edit them manually to get them all right.
Finally you can add the built in Avalon SDRAM controller, UART (mapped to the USB chip's port B), GPIO (LEDs etc), interval timer and SPI (accelerometer/ADC). You can even make your own peripherals by making Avalon memory mapped slave wrappers for them.
Here are some examples of a CYC1000 in Quartus Prime 18.1 Lite Component Wizard, full Avalon system. I always put my PLL externally to the Qsys entity so that I don't have to simulate the cumbersome Intel behavioural model and you can route the locked output to the system's reset_n. The Avalon clocks source is set to 48MHz, the PLL to 12MHz in, FPGA clock = 48MHz 3ns phase shift, SDRAM clock = 48MHz 0ns phase shift.
For extra fun, try grabbing the "Intel Floating Point Hardware 2 Multi-cycle" from the IP catalog and mapping it into the Bonfire's local memory bus, now you've got an FPU!
https://shop.trenz-electronic.de/en/TEC0117-01-FPGA-Module-with-GOWIN-LittleBee-and-8-MByte-internal-SDRAM
TEC0117
9K LE's with 8MB onboard RAM
Funny. I already have this board. I was not able to get the Gowin DRAM IP running, but was successful with an open source SDRAM controller which I already used on Sparta-6 based designs.
I will post about my experience with the TEC0117 in my blog soon.