Created
September 16, 2012 07:15
-
-
Save sora/3731396 to your computer and use it in GitHub Desktop.
Lattice Diamond: command-line build
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BUILD_DIR=build | |
all: $(BUILD_DIR)/system.bit | |
clean: | |
rm -rf build/* | |
.PHONY: clean |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "loadsources.tcl" | |
set_option -vlog_std sysv | |
set_option -project_relative_includes 1 | |
#device options | |
set_option -technology LATTICE-ECP3 | |
set_option -part LFE3_35EA | |
set_option -package FN484C | |
set_option -speed_grade -8 | |
set_option -part_companion "" | |
#compilation/mapping options | |
# mapper_options | |
set_option -frequency auto | |
set_option -write_verilog 0 | |
set_option -write_vhdl 0 | |
# Lattice XP | |
set_option -maxfan 1000 | |
set_option -disable_io_insertion 0 | |
set_option -retiming 0 | |
set_option -pipe 1 | |
set_option -forcegsr no | |
set_option -fixgatedclocks 3 | |
set_option -fixgeneratedclocks 3 | |
set_option -update_models_cp 0 | |
set_option -syn_edif_array_rename 1 | |
# NFilter | |
set_option -popfeed 0 | |
set_option -constprop 0 | |
set_option -createhierarchy 0 | |
# sequential_optimization_options | |
set_option -symbolic_fsm_compiler 1 | |
# Compiler Options | |
set_option -compiler_compatible 0 | |
set_option -resource_sharing 1 | |
set_option -multi_file_compilation_unit 1 | |
#automatic place and route (vendor) options | |
set_option -write_apr_constraint 1 | |
#set result format/file last | |
project -result_file "./system.edi" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BOARD_DIR=../rtl | |
CORES_DIR=../../../cores | |
BOARD_NAME="LatticeECP3" | |
DEVICE_NAME="LFE3-35EA" | |
PKG_NAME="FPBGA484" | |
PER_GRADE=8 | |
SEARCH_PATH="/usr/local/diamond/2.0/ispfpga/ep5c00/data" | |
include common.mak | |
include ../sources.mak | |
SRC=$(BOARD_DIR) $(CORES_DIR) | |
$(BUILD_DIR)/system.ucf: common.ucf lattice.ucf | |
cat common.ucf lattice.ucf > $(BUILD_DIR)/system.ucf | |
$(BUILD_DIR)/loadsources.tcl: $(SRC) | |
rm -f $(BUILD_DIR)/loadsources.tcl | |
for i in `echo $^`; do \ | |
echo "add_file -verilog \"../$$i\"" >> $(BUILD_DIR)/loadsources.tcl; \ | |
done | |
$(BUILD_DIR)/lattice.prj: lattice.prj | |
cp lattice.prj $(BUILD_DIR)/lattice.prj | |
$(BUILD_DIR)/system.edi: $(BUILD_DIR)/loadsources.tcl $(BUILD_DIR)/lattice.prj | |
cd $(BUILD_DIR) && synpwrap -prj lattice.prj -log system.srf | |
$(BUILD_DIR)/system.ngo: $(BUILD_DIR)/system.edi | |
cd $(BUILD_DIR) && edif2ngd -l $(BOARD_NAME) -d $(DEVICE_NAME) system.edi system.ngo | |
$(BUILD_DIR)/system.ngd: $(BUILD_DIR)/system.ngo | |
cd $(BUILD_DIR) && ngdbuild -a $(BOARD_NAME) -d $(DEVICE_NAME) -p $(SEARCH_PATH) system.ngo system.ngd | |
$(BUILD_DIR)/system_map.ncd: $(BUILD_DIR)/system.ngd $(BUILD_DIR)/system.ucf | |
cd $(BUILD_DIR) && map -a $(BOARD_NAME) -p $(DEVICE_NAME) -t $(PKG_NAME) -s $(PER_GRADE) -oc Commercial system.ngd -o system_map.ncd -pr system.prf -mp system.mrp system.ucf | |
$(BUILD_DIR)/system.ncd: $(BUILD_DIR)/system_map.ncd | |
cd $(BUILD_DIR) && mpartrce -p ../system.p2t -f ../system.p3t -tf system.pt system_map.ncd system.ncd | |
$(BUILD_DIR)/system.prf: $(BUILD_DIR)/system.ncd | |
cd $(BUILD_DIR) && par -f ../system.p2t system_map.ncd system.dir system.prf && ltxt2ptxt -path . system.ncd | |
$(BUILD_DIR)/system.bit: $(BUILD_DIR)/system.prf | |
cd $(BUILD_DIR) && bitgen -w system.ncd -f ../system.t2b -e -s system.sec -k system.bek system.prf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment