In this example we will cerate a soft processor using Xilinx Platform Studio software. We will program the processor with C language and finally we will download the processor to FPGA on the development board.
What will we do in this example
Before begining the project, letÔÇÖs take a quick look at MicroBlaze and its tools.
MicroBlaze is a virtual processor that is constructed by combining the blocks called cores in Xilinx FPGAs. Because MicroBlaze is a virtual processor , It can be created more than one processor in a FPGA and it can also be added any number of core to the processor .
Processor is created in Xilinx Platform Studio Software.The processor design is automotically created by using (BBW) Base System Builder Wizard In Xilinx Platform Studio
Furthermore a processor which is creaded in XPS can be added to any project in ISE and can be simulated it by using ModelSim or ISE Simulator.
We will write a simple C program. C language is used for programing Microblaze has includes special C commands belongs to MicroBlaze's cores in addition to the conventional C language. In this example we will use only a few commands of GPIOs
The C program includes a simple binary counter. We will define two IO variables named led and button. Led variable provide the connection between the counter to 8 led placed on board for showing the counter value. The button which is connected to a external switch on board increases or decreases the counting speed of counter.
XGpio led, button; // two variables are defined named led and button
volatile long int delay;// defined a variable for delay
long int ust_limit;
XGpio_SetDataDirection(&led,1,0); // set Leds as output ports
XGpio_SetDataDirection(&button,1,1); //set button as input port┬á
XGpio_DiscreteWrite(&led, 1, i);