Microblaze core on Breadboarded Spartan 3A [XC3S200A-4VQG100C]

For details on programming the FPGA with Xilinx ISE and SDK, see youtube video at beginning of page.

Verilog code (top.v)

module top(
input clk_fpga,
input reset,
input rx,
output tx,
input [7:0] switch,
output [7:0] leds
);
microblaze_mcs mcs_0 (
.Clk(clk_fpga), // input Clk
.Reset(reset), // input Reset
.UART_Rx(rx), // input UART_Rx
.UART_Tx(tx), // output UART_Tx
.GPO1(leds), // output [7 : 0] GPO1
.GPI1(switch), // input [7 : 0] GPI1
.GPI1_Interrupt() // output GPI1_Interrupt
);
endmodule
view raw top.v hosted with ❤ by GitHub

C code for microblaze core hello_world

#include <stdio.h>
#include "platform.h"
#include "xparameters.h"
#include "xiomodule.h"
void print(char *str);
int main()
{
init_platform();
u32 data;
XIOModule gpi;
XIOModule gpo;
print("Hello World\n\r");
data = XIOModule_Initialize(&gpi, XPAR_IOMODULE_0_DEVICE_ID);
data = XIOModule_Start(&gpi);
data = XIOModule_Initialize(&gpo, XPAR_IOMODULE_0_DEVICE_ID);
data = XIOModule_Start(&gpo);
while (1)
{
print("Hello World\n\r");
data = XIOModule_DiscreteRead(&gpi, 1);
XIOModule_DiscreteWrite(&gpo, 1, data);
}
cleanup_platform();
return 0;
}
view raw hello_world.c hosted with ❤ by GitHub