cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
head_up
Adventurer
Adventurer
601 Views
Registered: ‎10-11-2009

xfOpenCV BRAM usage

I'm using Vivado HLS with xfOpenCV, target xc7z007s-clg225-1. The code is taken from one of the examples and is something like this:

 

 

#define IMAGE_WIDTH 640
#define IMAGE_HEIGHT 512

typedef hls::stream< ap_axiu<16,1,1,1> > AXI_STREAM16_t;
typedef hls::stream< ap_axiu<8,1,1,1> > AXI_STREAM8_t;

void xfRSZ( AXI_STREAM8_t& s_axis_video,
	    AXI_STREAM8_t& m_axis_video )
{

	xf::Mat<XF_8UC1, 8, 8, XF_NPPC1> img_src(8, 8);
	xf::Mat<XF_8UC1, IMAGE_HEIGHT, IMAGE_WIDTH, XF_NPPC1> img_dst(IMAGE_HEIGHT, IMAGE_WIDTH);

	// Processing in dataflow
	#pragma HLS dataflow
	xf::AXIvideo2xfMat( s_axis_video, img_src );

	xf::resize <XF_INTERPOLATION_BILINEAR, XF_8UC1, 8, 8, IMAGE_HEIGHT, IMAGE_WIDTH, XF_NPPC1, 2> (img_src, img_dst);

	xf::xfMat2AXIvideo( img_dst, m_axis_video );

}

 

 

 

Well, I can't understand why the report have usage of 256 BRAM_18K?

 

 

 

* Summary: 
+-----------------+---------+-------+-------+-------+-----+
|       Name      | BRAM_18K| DSP48E|   FF  |  LUT  | URAM|
+-----------------+---------+-------+-------+-------+-----+
|DSP              |        -|      -|      -|      -|    -|
|Expression       |        -|      -|      0|     32|    -|
|FIFO             |        0|      -|     40|    160|    -|
|Instance         |        0|      8|   2898|   4139|    0|
|Memory           |      256|      -|     16|      8|    0|
|Multiplexer      |        -|      -|      -|     36|    -|
|Register         |        -|      -|      6|      -|    -|
+-----------------+---------+-------+-------+-------+-----+
|Total            |      256|      8|   2960|   4375|    0|
+-----------------+---------+-------+-------+-------+-----+
|Available        |      100|     66|  28800|  14400|    0|
+-----------------+---------+-------+-------+-------+-----+
|Utilization (%)  |      256|     12|     10|     30|    0|
+-----------------+---------+-------+-------+-------+-----+

 

 

The reason to ask this is migrating from hls video library to xfOpenCV. I have well working complex IP tested in hardware, written with hls video library. There I use cv::Mat to transfer data betwen functions. Now I'm trying to use xf::Mat and for some reason my design consumes more BRAMs, than I have on the device. So I'm confused - is there something wrong with the report, or I should not use xf::Mat, but hls:stream for example? Because the code above is actualy an examle copy, so I expect it to work fine and not to consume 256 BRAM. Can someone explain a bit more what is wrong here?

Edit: Vivado version is 2019.1

0 Kudos
1 Reply
Bandersnatch
Newbie
Newbie
157 Views
Registered: ‎06-07-2021

It might be late, but I hope it'll help others.

#pragma HLS stream variable=img_src.data dim=1 depth=1
#pragma HLS stream variable=img_dst.data dim=1 depth=1

you can reference to document ug1233 page 40

 

0 Kudos