Loading...
 
Location : Colin O'Flynn - Electronics, Programming, RF, and More » XilinxHLS

Xilinx High Level Synthesis


Vivado it's Xilinx's new design tool system. Part of this is the 'High Level Synthesis' option - something you can also get it seems for ~$2k. I'm using these design tools in the "wrong" way, in that I'm generating HDL & then synthesising it with the normal ISE chain. Some of the parts I'm using aren't officially supported in Vivado it seems. Plus I'm currently more used to the ISE design flow, so don't want to throw everything away.

Example #1: Smartcard Reader/Control

Invalid YouTube URL provided

Sorry there is no other data for this simple example! This example was more an introduction than a follow-along, so check the next one which has more details...

Example #2: FIR Filter Design

Invalid YouTube URL provided

The final results of the band-stop filter look like this:


Download the slides: http://www.newae.com/tiki-download_wiki_attachment.php?attId=144

The hardware in place is:


Some notes on the C Source (following):

  1. The 'pipeline' pragma automatically unrolls the interior loops to achieve the requested II. When using pipeline the II is important to check!
  2. I don't really need ap_fifo, but I like the interface in C to ap_fifo (the *++).

The C Source File looks like:
#include "ap_cint.h"

#define FIR_LENGTH 19

void fir(volatile uint10 * x, volatile uint10 * y)
{
#pragma HLS INTERFACE ap_fifo port=y
#pragma HLS INTERFACE ap_fifo port=x

	int10 int_value;
	int10 x_store[FIR_LENGTH];

	/* Coefficients are multiplied by 2^9 (512) to convert the
	 * -1/+1 range into the -512/511 range of the int10. */
	int10 b_coef[FIR_LENGTH] = {
		    11,
		    10,
		   -14,
		   -39,
		   -25,
		    31,
		    71,
		    39,
		   -42,
		   427,
		   -42,
		    39,
		    71,
		    31,
		   -25,
		   -39,
		   -14,
		    10,
		    11,
	};

	//Multiply 10x10 so need 20-bit
	int20 x_int_sum;

	//We add 10-bit number 19 times.
	//Possibly need up to 15 bits, as 2^4=16 is too
	//small, so need to go to 2^5=32.
	int15 int_sum;

	int i;

	while(1){
#pragma HLS PIPELINE II=1

		//Step through the x_store values
		for(i=0; i < FIR_LENGTH-1; i++){
			x_store[i] = x_store[i+1];
		}

		//Convert the straight-binary to signed
		x_store[FIR_LENGTH-1] = ((int11)*(x++) - (int10)512);

		//Apply FIR coefficients
		int_sum = 0;
		for(i=0; i < FIR_LENGTH; i++){
			x_int_sum = b_coef[i] * x_store[(FIR_LENGTH-1)-i];
			//Fix multiplication
			x_int_sum = x_int_sum >> 9;
			//Sum
			int_sum += x_int_sum;
		}

		//Convert back to straight-decimal from signed
		int_value = int_sum;
		*(y++) = (uint10)(int_value + (int10)512);
	}
}



Example #3: AES Block



Newest Blog Posts

Videos on YouTube