Microblaze howto: https://www.youtube.com/watch?v=oKAG_IcD0ag&t=398s
1 synthesis
2 source ipcore_dir/microblaze_mcs_setup.tcl
3 implement
4 open SDK
5 make workplace dir
6 File => New => Xilinx Hardware Platform Specyfication
  (in ipcore_dir)
7 File => New => Xilinx Board Support Package
8 File => New => Xilinx C Project
8a Window->show view C/C++
9 back to ISE - Generate Programming File
10 TCL> microblaze_mcs_data2mem workplace/Control_GPIO_MicroBlaze/Debug/Control_GPIO_MicroBlaze.elf
11 .bit => FPGA

***************************************** ISE module **********************************START
----------------------------------------------------------------------------------
-- Module Name:    GPIO_Control - Behavioral 
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;

-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity GPIO_Control is

port (
	Clk: in std_logic;
	Reset: in std_logic;
	Port0: out std_logic_vector(7 downto 0)
--	Port1: in std_logic_vector (7 downto 0)
	);
end GPIO_Control;

architecture Behavioral of GPIO_Control is

--COMPONENT miocroblaze
--  PORT (
--    Clk : IN STD_LOGIC;
--    Reset : IN STD_LOGIC;
--    GPO1 : OUT STD_LOGIC_VECTOR(7 DOWNTO 0)
----  GPI1 : IN STD_LOGIC_VECTOR(7 DOWNTO 0)
----    GPI1_Interrupt : OUT STD_LOGIC
--  );
END COMPONENT;
begin

--mcs_0 : miocroblaze
--  PORT MAP (
--    Clk => Clk,
--    Reset => not(Reset),
--    GPO1 => Port0
----  GPI1 => Port1
----    GPI1_Interrupt => GPI1_Interrupt
--  );

end Behavioral;
******************************************* ISE Module ********************************END


************************************* SDK microblaze C module *************************START
#include <stdio.h>
#include "platform.h"
#include "xparameters.h"
#include "xiomodule.h"

int main()
{
	init_platform();
	u32 data, i = 0;
	XIOModule gpo;
	/* print("Czyta przełączniki i zapisuje do ledów port0\n\r"); */
	XIOModule gpi;
	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)
	{
		data = 0x80;
		XIOModule_DiscreteWrite(&gpo, 1, data);     /* zapis data do wyjścia P33-P41 Achillesa */
		for(i = 0; i < 0x3FFFFF; i++);				/* opóźnienie około 0.7s */
		data = 0x40;
		XIOModule_DiscreteWrite(&gpo, 1, data);
		for(i = 0; i < 0x3FFFFF; i++);
		data = 0x20;
		XIOModule_DiscreteWrite(&gpo, 1, data);
		for(i = 0; i < 0x3FFFFF; i++);
		data = 0x10;
		XIOModule_DiscreteWrite(&gpo, 1, data);
		for(i = 0; i < 0x3FFFFF; i++);
		data = 0x08;
		XIOModule_DiscreteWrite(&gpo, 1, data);
		for(i = 0; i < 0x3FFFFF; i++);
		data = 0x04;
		XIOModule_DiscreteWrite(&gpo, 1, data);
		for(i = 0; i < 0x3FFFFF; i++);
		data = 0x02;
		XIOModule_DiscreteWrite(&gpo, 1, data);
		for(i = 0; i < 0x3FFFFF; i++);
		data = 0x01;
		XIOModule_DiscreteWrite(&gpo, 1, data);
		data = XIOModule_DiscreteRead(&gpi, 1);		/* wczytanie stanu P43-P50 do data */
		for(i = 0; i < 0x3FFFFF; i++);
		XIOModule_DiscreteWrite(&gpo, 1, data);		/* wyświetlenie stanu P43-P50 na wyściu P33-P43 */
		for(i = 0; i < 0xFFFFFF; i++);				/* opóżnienie okolo 6s */
	}
	cleanup_platform();
	return 0;
}
************************************* SDK microblaze C module *************************END


************************************* ISE Constrain File *****************************************START
##################################### CF for Achilles v1.0 wersja 3S200 + PMOD3364 ###############
# Clock 50 MHz
NET "Clk"               LOC = P36  | IOSTANDARD = LVCMOS33 | PERIOD = 50MHz;

########### HEADER 1 PINS ########################################################################	 

NET "Port0(3)"             LOC = P53  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12; #P33 H1_4_D4
NET "Port0(4)"             LOC = P55  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12; #P35 H1_10_D5
NET "Port0(2)"             LOC = P59  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12; #P36 H1_3_D3
NET "Port0(5)"             LOC = P60  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12; #P37 H1_9_D6
NET "Port0(1)"             LOC = P61  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12; #P38 H1_2_D2
NET "Port0(6)"             LOC = P62  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12; #P39 H1_8_D7
NET "Port0(0)"             LOC = P63  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12; #P40 H1_1_D1
NET "Port0(7)"             LOC = P64  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12; #P41 H1_7_D8

########### HEADER 2 PINS ########################################################################
################################################################################################## Wejscia podciągnięte do +(pullup)
#NET "Port1(3)"             LOC = P67  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12 | PULLUP; #P43 H2_4_D4
#NET "Port1(4)"             LOC = P68  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12 | PULLUP; #P44 H2_10_D5
#NET "Port1(2)"             LOC = P71  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12 | PULLUP; #P45 H2_3_D3
#NET "Port1(5)"             LOC = P72  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12 | PULLUP; #P46 H2_9_D6
#NET "Port1(1)"             LOC = P74  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12 | PULLUP; #P47 H2_2_D2
#NET "Port1(6)"             LOC = P75  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12 | PULLUP; #P48 H2_8_D7
#NET "Port1(0)"             LOC = P79  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12 | PULLUP; #P49 H2_1_D1
#NET "Port1(7)"             LOC = P80  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12 | PULLUP; #P50 H2_7_D8

NET "Reset" LOC = P50  | IOSTANDARD = LVCMOS33 | SLEW = SLOW | DRIVE = 12 | PULLUP; #SW1

************************************* ISE Constrain File *****************************************END