Author Topic: [Zynq] transferring data between CPU cores and fabric without too much hassle  (Read 2606 times)

0 Members and 1 Guest are viewing this topic.

Offline DigitalioTopic starter

  • Contributor
  • Posts: 26
  • Country: mx
I need to transfer blocks of data (up to several megabytes each) between CPU core and FPGA fabric, bidirectionally. Could anyone point to me any good tutorials / books / samples / etc?
« Last Edit: September 29, 2020, 10:11:49 pm by Digitalio »
 

Offline colorado.rob

  • Frequent Contributor
  • **
  • Posts: 420
  • Country: us
Have you read The Zynq Book yet?
 

Offline DigitalioTopic starter

  • Contributor
  • Posts: 26
  • Country: mx
Have you read The Zynq Book yet?
In process.
 

Offline DigitalioTopic starter

  • Contributor
  • Posts: 26
  • Country: mx
It seems that I need AXI, right?
 

Offline hamster_nz

  • Super Contributor
  • ***
  • Posts: 2812
  • Country: nz
What does your programming interfaces look like? It really depends on how you intend to use it.

For example you could do it with a memory window, in which case you hang your design off of an AXI mastter.
or you could use two FIFOs, which will need maybe four registers (data + status reg in each direction).
Or you could do it using DMA,
Or you could use GPIO, like we used to do with the good old EPP printer port in days of yore.
Or you could have the fabric talk to the AXI slave interface and read and write the data directly from the DDR, without the CPU being involved.

But Adam Taylor's Zynq book is a great start.
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 
The following users thanked this post: Digitalio

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4684
  • Country: dk
It seems that I need AXI, right?

yes you will need axi, either make your PL a slave the CPU can write to, or make PL a master than can directly read/write main memory

 

Offline DigitalioTopic starter

  • Contributor
  • Posts: 26
  • Country: mx
What does your programming interfaces look like? It really depends on how you intend to use it.

For example you could do it with a memory window, in which case you hang your design off of an AXI mastter.
or you could use two FIFOs, which will need maybe four registers (data + status reg in each direction).
Or you could do it using DMA,
Or you could use GPIO, like we used to do with the good old EPP printer port in days of yore.
Or you could have the fabric talk to the AXI slave interface and read and write the data directly from the DDR, without the CPU being involved.

But Adam Taylor's Zynq book is a great start.
What's the best method for sending data of fixed width in both directions on every clock tick?
 

Online brucehoult

  • Super Contributor
  • ***
  • Posts: 4455
  • Country: nz
To and from what?

No CPU can continuously absorb data arriving on every clock tick. And put it where? There are only a few registers.

You can't depend on accessing DRAM every clock because it takes time and because the CPU wants to use it also.

Assuming that this is not continuous, forever, you can put the data in SRAM in the FPGA, and provide the CPU with access to this, perhaps by mapping it as a range of addresses, or perhaps by reading from the same address repeatedly, with new data appearing each time.

You need to specify much more precisely what it is you are trying to do.
 

Offline hamster_nz

  • Super Contributor
  • ***
  • Posts: 2812
  • Country: nz
What does your programming interfaces look like? It really depends on how you intend to use it.

For example you could do it with a memory window, in which case you hang your design off of an AXI mastter.
or you could use two FIFOs, which will need maybe four registers (data + status reg in each direction).
Or you could do it using DMA,
Or you could use GPIO, like we used to do with the good old EPP printer port in days of yore.
Or you could have the fabric talk to the AXI slave interface and read and write the data directly from the DDR, without the CPU being involved.

But Adam Taylor's Zynq book is a great start.
What's the best method for sending data of fixed width in both directions on every clock tick?

The best is to not go near the CPU at all.

If you seriously want to process a word of data every clock cycle, without hiccups, then you need to do it all in a fixed latency pipeline in the FPGA fabric, and just use the CPU for command and control duties. This is what you would do for a low-latency audio, video or SDR processing pipeline.
Gaze not into the abyss, lest you become recognized as an abyss domain expert, and they expect you keep gazing into the damn thing.
 
The following users thanked this post: Digitalio

Offline DigitalioTopic starter

  • Contributor
  • Posts: 26
  • Country: mx
The best is to not go near the CPU at all.

If you seriously want to process a word of data every clock cycle, without hiccups, then you need to do it all in a fixed latency pipeline in the FPGA fabric, and just use the CPU for command and control duties. This is what you would do for a low-latency audio, video or SDR processing pipeline.
My ultimate goal is to use Ultra96 for performing calculations on data loaded from SSDs connected via its USB 3 ports and saving the results back. It's not a problem to have some hiccups if it saves me a good deal of time writing the firmware code.
 

Offline Dmeads

  • Regular Contributor
  • *
  • Posts: 164
  • Country: us
  • who needs deep learning when you have 555 timers
The xilinx axi gpio cores can be instantiated via the block diagram in vivado. The configuration Wizard for them can be enabled for dual channel bidirectional (double click on the instance in the GUI). I use these to move data from the CPU to my RTL code on the FPGA fabric, however I have never done it with the amount of data you are using. I think each channel on the AXI_gpio blocks can be 32 bits?

I made a very basic video series on moving data in from io pins, then having it be processed by the FPGA. That processed Data is sent to the Zynq core via AXI_GPIO, further processed, and sent back outside the chip via another AXI_gpio block.

maybe it will help you? there are two parts
part 1:
part 2:

give me some feedback if it works :)
 
The following users thanked this post: Digitalio

Offline lincoln

  • Regular Contributor
  • *
  • Posts: 155
  • Country: us
Some other axi video that helped me :

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf