To C++ or not to C++ for DSP and FPGA

Thread Starter

n3rdx

Joined Jan 29, 2021
5
For the purposes of this post: I'm a medium experienced design engineer with experience in original design in power regulation, switching, distribution and microcontroller (C++, either ColdFire or MSP MCU) based low-level control for smallsat flight hardware, and separately some radio transceivers that I laid out on PCBs and got working from published articles. Not much of a history in EE FPGA topics, other than I have FPGA boards in front of me and programming them ok for general purpose networked control applications. What I could not yet do with the boards is DSP applications due to my lack of training in that. I can do the math, but haven't started on detailed development so far. So far I have achieved a lot of non-DSP control application development in Spartan-7 (I wrote a Xilinx Board file for Spartan Edge Accelerator and used that) and I do have at my disposal Avnet MiniZed/SoC family development boards but want to explore if I can use the Spartan-7 as it is much lower cost for my project needs.

Can I ask a few questions, having invested so far in XILINX toolchain with Vivado/Vitis and having done microblaze development recently:
  • Are there standalone C++ libraries for DSP functions that can be compiled on baremetal XILINX FGPA? for use in Microblaze RTOS environment?
  • Are there ways to convert Gnu Octave DSP routines to C++ code for compiling via Vitis or is this an infeasible development pathway?
  • For a FPGA generic device, is a DSP application even possible using non-DSP hardware? If it is, what are the likely constraints?
  • Any good tutorials on using DSP slices on XILINX FPGA devices?
Thanks
 

DrBit

Joined Jan 26, 2021
6
I do a lot of DSP, mostly ultra-sound. This is how we work.
Typically the signals flows between modules with AXI4 streams. Xilinx have a lot of support for that. FIR, FFT etc.
Then I use Instant SoC that have very good support for AXI4 Streams. With Instant SoC you write your code in C++ and the compiler makes both the hardware and software. Instant SoC is very easy to use and I usually have several Instant SoC cores in a project.
It is also very easy to write and use your own Verilog or VHDL Wishbone extensions to the systems.
 

Deleted member 115935

Joined Dec 31, 1969
0
HLS is the latest thing in Xilinx land
You write code in (C++) and then it compiles to FPGA code to synthesis
The other common way is MatLab, again you write in Matlab code, then compile that to code that the FPGA tools can synthesise.

The advantage is that you simulate and design the DSP code in the tools that are good at designing said,

I have seen some very good demos of this,
and some real real bad real world examples,

Despite everything ,
at the moment you have to still design the algorithm to work in FPGA land

I am convinced that a high level way of coding is the way we have to go,
but I'd say you can not just write C++ and get good FPGA results.
 

Thread Starter

n3rdx

Joined Jan 29, 2021
5
Then I use Instant SoC that have very good support for AXI4 Streams. With Instant SoC you write your code in C++ and the compiler makes both the hardware and software. Instant SoC is very easy to use and I usually have several Instant SoC cores in a project.
It is also very easy to write and use your own Verilog or VHDL Wishbone extensions to the systems.
Thanks for the very interesting suggestion DrBit. In the intro it mentions a RISC-V soft CPU which I must have probably studied in its early iteration in computer architecture classes a long time ago - do you develop bare metal applications on this, or do you employ a RTOS on the soft CPU for your projects if I may ask? I've got some previous familiarity with FreeRTOS but thought of using FreeRTOS with Microblaze . I have done Microblaze bare metal, and the FreeRTOS was on my list of nice to haves as I have more experience in the RTOS domain. One of my recent projects on microblaze was to write a driver to output graphics using a SEEED Studio Spartan-7 board with custom header to a Digilent Pmod OLEDrgb 1" LCD panel that was fun when I got it working. Keypads and keyboards were also tested.

Last questions does Instant Soc (I am studying it) rely upon any particular XILINX FPGA series?

Thanks

N3RDX
 

DrBit

Joined Jan 26, 2021
6
Thanks for the very interesting suggestion DrBit. In the intro it mentions a RISC-V soft CPU which I must have probably studied in its early iteration in computer architecture classes a long time ago - do you develop bare metal applications on this, or do you employ a RTOS on the soft CPU for your projects if I may ask? I've got some previous familiarity with FreeRTOS but thought of using FreeRTOS with Microblaze . I have done Microblaze bare metal, and the FreeRTOS was on my list of nice to haves as I have more experience in the RTOS domain. One of my recent projects on microblaze was to write a driver to output graphics using a SEEED Studio Spartan-7 board with custom header to a Digilent Pmod OLEDrgb 1" LCD panel that was fun when I got it working. Keypads and keyboards were also tested.

Last questions does Instant Soc (I am studying it) rely upon any particular XILINX FPGA series?

Thanks

N3RDX
Instant SoC is not designed larger projects with RTOS. I design bare metal with this however I usually end up in a couple of Instant SoC/RISC-V CPUs in a project. Since only hardware that is need is created there are minimal overhead.
I like this approach for time critical apps.

The VHDL code that Instant SoC produces is not device dependent. I have used the same code on Spartan-6 and Artix and it also run on e.g. Lattice devices.
 

bdrmachine

Joined Jan 26, 2010
20
I do a lot of DSP, mostly ultra-sound. This is how we work.
Typically the signals flows between modules with AXI4 streams. Xilinx have a lot of support for that. FIR, FFT etc.
Then I use Instant SoC that have very good support for AXI4 Streams. With Instant SoC you write your code in C++ and the compiler makes both the hardware and software. Instant SoC is very easy to use and I usually have several Instant SoC cores in a project.
It is also very easy to write and use your own Verilog or VHDL Wishbone extensions to the systems.
I have run across Instant SoC mentioned several times recently and was curious so I researched it. My understanding is that it converts C++ into VHDL. Sadly I have only used Verilog.
 

DrBit

Joined Jan 26, 2021
6
I have run across Instant SoC mentioned several times recently and was curious so I researched it. My understanding is that it converts C++ into VHDL. Sadly I have only used Verilog.
I don't think that should be a problem. A verilog wrapper is generated when compiling and in most (all?) synthesis tools you can mix VHDL and verilog. However I use most VHDL and have not tested using the verilog wrapper/header. You never need to edit the generated VHDL module.
The Wishbone class that can take verilog as input.
 

Deleted member 115935

Joined Dec 31, 1969
0
I don't think that should be a problem. A verilog wrapper is generated when compiling and in most (all?) synthesis tools you can mix VHDL and verilog. However I use most VHDL and have not tested using the verilog wrapper/header. You never need to edit the generated VHDL module.
The Wishbone class that can take verilog as input.
Re tools and verilog / VHDL,
simulators are known to have different price points to support each language,
the ones built into intel / altera and Xilinx FPGAs support both , but be aware some other simulators don't .
 
Top