UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor carpe_noctem
Visitor
2,929 Views
Registered: ‎01-03-2017

Same Template Class is build different

Hi

 

i have a problem.

 

I wrote a template Class for a Buffer, which save's a complete Line.

 

void MeanFilter(ap_uint<8> iData, ap_uint<8> iData_Temp,
		ap_uint<8>* oData, GetLineParam ImageData){
#pragma HLS pipeline II=1
#pragma HLS INTERFACE ap_ctrl_none port=return

	static ap_uint<8> Buf1[7], Buf2[7];
	static Buf::Buffer<7, 200> Buff_A;
	static Buf::Buffer<7, 200> Buff_B;

	Buff_A.GetCol(ImageData, iData, Buf1);
	Buff_B.GetCol(ImageData, iData_Temp, Buf2);

	*oData = (Buf1[0]+Buf1[3]+Buf1[6]+Buf2[0]+Buf2[3]+Buf2[6])/6;

}

When i use the Buffer only one time the compiler build 7 BRAM Cells, but now with 2 Buffers the compiler build the second buffer different.

 

2017-01-03 12_24_21-Vivado HLS - Test2Input (C__Users_THINKY_Vivado_HLS_Test2Input).png

 

When i swap Buff_A and Buff_B the result is also swapped.

 

Buffer:

namespace Buf
{
template<int HEIGHT, int WIDTH>
class Buffer {
	public:
		Buffer(){
#pragma HLS INLINE
#pragma HLS ARRAY_PARTITION variable=LineBufferDelay_1 dim=1 complete
			VLine = 0;
		}
		void GetCol(GetLineParam iImageData, ap_uint<8> iData, ap_uint<8> oData[HEIGHT]);
		ap_uint<14> VLine;
		ap_uint<8> LineBufferDelay_1[HEIGHT][WIDTH];

};} //namespace

template<int HEIGHT, int WIDTH> void Buf::Buffer<HEIGHT, WIDTH>::GetCol(GetLineParam iImageData, ap_uint<8> iData, ap_uint<8> oData[HEIGHT]) {
#pragma HLS INLINE
#pragma HLS ARRAY_PARTITION variable=oData complete dim=1

	int i = 0;
	int t = 0;

	//Rotate Pointer on Matrix and fill oData

	}

i know, that i have no conflict in the Template class and the result is right.

 

Anyone have an Idea?

 

 

0 Kudos
1 Reply
Visitor carpe_noctem
Visitor
2,902 Views
Registered: ‎01-03-2017

Re: Same Template Class is build different

when i change the Buffer Size to 8 Lines the Compiler build it in the right way and i get a Pipeline Function. But with 7 Lines it is not possible to build it as pipeline.

But why?
0 Kudos