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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [boards/] [xilinx/] [atlys/] [backend/] [par/] [bin/] [Makefile] - Blame information for rev 628

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

Line No. Rev Author Line
1 628 stekern
######################################################################
2
####                                                              ####
3
####  ORPSoC Xilinx backend Makefile                              ####
4
####                                                              ####
5
####  Author(s):                                                  ####
6
####      - Julius Baxter, julius@opencores.org                   ####
7
####                                                              ####
8
####                                                              ####
9
######################################################################
10
####                                                              ####
11
#### Copyright (C) 2009,2010,2011 Authors and OPENCORES.ORG       ####
12
####                                                              ####
13
#### This source file may be used and distributed without         ####
14
#### restriction provided that this copyright statement is not    ####
15
#### removed from the file and that any derivative work contains  ####
16
#### the original copyright notice and the associated disclaimer. ####
17
####                                                              ####
18
#### This source file is free software; you can redistribute it   ####
19
#### and/or modify it under the terms of the GNU Lesser General   ####
20
#### Public License as published by the Free Software Foundation; ####
21
#### either version 2.1 of the License, or (at your option) any   ####
22
#### later version.                                               ####
23
####                                                              ####
24
#### This source is distributed in the hope that it will be       ####
25
#### useful, but WITHOUT ANY WARRANTY; without even the implied   ####
26
#### warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ####
27
#### PURPOSE.  See the GNU Lesser General Public License for more ####
28
#### details.                                                     ####
29
####                                                              ####
30
#### You should have received a copy of the GNU Lesser General    ####
31
#### Public License along with this source; if not, download it   ####
32
#### from http://www.opencores.org/lgpl.shtml                     ####
33
####                                                              ####
34
######################################################################
35
 
36
# Name of the directory we're currently in
37
CUR_DIR=$(shell pwd)
38
 
39
# The root path of the board build
40
BOARD_ROOT ?=$(CUR_DIR)/../../..
41
include $(BOARD_ROOT)/Makefile.inc
42
 
43
#
44
# Options for Xilinx PAR tools
45
#
46
FPGA_PART=xc6slx45-2-csg324
47
ifeq ($(V), 1)
48
XILINX_FLAGS ?=
49
else
50
XILINX_FLAGS ?=-intstyle silent
51
endif
52
XILINX_MAP_FLAGS=-logic_opt off
53
XILINX_AREA_TARGET = speed
54
TIMING_REPORT_OPTIONS = -u 1000 -e 1000
55
SPI_FLASH_SIZE_KBYTES ?=16384
56
SPI_BOOTLOADER_SW_OFFSET_HEX ?=1c0000
57
 
58
print-config:
59
        $(Q)echo; echo "\t### Backend make configuration ###"; echo
60
        $(Q)echo "\tFPGA_PART="$(FPGA_PART)
61
        $(Q)echo "\tXILINX_FLAGS="$(XILINX_FLAGS)
62
        $(Q)echo "\tXILINX_MAP_FLAGS="$(XILINX_MAP_FLAGS)
63
        $(Q)echo "\tXILINX_AREA_TARGET="$(XILINX_AREA_TARGET)
64
        $(Q)echo "\tTIMING_REPORT_OPTIONS="$(TIMING_REPORT_OPTIONS)
65
        $(Q)echo "\tSPI_FLASH_SIZE_KBYTES="$(SPI_FLASH_SIZE_KBYTES)
66
        $(Q)echo "\tSPI_BOOTLOADER_SW_OFFSET_HEX="$(SPI_BOOTLOADER_SW_OFFSET_HEX)
67
 
68
NGC_FILE=$(BOARD_SYN_RUN_DIR)/$(DESIGN_NAME).ngc
69
NGD_FILE=$(DESIGN_NAME).ngd
70
UCF_FILE=../bin/$(BOARD_NAME).ucf
71
MAPPED_NCD=$(DESIGN_NAME)_mapped.ncd
72
PARRED_NCD=$(DESIGN_NAME).ncd
73
PCF_FILE=$(DESIGN_NAME).pcf
74
BIT_FILE=$(DESIGN_NAME).bit
75
BIT_FILE_FOR_SPI=$(DESIGN_NAME)_spiboot.bit
76
BATCH_FILE=$(DESIGN_NAME).batch
77
MCS_FILE=$(DESIGN_NAME).mcs
78
 
79
$(NGC_FILE):
80
        $(Q)$(MAKE) -C $(BOARD_SYN_RUN_DIR) $(DESIGN_NAME).ngc
81
 
