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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 415 julius
######################################################################
2
####                                                              ####
3
####  ORPSoC Xilinx backend Makefile                              ####
4
####                                                              ####
5
####  Author(s):                                                  ####
6
####      - Julius Baxter, julius@opencores.org                   ####
7
####                                                              ####
8
####                                                              ####
9
######################################################################
10
####                                                              ####
11 542 julius
#### Copyright (C) 2009,2010,2011 Authors and OPENCORES.ORG       ####
12 415 julius
####                                                              ####
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 67 julius
 
36 415 julius
# Name of the directory we're currently in
37
CUR_DIR=$(shell pwd)
38 67 julius
 
39 415 julius
# The root path of the board build
40 542 julius
BOARD_ROOT ?=$(CUR_DIR)/../../..
41
include $(BOARD_ROOT)/Makefile.inc
42 67 julius
 
43 415 julius
#
44
# Options for Xilinx PAR tools
45
#
46
FPGA_PART=xc5vlx50-ff676-1
47 67 julius
XILINX_FLAGS=-intstyle silent
48
XILINX_MAP_FLAGS=-logic_opt off
49 415 julius
XILINX_AREA_TARGET = speed
50
TIMING_REPORT_OPTIONS = -u 1000 -e 1000
51 655 julius
#
52
# Board programming generation settings
53
#
54 415 julius
SPI_FLASH_SIZE_KBYTES ?=2048
55
SPI_BOOTLOADER_SW_OFFSET_HEX ?=1c0000
56 655 julius
PLATFORMFLASH_PART ?= xcf32p
57 67 julius
 
58 415 julius
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 542 julius
NGC_FILE=$(BOARD_SYN_RUN_DIR)/$(DESIGN_NAME).ngc
69 415 julius
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 655 julius
BIT_FILE_FOR_PLATFORMFLASH=$(DESIGN_NAME)_platformflash.bit
77 415 julius
BATCH_FILE=$(DESIGN_NAME).batch
78 655 julius
SPI_MCS_FILE=$(DESIGN_NAME)_spi.mcs
79
PLATFORMFLASH_MCS_FILE=$(DESIGN_NAME)_platformflash.mcs
80 415 julius
 
81 655 julius
 
82 415 julius
$(NGC_FILE):
83 542 julius
        $(Q)$(MAKE) -C $(BOARD_SYN_RUN_DIR) $(DESIGN_NAME).ngc
84 415 julius
 
85
$(NGD_FILE): $(UCF_FILE) $(NGC_FILE)
86 67 julius
        @echo; echo "\t#### Running NGDBuild ####";
87 638 stekern
        $(Q)ngdbuild -p $(FPGA_PART) -sd $(BOARD_BACKEND_BIN_DIR) \
88
        -uc $(UCF_FILE) $(NGC_FILE) $@
89 67 julius
 
90
#This target uses Xilinx tools to perform Mapping
91 415 julius
$(MAPPED_NCD): $(NGD_FILE)
92 67 julius
        @echo; echo "\t#### Mapping ####";
93 638 stekern
        $(Q) export XIL_MAP_NO_DSP_AUTOREG=1 && \
94 67 julius
        export XIL_MAP_ALLOW_ANY_DLL_INPUT=1 && \
95 415 julius
        map -p $(FPGA_PART) -detail -pr b -cm ${XILINX_AREA_TARGET} \
96 638 stekern
        -timing -ol high -w $(XILINX_FLAGS) -o $@ -xe n $(NGD_FILE) $(PCF_FILE)
97 67 julius
 
98
#This target uses Xilinx tools to Place & Route the design
99 415 julius
$(PARRED_NCD): $(MAPPED_NCD)
100 67 julius
        @echo; echo "\t#### PAR'ing ####";
101 638 stekern
        $(Q)par -w -ol high $(XILINX_FLAGS) $< $@ $(PCD_FILE)
102 67 julius
 
103 415 julius
#This target uses Xilinx tools to generate a bitstream for download
104
$(BIT_FILE): $(PARRED_NCD)
105 67 julius
        @echo; echo "\t#### Generating .bit file ####";
106 638 stekern
        $(Q)bitgen -w $(XILINX_FLAGS) -g StartUpClk:JtagClk $< $@
107 67 julius
 
108 415 julius
$(BIT_FILE_FOR_SPI): $(PARRED_NCD)
109
        @echo; echo "\t#### Generating .bit file for SPI load ####";
110 638 stekern
        $(Q)bitgen -w $(XILINX_FLAGS) -g StartUpClk:CClk $< $@
111 478 julius
 
112 655 julius
$(BIT_FILE_FOR_PLATFORMFLASH): $(PARRED_NCD)
113
        @echo; echo "\t#### Generating .bit file for platform flash load ####";
114
        $(Q)bitgen -w $(XILINX_FLAGS) -g StartUpClk:CClk $< $@
115
 
116 478 julius
# Generate MCS with bootloader specified by user, if BOOTLOADER_BIN defined.
117 415 julius
ifeq ($(BOOTLOADER_BIN),)
118 655 julius
$(SPI_MCS_FILE): $(BIT_FILE_FOR_SPI)
119 415 julius
        @echo; echo "\t#### Generating .mcs file for SPI load ####";
120 638 stekern
        $(Q)promgen -spi -p mcs -w -o $@ -s $(SPI_FLASH_SIZE_KBYTES) -u 0 $<
121 415 julius
else
122 655 julius
$(SPI_MCS_FILE): $(BIT_FILE_FOR_SPI)
123 478 julius
        @echo; echo "\t#### Generating .mcs file with bootloader for SPI load ####";
124 638 stekern
        $(Q)promgen -spi -p mcs -w -o $@ -s $(SPI_FLASH_SIZE_KBYTES) -u 0 $< \
125
        -data_file up $(SPI_BOOTLOADER_SW_OFFSET_HEX) $(BOOTLOADER_BIN)
126 415 julius
endif
127
 
128 655 julius
$(PLATFORMFLASH_MCS_FILE): $(BIT_FILE_FOR_PLATFORMFLASH)
129
        @echo; echo "\t#### Generating .mcs file for platform flash load ####";
130
        $(Q)promgen -p mcs -w -o $@ -x $(PLATFORMFLASH_PART) -data_width 16 \
131
        -u 0 $<
132
 
133 67 julius
#this target downloads the bitstream to the target fpga
134 415 julius
download: $(BIT_FILE) $(BATCH_FILE)
135 638 stekern
        $(Q)impact -batch $(BATCH_FILE)
136 67 julius
 
137
#This target uses netgen to make a simulation netlist
138 415 julius
netlist: $(PARRED_NCD)
139 67 julius
        @echo; echo "\t#### Generating netlist ####";
140 638 stekern
        $(Q)netgen -ofmt verilog -sim -dir netlist -pcf $(PCF_FILE) $<
141 67 julius
 
142
#This one uses TRCE to make a timing report
143 415 julius
timingreport: $(PARRED_NCD)
144 67 julius
        @echo; echo "\t#### Generating timing report ####";
145 638 stekern
        $(Q)trce $(TIMING_REPORT_OPTIONS) $<
146 67 julius
 
147
 
148
clean:
149 479 julius
        $(Q)rm -rf *.* xlnx_auto*
150 67 julius
 
151 415 julius
clean-syn:
152 542 julius
        $(Q)$(MAKE) -C $(BOARD_SYN_RUN_DIR) distclean
153 415 julius
 
154 449 julius
distclean: clean-syn clean
155 415 julius
 
156
.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.