aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/family.cmake
diff options
context:
space:
mode:
authorSean Cross <sean@xobs.io>2019-09-17 11:32:44 +0800
committerSean Cross <sean@xobs.io>2019-09-17 11:32:44 +0800
commit062091e9e4a15589f7e1d9b2ba50a84c2ff6ec2c (patch)
treecc54f2a3e306fc63836016b54dd4a77da26d7b7a /ecp5/family.cmake
parentc2299c8972e0cd22641d7d3b8e0bf7c19a42c3cb (diff)
downloadnextpnr-062091e9e4a15589f7e1d9b2ba50a84c2ff6ec2c.tar.gz
nextpnr-062091e9e4a15589f7e1d9b2ba50a84c2ff6ec2c.tar.bz2
nextpnr-062091e9e4a15589f7e1d9b2ba50a84c2ff6ec2c.zip
ecp5: add support for PREGENERATED_BBA_PATH
Support pre-generated bba files to speed up compiling on Windows and get it compiling on Darwin. Signed-off-by: Sean Cross <sean@xobs.io>
Diffstat (limited to 'ecp5/family.cmake')
-rw-r--r--ecp5/family.cmake49
1 files changed, 31 insertions, 18 deletions
diff --git a/ecp5/family.cmake b/ecp5/family.cmake
index ec857569..2c31a84c 100644
--- a/ecp5/family.cmake
+++ b/ecp5/family.cmake
@@ -40,14 +40,20 @@ if (NOT EXTERNAL_CHIPDB)
set(DEV_CC_DB ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/chipdbs/chipdb-${dev}.bin)
set(DEV_CC_BBA_DB ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/chipdbs/chipdb-${dev}.bba)
set(DEV_CONSTIDS_INC ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/constids.inc)
- add_custom_command(OUTPUT ${DEV_CC_BBA_DB}
- COMMAND ${ENV_CMD} ${PYTHON_EXECUTABLE} ${DB_PY} -p ${DEV_CONSTIDS_INC} ${dev} > ${DEV_CC_BBA_DB}
- DEPENDS ${DB_PY} ${PREV_DEV_CC_BBA_DB}
- )
- add_custom_command(OUTPUT ${DEV_CC_DB}
- COMMAND bbasm ${DEV_CC_BBA_DB} ${DEV_CC_DB}
- DEPENDS bbasm ${DEV_CC_BBA_DB}
- )
+ if (PREGENERATED_BBA_PATH)
+ add_custom_command(OUTPUT ${DEV_CC_DB}
+ COMMAND bbasm ${PREGENERATED_BBA_PATH}/chipdb-${dev}.bba ${DEV_CC_DB}
+ )
+ else()
+ add_custom_command(OUTPUT ${DEV_CC_BBA_DB}
+ COMMAND ${ENV_CMD} ${PYTHON_EXECUTABLE} ${DB_PY} -p ${DEV_CONSTIDS_INC} ${dev} > ${DEV_CC_BBA_DB}
+ DEPENDS ${DB_PY} ${PREV_DEV_CC_BBA_DB}
+ )
+ add_custom_command(OUTPUT ${DEV_CC_DB}
+ COMMAND bbasm ${DEV_CC_BBA_DB} ${DEV_CC_DB}
+ DEPENDS bbasm ${DEV_CC_BBA_DB}
+ )
+ endif()
if (SERIALIZE_CHIPDB)
set(PREV_DEV_CC_BBA_DB ${DEV_CC_BBA_DB})
endif()
@@ -64,16 +70,23 @@ if (NOT EXTERNAL_CHIPDB)
set(DEV_CC_DB ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/chipdbs/chipdb-${dev}.cc)
set(DEV_CC_BBA_DB ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/chipdbs/chipdb-${dev}.bba)
set(DEV_CONSTIDS_INC ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/constids.inc)
- add_custom_command(OUTPUT ${DEV_CC_BBA_DB}
- COMMAND ${ENV_CMD} ${PYTHON_EXECUTABLE} ${DB_PY} -p ${DEV_CONSTIDS_INC} ${dev} > ${DEV_CC_BBA_DB}.new
- COMMAND mv ${DEV_CC_BBA_DB}.new ${DEV_CC_BBA_DB}
- DEPENDS ${DB_PY} ${PREV_DEV_CC_BBA_DB}
- )
- add_custom_command(OUTPUT ${DEV_CC_DB}
- COMMAND bbasm --c ${DEV_CC_BBA_DB} ${DEV_CC_DB}.new
- COMMAND mv ${DEV_CC_DB}.new ${DEV_CC_DB}
- DEPENDS bbasm ${DEV_CC_BBA_DB}
- )
+ if (PREGENERATED_BBA_PATH)
+ add_custom_command(OUTPUT ${DEV_CC_DB}
+ COMMAND bbasm --c ${PREGENERATED_BBA_PATH}/chipdb-${dev}.bba ${DEV_CC_DB}.new
+ COMMAND mv ${DEV_CC_DB}.new ${DEV_CC_DB}
+ )
+ else()
+ add_custom_command(OUTPUT ${DEV_CC_BBA_DB}
+ COMMAND ${ENV_CMD} ${PYTHON_EXECUTABLE} ${DB_PY} -p ${DEV_CONSTIDS_INC} ${dev} > ${DEV_CC_BBA_DB}.new
+ COMMAND mv ${DEV_CC_BBA_DB}.new ${DEV_CC_BBA_DB}
+ DEPENDS ${DB_PY} ${PREV_DEV_CC_BBA_DB}
+ )
+ add_custom_command(OUTPUT ${DEV_CC_DB}
+ COMMAND bbasm --c ${DEV_CC_BBA_DB} ${DEV_CC_DB}.new
+ COMMAND mv ${DEV_CC_DB}.new ${DEV_CC_DB}
+ DEPENDS bbasm ${DEV_CC_BBA_DB}
+ )
+ endif()
if (SERIALIZE_CHIPDB)
set(PREV_DEV_CC_BBA_DB ${DEV_CC_BBA_DB})
endif()