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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [boards/] [xilinx/] [atlys/] [syn/] [xst/] [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 Synthesis 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
# We don't want the usbhostslave module to be pulled in during synthesis because
40
# we haven't copied the headers to our RTL director
41
#COMMON_VERILOG_MODULES_EXCLUDE+= usbhostslave
42
 
43
 
44
# The root path of the board build
45
BOARD_ROOT ?=$(CUR_DIR)/../../..
46
include $(BOARD_ROOT)/Makefile.inc
47
 
48
RTL_TOP ?=$(DESIGN_NAME)_top
49
 
50
SYN_RUN_DIR=$(BOARD_SYN_DIR)/run
51
 
52
TIMESCALE_FILE=timescale.v
53
SYNDIR_TIMESCALE_FILE=$(SYN_RUN_DIR)/$(TIMESCALE_FILE)
54
$(SYNDIR_TIMESCALE_FILE):
55
        $(Q)echo "" > $@
56
 
57
SYN_VERILOG_DEFINES=synthesis-defines.v
58
SYNDIR_SYN_VERILOG_DEFINES=$(SYN_RUN_DIR)/$(SYN_VERILOG_DEFINES)
59
$(SYNDIR_SYN_VERILOG_DEFINES):
60
        $(Q)echo "\`define SYNTHESIS" > $@
61
        $(Q)echo "\`define XILINX" >> $@
62
        $(Q)echo "" >> $@
63
 
64
GENERATED_DEFINES = $(BOOTROM_VERILOG)
65
GENERATED_DEFINES += $(SYNDIR_TIMESCALE_FILE)
66
GENERATED_DEFINES += $(SYNDIR_SYN_VERILOG_DEFINES)
67
 
68
 
69
FPGA_PART ?=xc6slx45-2-csg324
70
OPT_MODE ?=Speed
71
OPT_LEVEL ?=2
72
 
73
ifeq ($(V), 1)
74
XILINX_FLAGS ?=
75
else
76
XILINX_FLAGS ?=-intstyle silent
77
endif
78
 
79
XILINX_XST_FLAGS ?= -power NO -glob_opt AllClockNets -write_timing_constraints NO -cross_clock_analysis NO -slice_utilization_ratio 100 -bram_utilization_ratio 100 -dsp_utilization_ratio 100 -safe_implementation No -fsm_style lut -ram_extract Yes -ram_style Auto -rom_extract Yes -rom_style Auto -auto_bram_packing NO -mux_extract YES -mux_style Auto -decoder_extract YES -priority_extract YES -shreg_extract YES -shift_extract YES -xor_collapse YES -resource_sharing YES -async_to_sync NO -use_dsp48 auto -iobuf YES -max_fanout 100000 -bufg 32 -register_duplication YES -equivalent_register_removal YES -register_balancing No -slice_packing YES -optimize_primitives NO -use_clock_enable Auto -use_sync_set Auto -use_sync_reset Auto -iob Auto -slice_utilization_ratio_maxmargin 5
80
 
81
XCF_FILE=$(DESIGN_NAME).xcf
82
XST_FILE=$(DESIGN_NAME).xst
83
PRJ_FILE=$(DESIGN_NAME).prj
84
NGC_FILE=$(DESIGN_NAME).ngc
85
NETLIST_FILE=$(DESIGN_NAME).v
86
 
87
 
88
XST_PRJ_FILE_SRC_DECLARE=verilog work
89
 
90
print-config:
91
        $(Q)echo; echo "\t### Synthesis make configuration ###"; echo
92
        $(Q)echo "\tFPGA_PART="$(FPGA_PART)
93
        $(Q)echo "\tOPT_MODE="$(OPT_MODE)
94
        $(Q)echo "\tOTP_LEVEL="$(OPT_LEVEL)
95
        $(Q)echo "\tXILINX_XST_FLAGS="$(XILINX_XST_FLAGS)
96
        $(Q)echo
97
 
98
all: $(NGC_FILE)
99
 
100
# Generate the .xst file
101
# See this page for information on options:
102
# http://www.xilinx.com/itp/xilinx4/data/docs/xst/command_line5.html
103
$(XST_FILE):
104
        $(Q)echo; echo "\t#### Generating XST file ####"; echo
105
        $(Q)echo "# XST Script for ORPSoC Synthesis" > $@
106
        $(Q)echo "# This file is autogenerated - any changes will be overwritten" >> $@
107
        $(Q)echo "# See the Makefile in syn/xst/bin to make changes" >> $@
108
        $(Q)echo "run" >> $@
109
        $(Q)echo "-ifn "$(PRJ_FILE) >> $@
110
        $(Q)echo "-ifmt mixed" >> $@
111
        $(Q)echo "-top "$(RTL_TOP) >> $@
112
        $(Q)echo "-ofmt NGC" >> $@
113
        $(Q)echo "-ofn "$(NGC_FILE) >> $@
114
        $(Q)echo "-p "$(FPGA_PART) >> $@
115
        $(Q)echo "-opt_level "$(OPT_LEVEL) >> $@
116
        $(Q)echo "-opt_mode "$(OPT_MODE) >> $@
117
        $(Q)echo "-uc "$(XCF_FILE) >> $@
118
#       $(Q)echo "elaborate " >> $@
119
#       $(Q)echo -n "-vlgpath \"" >> $@
120
# option missing from XST - wtf?!       $(Q)for vlogpath in $(VERILOG_SRC_PATHS); do \
121
                echo -n $$vlogpath" "; done >> $@
122
#       $(Q)echo "\"" >> $@
123
# Give board then common verilog include paths, hoping xst does a sensible thing
124
# and searches them in order.
125
        $(Q)echo "-vlgincdir { "$(BOARD_RTL_VERILOG_INCLUDE_DIR)" "$(COMMON_RTL_VERILOG_DIR)/include" "$(BOOTROM_SW_DIR) " }" >> $@
126
        $(Q)echo >> $@
127
 
128
# Generate Xilinx project (.prj) file
129
$(PRJ_FILE): $(RTL_VERILOG_SRC)
130
        $(Q)echo; echo "\t#### Generating Xilinx PRJ file ####";
131
#       $(Q)echo "# Autogenerated XST .prj file" > $@
132
#       $(Q)echo "# Any changes will be written over." >> $@
133
        $(Q)for file in $(RTL_VERILOG_SRC); do \
134
                echo $(XST_PRJ_FILE_SRC_DECLARE) $$file >> $@ ; \
135
        done
136
        $(Q)echo >> $@
137
        $(Q)echo
138
 
139
# Constraints file
140
$(XCF_FILE):
141
        $(Q)echo; echo "\t#### Generating Xilinx XCF file ####"; echo
142
        $(Q)echo "# Autogenerated XST .prj file" > $@
143
        $(Q)echo "#" >> $@
144
        $(Q)echo "# Not much here, XST is smart enough to determine clocks through DCMs" >> $@
145
        $(Q)echo "#" >> $@
146
        $(Q)echo "# 100 MHz user clock" >> $@
147
        $(Q)echo "NET \"sys_clk_in\" TNM_NET = \"sys_clk_in_grp\";" >> $@
148
        $(Q)echo "TIMESPEC \"TS_sys_clk_in\" = PERIOD \"sys_clk_in_grp\" 10 ns HIGH 50%;" >> $@
149
        $(Q)echo "# Ignore the reset logic" >> $@
150
        $(Q)echo "NET rst_n_pad_i* TIG;" >> $@
151
        $(Q)echo "# Define the two clock domains as timespecs" >> $@
152
        $(Q)echo "#NET dcm0_clkdv TNM_NET=\"wb_clk\";" >> $@
153
        $(Q)echo "#TIMESPEC \"TS_wb_clk\" = PERIOD \"wb_clk\" 20 ns HIGH 10;" >> $@
154
 
155
# XST command
156
$(NGC_FILE): $(PRJ_FILE) $(XST_FILE) $(XCF_FILE) $(GENERATED_DEFINES)
157
        $(Q)echo; echo "\t#### Running XST ####"; echo;
158
        $(Q)(. $(XILINX_SETTINGS_SCRIPT) ; xst -ifn $(XST_FILE) $(XILINX_FLAGS) $(XST_FLAGS) )
159
        $(Q)echo
160
 
161
netlist: $(NETLIST_FILE)
162
 
163
# Netlist generation command
164
$(NETLIST_FILE): $(NGC_FILE)
165
        $(Q)echo; echo "\t#### Generating verilog netlist ####"; echo;
166
        $(Q)(. $(XILINX_SETTINGS_SCRIPT) ; \
167
        netgen -sim -aka -dir . -ofmt verilog $< -w $@ )
168
 
169
 
170
clean:
171
        $(Q)rm -rf *.* xst
172
 
173
clean-sw:
174
        $(MAKE) -C $(PROJECT_ROOT)/sw/lib distclean
175
 
176
distclean: clean-sw clean
177
 
178
 
179
.PRECIOUS : $(NGC_FILE) $(XST_FILE) $(XCF_FILE)

powered by: WebSVN 2.1.0

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