Initial commit
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
build/
|
209
Makefile
Normal file
209
Makefile
Normal file
@@ -0,0 +1,209 @@
|
||||
###########################################################################
|
||||
## Xilinx ISE Makefile
|
||||
##
|
||||
## To the extent possible under law, the author(s) have dedicated all copyright
|
||||
## and related and neighboring rights to this software to the public domain
|
||||
## worldwide. This software is distributed without any warranty.
|
||||
###########################################################################
|
||||
|
||||
include project.cfg
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Default values
|
||||
###########################################################################
|
||||
|
||||
ifndef XILINX
|
||||
$(error XILINX must be defined)
|
||||
endif
|
||||
|
||||
ifndef PROJECT
|
||||
$(error PROJECT must be defined)
|
||||
endif
|
||||
|
||||
ifndef TARGET_PART
|
||||
$(error TARGET_PART must be defined)
|
||||
endif
|
||||
|
||||
TOPLEVEL ?= $(PROJECT)
|
||||
CONSTRAINTS ?= $(PROJECT).ucf
|
||||
BITFILE ?= build/$(PROJECT).bit
|
||||
|
||||
COMMON_OPTS ?= -intstyle xflow
|
||||
XST_OPTS ?=
|
||||
NGDBUILD_OPTS ?=
|
||||
MAP_OPTS ?=
|
||||
PAR_OPTS ?=
|
||||
BITGEN_OPTS ?=
|
||||
TRACE_OPTS ?=
|
||||
FUSE_OPTS ?= -incremental
|
||||
|
||||
PROGRAMMER ?= none
|
||||
|
||||
IMPACT_OPTS ?= -batch impact.cmd
|
||||
|
||||
DJTG_EXE ?= djtgcfg
|
||||
DJTG_DEVICE ?= DJTG_DEVICE-NOT-SET
|
||||
DJTG_INDEX ?= 0
|
||||
|
||||
XC3SPROG_EXE ?= xc3sprog
|
||||
XC3SPROG_CABLE ?= none
|
||||
XC3SPROG_OPTS ?=
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Internal variables, platform-specific definitions, and macros
|
||||
###########################################################################
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
XILINX := $(shell cygpath -m $(XILINX))
|
||||
CYG_XILINX := $(shell cygpath $(XILINX))
|
||||
EXE := .exe
|
||||
XILINX_PLATFORM ?= nt64
|
||||
PATH := $(PATH):$(CYG_XILINX)/bin/$(XILINX_PLATFORM)
|
||||
else
|
||||
EXE :=
|
||||
XILINX_PLATFORM ?= lin64
|
||||
PATH := $(PATH):$(XILINX)/bin/$(XILINX_PLATFORM)
|
||||
endif
|
||||
|
||||
TEST_NAMES = $(foreach file,$(VTEST) $(VHDTEST),$(basename $(file)))
|
||||
TEST_EXES = $(foreach test,$(TEST_NAMES),build/isim_$(test)$(EXE))
|
||||
|
||||
RUN = @echo "\n\e[1;33m============ $(1) ============\e[m\n"; \
|
||||
cd build && $(XILINX)/bin/$(XILINX_PLATFORM)/$(1)
|
||||
|
||||
# isim executables don't work without this
|
||||
export XILINX
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Default build
|
||||
###########################################################################
|
||||
|
||||
default: $(BITFILE)
|
||||
|
||||
clean:
|
||||
rm -rf build
|
||||
|
||||
build/$(PROJECT).prj: project.cfg
|
||||
@echo "Updating $@"
|
||||
@mkdir -p build
|
||||
@rm -f $@
|
||||
@$(foreach file,$(VSOURCE),echo "verilog work \"../$(file)\"" >> $@;)
|
||||
@$(foreach file,$(VHDSOURCE),echo "vhdl work \"../$(file)\"" >> $@;)
|
||||
|
||||
build/$(PROJECT)_sim.prj: build/$(PROJECT).prj
|
||||
@cp build/$(PROJECT).prj $@
|
||||
@$(foreach file,$(VTEST),echo "verilog work \"../$(file)\"" >> $@;)
|
||||
@$(foreach file,$(VHDTEST),echo "vhdl work \"../$(file)\"" >> $@;)
|
||||
@echo "verilog work $(XILINX)/verilog/src/glbl.v" >> $@
|
||||
|
||||
build/$(PROJECT).scr: project.cfg
|
||||
@echo "Updating $@"
|
||||
@mkdir -p build
|
||||
@rm -f $@
|
||||
@echo "run" \
|
||||
"-ifn $(PROJECT).prj" \
|
||||
"-ofn $(PROJECT).ngc" \
|
||||
"-ifmt mixed" \
|
||||
"$(XST_OPTS)" \
|
||||
"-top $(TOPLEVEL)" \
|
||||
"-ofmt NGC" \
|
||||
"-p $(TARGET_PART)" \
|
||||
> build/$(PROJECT).scr
|
||||
|
||||
$(BITFILE): project.cfg $(VSOURCE) $(CONSTRAINTS) build/$(PROJECT).prj build/$(PROJECT).scr
|
||||
@mkdir -p build
|
||||
$(call RUN,xst) $(COMMON_OPTS) \
|
||||
-ifn $(PROJECT).scr
|
||||
$(call RUN,ngdbuild) $(COMMON_OPTS) $(NGDBUILD_OPTS) \
|
||||
-p $(TARGET_PART) -uc ../$(CONSTRAINTS) \
|
||||
$(PROJECT).ngc $(PROJECT).ngd
|
||||
$(call RUN,map) $(COMMON_OPTS) $(MAP_OPTS) \
|
||||
-p $(TARGET_PART) \
|
||||
-w $(PROJECT).ngd -o $(PROJECT).map.ncd $(PROJECT).pcf
|
||||
$(call RUN,par) $(COMMON_OPTS) $(PAR_OPTS) \
|
||||
-w $(PROJECT).map.ncd $(PROJECT).ncd $(PROJECT).pcf
|
||||
$(call RUN,bitgen) $(COMMON_OPTS) $(BITGEN_OPTS) \
|
||||
-w $(PROJECT).ncd $(PROJECT).bit
|
||||
@echo "\e[1;32m============ OK ============\e[m\n\n"
|
||||
@echo "\e[1;33m============ Reports.. ===========\e[m\n"
|
||||
@echo "\e[1;97m==== Synthesis Summary Report ====\e[m"
|
||||
@echo "\e[1;35m ./build/$(PROJECT).srp\e[m\n"
|
||||
@echo "\e[1;97m======= Map Summary Report =======\e[m"
|
||||
@echo "\e[1;35m ./build/$(PROJECT).map.mrp\e[m\n"
|
||||
@echo "\e[1;97m======= PAR Summary Report =======\e[m"
|
||||
@echo "\e[1;35m ./build/$(PROJECT).par\e[m\n"
|
||||
@echo "\e[1;97m===== Pinout Summary Report ======\e[m"
|
||||
@echo "\e[1;35m ./build/$(PROJECT)_pad.txt\e[m\n"
|
||||
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Testing (work in progress)
|
||||
###########################################################################
|
||||
|
||||
trace: project.cfg $(BITFILE)
|
||||
$(call RUN,trce) $(COMMON_OPTS) $(TRACE_OPTS) \
|
||||
$(PROJECT).ncd $(PROJECT).pcf
|
||||
@echo "\n\e[1;33m============ Reports.. ===========\e[m\n"
|
||||
@echo "\e[1;97m===== Timing Summary Report ======\e[m"
|
||||
@echo "\e[1;35m ./build/$(PROJECT).twr\e[m\n"
|
||||
|
||||
test: $(TEST_EXES)
|
||||
|
||||
build/isim_%$(EXE): build/$(PROJECT)_sim.prj $(VSOURCE) $(VHDSOURCE) $(VTEST) $(VHDTEST)
|
||||
$(call RUN,fuse) $(COMMON_OPTS) $(FUSE_OPTS) \
|
||||
-prj $(PROJECT)_sim.prj \
|
||||
-o isim_$*$(EXE) \
|
||||
work.$* work.glbl
|
||||
|
||||
isim: build/isim_$(TB)$(EXE)
|
||||
@grep --no-filename --no-messages 'ISIM:' $(TB).{v,vhd} | cut -d: -f2 > build/isim_$(TB).cmd
|
||||
@echo "run all" >> build/isim_$(TB).cmd
|
||||
cd build ; ./isim_$(TB)$(EXE) -tclbatch isim_$(TB).cmd
|
||||
|
||||
isimgui: build/isim_$(TB)$(EXE)
|
||||
@grep --no-filename --no-messages 'ISIM:' $(TB).{v,vhd} | cut -d: -f2 > build/isim_$(TB).cmd
|
||||
@echo "run all" >> build/isim_$(TB).cmd
|
||||
cd build ; ./isim_$(TB)$(EXE) -gui -tclbatch isim_$(TB).cmd
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Programming
|
||||
###########################################################################
|
||||
|
||||
ifeq ($(PROGRAMMER), impact)
|
||||
prog: $(BITFILE)
|
||||
sudo $(XILINX)/bin/$(XILINX_PLATFORM)/impact $(IMPACT_OPTS)
|
||||
endif
|
||||
|
||||
ifeq ($(PROGRAMMER), digilent)
|
||||
prog: $(BITFILE)
|
||||
yes Y | sudo $(DJTG_EXE) prog -d $(DJTG_DEVICE) -i $(DJTG_INDEX) -f $(BITFILE)
|
||||
endif
|
||||
|
||||
ifeq ($(PROGRAMMER), xc3sprog)
|
||||
prog: $(BITFILE)
|
||||
sudo $(XC3SPROG_EXE) -c $(XC3SPROG_CABLE) $(XC3SPROG_OPTS) $(BITFILE)
|
||||
endif
|
||||
|
||||
ifeq ($(PROGRAMMER), none)
|
||||
prog:
|
||||
$(error PROGRAMMER must be set to use 'make prog')
|
||||
endif
|
||||
|
||||
###########################################################################
|
||||
# Flash
|
||||
###########################################################################
|
||||
|
||||
ifeq ($(PROGRAMMER), digilent)
|
||||
flash: $(BITFILE)
|
||||
yes Y | sudo $(DJTG_EXE) prog -d $(DJTG_DEVICE) -i $(DJTG_FLASH_INDEX) -f $(BITFILE)
|
||||
endif
|
||||
|
||||
|
||||
###########################################################################
|
||||
|
||||
# vim: set filetype=make: #
|
45
README.md
Normal file
45
README.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# English
|
||||
|
||||
## VHDL Project Template Using Xilinx Build Tools with Makefile
|
||||
|
||||
Welcome to the VHDL Project Template repository. This project is designed to streamline your FPGA development process using the Xilinx ISE Build Tools, integrated with a convenient Makefile approach for building and synthesizing your VHDL designs.
|
||||
|
||||
### Using the Makefile
|
||||
|
||||
To use the Makefile for building your VHDL projects, ensure you have the Xilinx Build Tools installed on your system. The Makefile is specifically configured to work with these tools to automate the build process.
|
||||
|
||||
For detailed instructions on how to use the Makefile, please refer to the following URL: [Xilinx ISE Makefile](https://github.com/PxaMMaxP/Xilinx-ISE-Makefile). This page contains comprehensive guidance on setup and usage to get you started quickly.
|
||||
|
||||
### Directory Structure
|
||||
|
||||
The project is organized into various subdirectories, each serving a specific role in the development process. For an explanation of the directory structure and the contents of each subdirectory, please refer to the `README.md` files located within the subdirectories. These documents provide valuable insights into how the project is organized and how to navigate the files and folders efficiently.
|
||||
|
||||
### Getting Started
|
||||
|
||||
To begin using this VHDL Project Template, clone the repository to your local machine and follow the instructions provided in the subdirectory `README.md` files to understand the project layout. Then, head over to the URL mentioned above for details on using the Makefile with the Xilinx Build Tools.
|
||||
|
||||
Thank you for choosing this VHDL Project Template. We hope it accelerates your development process and helps you achieve your project goals efficiently.
|
||||
|
||||
---
|
||||
|
||||
# Deutsch
|
||||
|
||||
## VHDL-Projektvorlage unter Verwendung von Xilinx Build Tools mit Makefile
|
||||
|
||||
Willkommen im Repository der VHDL-Projektvorlage. Dieses Projekt wurde entwickelt, um Ihren FPGA-Entwicklungsprozess mit den Xilinx ISE Build Tools zu vereinfachen, integriert mit einem praktischen Makefile-Ansatz zum Bauen und Synthetisieren Ihrer VHDL-Designs.
|
||||
|
||||
### Verwendung des Makefiles
|
||||
|
||||
Um das Makefile für den Bau Ihrer VHDL-Projekte zu verwenden, stellen Sie sicher, dass die Xilinx Build Tools auf Ihrem System installiert sind. Das Makefile ist speziell so konfiguriert, dass es mit diesen Tools arbeitet, um den Bauprozess zu automatisieren.
|
||||
|
||||
Für detaillierte Anweisungen zur Verwendung des Makefiles besuchen Sie bitte die folgende URL: [Xilinx ISE Makefile](https://github.com/PxaMMaxP/Xilinx-ISE-Makefile). Diese Seite enthält umfassende Anleitungen zur Einrichtung und Verwendung, damit Sie schnell starten können.
|
||||
|
||||
### Verzeichnisstruktur
|
||||
|
||||
Das Projekt ist in verschiedene Unterverzeichnisse organisiert, von denen jedes eine spezifische Rolle im Entwicklungsprozess spielt. Für eine Erklärung der Verzeichnisstruktur und des Inhalts jedes Unterverzeichnisses beachten Sie bitte die `README.md`-Dateien, die sich in den Unterverzeichnissen befinden. Diese Dokumente bieten wertvolle Einblicke, wie das Projekt organisiert ist und wie Sie effizient durch die Dateien und Ordner navigieren.
|
||||
|
||||
### Erste Schritte
|
||||
|
||||
Um mit dieser VHDL-Projektvorlage zu beginnen, klonen Sie das Repository auf Ihre lokale Maschine und folgen Sie den Anweisungen in den `README.md`-Dateien der Unterverzeichnisse, um das Layout des Projekts zu verstehen. Anschließend besuchen Sie die oben genannte URL für Details zur Verwendung des Makefiles mit den Xilinx Build Tools.
|
||||
|
||||
Vielen Dank, dass Sie sich für diese VHDL-Projektvorlage entschieden haben. Wir hoffen, dass sie Ihren Entwicklungsprozess beschleunigt und Ihnen hilft, Ihre Projektziele effizient zu erreichen.
|
13
code/README.md
Normal file
13
code/README.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# English
|
||||
|
||||
# `code` Directory
|
||||
|
||||
This directory is intended for project-specific VHDL codes. Modules, on the other hand, should be placed in the subdirectory `../lib`.
|
||||
|
||||
---
|
||||
|
||||
# Deutsch
|
||||
|
||||
# `code` Verzeichnis
|
||||
|
||||
Dieses Verzeichnis ist für projektspezifische VHDL-Codes vorgesehen. Module sollten hingegen im Unterordner `../lib` abgelegt werden.
|
13
lib/README.md
Normal file
13
lib/README.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# English
|
||||
|
||||
## `lib` Directory
|
||||
|
||||
This directory is intended for individual modules of the project. Each module should be placed in its own subdirectory within the `lib` directory. This structure helps to keep the project organized and makes it easier to locate specific modules.
|
||||
|
||||
---
|
||||
|
||||
# Deutsch
|
||||
|
||||
## `lib` Verzeichnis
|
||||
|
||||
Dieses Verzeichnis ist für einzelne Module des Projekts vorgesehen. Jedes Modul sollte in seinem eigenen Unterordner innerhalb des `lib` Verzeichnisses platziert werden. Diese Struktur hilft, das Projekt organisiert zu halten und erleichtert das Auffinden spezifischer Module.
|
85
project.cfg
Normal file
85
project.cfg
Normal file
@@ -0,0 +1,85 @@
|
||||
## Main settings.. ##
|
||||
|
||||
# Project name
|
||||
# @remark The name of the project is used as default name for the top module and the ucf file
|
||||
PROJECT =
|
||||
|
||||
# Target device
|
||||
# @example xc3s1200e-4-fg320 | xc5vlx50t-1-ff1136
|
||||
TARGET_PART =
|
||||
|
||||
# Path to the Xilinx ISE installation
|
||||
XILINX = /opt/Xilinx/14.7/ISE_DS/ISE
|
||||
|
||||
# Optional the name of the top module (default is the project name)
|
||||
# TOPLEVEL =
|
||||
|
||||
# Optional the name of the ucf file (default is the project name)
|
||||
# CONSTRAINTS =
|
||||
|
||||
## ## ## ## ## ## ## ##
|
||||
# ---------------------
|
||||
|
||||
## Source files settings.. ##
|
||||
# The source files to be compiled
|
||||
# @example `VSOURCE += src/main.v` (add a single Verilog file per line)
|
||||
# @example `VHDSOURCE += src/main.vhd` (add a single VHDL file per line)
|
||||
|
||||
|
||||
|
||||
## ## ## ## ## ## ## ##
|
||||
# ---------------------
|
||||
|
||||
## ISE executable settings.. ##
|
||||
|
||||
# General command line options to be passed to all ISE executables (default is `-intstyle xflow`)
|
||||
# COMMON_OPTS =
|
||||
# Options for the XST synthesizer
|
||||
# XST_OPTS =
|
||||
|
||||
# Options for the NGDBuild tool
|
||||
# NGDBUILD_OPTS =
|
||||
|
||||
# Options for the MAP tool
|
||||
# @example -mt 2 (multi-threading with 2 threads)
|
||||
# MAP_OPTS =
|
||||
|
||||
# Options for the PAR tool
|
||||
# @example -mt 2 (multi-threading with 2 threads)
|
||||
# PAR_OPTS =
|
||||
|
||||
# Options for the BitGen tool
|
||||
# @example -g Compress (compress bitstream)
|
||||
# @example -g StartupClk:Cclk (specify the startup clock to onboard clock)
|
||||
# @example -g StartupClk:JtagClk (specify the startup clock to JTAG clock)
|
||||
# BITGEN_OPTS =
|
||||
|
||||
# Options for the Trace tool
|
||||
# TRACE_OPTS =
|
||||
|
||||
# Options for the Fuse tool
|
||||
# FUSE_OPTS =
|
||||
|
||||
## ## ## ## ## ## ## ##
|
||||
# ---------------------
|
||||
|
||||
## Programmer settings.. ##
|
||||
|
||||
# The programmer to use
|
||||
# @example impact | digilent | xc3sprog
|
||||
# @remark impact is the default Xilinx programmer and you must create a impact.cmd file in the root directory..
|
||||
PROGRAMMER =
|
||||
|
||||
## Digilent JTAG cable settings
|
||||
|
||||
# @remark Use the `djtgcfg enum` command to list all available devices
|
||||
# DJTG_DEVICE = DOnbUsb
|
||||
|
||||
# The index of the JTAG device for the `prog` target
|
||||
# DJTG_INDEX = 0
|
||||
|
||||
# The index of the flash device for the `flash` target
|
||||
# DJTG_FLASH_INDEX = 1
|
||||
|
||||
## ## ## ## ## ## ## ##
|
||||
# ---------------------
|
Reference in New Issue
Block a user