82
$(NGD_FILE): $(UCF_FILE) $(NGC_FILE)
83
        @echo; echo "\t#### Running NGDBuild ####";
84
        $(Q)( . $(XILINX_SETTINGS_SCRIPT) && \
85
        ngdbuild -p $(FPGA_PART) -sd $(BOARD_BACKEND_BIN_DIR) -uc $(UCF_FILE) \
86
        $(NGC_FILE) $@ )
87
 
88
#This target uses Xilinx tools to perform Mapping
89
$(MAPPED_NCD): $(NGD_FILE)
90
        @echo; echo "\t#### Mapping ####";
91
        $(Q)( . $(XILINX_SETTINGS_SCRIPT) && \
92
        map -p $(FPGA_PART) -detail -pr b \
93
        -timing -ol high -w $(XILINX_FLAGS) -o $@ -xe n $(NGD_FILE) $(PCF_FILE))
94
 
95
#This target uses Xilinx tools to Place & Route the design
96
$(PARRED_NCD): $(MAPPED_NCD)
97
        @echo; echo "\t#### PAR'ing ####";
98
        $(Q)( . $(XILINX_SETTINGS_SCRIPT) && \
99
        par -w -ol high -xe n $(XILINX_FLAGS) $< $@ $(PCD_FILE) )
100
 
101
#This target uses Xilinx tools to generate a bitstream for download
102
$(BIT_FILE): $(PARRED_NCD)
103
        @echo; echo "\t#### Generating .bit file ####";
104
        $(Q)( . $(XILINX_SETTINGS_SCRIPT) && \
105
        bitgen -w $(XILINX_FLAGS) -g StartUpClk:JtagClk $< $@ )
106
 
107
$(BIT_FILE_FOR_SPI): $(PARRED_NCD)
108
        @echo; echo "\t#### Generating .bit file for SPI load ####";
109
        $(Q)( . $(XILINX_SETTINGS_SCRIPT) && \
110
        bitgen -w $(XILINX_FLAGS) -g StartUpClk:CClk $< $@ )
111
 
112
# Generate MCS with bootloader specified by user, if BOOTLOADER_BIN defined.
113
ifeq ($(BOOTLOADER_BIN),)
114
$(MCS_FILE): $(BIT_FILE_FOR_SPI)
115
        @echo; echo "\t#### Generating .mcs file for SPI load ####";
116
        $(Q)( . $(XILINX_SETTINGS_SCRIPT) && \
117
        promgen -spi -p mcs -w -o $@ -s $(SPI_FLASH_SIZE_KBYTES) -u 0 $< )
118
else
119
$(MCS_FILE): $(BIT_FILE_FOR_SPI)
120
        @echo; echo "\t#### Generating .mcs file with bootloader for SPI load ####";
121
        $(Q)( . $(XILINX_SETTINGS_SCRIPT) && \
122
        promgen -spi -p mcs -w -o $@ -s $(SPI_FLASH_SIZE_KBYTES) -u 0 $< \
123
        -data_file up $(SPI_BOOTLOADER_SW_OFFSET_HEX) $(BOOTLOADER_BIN) \
124
         )
125
endif
126
 
127
#this target downloads the bitstream to the target fpga
128
download: $(BIT_FILE) $(BATCH_FILE)
129
        $(Q)( . ${XILINX_PATH}/settings32.sh && \
130
        impact -batch $(BATCH_FILE) )
131
 
132
#This target uses netgen to make a simulation netlist
133
netlist: $(PARRED_NCD)
134
        @echo; echo "\t#### Generating netlist ####";
135
        $(Q)(. $(XILINX_SETTINGS_SCRIPT) && \
136
        netgen -ofmt verilog -sim -dir netlist -pcf $(PCF_FILE) $<)
137
 
138
#This one uses TRCE to make a timing report
139
timingreport: $(PARRED_NCD)
140
        @echo; echo "\t#### Generating timing report ####";
141
        $(Q)(. $(XILINX_SETTINGS_SCRIPT) && \
142
        trce $(TIMING_REPORT_OPTIONS) $< )
143
 
144
 
145
clean:
146
        $(Q)rm -rf *.* xlnx_auto*
147
 
148
clean-syn:
149
        $(Q)$(MAKE) -C $(BOARD_SYN_RUN_DIR) distclean
150
 
151
distclean: clean-syn clean
152
 
153
.PRECIOUS : $(PARRED_NCD) $(MAPPED_NCD) $(NGC_FILE) $(NGD_FILE) $(BIT_FILE) $(BIT_FILE_FOR_SPI)

powered by: WebSVN 2.1.0

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