2025-01-15 22:42:20 +08:00
|
|
|
include(FindTrellis)
|
|
|
|
|
2025-01-17 04:06:10 +08:00
|
|
|
set(SOURCES
|
|
|
|
arch.cc
|
|
|
|
archdefs.h
|
|
|
|
arch.h
|
|
|
|
arch_place.cc
|
|
|
|
arch_pybindings.cc
|
|
|
|
arch_pybindings.h
|
|
|
|
baseconfigs.cc
|
|
|
|
bitstream.cc
|
|
|
|
bitstream.h
|
|
|
|
cells.cc
|
|
|
|
cells.h
|
|
|
|
config.cc
|
|
|
|
config.h
|
|
|
|
constids.inc
|
|
|
|
dcu_bitstream.h
|
|
|
|
gfx.cc
|
|
|
|
gfx.h
|
|
|
|
globals.cc
|
|
|
|
globals.h
|
|
|
|
iotypes.inc
|
|
|
|
lpf.cc
|
|
|
|
pack.cc
|
|
|
|
pio.cc
|
|
|
|
pio.h
|
|
|
|
)
|
2025-01-15 22:42:20 +08:00
|
|
|
|
2025-01-17 04:06:10 +08:00
|
|
|
add_nextpnr_architecture(${family}
|
|
|
|
CORE_SOURCES ${SOURCES}
|
|
|
|
MAIN_SOURCE main.cc
|
|
|
|
)
|
2020-06-24 23:44:45 +08:00
|
|
|
|
|
|
|
set(ALL_ECP5_DEVICES 25k 45k 85k)
|
|
|
|
set(ECP5_DEVICES ${ALL_ECP5_DEVICES} CACHE STRING
|
|
|
|
"Include support for these ECP5 devices (available: ${ALL_ECP5_DEVICES})")
|
|
|
|
message(STATUS "Enabled ECP5 devices: ${ECP5_DEVICES}")
|
|
|
|
|
2025-01-15 22:42:20 +08:00
|
|
|
foreach (device ${ECP5_DEVICES})
|
|
|
|
if (NOT device IN_LIST ALL_ECP5_DEVICES)
|
|
|
|
message(FATAL_ERROR "Device ${device} is not a supported ECP5 device")
|
2020-06-24 23:44:45 +08:00
|
|
|
endif()
|
|
|
|
|
2025-01-15 22:42:20 +08:00
|
|
|
add_bba_produce_command(
|
2025-01-23 06:43:34 +08:00
|
|
|
TARGET nextpnr-${family}-bba
|
2025-01-15 22:42:20 +08:00
|
|
|
COMMAND ${Python3_EXECUTABLE}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/trellis_import.py
|
|
|
|
-L ${TRELLIS_LIBDIR}
|
|
|
|
-L ${TRELLIS_DATADIR}/util/common
|
|
|
|
-L ${TRELLIS_DATADIR}/timing/util
|
|
|
|
-p ${CMAKE_CURRENT_SOURCE_DIR}/constids.inc
|
|
|
|
-g ${CMAKE_CURRENT_SOURCE_DIR}/gfx.h
|
|
|
|
${device}
|
|
|
|
> ${CMAKE_CURRENT_BINARY_DIR}/chipdb-${device}.bba.new
|
|
|
|
OUTPUT
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/chipdb-${device}.bba
|
|
|
|
INPUTS
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/trellis_import.py
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/constids.inc
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/gfx.h
|
|
|
|
)
|
|
|
|
|
|
|
|
add_bba_compile_command(
|
2025-01-17 04:06:10 +08:00
|
|
|
TARGET nextpnr-${family}-chipdb
|
|
|
|
OUTPUT ${family}/chipdb-${device}.bin
|
2025-01-15 22:42:20 +08:00
|
|
|
INPUT ${CMAKE_CURRENT_BINARY_DIR}/chipdb-${device}.bba
|
|
|
|
MODE ${BBASM_MODE}
|
|
|
|
)
|
|
|
|
endforeach()
|