OpenCores
URL https://opencores.org/ocsvn/xulalx25soc/xulalx25soc/trunk

Subversion Repositories xulalx25soc

[/] [xulalx25soc/] [trunk/] [xilinx/] [Makefile] - Rev 97

Go to most recent revision | Compare with Previous | Blame | View Log

################################################################################
##
## Filename:    Makefile
##
## Project:     XuLA2 board
##
## Purpose:     In case you don't want to fire up ISE, this Makefile attempts
##              to coordinate the build process without it.  While it works in
##      testing, there are some problems to this approach.  The first is that
##      if you bust timing, you may never know it--nothing will tell you it
##      failed.  Second, the output file is different from the output file
##      produced via ISE.  Still ... for a command line make script, it is a 
##      (good) start.
##
##      Makefile targets:
##
##      xula.bit        The FPGA bitfile or configuration file
##
##      objdir          Makes a directory for temporary build files, which can
##                      then be removed later with a clean target.  While a 
##                      great idea in principle, this doesn't work well in 
##                      practice since Xilinx's ISE never uses it.
##
##      clean           Removes intermediate build files.
##
## Creator:     Dan Gisselquist, Ph.D.
##              Gisselquist Technology, LLC
##
################################################################################
##
## Copyright (C) 2015, Gisselquist Technology, LLC
##
## This program is free software (firmware): you can redistribute it and/or
## modify it under the terms of  the GNU General Public License as published
## by the Free Software Foundation, either version 3 of the License, or (at
## your option) any later version.
##
## This program is distributed in the hope that it will be useful, but WITHOUT
## ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
## for more details.
##
## License:     GPL, v3, as defined and found on www.gnu.org,
##              http:##www.gnu.org/licenses/gpl.html
##
##
################################################################################
##
##
DIR_SPACES  := $(subst /, ,$(CURDIR))
DIR_NAME    := $(word $(words $(DIR_SPACES)), $(DIR_SPACES))
PROJECT     := xula
BRD         := lx25
PART        := xc6s$(BRD)-ftg256-2
OBJDIR      := obj-xilinx
UCFFILE     := ../xula.ucf
ifeq ($(shell uname),Linux)
  MKDIR:=mkdir
else
  MKDIR:=gmkdir
endif
SRCDIR      := ../rtl
CPUDIR      := ../rtl/cpu
JTAGBUS := wbufifo.v wbubus.v wbucompactlines.v wbucompress.v           \
        wbudecompress.v wbudeword.v wbuexec.v wbuidleint.v wbuinput.v   \
        wbuoutput.v wbureadcw.v wbusixchar.v wbutohex.v
PERIPHERALS: wbgpio.v wbpwmaudio.v rxuart.v txuart.v uartdev.v          \
        rtcdate.v rtclight.v
CPUSRC := zipsystem.v                                                   \
        busdelay.v wbarbiter.v wbdblpriarb.v                            \
        zipcpu.v cpuops.v pfcache.v idecode.v pipemem.v pipefetch.v div.v \
        zipcounter.v zipjiffies.v ziptimer.v wbdmac.v wbwatchdog.v
SOURCES     := toplevel.v jtagser.v busmaster.v                         \
        ioslave.v memdev.v hexmap.v icontrol.v builddate.v              \
        wbspiflash.v lldspi.v                                           \
        wbsdramng.v wbscope.v wbscopc.v $(JTAGBUS)

RTLFILES := $(addprefix $(SRCDIR)/,$(SOURCES)) $(addprefix $(CPUDIR)/,$(CPUSRC))


all: objdir xula.bit

.PHONY: objdir
objdir:
        @bash -c "if [ ! -e $(OBJDIR)/ ]; then $(MKDIR) -p $(OBJDIR)/; fi"

$(OBJDIR)/$(PROJECT).ngc: $(RTLFILES) $(PROJECT).xst
        $(MKDIR) -p xst/projnav.tmp/
        xst -intstyle ise -ifn $(PROJECT).xst -ofn $(OBJDIR)/$(PROJECT).syr
        mv $(PROJECT).ngc $(OBJDIR)/$(PROJECT).ngc
        mv $(PROJECT).ngr $(OBJDIR)/$(PROJECT).ngr

$(OBJDIR)/$(PROJECT).ngd: $(OBJDIR)/$(PROJECT).ngc
        ngdbuild -intstyle ise -dd _ngo -nt timestamp \
        -uc $(UCFFILE) -p $(PART) $(OBJDIR)/$(PROJECT).ngc $(OBJDIR)/$(PROJECT).ngd

MAPOPTS := -w -logic_opt on -ol high -xe n -t 1 -xt 0 -r 4      \
        -global_opt speed -equivalent_register_removal on -mt 2 -detail \
        -ir off -ignore_keep_hierarchy -pr off -lc area -power off
$(OBJDIR)/$(PROJECT).ncd: $(OBJDIR)/$(PROJECT).ngd
        map -intstyle ise -p $(PART) $(MAPOPTS) \
        -o $(OBJDIR)/$(PROJECT)_map.ncd $(OBJDIR)/$(PROJECT).ngd $(OBJDIR)/$(PROJECT).pcf

$(OBJDIR)/$(PROJECT).ncd: $(OBJDIR)/$(PROJECT)_map.ncd
        par -w -intstyle ise -ol std -mt 4 $(OBJDIR)/$(PROJECT)_map.ncd $(OBJDIR)/$(PROJECT).ncd $(OBJDIR)/$(PROJECT).pcf

$(PROJECT).bit: $(OBJDIR)/$(PROJECT).ncd
        bitgen -f $(PROJECT).ut $(OBJDIR)/$(PROJECT).ncd $(PROJECT).bit

timing: $(OBJDIR)/$(PROJECT).ncd  $(OBJDIR)/$(PROJECT).pcf
        trce -intstyle ise -v 3 -s 2 -n 3 -fastpaths -xml $(OBJDIR)/$(PROJECT).twx -o $(OBJDIR)/$(PROJECT).ncd -o $(OBJDIR)/$(PROJECT).twr $(OBJDIR)/$(PROJECT).pcf

.PHONY: clean
clean:
        @-rm -rf $(OBJDIR)
        @-rm -f *.ngc *.ngd *.ncd *.pcf *.lso *.ngr *.bgn *.bld *.cmd_log
        @-rm -f *.drc *.gise *.map *.mrp *.ngm *.syr *.xwbt *.xrpt
        @-rm -f *.pad *.par *.psr *.ptwx *.unroutes *.xpi *.csv *.xml
        @-rm -f *.html *.xrpt *.log *.stx *.tcl *.txt *.twr *.twx
        @-rm -rf _ngo  _xmsgs xlnx_* ipcore_dir iseconfig templates xst
        @echo "All cleaned up"

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.