• 0
rappysaha

Having trouble with Block memory generator for Genesys 2

Question

Hi,

I am using block memory generator 8.3 in vivado16.2. I am using to store my image sensor data. The resolution of the sensor is 1280*1024(=1310720). And each pixel contains 16-bit. 

Parameters I am using:

Interface type: Native, Memory type: Simple Dual port RAM. PORT A is used for writing the pixels into the memory block. PORT B is used for reading out.

Port A Width: 16 Range: 1 to 4608 bits (as each pixel has 16 bit) Port A Depth: 1310720 Range: 2 to 1048576 ( but this value exceed the range)

So, I am thinking to write two pixels into the memory at a time so that I can reduce the Depth at half.

Port A Width: 32 Range: 1 to 4608 bits  Port A Depth: 655360 Range: 2 to 1048576 

But it gave me some collision error which is shown in the attached image. But, I gave the value within the range. 

How can I allocate memory for my case? And what is the reason behind this error?

Any suggestion  will be appreciated.

Thank you. 

 

 

Problem.png

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 1

Your problem is that block RAM on FPGA's is a limited resource, some would say even a precious resource.  Your design over-uses your block RAM.  There is only about 16 Mbits of block RAM on your device in total, or about 2MBytes, or equivalently, enough to handle one Mpixel.  Your design exceeds this by itself, leaving no room for anything else within your design that might need the same block RAM.

What you will need to do instead is to use the DDR3 SDRAM.  You will have 1GB available to you with the DDR3 SDRAM.  Use the Xilinx Memory Interface Generator to create a configuration for the SDRAM, rather than the BlockRAM interface generator.

Let us know how that works,

Dan

Share this post


Link to post
Share on other sites
  • 1

Hi Rappy,

The 16 Mbits of fast block RAM (up 7x) is refering to the difference from the Genesys and Genesys 2. In this case there is more than 7 time more fast block Ram in the Genesys 2. Hope this helps!

cheers,

Jon  

Share this post


Link to post
Share on other sites
  • 0

@D@n

Hi,

Instead of using DDR3, is it possible to use block memory and the distributed memory at the same time? (I can be wrong)

Any suggestion will be appreciated.

Thank you

Rappy

Share this post


Link to post
Share on other sites
  • 0

To really find out what it means, you need to look into the 7-series overview, where the number came from.  You can find it on the KC7K325T line (the one appropriate for a Genesys2 board) on page 3.  On that line, it says you have 16,020k-bits of fast RAM, divided between 18kb and 36kb components.  You'll need to note two things about this line.  First, the number is given in bits, not bytes, and second the number is just less than 16,384.  Hence, while the device has over 16 million bits of fast block RAM, it doesn't really have 2MBytes.

Now, in your case, you are trying to work with a 1M pixel camera, that has 16bits per pixel.  From the above statistic, it would look like you should be able to allocate a memory the full size of your camera, right?  I mean, it's got 16 million bits, right?  Not quite so fast.  First, while it has more than 16*10^6 bits, it doesn't have 16*(1280*1024) bits.  Keep in mind, in allocating block RAM, you will allocate a power of two's worth---even if you don't need it.  Hence, since you have more than 1024*1024 pixels, you will need to allocate enough RAM for 2*1024*1024 pixels (or crop your image).  This means you might be able to allocate enough memory to hold 7-bits at every pixel location.

Be careful, though, if you wish to push this to the limit: you might find that other things need this memory too.

Some alternatives to consider: if you must use fast RAM (I still think DDR3 would work--but I can understand your frustration with its complexity), would be to compress the image as you read it in or wrote it out.  Wavelets might work nicely, but might also be more complex than that DDR3 memory.  Another alternative might be to clip your image so that it fits within 1024x1024, or (as suggested above) to drop from 16-bits per pixel down to a smaller number.

Dan

Share this post


Link to post
Share on other sites
  • 0

Hi D@n,

Thank you for your suggestion. The explanation is quite clear to me except "(up 7x)". I am not clear about this terminology. What does they mean by this terminology?

Besides, your idea about cropping the image or reducing the bit of each pixel was good. But in my case quality of the picture is fact. So, I can't just reduce the pixel bit no. And cropping the image also won't give me enough solution because I am going to use 3 more blocks for RGB pictures. DDR3 is always great solution I have to do lots of work on it.

Any suggestion will be helpful.

Thank you.

Rappy

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now