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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [orpsocv2/] [boards/] [actel/] [ordb1a3pe1500/] [backend/] [par/] [bin/] [Makefile] - Blame information for rev 438

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

Line No. Rev Author Line
1 408 julius
# Script to do compilation in Actel's tools then PAR.
2
# Need windows Libero for bitgen
3
#
4
# Is easy to target to other versions of ORSoC dev board:
5
#       for old A3P1000, 25MHz board:
6
#$ make FPGA_FAMILY=ProASIC3 FPGA_PART=A3P1000 all
7
#
8
#
9
# Can also set following environment variables to have the correspondingly
10
# affect the placer:
11
# PLACE_INCREMENTAL=on
12
# ROUTE_INCREMENTAL=on
13
# PLACER_HIGH_EFFORT=on
14
#
15
# So command above would look like:
16
#$ make FPGA_FAMILY=ProASIC3 FPGA_PART=A3P1000 all PLACE_INCREMENTAL=on ROUTE_INCREMENTAL=on PLACER_HIGH_EFFORT=on
17
#
18
 
19
# Name of the directory we're currently in
20
CUR_DIR=$(shell pwd)
21
 
22
VENDOR=actel
23
VENDOR_TCL_SHELL=acttclsh
24
 
25
PROJECT_NAME=orpsoc
26
PROJECT_TOP_NAME=$(PROJECT_NAME)_top
27
PROJ_ADB_FILE_NAME=$(PROJECT_NAME).adb
28
PROJ_ADB_FILE=$(PROJ_ADB_FILE_NAME)
29
 
30
# The root path of the whole project
31
BOARD_DIR ?=$(CUR_DIR)/../../..
32
PROJECT_ROOT=$(BOARD_DIR)/../../..
33
 
34
BOARD_RTL_PATH=$(BOARD_DIR)/rtl
35
BOARD_RTL_VERILOG_PATH=$(BOARD_RTL_PATH)/verilog
36
BOARD_RTL_VERILOG_INCLUDES=$(BOARD_RTL_VERILOG_PATH)/include
37
PROJECT_VERILOG_DEFINES=$(BOARD_RTL_VERILOG_INCLUDES)/$(PROJECT_NAME)-defines.v
38
 
39
SYN_PATH=$(BOARD_DIR)/syn/synplify
40
 
41
SW_PATH=$(PROJECT_ROOT)/sw
42
 
43
PAR_PATH=$(BOARD_DIR)/backend/par
44
PAR_RUN_PATH=$(PAR_PATH)/run
45
PAR_OUT_PATH=$(PAR_PATH)/out
46
 
47
# Required EDIF file names
48
EDIF_NAME=$(PROJECT_TOP_NAME).edn
49
PROJ_EDF_FILE=$(SYN_PATH)/out/$(EDIF_NAME)
50
 
51
# TCL script names
52
TCL_SCRIPT_START=start.tcl
53
TCL_SCRIPT_COMPILE=compile.tcl
54
TCL_SCRIPT_PAR=par.tcl
55
TCL_SCRIPT_CREATE_COMPILE_PAR=create-compile-par.tcl
56
TCL_SCRIPT_REPORT=report.tcl
57
TCL_SCRIPT_BITGEN=bitgen.tcl
58
# Generate these every time
59
.PHONY: $(TCL_SCRIPT_START) $(TCL_SCRIPT_COMPILE) $(TCL_SCRIPT_PAR) $(TCL_SCRIPT_BITGEN)
60
 
61
 
62
# TCL script generation parameters
63
# Potentially we want more here!
64
# All are assigned with ?= allowing them to be redfined on the command line
65
 
66
FPGA_FAMILY ?=ProASIC3E
67
FPGA_PART ?=A3PE1500
68
FPGA_PACKAGE ?=\"208 PQFP\"
69
FPGA_VOLTAGE ?=1.5
70
#FPGA_SPEED_GRADE ?=-2
71
FPGA_SPEED_GRADE ?=STD
72
FPGA_TEMP_RANGE=COM # either COM or IND
73
FPGA_VOLT_RANGE=COM # either COM or IND
74
COMP_DIR ?=parcomp
75
 
76
# Tool effort settings
77
# Set to 'on' to enable them
78
PLACE_INCREMENTAL ?= off
79
ROUTE_INCREMENTAL ?= off
80
PLACER_HIGH_EFFORT ?= off
81
 
82
PDC_FILE ?=$(PROJECT_NAME).pdc
83
SDC_FILE ?=$(PROJECT_NAME).sdc
84
 
85
 
