diff --git a/.gitignore b/.gitignore index 506079d..a3c4065 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -*.log - # Created by https://www.toptal.com/developers/gitignore/api/xilinxise # Edit at https://www.toptal.com/developers/gitignore?templates=xilinxise @@ -74,3 +72,13 @@ _xmsgs/ # End of https://www.toptal.com/developers/gitignore/api/xilinxise +*.log +syn/* +!syn/main.prj +!syn/main.ut +!syn/main.xst + +mb/*.elf +mb/*.d +mb/*.o +mb/Graphics_bsp/microblaze_mcs diff --git a/.vimlocal b/.vimlocal new file mode 100644 index 0000000..6b16e68 --- /dev/null +++ b/.vimlocal @@ -0,0 +1 @@ +map :Make diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8d3dfae --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +all: syn/main.bin + +syn/main.bin: syn/main.ncd mb/Graphics/Release/Graphics.elf + @cd syn && bitgen -intstyle ise -f main.ut main.ncd + +syn/main.ncd: syn/main.prj syn/main.xst src/*.v ipcore_dir/*.v syn/xst/projnav.tmp/ + @cd syn && xst -intstyle ise -ifn "main.xst" -ofn "main.syr" + @cd syn && ngdbuild -intstyle ise -dd _ngo -sd ../ipcore_dir -nt timestamp -i -p xc6slx9-tqg144-2 main.ngc main.ngd -bm "../ipcore_dir/microblaze_mcs.bmm" + @cd syn && map -intstyle ise -p xc6slx9-tqg144-2 -w -logic_opt off -ol high -t 1 -xt 0 -register_duplication off -r 4 -global_opt off -mt off -ir off -pr off -lc off -power off -o main_map.ncd main.ngd main.pcf + @cd syn && par -w -intstyle ise -ol high -mt off main_map.ncd main.ncd main.pcf + @cd syn && trce -intstyle ise -v 3 -s 2 -n 3 -fastpaths -xml main.twx main.ncd -o main.twr main.pcf + +syn/xst/projnav.tmp/: + @mkdir -p syn/xst/projnav.tmp + +mb/Graphics/Release/Graphics.elf: mb + @echo + +.PHONY: mb +mb: + @$(MAKE) -C mb/Graphics_bsp all + @$(MAKE) -C mb/Graphics/Release all + +.PHONY: clean +clean: + @cd syn && find . ! -name 'main.prj' ! -name 'main.ut' ! -name 'main.xst' ! -name 'Makefile' ! -name '.' -exec rm -rf {} + + @$(MAKE) -C mb/Graphics_bsp clean + @$(MAKE) -C mb/Graphics/Release clean diff --git a/cmds.sh b/cmds.sh new file mode 100755 index 0000000..9a32afc --- /dev/null +++ b/cmds.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# @todo We need to figure out the dependecies and turn this into a Makefile + +# mkdir -p xst/projnav.tmp && \ + +# xst -intstyle ise -ifn "/home/tim/Projects/z80/hdmi/syn/main.xst" -ofn "/home/tim/Projects/z80/hdmi/syn/main.syr" +# +# ngdbuild -intstyle ise -dd _ngo -sd ../ipcore_dir -nt timestamp -i -p xc6slx9-tqg144-2 main.ngc main.ngd -bm "../ipcore_dir/microblaze_mcs.bmm" +# +# map -intstyle ise -p xc6slx9-tqg144-2 -w -logic_opt off -ol high -t 1 -xt 0 -register_duplication off -r 4 -global_opt off -mt off -ir off -pr off -lc off -power off -o main_map.ncd main.ngd main.pcf +# +# par -w -intstyle ise -ol high -mt off main_map.ncd main.ncd main.pcf +# +# trce -intstyle ise -v 3 -s 2 -n 3 -fastpaths -xml main.twx main.ncd -o main.twr main.pcf + +bitgen -intstyle ise -f main.ut main.ncd diff --git a/mb/Graphics/.cproject b/mb/Graphics/.cproject new file mode 100644 index 0000000..be440c1 --- /dev/null +++ b/mb/Graphics/.cproject @@ -0,0 +1,240 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mb/Graphics/.project b/mb/Graphics/.project new file mode 100644 index 0000000..0145828 --- /dev/null +++ b/mb/Graphics/.project @@ -0,0 +1,26 @@ + + + Graphics + LED_Controller_bsp - microblaze_mcs + + LED_Controller_bsp + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + diff --git a/mb/Graphics/Release/Graphics.elf b/mb/Graphics/Release/Graphics.elf new file mode 100755 index 0000000..40ce029 Binary files /dev/null and b/mb/Graphics/Release/Graphics.elf differ diff --git a/mb/Graphics/Release/makefile b/mb/Graphics/Release/makefile new file mode 100644 index 0000000..1c78fd6 --- /dev/null +++ b/mb/Graphics/Release/makefile @@ -0,0 +1,65 @@ +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +-include ../makefile.init + +RM := rm -rf + +# All of the sources participating in the build are defined here +-include sources.mk +-include src/subdir.mk +-include subdir.mk +-include objects.mk + +ifneq ($(MAKECMDGOALS),clean) +ifneq ($(strip $(C_DEPS)),) +-include $(C_DEPS) +endif +ifneq ($(strip $(S_UPPER_DEPS)),) +-include $(S_UPPER_DEPS) +endif +endif + +-include ../makefile.defs + +# Add inputs and outputs from these tool invocations to the build variables +ELFSIZE += \ + +ELFCHECK += \ + + +# All Target +all: Graphics.elf secondary-outputs + +# Tool invocations +Graphics.elf: $(OBJS) ../src/lscript.ld $(USER_OBJS) + @echo 'Building target: $@' + @echo 'Invoking: MicroBlaze gcc linker' + mb-gcc -Wl,-T -Wl,../src/lscript.ld -L../../Graphics_bsp/microblaze_mcs/lib -mlittle-endian -mcpu=v8.40.a -mxl-soft-mul -Wl,--no-relax -Wl,--gc-sections -o "Graphics.elf" $(OBJS) $(USER_OBJS) $(LIBS) + @echo 'Finished building target: $@' + @echo ' ' + +Graphics.elf.size: Graphics.elf + @echo 'Invoking: MicroBlaze Print Size' + mb-size Graphics.elf |tee "Graphics.elf.size" + @echo 'Finished building: $@' + @echo ' ' + +Graphics.elf.elfcheck: Graphics.elf + @echo 'Invoking: Xilinx ELF Check' + elfcheck Graphics.elf -hw ../../hardware/system.xml -pe microblaze_mcs |tee "Graphics.elf.elfcheck" + @echo 'Finished building: $@' + @echo ' ' + +# Other Targets +clean: + -$(RM) $(OBJS)$(C_DEPS)$(EXECUTABLES)$(ELFSIZE)$(ELFCHECK)$(S_UPPER_DEPS) Graphics.elf + -@echo ' ' + +secondary-outputs: $(ELFSIZE) $(ELFCHECK) + +.PHONY: all clean dependents +.SECONDARY: + +-include ../makefile.targets diff --git a/mb/Graphics/Release/objects.mk b/mb/Graphics/Release/objects.mk new file mode 100644 index 0000000..dca16ac --- /dev/null +++ b/mb/Graphics/Release/objects.mk @@ -0,0 +1,8 @@ +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +USER_OBJS := + +LIBS := -Wl,--start-group,-lxil,-lgcc,-lc,--end-group + diff --git a/mb/Graphics/Release/sources.mk b/mb/Graphics/Release/sources.mk new file mode 100644 index 0000000..a745eb3 --- /dev/null +++ b/mb/Graphics/Release/sources.mk @@ -0,0 +1,21 @@ +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +O_SRCS := +C_SRCS := +LD_SRCS := +S_UPPER_SRCS := +S_SRCS := +OBJ_SRCS := +OBJS := +C_DEPS := +EXECUTABLES := +ELFSIZE := +ELFCHECK := +S_UPPER_DEPS := + +# Every subdirectory with source files must be described here +SUBDIRS := \ +src \ + diff --git a/mb/Graphics/Release/src/main.d b/mb/Graphics/Release/src/main.d new file mode 100644 index 0000000..02a52d5 --- /dev/null +++ b/mb/Graphics/Release/src/main.d @@ -0,0 +1,25 @@ +src/main.d: ../src/main.c \ + ../../Graphics_bsp/microblaze_mcs/include/xparameters.h \ + ../../Graphics_bsp/microblaze_mcs/include/xiomodule.h \ + ../../Graphics_bsp/microblaze_mcs/include/xbasic_types.h \ + ../../Graphics_bsp/microblaze_mcs/include/xparameters.h \ + ../../Graphics_bsp/microblaze_mcs/include/xstatus.h \ + ../../Graphics_bsp/microblaze_mcs/include/xiomodule_l.h \ + ../../Graphics_bsp/microblaze_mcs/include/xiomodule_io.h \ + ../../Graphics_bsp/microblaze_mcs/include/xil_io.h \ + ../../Graphics_bsp/microblaze_mcs/include/xil_types.h \ + ../../Graphics_bsp/microblaze_mcs/include/mb_interface.h \ + ../../Graphics_bsp/microblaze_mcs/include/xil_printf.h \ + ../../Graphics_bsp/microblaze_mcs/include/xio.h +../../Graphics_bsp/microblaze_mcs/include/xparameters.h: +../../Graphics_bsp/microblaze_mcs/include/xiomodule.h: +../../Graphics_bsp/microblaze_mcs/include/xbasic_types.h: +../../Graphics_bsp/microblaze_mcs/include/xparameters.h: +../../Graphics_bsp/microblaze_mcs/include/xstatus.h: +../../Graphics_bsp/microblaze_mcs/include/xiomodule_l.h: +../../Graphics_bsp/microblaze_mcs/include/xiomodule_io.h: +../../Graphics_bsp/microblaze_mcs/include/xil_io.h: +../../Graphics_bsp/microblaze_mcs/include/xil_types.h: +../../Graphics_bsp/microblaze_mcs/include/mb_interface.h: +../../Graphics_bsp/microblaze_mcs/include/xil_printf.h: +../../Graphics_bsp/microblaze_mcs/include/xio.h: diff --git a/mb/Graphics/Release/src/main.o b/mb/Graphics/Release/src/main.o new file mode 100644 index 0000000..9734352 Binary files /dev/null and b/mb/Graphics/Release/src/main.o differ diff --git a/mb/Graphics/Release/src/subdir.mk b/mb/Graphics/Release/src/subdir.mk new file mode 100644 index 0000000..7ec44d0 --- /dev/null +++ b/mb/Graphics/Release/src/subdir.mk @@ -0,0 +1,27 @@ +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +# Add inputs and outputs from these tool invocations to the build variables +C_SRCS += \ +../src/main.c + +LD_SRCS += \ +../src/lscript.ld + +OBJS += \ +./src/main.o + +C_DEPS += \ +./src/main.d + + +# Each subdirectory must supply rules for building sources it contributes +src/main.o: ../src/main.c + @echo 'Building file: $<' + @echo 'Invoking: MicroBlaze gcc compiler' + mb-gcc -Wall -O3 -I../../Graphics_bsp/microblaze_mcs/include -c -fmessage-length=0 -mno-xl-reorder -mlittle-endian -mcpu=v8.40.a -mxl-soft-mul -Wl,--no-relax -ffunction-sections -fdata-sections -MMD -MP -MF"$(@:%.o=%.d)" -MT"src/main.d" -o "$@" "$<" + @echo 'Finished building: $<' + @echo ' ' + + diff --git a/mb/Graphics/src/README.txt b/mb/Graphics/src/README.txt new file mode 100644 index 0000000..c4d32ef --- /dev/null +++ b/mb/Graphics/src/README.txt @@ -0,0 +1 @@ +Empty application. Add your own sources. diff --git a/mb/Graphics/src/lscript.ld b/mb/Graphics/src/lscript.ld new file mode 100644 index 0000000..b66868a --- /dev/null +++ b/mb/Graphics/src/lscript.ld @@ -0,0 +1,212 @@ +/*******************************************************************/ +/* */ +/* This file is automatically generated by linker script generator.*/ +/* */ +/* Version: Xilinx EDK 14.7 EDK_P.20131013 */ +/* */ +/* Copyright (c) 2010 Xilinx, Inc. All rights reserved. */ +/* */ +/* Description : MicroBlaze Linker Script */ +/* */ +/*******************************************************************/ + +_STACK_SIZE = DEFINED(_STACK_SIZE) ? _STACK_SIZE : 0x400; +_HEAP_SIZE = DEFINED(_HEAP_SIZE) ? _HEAP_SIZE : 0x400; + +/* Define Memories in the system */ + +MEMORY +{ + ilmb_cntlr_dlmb_cntlr : ORIGIN = 0x00000050, LENGTH = 0x00003FB0 +} + +/* Specify the default entry point to the program */ + +ENTRY(_start) + +/* Define the sections, and where they are mapped in memory */ + +SECTIONS +{ +.vectors.reset 0x00000000 : { + KEEP (*(.vectors.reset)) +} + +.vectors.sw_exception 0x00000008 : { + KEEP (*(.vectors.sw_exception)) +} + +.vectors.interrupt 0x00000010 : { + KEEP (*(.vectors.interrupt)) +} + +.vectors.hw_exception 0x00000020 : { + KEEP (*(.vectors.hw_exception)) +} + +.text : { + *(.text) + *(.text.*) + *(.gnu.linkonce.t.*) +} > ilmb_cntlr_dlmb_cntlr + +.init : { + KEEP (*(.init)) +} > ilmb_cntlr_dlmb_cntlr + +.fini : { + KEEP (*(.fini)) +} > ilmb_cntlr_dlmb_cntlr + +.ctors : { + __CTOR_LIST__ = .; + ___CTORS_LIST___ = .; + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE(*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + __CTOR_END__ = .; + ___CTORS_END___ = .; +} > ilmb_cntlr_dlmb_cntlr + +.dtors : { + __DTOR_LIST__ = .; + ___DTORS_LIST___ = .; + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE(*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + PROVIDE(__DTOR_END__ = .); + PROVIDE(___DTORS_END___ = .); +} > ilmb_cntlr_dlmb_cntlr + +.rodata : { + __rodata_start = .; + *(.rodata) + *(.rodata.*) + *(.gnu.linkonce.r.*) + __rodata_end = .; +} > ilmb_cntlr_dlmb_cntlr + +.sdata2 : { + . = ALIGN(8); + __sdata2_start = .; + *(.sdata2) + *(.sdata2.*) + *(.gnu.linkonce.s2.*) + . = ALIGN(8); + __sdata2_end = .; +} > ilmb_cntlr_dlmb_cntlr + +.sbss2 : { + __sbss2_start = .; + *(.sbss2) + *(.sbss2.*) + *(.gnu.linkonce.sb2.*) + __sbss2_end = .; +} > ilmb_cntlr_dlmb_cntlr + +.data : { + . = ALIGN(4); + __data_start = .; + *(.data) + *(.data.*) + *(.gnu.linkonce.d.*) + __data_end = .; +} > ilmb_cntlr_dlmb_cntlr + +.got : { + *(.got) +} > ilmb_cntlr_dlmb_cntlr + +.got1 : { + *(.got1) +} > ilmb_cntlr_dlmb_cntlr + +.got2 : { + *(.got2) +} > ilmb_cntlr_dlmb_cntlr + +.eh_frame : { + *(.eh_frame) +} > ilmb_cntlr_dlmb_cntlr + +.jcr : { + *(.jcr) +} > ilmb_cntlr_dlmb_cntlr + +.gcc_except_table : { + *(.gcc_except_table) +} > ilmb_cntlr_dlmb_cntlr + +.sdata : { + . = ALIGN(8); + __sdata_start = .; + *(.sdata) + *(.sdata.*) + *(.gnu.linkonce.s.*) + __sdata_end = .; +} > ilmb_cntlr_dlmb_cntlr + +.sbss (NOLOAD) : { + . = ALIGN(4); + __sbss_start = .; + *(.sbss) + *(.sbss.*) + *(.gnu.linkonce.sb.*) + . = ALIGN(8); + __sbss_end = .; +} > ilmb_cntlr_dlmb_cntlr + +.tdata : { + __tdata_start = .; + *(.tdata) + *(.tdata.*) + *(.gnu.linkonce.td.*) + __tdata_end = .; +} > ilmb_cntlr_dlmb_cntlr + +.tbss : { + __tbss_start = .; + *(.tbss) + *(.tbss.*) + *(.gnu.linkonce.tb.*) + __tbss_end = .; +} > ilmb_cntlr_dlmb_cntlr + +.bss (NOLOAD) : { + . = ALIGN(4); + __bss_start = .; + *(.bss) + *(.bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + . = ALIGN(4); + __bss_end = .; +} > ilmb_cntlr_dlmb_cntlr + +_SDA_BASE_ = __sdata_start + ((__sbss_end - __sdata_start) / 2 ); + +_SDA2_BASE_ = __sdata2_start + ((__sbss2_end - __sdata2_start) / 2 ); + +/* Generate Stack and Heap definitions */ + +.heap (NOLOAD) : { + . = ALIGN(8); + _heap = .; + _heap_start = .; + . += _HEAP_SIZE; + _heap_end = .; +} > ilmb_cntlr_dlmb_cntlr + +.stack (NOLOAD) : { + _stack_end = .; + . += _STACK_SIZE; + . = ALIGN(8); + _stack = .; + __stack = _stack; +} > ilmb_cntlr_dlmb_cntlr + +_end = .; +} + diff --git a/mb/Graphics/src/main.c b/mb/Graphics/src/main.c new file mode 100644 index 0000000..52392c6 --- /dev/null +++ b/mb/Graphics/src/main.c @@ -0,0 +1,265 @@ +#include +#include + +XIOModule gpo; + +Xint8 x = 0; +Xint8 y = 0; +Xint8 scroll = 0; + +Xint8 reversed = 0; +Xint8 foreground = 0b111; +Xint8 background = 0; + +Xint16 properties = 0; + +void commit() { + XIOModule_DiscreteSet(&gpo, 3, 1); + XIOModule_DiscreteClear(&gpo, 3, 1); +} + +void calculate_properties() { + if (reversed) { + properties = ((foreground << 4) + background) << 8; + } else { + properties = ((background << 4) + foreground) << 8; + } +} + +void set_foreground(Xint8 color) { + foreground = color; + + calculate_properties(); +} + +void set_background(Xint8 color) { + background = color; + + calculate_properties(); +} + +void reverse(u8 enable) { + reversed = enable; + + calculate_properties(); +} + +void clear_screen() { + reverse(0); + set_foreground(0b111); + set_background(0); + XIOModule_DiscreteWrite(&gpo, 1, 0); + XIOModule_DiscreteWrite(&gpo, 2, 0); + XIOModule_DiscreteSet(&gpo, 3, 1); + + for (int y = 0; y < (45+2); ++y) { + Xint16 temp = (y << 8); + for (int x = 0; x < (80+24); ++x) { + XIOModule_DiscreteWrite(&gpo, 2, temp + x); + } + } + + XIOModule_DiscreteClear(&gpo, 3, 1); + + x = 0; + y = 0; + scroll = 0; + XIOModule_DiscreteWrite(&gpo, 4, scroll); +} + +void clear_eol() { + reverse(0); + Xint16 temp = (y << 8); + + XIOModule_DiscreteWrite(&gpo, 1, 0); + XIOModule_DiscreteWrite(&gpo, 2, temp + x); + XIOModule_DiscreteSet(&gpo, 3, 1); + + for (int i = x; i < (80+24); ++i) { + XIOModule_DiscreteWrite(&gpo, 2, temp + i); + } + + XIOModule_DiscreteClear(&gpo, 3, 1); +} + +void write(u8 c) { + XIOModule_DiscreteWrite(&gpo, 1, properties + c); + XIOModule_DiscreteWrite(&gpo, 2, (y << 8) + x); + commit(); +} + +void next() { + x++; + if (x >= 80) { + y++; + x %= 80; + } + + if (y >= 45) { + y--; + scroll = (scroll + 1) % 45; + XIOModule_DiscreteWrite(&gpo, 4, scroll); + clear_eol(); + } +} + +// @todo This does not appear to work quite correctly +void previous() { + x--; + if (x < 0) { + y--; + x %= 80; + } + + if (y < 0) { + y = 0; + x = 0; + } +} + +u8 data = 0; +u8 had = 0; +u8 escape = 0; +u8 escape_parameter_1 = 0; +u8 escape_parameter_2 = 0; + + +void clock() { + u8 signals = XIOModule_DiscreteRead(&gpo, 3) & 0b11; + + if (!(signals & 0b01)) { + return; + } + + if (signals & 0b10) { + data = XIOModule_DiscreteRead(&gpo, 1) & 0xFF; + had = 1; + } else if (had) { + had = 0; + + if (escape == 1) { + if (data == '[') { + escape = 2; + } else { + escape = 0; + } + } else if (escape) { + switch (data) { + // For now we are only going to implement what we actually use + case 'K': + // Assume parameter 0 + clear_eol(); + escape = 0; + break; + + case 'H': + if (escape_parameter_1 == 0) { + escape_parameter_1 = 1; + } + + if (escape_parameter_2 == 0) { + escape_parameter_2 = 1; + } + + x = escape_parameter_1 - 1; + y = escape_parameter_2 - 1; + escape = 0; + break; + + case 'm': + if (escape_parameter_1 == 0) { + reverse(0); + set_foreground(0b111); + set_background(0); + } else if (escape_parameter_1 == 7) { + reverse(1); + } else if (escape_parameter_1 >= 30 && escape_parameter_1 <= 37) { + set_foreground(escape_parameter_1 - 30); + } else if (escape_parameter_1 >= 40 && escape_parameter_1 <= 47) { + set_background(escape_parameter_1 - 40); + } else if (escape_parameter_1 >= 90 && escape_parameter_1 <= 97) { + set_foreground(escape_parameter_1 - 90 + 8); + } else if (escape_parameter_1 >= 100 && escape_parameter_1 <= 107) { + set_background(escape_parameter_1 - 100 + 8); + } + escape = 0; + break; + + case 'J': + // Assume parameter 2 + clear_screen(); + escape = 0; + break; + + case '0' ... '9': + escape_parameter_1 *= 10; + escape_parameter_1 += (data - 48); + break; + + case ';': + escape_parameter_2 = escape_parameter_1; + escape_parameter_1 = 0; + break; + + default: + escape = 0; + break; + } + } else { + switch (data) { + case '\n': + y++; + if (y >= 45) { + y--; + scroll = (scroll + 1) % 45; + XIOModule_DiscreteWrite(&gpo, 4, scroll); + clear_eol(); + } + break; + + case '\r': + x = 0; + break; + + case 0x08: + previous(); + break; + + case 0x1B: + escape = 1; + escape_parameter_1 = 0; + escape_parameter_2 = 0; + // Handle escape code + break; + + default: + write(data - 32); + next(); + break; + } + } + XIOModule_DiscreteWrite(&gpo, 2, (y << 8) + x); + } +} + +int main() { + XIOModule_Initialize(&gpo, XPAR_IOMODULE_0_DEVICE_ID); // Initialize the GPO module + + microblaze_register_handler(XIOModule_DeviceInterruptHandler, + XPAR_IOMODULE_0_DEVICE_ID); // register the interrupt handler + + XIOModule_Start(&gpo); // start the GPO module + + XIOModule_Connect(&gpo, XIN_IOMODULE_GPI_2_INTERRUPT_INTR, clock, + NULL); // register timerTick() as our interrupt handler + XIOModule_Enable(&gpo, XIN_IOMODULE_GPI_2_INTERRUPT_INTR); // enable the interrupt + + microblaze_enable_interrupts(); // enable global interrupts + + // Clear the screen + clear_screen(); + + while (1) { + + } +} diff --git a/mb/Graphics_bsp/.cproject b/mb/Graphics_bsp/.cproject new file mode 100644 index 0000000..7e4fa4a --- /dev/null +++ b/mb/Graphics_bsp/.cproject @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/mb/Graphics_bsp/.project b/mb/Graphics_bsp/.project new file mode 100644 index 0000000..e49cd14 --- /dev/null +++ b/mb/Graphics_bsp/.project @@ -0,0 +1,80 @@ + + + Graphics_bsp + + + hardware + + + + org.eclipse.cdt.make.core.makeBuilder + + + org.eclipse.cdt.core.errorOutputParser + org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.GmakeErrorParser;org.eclipse.cdt.core.VCErrorParser;org.eclipse.cdt.core.CWDLocator;org.eclipse.cdt.core.MakeErrorParser; + + + org.eclipse.cdt.make.core.append_environment + true + + + org.eclipse.cdt.make.core.build.arguments + + + + org.eclipse.cdt.make.core.build.command + make + + + org.eclipse.cdt.make.core.build.location + + + + org.eclipse.cdt.make.core.build.target.auto + all + + + org.eclipse.cdt.make.core.build.target.clean + clean + + + org.eclipse.cdt.make.core.build.target.inc + all + + + org.eclipse.cdt.make.core.enableAutoBuild + true + + + org.eclipse.cdt.make.core.enableCleanBuild + true + + + org.eclipse.cdt.make.core.enableFullBuild + true + + + org.eclipse.cdt.make.core.enabledIncrementalBuild + true + + + org.eclipse.cdt.make.core.environment + + + + org.eclipse.cdt.make.core.stopOnError + false + + + org.eclipse.cdt.make.core.useDefaultBuildCmd + true + + + + + + com.xilinx.sdk.sw.SwProjectNature + org.eclipse.cdt.core.cnature + org.eclipse.cdt.make.core.makeNature + + diff --git a/mb/Graphics_bsp/.sdkproject b/mb/Graphics_bsp/.sdkproject new file mode 100644 index 0000000..20a40c3 --- /dev/null +++ b/mb/Graphics_bsp/.sdkproject @@ -0,0 +1,3 @@ +THIRPARTY=false +PROCESSOR=microblaze_mcs +MSS_FILE=system.mss diff --git a/mb/Graphics_bsp/.settings/org.eclipse.cdt.codan.core.prefs b/mb/Graphics_bsp/.settings/org.eclipse.cdt.codan.core.prefs new file mode 100644 index 0000000..8e05504 --- /dev/null +++ b/mb/Graphics_bsp/.settings/org.eclipse.cdt.codan.core.prefs @@ -0,0 +1,34 @@ +eclipse.preferences.version=1 +org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} +org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} +org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false} +org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} +org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} +org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} +org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} +org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},no_break_comment\=>"no break",last_case_param\=>false,empty_case_param\=>false} +org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},unknown\=>false,exceptions\=>()} +org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} +org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},skip\=>true} +org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} +org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} +org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} +org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} +org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} +org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} +org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} +org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},pattern\=>"^[a-z]",macro\=>true,exceptions\=>()} +org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} +org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} +org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} +org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} +org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} +org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} +org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>()} +org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},paramNot\=>false} +org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},else\=>false,afterelse\=>false} +org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} +org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} +org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true} +org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},macro\=>true,exceptions\=>("@(\#)","$Id")} +org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}} diff --git a/mb/Graphics_bsp/Makefile b/mb/Graphics_bsp/Makefile new file mode 100644 index 0000000..fe2a0ef --- /dev/null +++ b/mb/Graphics_bsp/Makefile @@ -0,0 +1,21 @@ +# Makefile generated by Xilinx SDK. + +-include libgen.options + +LIBRARIES = ${PROCESSOR}/lib/libxil.a +MSS = system.mss + +all: libs + @echo 'Finished building libraries' + +libs: $(LIBRARIES) + +$(LIBRARIES): $(MSS) + libgen -hw ${HWSPEC}\ + ${REPOSITORIES}\ + -pe ${PROCESSOR} \ + -log libgen.log \ + $(MSS) + +clean: + rm -rf ${PROCESSOR} diff --git a/mb/Graphics_bsp/libgen.options b/mb/Graphics_bsp/libgen.options new file mode 100644 index 0000000..b483db4 --- /dev/null +++ b/mb/Graphics_bsp/libgen.options @@ -0,0 +1,3 @@ +PROCESSOR=microblaze_mcs +REPOSITORIES= +HWSPEC=../hardware/system.xml diff --git a/mb/Graphics_bsp/system.mss b/mb/Graphics_bsp/system.mss new file mode 100644 index 0000000..b226217 --- /dev/null +++ b/mb/Graphics_bsp/system.mss @@ -0,0 +1,39 @@ + + PARAMETER VERSION = 2.2.0 + + +BEGIN OS + PARAMETER OS_NAME = standalone + PARAMETER OS_VER = 3.11.a + PARAMETER PROC_INSTANCE = microblaze_mcs + PARAMETER STDIN = iomodule_0 + PARAMETER STDOUT = iomodule_0 +END + + +BEGIN PROCESSOR + PARAMETER DRIVER_NAME = cpu + PARAMETER DRIVER_VER = 1.15.a + PARAMETER HW_INSTANCE = microblaze_mcs +END + + +BEGIN DRIVER + PARAMETER DRIVER_NAME = bram + PARAMETER DRIVER_VER = 3.03.a + PARAMETER HW_INSTANCE = dlmb_cntlr +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = bram + PARAMETER DRIVER_VER = 3.03.a + PARAMETER HW_INSTANCE = ilmb_cntlr +END + +BEGIN DRIVER + PARAMETER DRIVER_NAME = iomodule + PARAMETER DRIVER_VER = 1.04.a + PARAMETER HW_INSTANCE = iomodule_0 +END + + diff --git a/mb/hardware/.project b/mb/hardware/.project new file mode 100644 index 0000000..c5a043d --- /dev/null +++ b/mb/hardware/.project @@ -0,0 +1,12 @@ + + + hardware + + + + + + + com.xilinx.sdk.hw.HwProject + + diff --git a/mb/hardware/system.xml b/mb/hardware/system.xml new file mode 100644 index 0000000..023c73b --- /dev/null +++ b/mb/hardware/system.xml @@ -0,0 +1,5833 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Enable Fault Tolerance Support + + + + + + Select implementation to optimize area (with lower instruction throughput) + + + + Select Bus Interfaces + + + Select Stream Interfaces + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Enable Additional Machine Status Register Instructions + + + Enable Pattern Comparator + + + Enable Barrel Shifter + + + Enable Integer Divider + + + Enable Integer Multiplier + + + Enable Floating Point Unit + + + Enable Reversed Load/Store and Swap Instructions + + + Enable Unaligned Data Exception + + + Enable Illegal Instruction Exception + + + Enable Instruction-side AXI Exception + + + Enable Data-side AXI Exception + + + Enable Instruction-side PLB Exception + + + Enable Data-side PLB Exception + + + Enable Integer Divide Exception + + + Enable Floating Point Unit Exceptions + + + Enable Stream Exception + + + <qt>Enable stack protection</qt> + + + Specifies Processor Version Register + + + Specify USER1 Bits in Processor Version Register + + + Specify USER2 Bits in Processor Version Registers + + + Enable MicroBlaze Debug Module Interface + + + Number of PC Breakpoints + + + Number of Read Address Watchpoints + + + Number of Write Address Watchpoints + + + Sense Interrupt on Edge vs. Level + + + Sense Interrupt on Rising vs. Falling Edge + + + Specify Reset Value for Select MSR Bits + + + <qt>Generate Illegal Instruction Exception for NULL Instruction</qt> + + + Number of Stream Links + + + + Enable Additional Stream Instructions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Base Address + + + High Address + + + Enable Instruction Cache + + + Enable Writes + + + + Size in Bytes + + + + Line Length + + + Use Cache Links for All Memory Accesses + + + + Number of Victims + + + Number of Streams + + + Use Distributed RAM for Tags + + + Data Width + + + + + + + + + + + + + + + + + + + Base Address + + + High Address + + + Enable Data Cache + + + Enable Writes + + + + Size in Bytes + + + + Line Length + + + Use Cache Links for All Memory Accesses + + + + Enable Write-back Storage Policy + + + Number of Victims + + + Use Distributed RAM for Tags + + + Data Width + + + + + + + + + + + + + + + + + + + + + Memory Management + + + Data Shadow Translation Look-Aside Buffer Size + + + Instruction Shadow Translation Look-Aside Buffer Size + + + Enable Access to Memory Management Special Registers + + + Number of Memory Protection Zones + + + Privileged Instructions + + + + + + Enable Branch Target Cache + + + Branch Target Cache Size + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Local Memory Bus (LMB) 1.0 + 'The LMB is a fast, local bus for connecting MicroBlaze I and D ports to peripherals and BRAM' + + + + Number of Bus Slaves + + + LMB Address Bus Width + + + LMB Data Bus Width + + + Active High External Reset + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Local Memory Bus (LMB) 1.0 + 'The LMB is a fast, local bus for connecting MicroBlaze I and D ports to peripherals and BRAM' + + + + Number of Bus Slaves + + + LMB Address Bus Width + + + LMB Data Bus Width + + + Active High External Reset + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMB BRAM Base Address + + + LMB BRAM High Address + + + + SLMB Address Decode Mask + + + SLMB1 Address Decode Mask + + + SLMB2 Address Decode Mask + + + SLMB3 Address Decode Mask + + + LMB Address Bus Width + + + LMB Data Bus Width + + + Error Correction Code + + + Select Interconnect + + + Fault Inject Registers + + + Correctable Error First Failing Register + + + Uncorrectable Error First Failing Register + + + ECC Status and Control Register + + + ECC On/Off Register + + + ECC On/Off Reset Value + + + Correctable Error Counter Register Width + + + Write Access setting + + + Number of LMB ports + + + Base Address for PLB Interface + + + High Address for PLB Interface + + + PLB Address Bus Width + + + PLB Data Bus Width + + + PLB Slave Uses P2P Topology + + + Master ID Bus Width of PLB + + + Number of PLB Masters + + + PLB Slave is Capable of Bursts + + + Native Data Bus Width of PLB Slave + + + Frequency of PLB Slave + + + S_AXI_CTRL Clock Frequency + + + S_AXI_CTRL Base Address + + + S_AXI_CTRL High Address + + + S_AXI_CTRL Address Width + + + S_AXI_CTRL Data Width + + + S_AXI_CTRL Protocol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMB BRAM Base Address + + + LMB BRAM High Address + + + + SLMB Address Decode Mask + + + SLMB1 Address Decode Mask + + + SLMB2 Address Decode Mask + + + SLMB3 Address Decode Mask + + + LMB Address Bus Width + + + LMB Data Bus Width + + + Error Correction Code + + + Select Interconnect + + + Fault Inject Registers + + + Correctable Error First Failing Register + + + Uncorrectable Error First Failing Register + + + ECC Status and Control Register + + + ECC On/Off Register + + + ECC On/Off Reset Value + + + Correctable Error Counter Register Width + + + Write Access setting + + + Number of LMB ports + + + Base Address for PLB Interface + + + High Address for PLB Interface + + + PLB Address Bus Width + + + PLB Data Bus Width + + + PLB Slave Uses P2P Topology + + + Master ID Bus Width of PLB + + + Number of PLB Masters + + + PLB Slave is Capable of Bursts + + + Native Data Bus Width of PLB Slave + + + Frequency of PLB Slave + + + S_AXI_CTRL Clock Frequency + + + S_AXI_CTRL Base Address + + + S_AXI_CTRL High Address + + + S_AXI_CTRL Address Width + + + S_AXI_CTRL Data Width + + + S_AXI_CTRL Protocol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Block RAM (BRAM) Block + The BRAM Block is a configurable memory module that attaches to a variety of BRAM Interface Controllers. + + + + + + + Size of BRAM(s) in Bytes + + + Data Width of Port A and B + + + Address Width of Port A and B + + + Number of Byte Write Enables + + + Device Family + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LMB I/O Module + LMB module which includes plenty of I/O peripherals + + + + + + + I/O Module Register Base Address + + + I/O Module Register High Address + + + I/O Module Register Address Decode Mask + + + I/O Module IO Bus Base Address + + + I/O Module IO Bus High Address + + + I/O Module IO Bus Address Decode Mask + + + LMB Address Bus Width + + + LMB Data Bus Width + + + Enable IO Bus + + + Enable Receiver + + + Enable Transmitter + + + Define Baud Rate + + + Number of Data Bits + + + Use Parity + + + Even or Odd Parity + + + Implement Receive Interrupt + + + Implement Transmit Interrupt + + + Implement Error Interrupt + + + Programmable Baud Rate + + + Use FIT + + + Number of Clocks Between Strobes + + + Generate Interrupt + + + Use FIT + + + Number of Clocks Between Strobes + + + Generate Interrupt + + + Use FIT + + + Number of Clocks Between Strobes + + + Generate Interrupt + + + Use FIT + + + Number of Clocks Between Strobes + + + Generate Interrupt + + + Use PIT + + + Number of Bits for Timer + + + Shall Counter Value Be Readable + + + Define Prescaler + + + Generate Interrupt + + + Use PIT + + + Number of Bits for Timer + + + Shall Counter Value Be Readable + + + Define Prescaler + + + Generate Interrupt + + + Use PIT + + + Number of Bits for Timer + + + Shall Counter Value be Readable + + + Define Prescaler + + + Generate Interrupt + + + Use PIT + + + Number of Bits for Timer + + + Shall Counter Value Be Readable + + + Define Prescaler + + + Generate Interrupt + + + Use GPO + + + Number of Bits + + + Initial Value of GPO + + + Use GPO + + + Number of Bits + + + Initial Value of GPO + + + Use GPO + + + Number of Bits + + + Initial Value of GPO + + + Use GPO + + + Number of Bits + + + Initial Value of GPO + + + Use GPI + + + Number of Bits + + + Generate Interrupt + + + Use GPI + + + Number of Bits + + + Generate Interrupt + + + Use GPI + + + Number of Bits + + + Generate Interrupt + + + Use GPI + + + Number of Bits + + + Generate Interrupt + + + Use External Interrupts + + + Number of External Inputs + + + + + Use Low-latency Interrupt Handling + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Serial Data In + + + + + + Serial Data Out + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Interrupt Inputs + + + + Interrupt Request Output + + + + + + + Interrupt Vector Address Output + + + + + + Interrupt Acknowledgement Input + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mb/hardware/system_bd.bmm b/mb/hardware/system_bd.bmm new file mode 100644 index 0000000..b71facc --- /dev/null +++ b/mb/hardware/system_bd.bmm @@ -0,0 +1,16 @@ +ADDRESS_MAP microblaze_mcs MICROBLAZE-LE 100 + ADDRESS_SPACE lmb_bram COMBINED [0x00000000:0x00003fff] + ADDRESS_RANGE RAMB16 + BUS_BLOCK + mcs_0/U0/lmb_bram_I/RAM_Inst/Using_B16_S4.The_BRAMs[0].RAMB16_S4_1 [31:28] INPUT = microblaze_mcs.lmb_bram_0.mem; + mcs_0/U0/lmb_bram_I/RAM_Inst/Using_B16_S4.The_BRAMs[1].RAMB16_S4_1 [27:24] INPUT = microblaze_mcs.lmb_bram_1.mem; + mcs_0/U0/lmb_bram_I/RAM_Inst/Using_B16_S4.The_BRAMs[2].RAMB16_S4_1 [23:20] INPUT = microblaze_mcs.lmb_bram_2.mem; + mcs_0/U0/lmb_bram_I/RAM_Inst/Using_B16_S4.The_BRAMs[3].RAMB16_S4_1 [19:16] INPUT = microblaze_mcs.lmb_bram_3.mem; + mcs_0/U0/lmb_bram_I/RAM_Inst/Using_B16_S4.The_BRAMs[4].RAMB16_S4_1 [15:12] INPUT = microblaze_mcs.lmb_bram_4.mem; + mcs_0/U0/lmb_bram_I/RAM_Inst/Using_B16_S4.The_BRAMs[5].RAMB16_S4_1 [11:8] INPUT = microblaze_mcs.lmb_bram_5.mem; + mcs_0/U0/lmb_bram_I/RAM_Inst/Using_B16_S4.The_BRAMs[6].RAMB16_S4_1 [7:4] INPUT = microblaze_mcs.lmb_bram_6.mem; + mcs_0/U0/lmb_bram_I/RAM_Inst/Using_B16_S4.The_BRAMs[7].RAMB16_S4_1 [3:0] INPUT = microblaze_mcs.lmb_bram_7.mem; + END_BUS_BLOCK; + END_ADDRESS_RANGE; + END_ADDRESS_SPACE; +END_ADDRESS_MAP; diff --git a/syn/.gitignore b/syn/.gitignore deleted file mode 100644 index 86d0cb2..0000000 --- a/syn/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore \ No newline at end of file diff --git a/syn/main.prj b/syn/main.prj new file mode 100644 index 0000000..f2039e9 --- /dev/null +++ b/syn/main.prj @@ -0,0 +1,12 @@ +verilog work "../ipcore_dir/microblaze_mcs.v" +verilog work "../ipcore_dir/hdmi_clk.v" +verilog work "../src/simple_dual_ram.v" +verilog work "../src/async_fifo.v" +verilog work "../src/tmds_encoder.v" +verilog work "../src/serdes_n_to_1.v" +verilog work "../src/fifo_2x_reducer.v" +verilog work "../src/dvi_encoder.v" +verilog work "../src/hdmi_encoder.v" +verilog work "../src/color_map.v" +verilog work "../src/char_map.v" +verilog work "../src/main.v" diff --git a/syn/main.ut b/syn/main.ut new file mode 100644 index 0000000..0a46560 --- /dev/null +++ b/syn/main.ut @@ -0,0 +1,31 @@ +-bd "/home/tim/Projects/z80/hdmi-mb/Graphics/Release/Graphics.elf" tag microblaze_mcs +-w +-g Binary:yes +-g Compress +-g CRC:Enable +-g Reset_on_err:No +-g ConfigRate:2 +-g ProgPin:PullUp +-g TckPin:PullUp +-g TdiPin:PullUp +-g TdoPin:PullUp +-g TmsPin:PullUp +-g UnusedPin:PullDown +-g UserID:0xFFFFFFFF +-g ExtMasterCclk_en:No +-g SPI_buswidth:1 +-g TIMER_CFG:0xFFFF +-g multipin_wakeup:No +-g StartUpClk:CClk +-g DONE_cycle:4 +-g GTS_cycle:5 +-g GWE_cycle:6 +-g LCK_cycle:NoWait +-g Security:None +-g DonePipe:Yes +-g DriveDone:No +-g en_sw_gsr:No +-g drive_awake:No +-g sw_clk:Startupclk +-g sw_gwe_cycle:5 +-g sw_gts_cycle:4 diff --git a/syn/main.xst b/syn/main.xst new file mode 100644 index 0000000..3ca81cb --- /dev/null +++ b/syn/main.xst @@ -0,0 +1,53 @@ +set -tmpdir "xst/projnav.tmp" +set -xsthdpdir "xst" +run +-ifn main.prj +-ofn main +-ofmt NGC +-p xc6slx9-2-tqg144 +-top main +-opt_mode Speed +-opt_level 1 +-power NO +-iuc NO +-keep_hierarchy No +-netlist_hierarchy As_Optimized +-rtlview Yes +-glob_opt AllClockNets +-read_cores YES +-sd {"../ipcore_dir" } +-write_timing_constraints NO +-cross_clock_analysis NO +-hierarchy_separator / +-bus_delimiter <> +-case Maintain +-slice_utilization_ratio 100 +-bram_utilization_ratio 100 +-dsp_utilization_ratio 100 +-lc Auto +-reduce_control_sets Auto +-fsm_extract YES -fsm_encoding Auto +-safe_implementation No +-fsm_style LUT +-ram_extract Yes +-ram_style Auto +-rom_extract Yes +-shreg_extract YES +-rom_style Auto +-auto_bram_packing NO +-resource_sharing YES +-async_to_sync NO +-shreg_min_size 2 +-use_dsp48 Auto +-iobuf YES +-max_fanout 100000 +-bufg 16 +-register_duplication YES +-register_balancing No +-optimize_primitives NO +-use_clock_enable Auto +-use_sync_set Auto +-use_sync_reset Auto +-iob Auto +-equivalent_register_removal YES +-slice_utilization_ratio_maxmargin 5