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

Subversion Repositories xulalx25soc

[/] [xulalx25soc/] [trunk/] [xilinx/] [Makefile] - Blame information for rev 117

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 dgisselq
################################################################################
2
##
3
## Filename:    Makefile
4
##
5
## Project:     XuLA2 board
6
##
7
## Purpose:     In case you don't want to fire up ISE, this Makefile attempts
8
##              to coordinate the build process without it.  While it works in
9
##      testing, there are some problems to this approach.  The first is that
10
##      if you bust timing, you may never know it--nothing will tell you it
11
##      failed.  Second, the output file is different from the output file
12
##      produced via ISE.  Still ... for a command line make script, it is a
13
##      (good) start.
14
##
15 7 dgisselq
##      Makefile targets:
16 6 dgisselq
##
17 7 dgisselq
##      xula.bit        The FPGA bitfile or configuration file
18
##
19
##      objdir          Makes a directory for temporary build files, which can
20
##                      then be removed later with a clean target.  While a
21
##                      great idea in principle, this doesn't work well in
22
##                      practice since Xilinx's ISE never uses it.
23
##
24
##      clean           Removes intermediate build files.
25
##
26 6 dgisselq
## Creator:     Dan Gisselquist, Ph.D.
27
##              Gisselquist Technology, LLC
28
##
29
################################################################################
30
##
31
## Copyright (C) 2015, Gisselquist Technology, LLC
32
##
33
## This program is free software (firmware): you can redistribute it and/or
34
## modify it under the terms of  the GNU General Public License as published
35
## by the Free Software Foundation, either version 3 of the License, or (at
36
## your option) any later version.
37
##
38
## This program is distributed in the hope that it will be useful, but WITHOUT
39
## ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
40
## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
41
## for more details.
42
##
43
## License:     GPL, v3, as defined and found on www.gnu.org,
44
##              http:##www.gnu.org/licenses/gpl.html
45
##
46
##
47
################################################################################
48
##
49
##
50
DIR_SPACES  := $(subst /, ,$(CURDIR))
51
DIR_NAME    := $(word $(words $(DIR_SPACES)), $(DIR_SPACES))
52
PROJECT     := xula
53
BRD         := lx25
54
PART        := xc6s$(BRD)-ftg256-2
55
OBJDIR      := obj-xilinx
56
UCFFILE     := ../xula.ucf
57
ifeq ($(shell uname),Linux)
58
  MKDIR:=mkdir
59
else
60
  MKDIR:=gmkdir
61
endif
62
SRCDIR      := ../rtl
63
CPUDIR      := ../rtl/cpu
64
JTAGBUS := wbufifo.v wbubus.v wbucompactlines.v wbucompress.v           \
65
        wbudecompress.v wbudeword.v wbuexec.v wbuidleint.v wbuinput.v   \
66
        wbuoutput.v wbureadcw.v wbusixchar.v wbutohex.v
67 117 dgisselq
PERIPHERALS:= wbgpio.v wbpwmaudio.v rxuart.v txuart.v uartdev.v         \
68
        rtcdate.v rtclight.v sdspi.v spiarbiter.v
69 6 dgisselq
CPUSRC := zipsystem.v                                                   \
70 117 dgisselq
        busdelay.v wbarbiter.v wbdblpriarb.v icontrol.v                 \
71 6 dgisselq
        zipcpu.v cpuops.v pfcache.v idecode.v pipemem.v pipefetch.v div.v \
72
        zipcounter.v zipjiffies.v ziptimer.v wbdmac.v wbwatchdog.v
73
SOURCES     := toplevel.v jtagser.v busmaster.v                         \
74 117 dgisselq
        ioslave.v memdev.v builddate.v          \
75
        wbspiflash.v lldspi.v sdspi.v wbgpio.v                          \
76
        wbsdram.v wbscope.v wbscopc.v $(JTAGBUS)
77 6 dgisselq
 
78
RTLFILES := $(addprefix $(SRCDIR)/,$(SOURCES)) $(addprefix $(CPUDIR)/,$(CPUSRC))
79
 
80
 
81
all: objdir xula.bit
82
 
83
.PHONY: objdir
84
objdir:
85
        @bash -c "if [ ! -e $(OBJDIR)/ ]; then $(MKDIR) -p $(OBJDIR)/; fi"
86
 
87 117 dgisselq
# Synthesize
88 6 dgisselq
$(OBJDIR)/$(PROJECT).ngc: $(RTLFILES) $(PROJECT).xst
89
        $(MKDIR) -p xst/projnav.tmp/
90
        xst -intstyle ise -ifn $(PROJECT).xst -ofn $(OBJDIR)/$(PROJECT).syr
91
        mv $(PROJECT).ngc $(OBJDIR)/$(PROJECT).ngc
92
        mv $(PROJECT).ngr $(OBJDIR)/$(PROJECT).ngr
93
 
94 117 dgisselq
# Translate
95 6 dgisselq
$(OBJDIR)/$(PROJECT).ngd: $(OBJDIR)/$(PROJECT).ngc
96
        ngdbuild -intstyle ise -dd _ngo -nt timestamp \
97
        -uc $(UCFFILE) -p $(PART) $(OBJDIR)/$(PROJECT).ngc $(OBJDIR)/$(PROJECT).ngd
98
 
99 117 dgisselq
# Map
100 18 dgisselq
MAPOPTS := -w -logic_opt on -ol high -xe n -t 1 -xt 0 -r 4      \
101
        -global_opt speed -equivalent_register_removal on -mt 2 -detail \
102 12 dgisselq
        -ir off -ignore_keep_hierarchy -pr off -lc area -power off
103 117 dgisselq
$(OBJDIR)/$(PROJECT)_map.ncd: $(OBJDIR)/$(PROJECT).ngd
104 6 dgisselq
        map -intstyle ise -p $(PART) $(MAPOPTS) \
105
        -o $(OBJDIR)/$(PROJECT)_map.ncd $(OBJDIR)/$(PROJECT).ngd $(OBJDIR)/$(PROJECT).pcf
106
 
107 117 dgisselq
# Place and Route / Generate Programming File
108
$(PROJECT).bit: $(OBJDIR)/$(PROJECT)_map.ncd
109 12 dgisselq
        par -w -intstyle ise -ol std -mt 4 $(OBJDIR)/$(PROJECT)_map.ncd $(OBJDIR)/$(PROJECT).ncd $(OBJDIR)/$(PROJECT).pcf
110 117 dgisselq
        bitgen -f $(PROJECT).ut $(OBJDIR)/$(PROJECT).ncd $(PROJECT).bit $(OBJDIR)/$(PROJECT).pcf
111 6 dgisselq
 
112
timing: $(OBJDIR)/$(PROJECT).ncd  $(OBJDIR)/$(PROJECT).pcf
113 12 dgisselq
        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
114 6 dgisselq
 
115
.PHONY: clean
116
clean:
117
        @-rm -rf $(OBJDIR)
118
        @-rm -f *.ngc *.ngd *.ncd *.pcf *.lso *.ngr *.bgn *.bld *.cmd_log
119
        @-rm -f *.drc *.gise *.map *.mrp *.ngm *.syr *.xwbt *.xrpt
120
        @-rm -f *.pad *.par *.psr *.ptwx *.unroutes *.xpi *.csv *.xml
121
        @-rm -f *.html *.xrpt *.log *.stx *.tcl *.txt *.twr *.twx
122
        @-rm -rf _ngo  _xmsgs xlnx_* ipcore_dir iseconfig templates xst
123
        @echo "All cleaned up"

powered by: WebSVN 2.1.0

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