Update machxo2 backend with minimal build system changes so nextpnr compiles again.

This commit is contained in:
William D. Jones 2020-06-27 17:08:11 -04:00 committed by gatecat
parent c38762f91f
commit 539651609c
2 changed files with 13 additions and 3 deletions

View File

@ -70,9 +70,14 @@ def main():
pytrellis.load_database(database.get_db_root()) pytrellis.load_database(database.get_db_root())
# Dummy
dev_name = "1200"
bba = BinaryBlobAssembler() bba = BinaryBlobAssembler()
bba.pre('#include "nextpnr.h"') bba.pre('#include "nextpnr.h"')
bba.pre('#include "embed.h"')
bba.pre('NEXTPNR_NAMESPACE_BEGIN') bba.pre('NEXTPNR_NAMESPACE_BEGIN')
bba.post('EmbeddedFile chipdb_file_%s("machxo2/chipdb-%s.bin", chipdb_blob_%s);' % (dev_name, dev_name, dev_name))
bba.post('NEXTPNR_NAMESPACE_END') bba.post('NEXTPNR_NAMESPACE_END')
bba.push("chipdb_blob_%s" % args.device) bba.push("chipdb_blob_%s" % args.device)
bba.u8(0, None) bba.u8(0, None)

View File

@ -33,9 +33,14 @@ foreach(device ${MACHXO2_DEVICES})
endif() endif()
endforeach() endforeach()
if(WIN32) if(WIN32)
list(APPEND chipdb_sources set(chipdb_rc ${CMAKE_CURRENT_BINARY_DIR}/${family}/resource/chipdb.rc)
${CMAKE_CURRENT_SOURCE_DIR}/${family}/resource/embed.cc list(APPEND chipdb_sources ${chipdb_rc})
${CMAKE_CURRENT_SOURCE_DIR}/${family}/resource/chipdb.rc)
file(WRITE ${chipdb_rc})
foreach(device ${MACHXO2_DEVICES})
file(APPEND ${chipdb_rc}
"${family}/chipdb-${device}.bin RCDATA \"${CMAKE_CURRENT_BINARY_DIR}/${family}/chipdb/chipdb-${device}.bin\"")
endforeach()
endif() endif()
add_custom_target(chipdb-${family}-bins DEPENDS ${chipdb_sources} ${chipdb_binaries}) add_custom_target(chipdb-${family}-bins DEPENDS ${chipdb_sources} ${chipdb_binaries})