################################################################################
##
## (C) COPYRIGHT 2010  Gideon's Logic Architectures
##
################################################################################
## This is the Xilinx configuration make file containing project specific 
## settings.
################################################################################
#### NOTE: The following restrictions apply when using this make file:
####		- file and directory names may not contain spaces!
####		- target names must be lowercase
################################################################################

# GLOBAL incs should point to the make include files directory
export GLOBAL_INCS = $(strip $(shell pwd)/../../global_makefiles)
							

.SUFFIXES:		#delete all known suffixes

################################################################################
#### TARGET
################################################################################
#SHELL           := /bin/bash

TARGET 			:= ultimate_1541_700a

ISE_VERSION		:= 13

DESIGN_NAME 	:= $(TARGET)
TOP_NAME    	:= $(TARGET)

CONFIG			:= makefile_700a

# Project ROOT
WORK_DIR		:= work700

# Part settings
PART_TYPE        := xc3s700a
PART_SPEED_GRADE := 4
PART_PACKAGE     := ft256
PART             := $(PART_TYPE)-$(PART_SPEED_GRADE)-$(PART_PACKAGE)

#Synthesis options
XST_LSO			:= work
XST_FLAGS	 	:= 
XST_OPTIONS		:= -top $(TOP_NAME) \
				   -hierarchy_separator / \
				   -bus_delimiter \(\) \
				   -cross_clock_analysis YES \
				   -iob true \
				   -opt_mode Speed \
				   -opt_level 2 \
				   -register_balancing no \
				   -keep_hierarchy no

# Tools
MY_PROMGEN := ../../tools/promgen

#SETTING FILES		    
UCF_FILES := ./ucf/ultimate_ii.ucf 		# constraint/pin-assignment file(s)
BMM_FILE  := ./ucf/sd_ram4.bmm			# bmm file location

# TOOL FLAGS
NGDBUILD_FLAGS	 := 	
MAP_FLAGS        := 	-cm area -timing -pr b -detail
PAR_FLAGS        := 	-w 
TRCE_FLAGS       := 	-e 9 -l 11
PROMGEN_FLAGS	 := 	-w -p mcs -c FF -x xcf04s
BITGEN_FLAGS     := 	-w -d \
					    -g DebugBitstream:No -g Binary:no -g CRC:Enable \
					    -g ConfigRate:25 -g ProgPin:PullUp \
					    -g DonePin:PullUp -g TckPin:PullUp -g TdiPin:PullUp \
					    -g TdoPin:PullUp -g TmsPin:PullUp \
					    -g UnusedPin:PullUp -g UserID:0xFFFFFFFF \
					    -g StartUpClk:CClk -g DONE_cycle:4 -g GTS_cycle:5 \
					    -g GWE_cycle:6 -g LCK_cycle:NoWait -g Security:None \
					    -g Persist:No -g DonePipe:no \
					    -g DriveDone:Yes
								
################################################################################
## The SYNTH_PROJ variable contains all the project file locations. It is a 
## space seperated list of records. The following format is used:
## <source type>,<lib>,<filepath> <source type>,<lib>,<filepath> etc.
## (for example: vhdl,work,../../dummy.vhdl)
################################################################################

ULTIMATE_FPGA := ../../fpga
include ultimate_logic.inc

SYNTH_PROJ	:= 	$(ALL_ULTIMATE_LOGIC) \
				vhdl,work,$(ULTIMATE_FPGA)/fpga_top/ultimate_fpga/vhdl_source/$(TARGET).vhd


 ################################################################################
 #### Special flow options    
 ################################################################################

## IGNORE_TIMING_PIN_ERRORS
## When this variable is set to set yes a bit file is generated even when the 
## timing constraints are not met or not all pins in the design are assigend.

IGNORE_TIMING_PIN_ERRORS = no

################################################################################
#### Target specific rules
################################################################################

.PHONY: all test
all: $(TARGET).bit			# may be changed

test:
	echo $(SYNTH_PROJ)
	echo $(XILINX)
	echo $(XST)
	echo "$(GEN_VAR_DEP_FILE)"

	
################################################################################
#### WARNING!!
################################################################################
#### Do not touch the settings below (these statements should be placed at the
#### end of the makefile)
################################################################################

################################################################################
#### Include general Xilinx build rules
################################################################################

include $(GLOBAL_INCS)/xilinx_ise.inc
