CMakeLists.txt,main.cpp: option to enable/disable svf_jtag support
This commit is contained in:
parent
cc1dc3c868
commit
e78b5e2995
|
|
@ -37,6 +37,7 @@ option(ENABLE_JLINK "enable JLink cable (requires libUSB)" ${
|
|||
option(ENABLE_DFU "enable DFU support (requires libUSB)" ${ENABLE_CABLE_ALL})
|
||||
option(ENABLE_FTDI_BASED_CABLE "enable cables based on FTDI (requires libFTDI" ${ENABLE_CABLE_ALL})
|
||||
option(ENABLE_GOWIN_GWU2X "enable Gowin GWU2X interface" ${ENABLE_CABLE_ALL})
|
||||
option(ENABLE_SVF_JTAG "enable SVF support" ${ENABLE_CABLE_ALL})
|
||||
option(ENABLE_USB_BLASTERI "enable Altera USB Blaster I support" ${ENABLE_CABLE_ALL})
|
||||
option(ENABLE_USB_BLASTERII "enable Altera USB Blaster II support" ${ENABLE_CABLE_ALL})
|
||||
|
||||
|
|
@ -257,7 +258,6 @@ list(APPEND OPENFPGALOADER_SOURCE
|
|||
src/spiFlash.cpp
|
||||
src/spiInterface.cpp
|
||||
src/epcq.cpp
|
||||
src/svf_jtag.cpp
|
||||
src/jtag.cpp
|
||||
)
|
||||
|
||||
|
|
@ -268,7 +268,6 @@ list(APPEND OPENFPGALOADER_HEADERS
|
|||
src/spiFlashdb.hpp
|
||||
src/epcq.hpp
|
||||
src/spiInterface.hpp
|
||||
src/svf_jtag.hpp
|
||||
)
|
||||
|
||||
# FTDI Based cables
|
||||
|
|
@ -504,6 +503,13 @@ list (APPEND OPENFPGALOADER_SOURCE src/remoteBitbang_client.cpp)
|
|||
list (APPEND OPENFPGALOADER_HEADERS src/remoteBitbang_client.hpp)
|
||||
endif()
|
||||
|
||||
# SVF JTAG file type support
|
||||
if (ENABLE_SVF_JTAG)
|
||||
list (APPEND OPENFPGALOADER_SOURCE src/svf_jtag.cpp)
|
||||
list (APPEND OPENFPGALOADER_HEADERS src/svf_jtag.hpp)
|
||||
add_definitions(-DENABLE_SVF_JTAG)
|
||||
endif()
|
||||
|
||||
# Xilinx Virtual Cable
|
||||
if (ENABLE_XILINX_VIRTUAL_CABLE)
|
||||
list (APPEND OPENFPGALOADER_SOURCE src/xvc_client.cpp src/xvc_server.cpp)
|
||||
|
|
|
|||
|
|
@ -59,7 +59,9 @@
|
|||
#ifdef ENABLE_XILINX_SUPPORT
|
||||
#include "xilinx.hpp"
|
||||
#endif
|
||||
#ifdef ENABLE_SVF_JTAG
|
||||
#include "svf_jtag.hpp"
|
||||
#endif
|
||||
#ifdef ENABLE_XVC
|
||||
#include "xvc_server.hpp"
|
||||
#endif
|
||||
|
|
@ -622,6 +624,7 @@ int main(int argc, char **argv)
|
|||
/* detect svf file and program the device */
|
||||
if (!args.file_type.compare("svf") ||
|
||||
args.bit_file.find(".svf") != string::npos) {
|
||||
#ifdef ENABLE_SVF_JTAG
|
||||
SVF_jtag *svf = new SVF_jtag(jtag, args.verbose);
|
||||
try {
|
||||
svf->parse(args.bit_file);
|
||||
|
|
@ -629,6 +632,11 @@ int main(int argc, char **argv)
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
#else
|
||||
printError("Support for SVF Jtag was not enabled at compile time");
|
||||
delete(jtag);
|
||||
return EXIT_FAILURE;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* check if selected device is supported
|
||||
|
|
|
|||
Loading…
Reference in New Issue