86
DEFINES_FILE_CUTOFF=$(shell grep -n "end of included module defines" $(PROJECT_VERILOG_DEFINES) | cut -d ':' -f 1)
87
DESIGN_DEFINES=$(shell cat $(PROJECT_VERILOG_DEFINES) | sed s://.*::g | sed s:\`:\#:g | sed 's:^[ ]*::' | awk '{print};/^\#define/{printf "_%s=%s\n",$$2,$$2}' | grep -v PERIOD | cpp -P | sed s:^_::g | sed s:=$$::g )
88
# Rule to look at what defines are being extracted from main file
89
print-defines:
90
        @echo; echo "\t### Design defines ###"; echo
91
        @echo "\tParsing "$(PROJECT_VERILOG_DEFINES)" and exporting:"
92
        @echo $(DESIGN_DEFINES)
93
 
94
# Rule to print out current config of current session
95
print-config:
96
        @echo; echo "\t### PAR make configuration ###"; echo
97
        @echo "\tFPGA_FAMILY="$(FPGA_FAMILY)
98
        @echo "\tFPGA_PART="$(FPGA_PART)
99
        @echo "\tFPGA_PACKAGE="$(FPGA_PACKAGE)
100
        @echo "\tFPGA_VOLTAGE="$(FPGA_VOLTAGE)
101
        @echo "\tFPGA_SPEED_GRADE="$(FPGA_SPEED_GRADE)
102
        @echo "\tFPGA_TEMP_RANGE="$(FPGA_TEMP_RANGE)
103
        @echo "\tFPGA_VOLT_RANGE="$(FPGA_VOLT_RANGE)
104
        @echo "\tPLACE_INCREMENTAL="$(PLACE_INCREMENTAL)
105
        @echo "\tROUTE_INCREMENTAL="$(ROUTE_INCREMENTAL)
106
        @echo "\tPLACER_HIGH_EFFORT="$(PLACER_HIGH_EFFORT)
107
        @echo
108
        @echo "\tBackend pinout script:"
109
        @echo "\tBOARD_CONFIG="$(BOARD_CONFIG)
110
 
111
 
112
# Set V=1 when calling make to enable verbose output
113
# mainly for debugging purposes.
114
ifeq ($(V), 1)
115
Q=
116
else
117
Q ?=@
118
endif
119
 
120
TIME_CMD=time -p
121
 
122
# Rule for everything from, potentially, synthesis up to PAR
123
all: print-config print-defines create-compile-par
124
 
125
# Not possible to do programming file generation under Linux
126
# not with the free  tools
127
bitgen: $(TCL_SCRIPT_BITGEN)
128
        $(TIME_CMD) $(VENDOR_TCL_SHELL) $<
129
 
130
# Leave this with no pre-reqs so we can call it seperately
131
create-compile-par: sdc-file pdc-file $(PROJ_EDF_FILE) $(TCL_SCRIPT_CREATE_COMPILE_PAR)
132
        $(TIME_CMD) $(VENDOR_TCL_SHELL) $(TCL_SCRIPT_CREATE_COMPILE_PAR)
133
 
134
par: $(TCL_SCRIPT_PAR)
135
        $(TIME_CMD) $(VENDOR_TCL_SHELL) $<
136
 
137
compile: $(TCL_SCRIPT_COMPILE)
138
        $(TIME_CMD) $(VENDOR_TCL_SHELL) $<
139
 
140
create: print-config print-defines sdc-file pdc-file $(PROJ_ADB_FILE)
141
 
142
report: $(TCL_SCRIPT_REPORT)
143
        $(TIME_CMD) $(VENDOR_TCL_SHELL) $<
144
 
145
$(PROJ_ADB_FILE): $(PROJ_EDF_FILE) $(TCL_SCRIPT_START)
146
        $(TIME_CMD) $(VENDOR_TCL_SHELL) $(TCL_SCRIPT_START)
147
 
148
$(PROJ_EDF_FILE):
149
        $(MAKE) -C $(SYN_PATH)/run all
150
 
151
create-compile: create compile
152
 
153
clean:
154
        rm -rf *.rpt *.log *~ *.tcl *.lok *.tmp *.dtf $(SDC_FILE) $(PDC_FILE) *.adb
155
 
156
clean-syn:
157
        $(MAKE) -C $(SYN_PATH)/run clean-all
158
 
159
clean-sw:
160
        $(Q) echo; echo "\t### Cleaning simulation sw directories ###"; echo;
161
        $(MAKE) -C $(SW_PATH)/lib clean-all
162
 
163
 
164
clean-all: clean-sw clean-syn clean
165
 
166
STEP_NAME=$(shell echo $(TCL_FILE) | cut -d '.' -f 1)
167
 
168
# Rule to create the different steps of compilation with the Actel Designer
169
# tool.
170
# We need to create dollar signs ($) to dereference variables in the TCL
171
# scripts, but we also don't want make or bash thinking the variables we write
172
# with $s on the front are for them.. so we separate them from the actual
173
# variable name with ending and beginning the strings again, eg: $$""varname ..
174
 
175
 
176
# Just create the project
177
$(TCL_SCRIPT_START):
178
        TCL_FILE=$@ $(MAKE) tcl-common
179
        $(Q)echo "run_designer \"Starting new project\" \"" >> $@
180
        TCL_FILE=$@ $(MAKE) dump-actel-create-project-tcl
181
        $(Q)echo "\"">> $@
182
        $(Q)echo >> $@
183
 
184
# Open and compile the project's netlist
185
$(TCL_SCRIPT_COMPILE):
186
        TCL_FILE=$@ $(MAKE) tcl-common
187
        $(Q)echo "run_designer \"Compiling\" \" " >> $@
188
        $(Q)echo "  open_design $$""proj_name.adb " >> $(TCL_FILE)
189
        TCL_FILE=$@ $(MAKE) dump-actel-compile-project-tcl
190
        $(Q)echo "\"">> $@
191
 
192
# Import SDC and do place and route
193
$(TCL_SCRIPT_PAR):
194
        TCL_FILE=$@ $(MAKE) tcl-common
195
        $(Q)echo "run_designer \"PAR\" \" " >> $@
196
        $(Q)echo "  open_design $$""proj_name.adb " >> $@
197
        TCL_FILE=$@ $(MAKE) dump-actel-par-project-tcl
198
        $(Q)echo "\"">> $@
199
 
200
# Generate programming file
201
$(TCL_SCRIPT_BITGEN):
202
        TCL_FILE=$@ $(MAKE) tcl-common
203
        $(Q)echo "run_designer \"exporting PDB file\" \" " >> $@
204
        $(Q)echo "  open_design $$""proj_name.adb " >> $@
205
        TCL_FILE=$@ $(MAKE) dump-actel-bitgen-project-tcl
206
        $(Q)echo "\"">> $@
207
 
208
# Generate reports
209
$(TCL_SCRIPT_REPORT):
210
        TCL_FILE=$@ $(MAKE) tcl-common
211
        $(Q)echo "run_designer \"Generating timing reports\" \" " >> $@
212
        $(Q)echo "  open_design $$""proj_name.adb " >> $@
213
        TCL_FILE=$@ $(MAKE) dump-actel-report-project-tcl
214
        $(Q)echo "\"">> $@
215
 
216
# Do project creation, compile and PAR in one single run of the tool
217
$(TCL_SCRIPT_CREATE_COMPILE_PAR):
218
        TCL_FILE=$@ $(MAKE) tcl-common
219
        $(Q)echo "run_designer \"Create compile and PAR design project\" \" " >> $@
220
        TCL_FILE=$@ $(MAKE) dump-actel-create-project-tcl
221
        TCL_FILE=$@ $(MAKE) dump-actel-compile-project-tcl
222
        TCL_FILE=$@ $(MAKE) dump-actel-par-project-tcl
223
        $(Q)echo "\"">> $@
224
        $(Q)echo >> $@
225
 
226
# The different texts that we dump out for the different sets of command files
227
 
228
# This is the common header, setting variables in the TCL file
229
tcl-common:
230
        $(Q)rm -f $(TCL_FILE);
231
        $(Q)echo; echo "\tGenerating "$(TCL_FILE); echo
232
        $(Q)echo "set compile_directory     "$(COMP_DIR) >> $(TCL_FILE)
233
        $(Q)echo "set proj_name             "$(PROJECT_NAME) >> $(TCL_FILE)
234
        $(Q)echo "set top_name              "$(PROJECT_TOP_NAME) >> $(TCL_FILE)
235
        $(Q)echo "set family                "$(FPGA_FAMILY) >> $(TCL_FILE)
236
        $(Q)echo "set part                  "$(FPGA_PART) >> $(TCL_FILE)
237
        $(Q)echo "set package               "$(FPGA_PACKAGE) >> $(TCL_FILE)
238
        $(Q)echo "set pdc_filename          "$(PDC_FILE) >> $(TCL_FILE)
239
        $(Q)echo "set sdc_filename          "$(SDC_FILE) >> $(TCL_FILE)
240
        $(Q)echo >> $(TCL_FILE)
241
        $(Q)echo "  proc run_designer {message script} {" >> $(TCL_FILE)
242
        $(Q)echo "    puts \"Designer: $$""message\"" >> $(TCL_FILE)
243
        $(Q)echo "    set f [open designer.tcl w]" >> $(TCL_FILE)
244
        $(Q)echo "    puts $$""f $$""script" >> $(TCL_FILE)
245
        $(Q)echo "    close $$""f " >> $(TCL_FILE)
246
        $(Q)echo "    puts [exec designer SCRIPT:designer.tcl LOGFILE:"$(STEP_NAME)".log]" >> $(TCL_FILE)
247
        $(Q)echo "}" >> $(TCL_FILE)
248
        $(Q)echo >> $(TCL_FILE)
249
 
250
# TCL commands to create and setup a new project in Designer
251
dump-actel-create-project-tcl:
252
        $(Q)echo "  new_design " \\ >> $(TCL_FILE)
253
        $(Q)echo "    -name $$""proj_name " \\ >> $(TCL_FILE)
254
        $(Q)echo "    -family $$""family " \\ >> $(TCL_FILE)
255
        $(Q)echo "    -path ." >> $(TCL_FILE)
256
        $(Q)echo "  set_device " \\ >> $(TCL_FILE)
257
        $(Q)echo "    -die $$""part " \\ >> $(TCL_FILE)
258
        $(Q)echo "    -package \\\"$$""package\\\" " \\ >> $(TCL_FILE)
259
        $(Q)echo "    -speed "$(FPGA_SPEED_GRADE)" " \\ >> $(TCL_FILE)
260
        $(Q)echo "    -voltage "$(FPGA_VOLTAGE)" " \\ >> $(TCL_FILE)
261
        $(Q)echo "    -iostd LVTTL " \\ >> $(TCL_FILE)
262
        $(Q)echo "    -jtag yes " \\ >> $(TCL_FILE)
263
        $(Q)echo "    -probe yes " \\ >> $(TCL_FILE)
264
        $(Q)echo "    -trst yes " \\ >> $(TCL_FILE)
265
        $(Q)echo "    -temprange "$(FPGA_TEMP_RANGE)" "  \\ >> $(TCL_FILE)
266
        $(Q)echo "    -voltrange "$(FPGA_VOLT_RANGE)" "  >> $(TCL_FILE)
267
        $(Q)echo "  import_source " \\ >> $(TCL_FILE)
268
        $(Q)echo "    -format edif " \\ >> $(TCL_FILE)
269
        $(Q)echo "    -edif_flavor GENERIC "$(PROJ_EDF_FILE)" "\\ >> $(TCL_FILE)
270
        $(Q)echo "    -format pdc " \\ >> $(TCL_FILE)
271
        $(Q)echo "    -abort_on_error yes $$""pdc_filename " \\ >> $(TCL_FILE)
272
        $(Q)echo "    -merge_physical yes " \\ >> $(TCL_FILE)
273
        $(Q)echo "    -merge_timing yes " >> $(TCL_FILE)
274
        $(Q)echo "  save_design $$""proj_name.adb " >> $(TCL_FILE)
275
 
276
# TCL commands to compile a project in Designer
277
dump-actel-compile-project-tcl:
278
        $(Q)echo "  compile " \\ >> $(TCL_FILE)
279
        $(Q)echo "    -pdc_abort_on_error on " \\ >> $(TCL_FILE)
280
        $(Q)echo "    -pdc_eco_display_unmatched_objects off " \\ >> $(TCL_FILE)
281
        $(Q)echo "    -pdc_eco_max_warnings 10000 " \\ >> $(TCL_FILE)
282
        $(Q)echo "    -demote_globals off " \\ >> $(TCL_FILE)
283
        $(Q)echo "    -demote_globals_max_fanout 12 " \\ >> $(TCL_FILE)
284
        $(Q)echo "    -promote_globals off " \\ >> $(TCL_FILE)
285
        $(Q)echo "    -promote_globals_min_fanout 200 " \\ >> $(TCL_FILE)
286
        $(Q)echo "    -promote_globals_max_limit 0 " \\ >> $(TCL_FILE)
287
        $(Q)echo "    -localclock_max_shared_instances 12 " \\ >> $(TCL_FILE)
288
        $(Q)echo "    -localclock_buffer_tree_max_fanout 12 " \\ >> $(TCL_FILE)
289
        $(Q)echo "    -combine_register off " \\ >> $(TCL_FILE)
290
        $(Q)echo "    -delete_buffer_tree off " \\ >> $(TCL_FILE)
291
        $(Q)echo "    -delete_buffer_tree_max_fanout 12 " \\ >> $(TCL_FILE)
292
        $(Q)echo "    -report_high_fanout_nets_limit 10 " >> $(TCL_FILE)
293
        $(Q)echo "  save_design $$""proj_name.adb " >> $(TCL_FILE)
294
 
295
# TCL commands to ipmort SDC and do PAR on project
296
dump-actel-par-project-tcl:
297
        $(Q)echo "  import_aux " \\ >> $(TCL_FILE)
298
        $(Q)echo "    -format sdc $$""sdc_filename     " >> $(TCL_FILE)
299
        $(Q)echo "  layout " \\ >> $(TCL_FILE)
300
        $(Q)echo "    -timing_driven " \\ >> $(TCL_FILE)
301
        $(Q)echo "    -run_placer on " \\ >> $(TCL_FILE)
302
        $(Q)echo "    -place_incremental "$(PLACE_INCREMENTAL) \\ >> $(TCL_FILE)
303
        $(Q)echo "    -run_router on " \\ >> $(TCL_FILE)
304
        $(Q)echo "    -route_incremental "$(ROUTE_INCREMENTAL) \\ >> $(TCL_FILE)
305
        $(Q)echo "    -placer_high_effort "$(PLACER_HIGH_EFFORT) >> $(TCL_FILE)
306
        $(Q)echo "  save_design $$""proj_name.adb " >> $(TCL_FILE)
307
 
308
# TCL commands to generate programming file (PDB) from project
309
dump-actel-bitgen-project-tcl:
310
        $(Q)echo "  export " \\ >> $(TCL_FILE)
311
        $(Q)echo "    -format pdb " \\ >> $(TCL_FILE)
312
        $(Q)echo "    -feature prog_fpga " \\ >> $(TCL_FILE)
313
        $(Q)echo "    $$""proj_name.pdb " >> $(TCL_FILE)
314
        $(Q)echo "  save_design $$""proj_name.adb " >> $(TCL_FILE)
315
 
316
# TCL commands to generate timing reports of project
317
dump-actel-report-project-tcl:
318
        $(Q)echo "  report " \\ >> $(TCL_FILE)
319
        $(Q)echo "  -type timer " \\ >> $(TCL_FILE)
320
        $(Q)echo "  -analysis max " \\ >> $(TCL_FILE)
321
        $(Q)echo "  -print_summary yes " \\ >> $(TCL_FILE)
322
        $(Q)echo "  -use_slack_threshold no " \\ >> $(TCL_FILE)
323
        $(Q)echo "  -print_paths yes " \\ >> $(TCL_FILE)
324
        $(Q)echo "  -max_paths 5 " \\ >> $(TCL_FILE)
325
        $(Q)echo "  -max_expanded_paths 1 " \\ >> $(TCL_FILE)
326
        $(Q)echo "  -include_user_sets no " \\ >> $(TCL_FILE)
327
        $(Q)echo "  -include_pin_to_pin yes " \\ >> $(TCL_FILE)
328
        $(Q)echo "  -select_clock_domains no " \\ >> $(TCL_FILE)
329
        $(Q)echo "   "$(PROJECT_NAME)"-timing.rpt " >> $(TCL_FILE)
330
        $(Q)echo "  report " \\ >> $(TCL_FILE)
331
        $(Q)echo "  -type timing_violations " \\ >> $(TCL_FILE)
332
        $(Q)echo "  -analysis max " \\ >> $(TCL_FILE)
333
        $(Q)echo "  -use_slack_threshold no " \\ >> $(TCL_FILE)
334
        $(Q)echo "  -limit_max_paths yes " \\ >> $(TCL_FILE)
335
        $(Q)echo "  -max_paths 100 " \\ >> $(TCL_FILE)
336
        $(Q)echo "  -max_expanded_paths 0 " \\ >> $(TCL_FILE)
337
        $(Q)echo "   "$(PROJECT_NAME)"-timviol.rpt " >> $(TCL_FILE)
338
        $(Q)echo "  report " \\ >> $(TCL_FILE)
339
        $(Q)echo "  -type timing_violations " \\ >> $(TCL_FILE)
340
        $(Q)echo "  -analysis min " \\ >> $(TCL_FILE)
341
        $(Q)echo "  -use_slack_threshold no " \\ >> $(TCL_FILE)
342
        $(Q)echo "  -limit_max_paths yes " \\ >> $(TCL_FILE)
343
        $(Q)echo "  -max_paths 100 " \\ >> $(TCL_FILE)
344
        $(Q)echo "  -max_expanded_paths 0 " \\ >> $(TCL_FILE)
345
        $(Q)echo "  "$(PROJECT_NAME)"-timmindly.rpt " >> $(TCL_FILE)
346
 
347
 
348
 
349
sdc-file:
350
        $(Q)for define in $(DESIGN_DEFINES); do export $$define=1; done; \
351
        $(MAKE) $(SDC_FILE)
352
 
353
 
354
#
355
# Constraint script generation
356
#
357
 
358
ETH_CLK_PERIOD_NS ?= 8.0000 # 125 MHz
359
ETH_CLK_PERIOD_HALF_NS ?= 4.0000 # 125 MHz
360
SDRAM_OUT_DELAY ?=1.5
361
SDRAM_IN_DELAY ?=0.8
362
# Whittle away at the defines until we have only the Wishbone frequency (MHz) integer
363
WB_FREQ_MHZ ?=$(shell echo $(DESIGN_DEFINES) | tr " " "\n" | grep BOARD | grep _WB | tr "_" "\n" | grep WB | cut -d 'B' -f 2)
364
XTAL_FREQ_MHZ ?=$(shell echo $(DESIGN_DEFINES) | tr " " "\n" | grep BOARD | grep _XTAL | tr "_" "\n" | grep XTAL | cut -d 'L' -f 2)
365
 
366
ifeq ($(XTAL_FREQ_MHZ), 64)
367
SYS_CLK_PERIOD_NS ?= 15.625 # 64 MHz
368
# These are for board clock with 64 MHz XTAL
369
ifeq ($(WB_FREQ_MHZ), 16)
370
WB_SDC_GENCLK_DIVIDE_BY ?=144
371
WB_SDC_GENCLK_MULTIPLY_BY ?=36
372
endif
373
ifeq ($(WB_FREQ_MHZ), 18)
374
WB_SDC_GENCLK_DIVIDE_BY ?=128
375
WB_SDC_GENCLK_MULTIPLY_BY ?=36
376
endif
377
ifeq ($(WB_FREQ_MHZ), 20)
378
WB_SDC_GENCLK_DIVIDE_BY ?=144
379
WB_SDC_GENCLK_MULTIPLY_BY ?=45
380
endif
381
endif # ifeq ($(XTAL_FREQ_MHZ), 64)
382
 
383
ifeq ($(XTAL_FREQ_MHZ), 25)
384
SYS_CLK_PERIOD_NS ?= 40.00 # 25 MHz
385
# These are for board with 25 MHz XTAL
386
ifeq ($(WB_FREQ_MHZ), 20)
387
WB_SDC_GENCLK_DIVIDE_BY ?=125
388
WB_SDC_GENCLK_MULTIPLY_BY ?=100
389
endif
390
ifeq ($(WB_FREQ_MHZ), 24)
391
WB_SDC_GENCLK_DIVIDE_BY ?=125
392
WB_SDC_GENCLK_MULTIPLY_BY ?=120
393
endif
394
endif # ifeq ($(XTAL_FREQ_MHZ), 25)
395
 
396
print-freq:
397
        $(Q)echo "XTAL Freq: "$(XTAL_FREQ_MHZ)"MHz"
398
        $(Q)echo "sys_clk_pad_i period: "$(SYS_CLK_PERIOD_NS)"ns"
399
        $(Q)echo "Multiply XTAL by "$(WB_SDC_GENCLK_MULTIPLY_BY)" and divide by "$(WB_SDC_GENCLK_DIVIDE_BY)" to get WB frequency"
400
        $(Q)echo "WB Freq: "$(WB_FREQ_MHZ)"MHz"
401
 
402
 
403
#
404
# Timing (SDC)
405
#
406
$(SDC_FILE):
407
        $(Q)echo; echo "\t### Generating SDC file ###"; echo
408
        $(Q)rm -f $@
409
        $(Q) echo "set sdc_version 1.7" >> $@
410
        $(Q) echo "########  Clock Constraints  ########" >> $@
411
        $(Q) echo "create_clock  -name { sys_clk_pad_i } -period "$(SYS_CLK_PERIOD_NS)"  { sys_clk_pad_i  } " >> $@
412
        $(Q)if [ ! -z $$JTAG_DEBUG ]; then \
413
                echo "create_clock  -name { tck_pad_i } -period 50.000  { tck_pad_i  } " >> $@; \
414
        fi
415
        $(Q)if [ ! -z $$ETH_CLK ]; then \
416
                echo "create_clock  -name { eth_clk_pad_i } -period "$(ETH_CLK_PERIOD_NS)" { eth_clk_pad_i  } " >> $@; \
417
        fi
418
        $(Q)if [ ! -z $$SMII0 ]; then \
419
                echo "create_clock  -name { smii0/smii_if0/mtx_clk_gen:Q } -period 40.000   { smii0/smii_if0/mtx_clk_gen:Q  } " >> $@; \
420
                echo "create_clock  -name { smii0/smii_if0/mrx_clk_gen:Q } -period 40.000  { smii0/smii_if0/mrx_clk_gen:Q  } " >> $@; \
421
                echo "set_output_delay  -max 3.000 -clock { eth_clk_pad_i }  [get_ports { eth0_smii_sync_pad_o eth0_smii_tx_pad_o }] " >> $@; \
422
                echo "set_output_delay  -min -1.500 -clock { eth_clk_pad_i }  [get_ports { eth0_smii_sync_pad_o eth0_smii_tx_pad_o }] " >> $@; \
423
        fi
424
        $(Q) echo "########  Specify Asynchronous paths between domains  ########" >> $@
425
        $(Q) echo "set_false_path -from [ get_clocks { clkgen0/pll0/Core:GLA }] -to [ get_clocks { clkgen0/pll0/Core:GLB }]" >> $@
426
        $(Q) echo "set_false_path -from [ get_clocks { clkgen0/pll0/Core:GLB }] -to [ get_clocks { clkgen0/pll0/Core:GLA }]" >> $@
427
        $(Q) echo "########  Input Delay Constraints  ########" >> $@
428
        $(Q) echo "set_input_delay  -max "$(SDRAM_IN_DELAY)" -clock { clkgen0/pll0/Core:GLA } { sdram_dq_pad_io[*] }" >> $@
429
        $(Q) echo "########  Output Delay Constraints  ########" >> $@
430
        $(Q) echo "set_output_delay  -max  "$(SDRAM_OUT_DELAY)"  -clock { clkgen0/pll0/Core:GLA } { sdram_dq_pad_io[*] }" >> $@
431
        $(Q) echo "set_output_delay  -max  "$(SDRAM_OUT_DELAY)"  -clock { clkgen0/pll0/Core:GLA } { sdram_ras_pad_o }" >> $@
432
        $(Q) echo "set_output_delay  -max  "$(SDRAM_OUT_DELAY)"  -clock { clkgen0/pll0/Core:GLA } { sdram_cas_pad_o }" >> $@
433
        $(Q) echo "set_output_delay  -max  "$(SDRAM_OUT_DELAY)"  -clock { clkgen0/pll0/Core:GLA } { sdram_we_pad_o }" >> $@
434
        $(Q) echo "set_output_delay  -max  "$(SDRAM_OUT_DELAY)"  -clock { clkgen0/pll0/Core:GLA } { sdram_a_pad_o[*] }" >> $@
435
        $(Q) echo "set_output_delay  -max  "$(SDRAM_OUT_DELAY)"  -clock { clkgen0/pll0/Core:GLA } { sdram_ba_pad_o[*] }" >> $@
436
        $(Q) echo "set_output_delay  -max  "$(SDRAM_OUT_DELAY)"  -clock { clkgen0/pll0/Core:GLA } { sdram_cke_pad_o }" >> $@
437
        $(Q) echo "set_output_delay  -max  "$(SDRAM_OUT_DELAY)"  -clock { clkgen0/pll0/Core:GLA } { sdram_dqm_pad_o[*] }" >> $@
438
        $(Q)echo >> $@
439
 
440
#       $(Q) echo "########  Generated Clock Constraints  ########" >> $@
441
#       $(Q) echo "create_generated_clock  -name { clkgen0/pll0/Core:GLA } -divide_by 36  -multiply_by 36  -source { clkgen0/pll0/Core:CLKA } { clkgen0/pll0/Core:GLA  } " >> $@
442
#       $(Q) echo "create_generated_clock  -name { clkgen0/pll0/Core:GLB } -divide_by "$(WB_SDC_GENCLK_DIVIDE_BY)"  -multiply_by "$(WB_SDC_GENCLK_MULTIPLY_BY)"  -source { clkgen0/pll0/Core:CLKA } { clkgen0/pll0/Core:GLB  } " >> $@
443
 
444
#
445
# Physical design constraints
446
#
447
 
448
# Pin settings, based on CPU board
449
PDC_MKPINS_PATH ?=../bin
450
PDC_MKPINASSIGNS_PATH ?=../bin
451
 
452
# Default board config
453
BOARD_CONFIG ?= orsoccpuexpio.mkpinassigns
454
 
455
include $(PDC_MKPINASSIGNS_PATH)/$(BOARD_CONFIG)
456
 
457
# PDC file generation - depending on Verilog defines file, we generate right PDC
458
 
459
pdc-file:
460
        $(Q)for define in $(DESIGN_DEFINES); do export $$define=1; done; \
461
        $(MAKE) $(PDC_FILE)
462
 
463
# To do - somehow figure out the top-level signals in the design, and then
464
# auto-generate this rule....?!
465
$(PDC_FILE): $(PROJECT_VERILOG_DEFINES)
466
        $(Q)echo; echo "\t### Generating PDC file ###"; echo
467
        $(Q)touch $@
468
        $(Q)echo "#" >> $@
469
        $(Q)echo "# IO banks setting" >> $@
470
        $(Q)echo "#" >> $@
471
        $(Q)echo "" >> $@
472
        $(Q)if [ \"$(FPGA_FAMILY)\" = \"ProASIC3E\" ]; then \
473
                echo "set_iobank Bank7 -vcci 3.30 -fixed no" >> $@; \
474
                echo "set_iobank Bank6 -vcci 3.30 -fixed no" >> $@; \
475
                echo "set_iobank Bank5 -vcci 3.30 -fixed no" >> $@; \
476
                echo "set_iobank Bank4 -vcci 3.30 -fixed no" >> $@; \
477
        fi
478
        $(Q)echo "set_iobank Bank3 -vcci 3.30 -fixed no" >> $@
479
        $(Q)echo "set_iobank Bank2 -vcci 3.30 -fixed no" >> $@
480
        $(Q)echo "set_iobank Bank1 -vcci 3.30 -fixed no" >> $@
481
        $(Q)echo "set_iobank Bank0 -vcci 3.30 -fixed no" >> $@
482
        $(Q)echo "" >> $@
483
        $(Q)echo "#" >> $@
484
        $(Q)echo "# I/O constraints" >> $@
485
        $(Q)echo "#" >> $@
486
        $(Q)echo "" >> $@
487
        $(Q)echo "set_io rst_n_pad_i "$(RST_BUS_SETTING) " -pinname "$(RST_PIN) >> $@
488
        $(Q)echo "set_io sys_clk_pad_i "$(CLK_BUS_SETTING) " -pinname "$(CLK_PIN) >> $@
489
        $(Q)if [ ! -z $$JTAG_DEBUG ]; then \
490
                echo "set_io tck_pad_i "$(JTAG_DBG_SETTINGS)" -pinname "$(JTAG_DBG_TCK_PIN) >>$@; \
491
                echo "set_io tdi_pad_i "$(JTAG_DBG_SETTINGS)" -pinname "$(JTAG_DBG_TDI_PIN) >>$@; \
492
                echo "set_io tdo_pad_o "$(JTAG_DBG_SETTINGS)" -pinname "$(JTAG_DBG_TDO_PIN) >>$@; \
493
                echo "set_io tms_pad_i "$(JTAG_DBG_SETTINGS)" -pinname "$(JTAG_DBG_TMS_PIN) >>$@; \
494
        fi
495
        $(Q)if [ ! -z $$GPIO0 ]; then \
496
                echo "set_io gpio0_io\\[0\\] " $(GPIO_BUS_SETTINGS) "  -pinname "$(GPIO0_PIN) >> $@; \
497
                echo "set_io gpio0_io\\[1\\] " $(GPIO_BUS_SETTINGS) "  -pinname "$(GPIO1_PIN) >> $@; \
498
                echo "set_io gpio0_io\\[2\\] " $(GPIO_BUS_SETTINGS) "  -pinname "$(GPIO2_PIN) >> $@; \
499
                echo "set_io gpio0_io\\[3\\] " $(GPIO_BUS_SETTINGS) "  -pinname "$(GPIO3_PIN) >> $@; \
500
                echo "set_io gpio0_io\\[4\\] " $(GPIO_BUS_SETTINGS) "  -pinname "$(GPIO4_PIN) >> $@; \
501
                echo "set_io gpio0_io\\[5\\] " $(GPIO_BUS_SETTINGS) "  -pinname "$(GPIO5_PIN) >> $@; \
502
                echo "set_io gpio0_io\\[6\\] " $(GPIO_BUS_SETTINGS) "  -pinname "$(GPIO6_PIN) >> $@; \
503
                echo "set_io gpio0_io\\[7\\] " $(GPIO_BUS_SETTINGS) "  -pinname "$(GPIO7_PIN) >> $@; \
504
        fi
505
        $(Q)if [ ! -z $$I2C0 ]; then \
506
                echo "set_io i2c0_scl_io " $(I2C_BUS_SETTINGS) " -pinname "$(I2C_0_SCL_PIN) >> $@; \
507
                echo "set_io i2c0_sda_io " $(I2C_BUS_SETTINGS) " -pinname "$(I2C_0_SDA_PIN) >> $@; \
508
        fi
509
        $(Q)if [ ! -z $$I2C1 ]; then \
510
                echo "set_io i2c1_scl_io " $(I2C_BUS_SETTINGS) " -pinname "$(I2C_1_SCL_PIN) >> $@; \
511
                echo "set_io i2c1_sda_io " $(I2C_BUS_SETTINGS) " -pinname "$(I2C_1_SDA_PIN) >> $@; \
512
        fi
513
        $(Q)if [ ! -z $$I2C2 ]; then \
514
                echo "set_io i2c2_scl_io " $(I2C_BUS_SETTINGS) " -pinname "$(I2C_2_SCL_PIN) >> $@; \
515
                echo "set_io i2c2_sda_io " $(I2C_BUS_SETTINGS) " -pinname "$(I2C_2_SDA_PIN) >> $@; \
516
        fi
517
        $(Q)if [ ! -z $$I2C3 ]; then \
518
                echo "set_io i2c3_scl_io " $(I2C_BUS_SETTINGS) " -pinname "$(I2C_3_SCL_PIN) >> $@; \
519
                echo "set_io i2c3_sda_io " $(I2C_BUS_SETTINGS) " -pinname "$(I2C_3_SDA_PIN) >> $@; \
520
        fi
521
        $(Q)if [ ! -z $$MP2_0 ]; then \
522
                echo "set_io mp2_0_i -pinname "$(MP2_0_I_PIN) >> $@; \
523
                echo "set_io mp2_0_o -pinname "$(MP2_0_O_PIN) >> $@; \
524
        fi
525
        $(Q)if [ ! -z $$MP2_1 ]; then \
526
                echo "set_io mp2_1_i -pinname "$(MP2_1_I_PIN) >> $@; \
527
                echo "set_io mp2_1_o -pinname "$(MP2_1_O_PIN) >> $@; \
528
        fi
529
        $(Q)if [ ! -z $$VERSATILE_SDRAM ]; then \
530
                echo "set_io sdram_a_pad_o\\[0\\] "$(SDRAM_CTRL_BUS_SETTINGS)" -pinname "$(SDRAM_A0_PIN) >> $@; \
531
                echo "set_io sdram_a_pad_o\\[1\\] "$(SDRAM_CTRL_BUS_SETTINGS)" -pinname "$(SDRAM_A1_PIN) >> $@; \
532
                echo "set_io sdram_a_pad_o\\[2\\] "$(SDRAM_CTRL_BUS_SETTINGS)" -pinname "$(SDRAM_A2_PIN) >> $@; \
533
                echo "set_io sdram_a_pad_o\\[3\\] "$(SDRAM_CTRL_BUS_SETTINGS)" -pinname "$(SDRAM_A3_PIN) >> $@; \
534
                echo "set_io sdram_a_pad_o\\[4\\] "$(SDRAM_CTRL_BUS_SETTINGS)" -pinname "$(SDRAM_A4_PIN) >> $@; \
535
                echo "set_io sdram_a_pad_o\\[5\\] "$(SDRAM_CTRL_BUS_SETTINGS)" -pinname "$(SDRAM_A5_PIN) >> $@; \
536
                echo "set_io sdram_a_pad_o\\[6\\] "$(SDRAM_CTRL_BUS_SETTINGS)" -pinname "$(SDRAM_A6_PIN) >> $@; \
537
                echo "set_io sdram_a_pad_o\\[7\\] "$(SDRAM_CTRL_BUS_SETTINGS)" -pinname "$(SDRAM_A7_PIN) >> $@; \
538
                echo "set_io sdram_a_pad_o\\[8\\] "$(SDRAM_CTRL_BUS_SETTINGS)" -pinname "$(SDRAM_A8_PIN) >> $@; \
539
                echo "set_io sdram_a_pad_o\\[9\\] "$(SDRAM_CTRL_BUS_SETTINGS)" -pinname "$(SDRAM_A9_PIN) >> $@; \
540
                echo "set_io sdram_a_pad_o\\[10\\] "$(SDRAM_CTRL_BUS_SETTINGS)" -pinname "$(SDRAM_A10_PIN) >> $@; \
541
                echo "set_io sdram_a_pad_o\\[11\\] "$(SDRAM_CTRL_BUS_SETTINGS)" -pinname "$(SDRAM_A11_PIN) >> $@; \
542
                echo "set_io sdram_a_pad_o\\[12\\] "$(SDRAM_CTRL_BUS_SETTINGS)" -pinname "$(SDRAM_A12_PIN) >> $@; \
543
                echo "set_io sdram_ba_pad_o\\[0\\] "$(SDRAM_CTRL_BUS_SETTINGS)" -pinname "$(SDRAM_A13_PIN) >> $@; \
544
                echo "set_io sdram_ba_pad_o\\[1\\] "$(SDRAM_CTRL_BUS_SETTINGS)" -pinname "$(SDRAM_A14_PIN) >> $@; \
545
                echo "set_io sdram_ras_pad_o " $(SDRAM_CTRL_BUS_SETTINGS)" -pinname "$(SDRAM_RAS_PIN) >> $@; \
546
                echo "set_io sdram_cas_pad_o " $(SDRAM_CTRL_BUS_SETTINGS)" -pinname "$(SDRAM_CAS_PIN) >> $@; \
547
                echo "set_io sdram_we_pad_o  " $(SDRAM_CTRL_BUS_SETTINGS)" -pinname "$(SDRAM_WE_PIN) >> $@; \
548
                echo "set_io sdram_cke_pad_o " $(SDRAM_CTRL_BUS_SETTINGS_NO_REG)" -pinname "$(SDRAM_CKE_PIN) >> $@; \
549
                echo "set_io sdram_cs_n_pad_o" $(SDRAM_CTRL_BUS_SETTINGS_NO_REG)" -pinname "$(SDRAM_CS_PIN) >> $@; \
550
                echo "set_io sdram_dqm_pad_o\\[0\\] " $(SDRAM_CTRL_BUS_SETTINGS)" -pinname "$(SDRAM_DQM0_PIN) >> $@; \
551
                echo "set_io sdram_dqm_pad_o\\[1\\] " $(SDRAM_CTRL_BUS_SETTINGS)" -pinname "$(SDRAM_DQM1_PIN) >> $@; \
552
                echo "set_io sdram_dq_pad_io\\[0\\] " $(SDRAM_DATA_BUS_SETTINGS)" -pinname "$(SDRAM_DQ0_PIN) >> $@; \
553
                echo "set_io sdram_dq_pad_io\\[1\\] " $(SDRAM_DATA_BUS_SETTINGS)" -pinname "$(SDRAM_DQ1_PIN) >> $@; \
554
                echo "set_io sdram_dq_pad_io\\[2\\] " $(SDRAM_DATA_BUS_SETTINGS)" -pinname "$(SDRAM_DQ2_PIN) >> $@; \
555
                echo "set_io sdram_dq_pad_io\\[3\\] " $(SDRAM_DATA_BUS_SETTINGS)" -pinname "$(SDRAM_DQ3_PIN) >> $@; \
556
                echo "set_io sdram_dq_pad_io\\[4\\] " $(SDRAM_DATA_BUS_SETTINGS)" -pinname "$(SDRAM_DQ4_PIN) >> $@; \
557
                echo "set_io sdram_dq_pad_io\\[5\\] " $(SDRAM_DATA_BUS_SETTINGS)" -pinname "$(SDRAM_DQ5_PIN) >> $@; \
558
                echo "set_io sdram_dq_pad_io\\[6\\] " $(SDRAM_DATA_BUS_SETTINGS)" -pinname "$(SDRAM_DQ6_PIN) >> $@; \
559
                echo "set_io sdram_dq_pad_io\\[7\\] " $(SDRAM_DATA_BUS_SETTINGS)" -pinname "$(SDRAM_DQ7_PIN) >> $@; \
560
                echo "set_io sdram_dq_pad_io\\[8\\] " $(SDRAM_DATA_BUS_SETTINGS)" -pinname "$(SDRAM_DQ8_PIN) >> $@; \
561
                echo "set_io sdram_dq_pad_io\\[9\\] " $(SDRAM_DATA_BUS_SETTINGS)" -pinname "$(SDRAM_DQ9_PIN) >> $@; \
562
                echo "set_io sdram_dq_pad_io\\[10\\]" $(SDRAM_DATA_BUS_SETTINGS)" -pinname "$(SDRAM_DQ10_PIN) >> $@; \
563
                echo "set_io sdram_dq_pad_io\\[11\\]" $(SDRAM_DATA_BUS_SETTINGS)" -pinname "$(SDRAM_DQ11_PIN) >> $@; \
564
                echo "set_io sdram_dq_pad_io\\[12\\]" $(SDRAM_DATA_BUS_SETTINGS)" -pinname "$(SDRAM_DQ12_PIN) >> $@; \
565
                echo "set_io sdram_dq_pad_io\\[13\\]" $(SDRAM_DATA_BUS_SETTINGS)" -pinname "$(SDRAM_DQ13_PIN) >> $@; \
566
                echo "set_io sdram_dq_pad_io\\[14\\]" $(SDRAM_DATA_BUS_SETTINGS)" -pinname "$(SDRAM_DQ14_PIN) >> $@; \
567
                echo "set_io sdram_dq_pad_io\\[15\\]" $(SDRAM_DATA_BUS_SETTINGS)" -pinname "$(SDRAM_DQ15_PIN) >> $@; \
568
        fi
569
        $(Q)if [ ! -z $$SPI0 ]; then \
570
                echo "set_io spi0_miso_i "$(SPI_BUS_SETTINGS)" -pinname "$(SPI0_MISO_PIN) >> $@; \
571
                echo "set_io spi0_mosi_o "$(SPI_BUS_SETTINGS)" "$(SPI_BUS_OUT_SETTINGS)" -pinname "$(SPI0_MOSI_PIN) >> $@; \
572
                echo "set_io spi0_sck_o "$(SPI_BUS_SETTINGS)" "$(SPI_BUS_OUT_SETTINGS)" -pinname "$(SPI0_SCK_PIN) >> $@; \
573
                echo "set_io spi0_hold_n_o "$(SPI_BUS_SETTINGS)" "$(SPI_BUS_OUT_SETTINGS)" -pinname "$(SPI0_HOLD_N_PIN) >> $@; \
574
                echo "set_io spi0_w_n_o "$(SPI_BUS_SETTINGS)" "$(SPI_BUS_OUT_SETTINGS)" -pinname "$(SPI0_W_N_PIN) >> $@; \
575
        fi
576
        $(Q)if [ ! -z $$SPI0_SLAVE_SELECTS ]; then \
577
                echo "set_io spi0_ss_o\\[0\\] "$(SPI_BUS_SETTINGS)" "$(SPI_BUS_OUT_SETTINGS)" -pinname "$(SPI0_SS0_PIN) >> $@; \
578
        fi
579
        $(Q)if [ ! -z $$SPI1 ]; then \
580
                echo "set_io spi1_miso_i "$(SPI_BUS_SETTINGS)" -pinname "$(SPI1_MISO_PIN) >> $@; \
581
                echo "set_io spi1_mosi_o "$(SPI_BUS_SETTINGS)" "$(SPI_BUS_OUT_SETTINGS)" -pinname "$(SPI1_MOSI_PIN) >> $@; \
582
                echo "set_io spi1_sck_o "$(SPI_BUS_SETTINGS)" "$(SPI_BUS_OUT_SETTINGS)" -pinname "$(SPI1_SCK_PIN)  >> $@; \
583
                if [ ! -z $$SPI1_SLAVE_SELECTS ]; then \
584
                        echo "set_io spi1_ss_o\\[0\\] "$(SPI_BUS_SETTINGS)" "$(SPI_BUS_OUT_SETTINGS)" -pinname "$(SPI1_SS0_PIN) >> $@; \
585
                fi; \
586
        fi
587
        $(Q)if [ ! -z $$SPI2 ]; then \
588
                echo "set_io spi2_miso_i "$(SPI_BUS_SETTINGS)" -pinname "$(SPI2_MISO_PIN) >> $@; \
589
                echo "set_io spi2_mosi_o "$(SPI_BUS_SETTINGS)" "$(SPI_BUS_OUT_SETTINGS)" -pinname "$(SPI2_MOSI_PIN) >> $@; \
590
                echo "set_io spi2_sck_o "$(SPI_BUS_SETTINGS)" "$(SPI_BUS_OUT_SETTINGS)" -pinname "$(SPI2_SCK_PIN) >> $@; \
591
                if [ ! -z $$SPI2_SLAVE_SELECTS ]; then \
592
                        echo "set_io spi2_ss_o\\[0\\] "$(SPI_BUS_SETTINGS)" "$(SPI_BUS_OUT_SETTINGS)" -pinname "$(SPI2_SS0_PIN) >> $@; \
593
                fi; \
594
        fi
595
        $(Q)if [ ! -z $$SPW0 ]; then \
596
                echo "set_io spw0_rx_d "$(SPW_RX_BUS_SETTINGS)" -pinname "$(SPW0_RX_D_PIN) >> $@; \
597
                echo "set_io spw0_rx_s "$(SPW_RX_BUS_SETTINGS)" -pinname "$(SPW0_RX_S_PIN) >> $@; \
598
                echo "set_io spw0_tx_d "$(SPW_TX_BUS_SETTINGS)" -pinname "$(SPW0_TX_D_PIN) >> $@; \
599
                echo "set_io spw0_tx_s "$(SPW_TX_BUS_SETTINGS)" -pinname "$(SPW0_TX_S_PIN) >> $@; \
600
        fi
601
        $(Q)if [ ! -z $$UART0 ]; then \
602
                echo "set_io uart0_srx_pad_i "$(UART_RX_BUS_SETTINGS)" -pinname "$(UART0_RX_PIN) >> $@; \
603
                echo "set_io uart0_stx_pad_o "$(UART_TX_BUS_SETTINGS)" -pinname "$(UART0_TX_PIN) >> $@; \
604
        fi
605
        $(Q)if [ ! -z $$UART1 ]; then \
606
                echo "set_io uart1_srx_pad_i "$(UART_RX_BUS_SETTINGS)" -pinname "$(UART1_RX_PIN) >> $@; \
607
                echo "set_io uart1_stx_pad_o "$(UART_TX_BUS_SETTINGS)" -pinname "$(UART1_TX_PIN) >> $@; \
608
                if [ ! -z $$UART1_PPS ]; then \
609
                        echo "set_io uart1_pps_pad_i "$(UART_RX_BUS_SETTINGS)" -pinname "$(UART1_PPS_PIN) >> $@; \
610
                fi; \
611
        fi
612
        $(Q)if [ ! -z $$UART2 ]; then \
613
                echo "set_io uart2_srx_pad_i "$(UART_RX_BUS_SETTINGS)" -pinname "$(UART2_RX_PIN) >> $@; \
614
                echo "set_io uart2_stx_pad_o "$(UART_TX_BUS_SETTINGS)" -pinname "$(UART2_TX_PIN) >> $@; \
615
                if [ ! -z $$UART2_PPS ]; then \
616
                        echo "set_io uart2_pps_pad_i "$(UART_RX_BUS_SETTINGS)" -pinname "$(UART2_PPS_PIN) >> $@; \
617
                fi; \
618
        fi
619
        $(Q)if [ ! -z $$USB0 ];  then \
620
                echo "set_io usb0fullspeed_pad_o "$(USB_TX_BUS_SETTINGS)" -pinname "$(USB0_FULLSPEED) >> $@; \
621
                echo "set_io usb0ctrl_pad_o "$(USB_TX_BUS_SETTINGS)" -pinname "$(USB0_WIRECTRLOUT) >> $@; \
622
                echo "set_io usb0dat_pad_i\\[0\\] "$(USB_RX_DATA_SETTINGS)" -pinname "$(USB0_DATAIN0) >> $@; \
623
                echo "set_io usb0dat_pad_i\\[1\\] "$(USB_RX_DATA_SETTINGS)" -pinname "$(USB0_DATAIN1) >> $@; \
624
                echo "set_io usb0dat_pad_o\\[0\\] "$(USB_TX_DATA_SETTINGS)" -pinname "$(USB0_DATAOUT0) >> $@; \
625
                echo "set_io usb0dat_pad_o\\[1\\] "$(USB_TX_DATA_SETTINGS)" -pinname "$(USB0_DATAOUT1) >> $@; \
626
        fi
627
        $(Q)if [ ! -z $$USB1 ];  then \
628
                echo "set_io usb1fullspeed_pad_o "$(USB_TX_BUS_SETTINGS)" -pinname "$(USB1_FULLSPEED) >> $@; \
629
                echo "set_io usb1ctrl_pad_o "$(USB_TX_BUS_SETTINGS)" -pinname "$(USB1_WIRECTRLOUT) >> $@; \
630
                echo "set_io usb1dat_pad_i\\[0\\] "$(USB_RX_DATA_SETTINGS)" -pinname "$(USB1_DATAIN0) >> $@; \
631
                echo "set_io usb1dat_pad_i\\[1\\] "$(USB_RX_DATA_SETTINGS)" -pinname "$(USB1_DATAIN1) >> $@; \
632
                echo "set_io usb1dat_pad_o\\[0\\] "$(USB_TX_DATA_SETTINGS)" -pinname "$(USB1_DATAOUT0) >> $@; \
633
                echo "set_io usb1dat_pad_o\\[1\\] "$(USB_TX_DATA_SETTINGS)" -pinname "$(USB1_DATAOUT1) >> $@; \
634
        fi
635
        $(Q)if [ ! -z $$ETH_CLK ]; then \
636
                echo "set_io eth_clk_pad_i "$(ETHERNET_BUS_SETTINGS)" -REGISTER No  -pinname "$(ETH_CLK_PIN)  >> $@; \
637
        fi
638
        $(Q)if [ ! -z $$ETH0 ]; then \
639
                echo "set_io eth0_md_pad_io "$(ETHERNET_BUS_SETTINGS)" -pinname "$(ETH0_MDIO_PIN)  >> $@; \
640
                echo "set_io eth0_mdc_pad_o "$(ETHERNET_BUS_SETTINGS)" "$(ETHERNET_OUT_BUS_SETTINGS)" -pinname "$(ETH0_MDC_PIN)  >> $@; \
641
                echo "set_io eth0_smii_rx_pad_i "$(ETHERNET_BUS_SETTINGS)" -REGISTER Yes  -pinname "$(ETH0_SMII_RX_PIN)  >> $@; \
642
                echo "set_io eth0_smii_sync_pad_o "$(ETHERNET_BUS_SETTINGS)" "$(ETHERNET_OUT_REG_BUS_SETTINGS)" -pinname "$(ETH0_SMII_SYNC_PIN)  >> $@; \
643
                echo "set_io eth0_smii_tx_pad_o  "$(ETHERNET_BUS_SETTINGS)" "$(ETHERNET_OUT_REG_BUS_SETTINGS)" -pinname "$(ETH0_SMII_TX_PIN)  >> $@; \
644
                if [ ! -z $$ETH0_PHY_RST ]; then \
645
                        echo "set_io eth0_rst_n_o  "$(RST_BUS_SETTING)" -pinname "$(ETH0_PHY_RSTN_PIN)  >> $@; \
646
                fi; \
647
        fi
648
        $(Q)echo "" >> $@
649
 
650
 
651
# Removed due to SPI slave selects numbering only 1
652
#                       echo "set_io spi1_ss_o\\[1\\] "$(SPI_BUS_SETTINGS)" "$(SPI_BUS_OUT_SETTINGS)" -pinname "$(SPI1_SS1_PIN) >> $@;
653
#                       echo "set_io spi1_ss_o\\[2\\] "$(SPI_BUS_SETTINGS)" "$(SPI_BUS_OUT_SETTINGS)" -pinname "$(SPI1_SS2_PIN) >> $@; \
654
#                       echo "set_io spi2_ss_o\\[1\\] "$(SPI_BUS_SETTINGS)" "$(SPI_BUS_OUT_SETTINGS)" -pinname "$(SPI2_SS1_PIN) >> $@; \
655
#                       echo "set_io spi2_ss_o\\[2\\] "$(SPI_BUS_SETTINGS)" "$(SPI_BUS_OUT_SETTINGS)" -pinname "$(SPI2_SS2_PIN) >> $@; \
656
 

powered by: WebSVN 2.1.0

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