Line 17... |
Line 17... |
#
|
#
|
|
|
# Name of the directory we're currently in
|
# Name of the directory we're currently in
|
CUR_DIR=$(shell pwd)
|
CUR_DIR=$(shell pwd)
|
|
|
VENDOR=actel
|
|
VENDOR_TCL_SHELL=acttclsh
|
|
|
|
PROJECT_NAME=orpsoc
|
|
PROJECT_TOP_NAME=$(PROJECT_NAME)_top
|
|
PROJ_ADB_FILE_NAME=$(PROJECT_NAME).adb
|
|
PROJ_ADB_FILE=$(PROJ_ADB_FILE_NAME)
|
|
|
|
# The root path of the whole project
|
# The root path of the whole project
|
BOARD_DIR ?=$(CUR_DIR)/../../..
|
BOARD_ROOT ?=$(CUR_DIR)/../../..
|
PROJECT_ROOT=$(BOARD_DIR)/../../..
|
include $(BOARD_ROOT)/Makefile.inc
|
|
|
BOARD_RTL_PATH=$(BOARD_DIR)/rtl
|
|
BOARD_RTL_VERILOG_PATH=$(BOARD_RTL_PATH)/verilog
|
|
BOARD_RTL_VERILOG_INCLUDES=$(BOARD_RTL_VERILOG_PATH)/include
|
|
PROJECT_VERILOG_DEFINES=$(BOARD_RTL_VERILOG_INCLUDES)/$(PROJECT_NAME)-defines.v
|
|
|
|
SYN_PATH=$(BOARD_DIR)/syn/synplify
|
VENDOR_TCL_SHELL=acttclsh
|
|
|
SW_PATH=$(PROJECT_ROOT)/sw
|
|
|
|
PAR_PATH=$(BOARD_DIR)/backend/par
|
DESIGN_TOP_NAME=$(DESIGN_NAME)_top
|
PAR_RUN_PATH=$(PAR_PATH)/run
|
PROJ_ADB_FILE_NAME=$(DESIGN_NAME).adb
|
PAR_OUT_PATH=$(PAR_PATH)/out
|
PROJ_ADB_FILE=$(PROJ_ADB_FILE_NAME)
|
|
|
# Required EDIF file names
|
# Required EDIF file names
|
EDIF_NAME=$(PROJECT_TOP_NAME).edn
|
EDIF_NAME=$(DESIGN_TOP_NAME).edn
|
PROJ_EDF_FILE=$(SYN_PATH)/out/$(EDIF_NAME)
|
PROJ_EDF_FILE=$(BOARD_SYN_DIR)/out/$(EDIF_NAME)
|
|
|
# TCL script names
|
# TCL script names
|
TCL_SCRIPT_START=start.tcl
|
TCL_SCRIPT_START=start.tcl
|
TCL_SCRIPT_COMPILE=compile.tcl
|
TCL_SCRIPT_COMPILE=compile.tcl
|
TCL_SCRIPT_PAR=par.tcl
|
TCL_SCRIPT_PAR=par.tcl
|
Line 78... |
Line 63... |
# Set to 'on' to enable them
|
# Set to 'on' to enable them
|
PLACE_INCREMENTAL ?= off
|
PLACE_INCREMENTAL ?= off
|
ROUTE_INCREMENTAL ?= off
|
ROUTE_INCREMENTAL ?= off
|
PLACER_HIGH_EFFORT ?= off
|
PLACER_HIGH_EFFORT ?= off
|
|
|
PDC_FILE ?=$(PROJECT_NAME).pdc
|
PDC_FILE ?=$(DESIGN_NAME).pdc
|
SDC_FILE ?=$(PROJECT_NAME).sdc
|
SDC_FILE ?=$(DESIGN_NAME).sdc
|
|
|
|
|
DEFINES_FILE_CUTOFF=$(shell grep -n "end of included module defines" $(PROJECT_VERILOG_DEFINES) | cut -d ':' -f 1)
|
#DEFINES_FILE_CUTOFF=$(shell grep -n "end of included module defines" $(PROJECT_VERILOG_DEFINES) | cut -d ':' -f 1)
|
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 )
|
#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 )
|
# Rule to look at what defines are being extracted from main file
|
# Rule to look at what defines are being extracted from main file
|
print-defines:
|
#print-defines:
|
@echo; echo "\t### Design defines ###"; echo
|
# @echo; echo "\t### Design defines ###"; echo
|
@echo "\tParsing "$(PROJECT_VERILOG_DEFINES)" and exporting:"
|
# @echo "\tParsing "$(PROJECT_VERILOG_DEFINES)" and exporting:"
|
@echo $(DESIGN_DEFINES)
|
# @echo $(DESIGN_DEFINES)
|
|
|
# Rule to print out current config of current session
|
# Rule to print out current config of current session
|
print-config:
|
print-config:
|
@echo; echo "\t### PAR make configuration ###"; echo
|
@echo; echo "\t### PAR make configuration ###"; echo
|
@echo "\tFPGA_FAMILY="$(FPGA_FAMILY)
|
@echo "\tFPGA_FAMILY="$(FPGA_FAMILY)
|
Line 107... |
Line 92... |
@echo "\tPLACER_HIGH_EFFORT="$(PLACER_HIGH_EFFORT)
|
@echo "\tPLACER_HIGH_EFFORT="$(PLACER_HIGH_EFFORT)
|
@echo
|
@echo
|
@echo "\tBackend pinout script:"
|
@echo "\tBackend pinout script:"
|
@echo "\tBOARD_CONFIG="$(BOARD_CONFIG)
|
@echo "\tBOARD_CONFIG="$(BOARD_CONFIG)
|
|
|
|
|
# Set V=1 when calling make to enable verbose output
|
|
# mainly for debugging purposes.
|
|
ifeq ($(V), 1)
|
|
Q=
|
|
else
|
|
Q ?=@
|
|
endif
|
|
|
|
TIME_CMD=time -p
|
TIME_CMD=time -p
|
|
|
# Rule for everything from, potentially, synthesis up to PAR
|
# Rule for everything from, potentially, synthesis up to PAR
|
all: print-config print-defines create-compile-par-bitgen
|
all: print-config print-defines create-compile-par-bitgen
|
|
|
Line 148... |
Line 124... |
|
|
$(PROJ_ADB_FILE): $(PROJ_EDF_FILE) $(TCL_SCRIPT_START)
|
$(PROJ_ADB_FILE): $(PROJ_EDF_FILE) $(TCL_SCRIPT_START)
|
$(TIME_CMD) $(VENDOR_TCL_SHELL) $(TCL_SCRIPT_START)
|
$(TIME_CMD) $(VENDOR_TCL_SHELL) $(TCL_SCRIPT_START)
|
|
|
$(PROJ_EDF_FILE):
|
$(PROJ_EDF_FILE):
|
$(MAKE) -C $(SYN_PATH)/run all
|
$(MAKE) -C $(BOARD_SYN_DIR)/run all
|
|
|
create-compile: create compile
|
create-compile: create compile
|
|
|
clean:
|
clean:
|
rm -rf *.rpt *.log *~ *.tcl *.lok *.tmp *.dtf $(SDC_FILE) $(PDC_FILE) *.adb
|
rm -rf *.rpt *.log *~ *.tcl *.lok *.tmp *.dtf $(SDC_FILE) $(PDC_FILE) *.adb
|
|
|
clean-syn:
|
clean-syn:
|
$(MAKE) -C $(SYN_PATH)/run distclean
|
$(MAKE) -C $(BOARD_SYN_DIR)/run distclean
|
|
|
clean-sw:
|
clean-sw:
|
$(Q) echo; echo "\t### Cleaning simulation sw directories ###"; echo;
|
$(Q) echo; echo "\t### Cleaning simulation sw directories ###"; echo;
|
$(MAKE) -C $(SW_PATH)/lib distclean
|
$(MAKE) -C $(COMMON_SW_DIR)/lib distclean
|
|
|
|
|
distclean: clean-sw clean-syn clean
|
distclean: clean-sw clean-syn clean
|
|
|
STEP_NAME=$(shell echo $(TCL_FILE) | cut -d '.' -f 1)
|
STEP_NAME=$(shell echo $(TCL_FILE) | cut -d '.' -f 1)
|
Line 243... |
Line 219... |
# This is the common header, setting variables in the TCL file
|
# This is the common header, setting variables in the TCL file
|
tcl-common:
|
tcl-common:
|
$(Q)rm -f $(TCL_FILE);
|
$(Q)rm -f $(TCL_FILE);
|
$(Q)echo; echo "\tGenerating "$(TCL_FILE); echo
|
$(Q)echo; echo "\tGenerating "$(TCL_FILE); echo
|
$(Q)echo "set compile_directory "$(COMP_DIR) >> $(TCL_FILE)
|
$(Q)echo "set compile_directory "$(COMP_DIR) >> $(TCL_FILE)
|
$(Q)echo "set proj_name "$(PROJECT_NAME) >> $(TCL_FILE)
|
$(Q)echo "set proj_name "$(DESIGN_NAME) >> $(TCL_FILE)
|
$(Q)echo "set top_name "$(PROJECT_TOP_NAME) >> $(TCL_FILE)
|
$(Q)echo "set top_name "$(DESIGN_TOP_NAME) >> $(TCL_FILE)
|
$(Q)echo "set family "$(FPGA_FAMILY) >> $(TCL_FILE)
|
$(Q)echo "set family "$(FPGA_FAMILY) >> $(TCL_FILE)
|
$(Q)echo "set part "$(FPGA_PART) >> $(TCL_FILE)
|
$(Q)echo "set part "$(FPGA_PART) >> $(TCL_FILE)
|
$(Q)echo "set package "$(FPGA_PACKAGE) >> $(TCL_FILE)
|
$(Q)echo "set package "$(FPGA_PACKAGE) >> $(TCL_FILE)
|
$(Q)echo "set pdc_filename "$(PDC_FILE) >> $(TCL_FILE)
|
$(Q)echo "set pdc_filename "$(PDC_FILE) >> $(TCL_FILE)
|
$(Q)echo "set sdc_filename "$(SDC_FILE) >> $(TCL_FILE)
|
$(Q)echo "set sdc_filename "$(SDC_FILE) >> $(TCL_FILE)
|
Line 339... |
Line 315... |
$(Q)echo " -max_paths 5 " \\ >> $(TCL_FILE)
|
$(Q)echo " -max_paths 5 " \\ >> $(TCL_FILE)
|
$(Q)echo " -max_expanded_paths 1 " \\ >> $(TCL_FILE)
|
$(Q)echo " -max_expanded_paths 1 " \\ >> $(TCL_FILE)
|
$(Q)echo " -include_user_sets no " \\ >> $(TCL_FILE)
|
$(Q)echo " -include_user_sets no " \\ >> $(TCL_FILE)
|
$(Q)echo " -include_pin_to_pin yes " \\ >> $(TCL_FILE)
|
$(Q)echo " -include_pin_to_pin yes " \\ >> $(TCL_FILE)
|
$(Q)echo " -select_clock_domains no " \\ >> $(TCL_FILE)
|
$(Q)echo " -select_clock_domains no " \\ >> $(TCL_FILE)
|
$(Q)echo " "$(PROJECT_NAME)"-timing.rpt " >> $(TCL_FILE)
|
$(Q)echo " "$(DESIGN_NAME)"-timing.rpt " >> $(TCL_FILE)
|
$(Q)echo " report " \\ >> $(TCL_FILE)
|
$(Q)echo " report " \\ >> $(TCL_FILE)
|
$(Q)echo " -type timing_violations " \\ >> $(TCL_FILE)
|
$(Q)echo " -type timing_violations " \\ >> $(TCL_FILE)
|
$(Q)echo " -analysis max " \\ >> $(TCL_FILE)
|
$(Q)echo " -analysis max " \\ >> $(TCL_FILE)
|
$(Q)echo " -use_slack_threshold no " \\ >> $(TCL_FILE)
|
$(Q)echo " -use_slack_threshold no " \\ >> $(TCL_FILE)
|
$(Q)echo " -limit_max_paths yes " \\ >> $(TCL_FILE)
|
$(Q)echo " -limit_max_paths yes " \\ >> $(TCL_FILE)
|
$(Q)echo " -max_paths 100 " \\ >> $(TCL_FILE)
|
$(Q)echo " -max_paths 100 " \\ >> $(TCL_FILE)
|
$(Q)echo " -max_expanded_paths 0 " \\ >> $(TCL_FILE)
|
$(Q)echo " -max_expanded_paths 0 " \\ >> $(TCL_FILE)
|
$(Q)echo " "$(PROJECT_NAME)"-timviol.rpt " >> $(TCL_FILE)
|
$(Q)echo " "$(DESIGN_NAME)"-timviol.rpt " >> $(TCL_FILE)
|
$(Q)echo " report " \\ >> $(TCL_FILE)
|
$(Q)echo " report " \\ >> $(TCL_FILE)
|
$(Q)echo " -type timing_violations " \\ >> $(TCL_FILE)
|
$(Q)echo " -type timing_violations " \\ >> $(TCL_FILE)
|
$(Q)echo " -analysis min " \\ >> $(TCL_FILE)
|
$(Q)echo " -analysis min " \\ >> $(TCL_FILE)
|
$(Q)echo " -use_slack_threshold no " \\ >> $(TCL_FILE)
|
$(Q)echo " -use_slack_threshold no " \\ >> $(TCL_FILE)
|
$(Q)echo " -limit_max_paths yes " \\ >> $(TCL_FILE)
|
$(Q)echo " -limit_max_paths yes " \\ >> $(TCL_FILE)
|
$(Q)echo " -max_paths 100 " \\ >> $(TCL_FILE)
|
$(Q)echo " -max_paths 100 " \\ >> $(TCL_FILE)
|
$(Q)echo " -max_expanded_paths 0 " \\ >> $(TCL_FILE)
|
$(Q)echo " -max_expanded_paths 0 " \\ >> $(TCL_FILE)
|
$(Q)echo " "$(PROJECT_NAME)"-timmindly.rpt " >> $(TCL_FILE)
|
$(Q)echo " "$(DESIGN_NAME)"-timmindly.rpt " >> $(TCL_FILE)
|
|
|
|
|
|
|
sdc-file:
|
sdc-file:
|
$(Q)for define in $(DESIGN_DEFINES); do export $$define=1; done; \
|
$(Q)for define in $(DESIGN_DEFINES); do export $$define=1; done; \
|