Circular Buffer / FIFO Buffer

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hello,

   

I am streaming some binary data through my hardware and I want to make the latest 1000 bits available to CPU on demand at any point of time. I want to implement this by constantly filling a buffer by DMA. So I want a Circular buffer or a FIFO buffer capable of holding at least 1000 bits (uint8 buf[128]) Is it possible to implement this in hardware? Any suggestions?

0 Likes
6 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

What is the bit rate of the stream you are trying to generate ?

   

 

   

DMA and some code certainly can create a circular buffer by chaining.

   

 

   

Verilog a very good possibility.

   

http://www.cypress.com/documentation/application-notes/an82250-psoc-3-psoc-4-and-psoc-5lp-implementi...

   

http://www.cypress.com/?docID=42936

   

http://www.cypress.com/training/psoc-creator-tutorial-component-creation-implementing-verilog

   

 

   

Or use the Datapath and some ASM code.....

   

http://www.cypress.com/?rID=60720     DFB Assembler, MAC Topics

   

http://www.cypress.com/?app=forum&id=2492&rID=76907     DFB Assembler

   

https://www.youtube.com/watch?v=2UC4gCohrk8      DFB Video Part I

   

https://www.youtube.com/watch?v=6tr_CNWIA8M     DFB Video Part II

   

https://www.youtube.com/watch?v=nIa4X7gES3k     DFB Video Part III

   

 

   

Regards, Dana.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Since the VeriLog resources are not able to access memory, an interrupt driven approach could do best.

   

A circular buffer can be implemented using pointer arithmetic and has a high performance when compiler's optimization is set.

   

Not a too difficult job.

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Warp Verilog supports 32 bit registers, a clever combo of Verilog and DMA might

   

work ?

   

 

   

A SW approach begs the question, what is the data rate you are trying to achieve ?

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

The rate is 100 Kbps. 

   

Thanks for suggestions!

   

Dana, you think I can do it by chaining DMA TDs? Any more clues about this? Any examples?

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

These discuss chaining -

   

 

   

http://www.cypress.com/?rID=37793     AN52705     Getting Started with DMA

   

http://www.cypress.com/?rID=82680     AN84810     PSoC® 3 and PSoC 5LP Advanced DMA Topics

   

http://www.cypress.com/?rID=44335     AN61102 PSoC® 3 and PSoC 5LP - ADC Data Buffering Using DMA

   

http://video.cypress.com/video-library/search/dma/     Videos on DMA

   

https://www.youtube.com/results?search_query=dma+psoc Videos on DMA (some overlap)

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Hi, It should be possible with chaning DMA TDs. There does not exist example project exactly for this application. However, other examples as pointed out by Dana above should help. 

0 Likes