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: 
Highlighted
Visitor lkosmann
Visitor
5,164 Views
Registered: ‎01-27-2014

Synthesis of Memory interfaces in functions

Hi,

 

i'm trying to get some of the CHStone benchmarks synthesised with Vivado. One example is the LPC which is part of the gsm implementation. According to some threads is started like this (part of the code but working):

 

#include "ap_int.h"
typedef int16_t word;
typedef int32_t longword;
typedef int16_t doublebyte;

#define MIN_WORD ((-32767)-1)
#define MAX_WORD ( 32767)

word gsm_abs (word a)
{
    return a < 0 ? (a == MIN_WORD ? MAX_WORD : -a) : a;
}

void Autocorrelation(volatile word *s, longword *L_ACF)
{
	word temp, smax, scalauto, n, sl;
	word *sp;
	doublebyte k;

	smax = 0;

	for (k=0; k<159; k++) {
		temp = gsm_abs(s[k]);
		if (temp > smax){
			smax = temp;
		}
	}
}

void lpc(volatile word *s, volatile word *LARc)
{
#pragma HLS INTERFACE ap_memory depth=160 port=s
#pragma HLS INTERFACE ap_memory depth=8 port=LARc

	longword L_ACF[9];
	Autocorrelation(s, L_ACF);


}

 

 

 

when i hit synthesize i get the following error:

"unsupported memory access on variable 's' which is (or contains) an array with unknown size at compile time." for the line "

temp = gsm_abs(s[k]);

 

I haven't found something like the best practice for this case, but i think this is a common case while developing, so how should i resolve the problem?

0 Kudos
1 Reply
Xilinx Employee
Xilinx Employee
5,118 Views
Registered: ‎03-24-2010

Re: Synthesis of Memory interfaces in functions

Please try specify INTERFACE=ap_fifo or ap_hs with depth option to "S" before C synthesizing.

Regards,
brucey
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos