diff options
author | David Shah <davey1576@gmail.com> | 2018-07-08 11:15:30 +0200 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-07-11 10:41:36 +0200 |
commit | bb683d71d698481f472df26747c5332d49d933c1 (patch) | |
tree | a4c81608456b986dd6a066224b92d95bbbd91edb /ecp5/family.cmake | |
parent | 6f90c3df6118a857b24ee3ef031b54ef8aa8b7a8 (diff) | |
download | nextpnr-bb683d71d698481f472df26747c5332d49d933c1.tar.gz nextpnr-bb683d71d698481f472df26747c5332d49d933c1.tar.bz2 nextpnr-bb683d71d698481f472df26747c5332d49d933c1.zip |
ecp5: Add 25k database
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ecp5/family.cmake')
-rw-r--r-- | ecp5/family.cmake | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/ecp5/family.cmake b/ecp5/family.cmake index e69de29b..7f528886 100644 --- a/ecp5/family.cmake +++ b/ecp5/family.cmake @@ -0,0 +1,41 @@ + +set(devices 25k) + +set(DB_PY ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/trellis_import.py) + +file(MAKE_DIRECTORY ecp5/chipdbs/) +add_library(ecp5_chipdb OBJECT ecp5/chipdbs/) +target_compile_definitions(ecp5_chipdb PRIVATE NEXTPNR_NAMESPACE=nextpnr_${family}) +target_include_directories(ecp5_chipdb PRIVATE ${family}/) +set(ENV_CMD ${CMAKE_COMMAND} -E env "PYTHONPATH=${TRELLIS_ROOT}/libtrellis:${TRELLIS_ROOT}/util/common") +if (MSVC) + target_sources(ecp5_chipdb PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/resource/embed.cc) + set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/ecp5/resources/chipdb.rc PROPERTIES LANGUAGE RC) + foreach (dev ${devices}) + set(DEV_CC_DB ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/chipdbs/chipdb-${dev}.bin) + set(DEV_PORTS_INC ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/portpins.inc) + add_custom_command(OUTPUT ${DEV_CC_DB} + COMMAND ${ENV_CMD} python3 ${DB_PY} -b -p ${DEV_PORTS_INC} ${dev} ${DEV_CC_DB} + DEPENDS ${DB_PY} + ) + target_sources(ecp5_chipdb PRIVATE ${DEV_CC_DB}) + set_source_files_properties(${DEV_CC_DB} PROPERTIES HEADER_FILE_ONLY TRUE) + foreach (target ${family_targets}) + target_sources(${target} PRIVATE $<TARGET_OBJECTS:ecp5_chipdb> ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/resource/chipdb.rc) + endforeach (target) + endforeach (dev) +else() + target_compile_options(ecp5_chipdb PRIVATE -g0 -O0 -w) + foreach (dev ${devices}) + set(DEV_CC_DB ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/chipdbs/chipdb-${dev}.cc) + set(DEV_PORTS_INC ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/portpins.inc) + add_custom_command(OUTPUT ${DEV_CC_DB} + COMMAND ${ENV_CMD} python3 ${DB_PY} -c -p ${DEV_PORTS_INC} ${dev} ${DEV_CC_DB} + DEPENDS ${DB_PY} + ) + target_sources(ecp5_chipdb PRIVATE ${DEV_CC_DB}) + foreach (target ${family_targets}) + target_sources(${target} PRIVATE $<TARGET_OBJECTS:ecp5_chipdb>) + endforeach (target) + endforeach (dev) +endif() |