Showing posts with label XIlinx. Show all posts
Showing posts with label XIlinx. Show all posts

Friday, 2 May 2014

FSL connection between a Custom IP with a processor in Xilinx FPGA


Custom IP is usually attached to processor to accelerate certain tasks/functions which are bottlenecks in the software. This post describes how to connect a custom IP with a microblaze soft processor in Xilinx FPGA.

As usual, Xilinx provides documentation for connecting custom IP with microblaze processor. This link is available here:

FSL documentation from Xilinx

Unfortunately for Xilinx FPGA designers, this document was published in 2004 and works with obsolete technologies which include On-chip Peripheral bus etc. Currently, all the latest Xilinx FPGA are AXI based which are a part of the AMBA bus protocol. Hence, this post outlines the procedures to add a custom IP and describes how to write software for an application.

Procedures:

1. After creating the microblaze design from BSB, double click microblaze to add an FSL port to the processor. In the tab Buses, add one AXI based FSL streaming interface to XPS.
2. To create a custom IP, go to Hardware-> Create or Import Custom IP option and create a custom IP to XPS. Make sure you select the FSL interface. You may choose the input/output register according to your application.
3. An HDL example code is generated in the pcores directory of the project. This HDL code can be modified depending on your application. In my application, I used one master interface of the FSL protocol. The slave interfaces and signals were undriven in my HDL code.
4. After making suitable modifications to VHDL design, import the modified core by going to Hardware-> Create or Import Custom IP option. Make sure to give the updated HDL source code to the tool and select the correct bus interface.
5. Make the FSL connection between microblaze and custom IP ieslave connects to master and master connects to slave. This can also be done using the Configure co-processor option in EDK.
6. If control signal is not used in the design, double click the generated FSL bus IP and remove the propagate control bit option. Also in the ports section, make sure you connect FSL_CLK to CLKOUT0 from clock generator
7. Export design to SDK to write software and communicate with IP using blocking read/write functions supported by Xilinx. Please refer the following documentation  for available functions supported by  microblaze processor.

FSL documentation from Xilinx

Good Luck!!!

Monday, 28 April 2014

VHDL Type conversion function

Hello everyone,

In my undergraduate studies, I learnt Verilog before VHDL and hence I prefer to design in Verilog. In Verilog, there are just two data types for design, namely wire and reg. However, in VHDL, a signal / variable can be of different types like integer, std_logic, unsigned, signed etc. All these data types are used in different situation, eg:  '+'  operator is commonly used with unsigned data type.

For Verilog users who are migrating to VHDL, this becomes confusing to remember all the conversion functions. I found a figure which clearly shows all the conversion functions.


Answer record from Xilinx provides an example design of some conversion functions. 


Saturday, 26 April 2014

Writing/Reading data from Compact flash from FPGA


Do you know how to read/write from Compact flash from an FPGA board ?

Last week, I was trying to do read/write operations to compact flash using FPGA. As usual, it was very difficult to get good documentation to do this.

A summary of the procedure to access files in a Xilinx FPGA board(ML605) is as follows: 

1. Created an XPS project (Microblaze based) and added compact flash IP to the design 
2. Generated bitstream and exported the design to SDK
3. Created a new software project - added the Libxil FAT system library in MSS project settings
4. Wrote a C code to open a file, read/write file by reading LibXil documentation)
5. Increase the stack and heap size of the application (to allow dynamic memory allocation) and store application in DDR memory by generating linker script

Note : There is no change in jumper settings (for ML605) and default files in compact flash are not to be modified. 

Check out the following links for more details: