Implementing processor - eclubiitk/EClub-Handbook GitHub Wiki

About The Guide:-

Aim of this guide is to implement a microblaze processor in Xilinx FPGA using an example of a counter counting at interval of 1 sec.

Get Started:-

  1. Open Xilinx ISE create new project->new source->Embedded Processor give a name click next then finish ISE will automatically open Xilinx Platform Studio EDK.

Screenshot (69)

Screenshot (70)

  1. Go to your project directory search for a file "download.cmd" change 1 in that file by 5.

Screenshot (71) Screenshot (72) 5. Screenshot (73)

_Then copy and paste following lines into that

# GENERIC TEMPLATE

Net fpga_0_clk_1_sys_clk_pin TNM_NET = sys_clk_pin;
TIMESPEC TS_sys_clk_pin = PERIOD sys_clk_pin 100000 kHz;
Net fpga_0_clk_1_sys_clk_pin LOC=AH15;
Net fpga_0_rst_1_sys_rst_pin TIG;
Net fpga_0_rst_1_sys_rst_pin LOC=T25;
Net fpga_0_rst_1_sys_rst_pin PULLUP;
Net xps_gpio_0_GPIO_IO_pin<0> LOC=H18; # Bank 3, Vcco=2.5V, No DCI
Net xps_gpio_0_GPIO_IO_pin<1> LOC=L18; # Bank 3, Vcco=2.5V, No DCI
Net xps_gpio_0_GPIO_IO_pin<2> LOC=G15; # Bank 3, Vcco=2.5V, No DCI
Net xps_gpio_0_GPIO_IO_pin<3> LOC=AD26; # Bank 21, Vcco=1.8V, DCI using 49.9 ohm resistors
Net xps_gpio_0_GPIO_IO_pin<4> LOC=G16; # Bank 3, Vcco=2.5V, No DCI
Net xps_gpio_0_GPIO_IO_pin<5> LOC=AD25; # Bank 21, Vcco=1.8V, DCI using 49.9 ohm resistors
Net xps_gpio_0_GPIO_IO_pin<6> LOC=AD24; # Bank 21, Vcco=1.8V, DCI using 49.9 ohm resistors
Net xps_gpio_0_GPIO_IO_pin<7> LOC=AE24; # Bank 21, Vcco=1.8V, DCI using 49.9 ohm resistors


Screenshot (74)

Generate top level HDL source then Export design to sdk along with bitstream. Then create new xilinx c project Hello World. After this copy paste following code in hello_world.c

#include "xparameters.h"
#include "xgpio.h"
Click on generate net list then close
edk. 
void delay_ms()
{
int i=0;
for(i=0;i<5*13000000;i++){}
}
int main(void)
{
int j;
XGpio leds;
XGpio_Initialize(&leds,XPAR_XPS_GPIO_0_DEVICE_ID);
XGpio_SetDataDirection(&leds, 1, 0x00000000);
while(1)
{
j=(j+1)%16;
XGpio_DiscreteWrite(&leds,1,j);
delay_ms();
}

}

After this programme fpga then run as->launch on hardware. Take this guide just as an test drive.