From dd0c009e6ff489e498ff4a968b01d65a0c87dc70 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Fri, 2 Jun 2017 21:55:35 -0700 Subject: [PATCH] CPLD: Stop generating HackRF CPLD .hpp file. --- firmware/application/CMakeLists.txt | 2 +- firmware/common/hackrf_cpld_data.hpp | 39 ++++++++++++++++++++++ firmware/tools/extract_svf_data_xc2c64a.py | 9 ++--- 3 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 firmware/common/hackrf_cpld_data.hpp diff --git a/firmware/application/CMakeLists.txt b/firmware/application/CMakeLists.txt index 5e46e4b28..03d7bc007 100644 --- a/firmware/application/CMakeLists.txt +++ b/firmware/application/CMakeLists.txt @@ -327,7 +327,7 @@ add_custom_command( add_custom_command( OUTPUT ${HACKRF_CPLD_DATA_HPP} ${HACKRF_CPLD_DATA_CPP} - COMMAND ${EXTRACT_SVF_DATA_XC2C64A} ${HACKRF_CPLD_SVF_PATH} hackrf::one::cpld::verify_blocks ${HACKRF_CPLD_DATA_HPP} ${HACKRF_CPLD_DATA_CPP} + COMMAND ${EXTRACT_SVF_DATA_XC2C64A} ${HACKRF_CPLD_SVF_PATH} hackrf::one::cpld::verify_blocks ${HACKRF_CPLD_DATA_CPP} DEPENDS ${EXTRACT_SVF_DATA_XC2C64A} ${HACKRF_CPLD_SVF_PATH} ) diff --git a/firmware/common/hackrf_cpld_data.hpp b/firmware/common/hackrf_cpld_data.hpp new file mode 100644 index 000000000..888d41eac --- /dev/null +++ b/firmware/common/hackrf_cpld_data.hpp @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc. + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __HACKRF_CPLD_DATA_H__ +#define __HACKRF_CPLD_DATA_H__ + +#include "cpld_xilinx.hpp" + +namespace hackrf { +namespace one { +namespace cpld { + +using CPLD = ::cpld::xilinx::XC2C64A; + +extern const CPLD::verify_blocks_t verify_blocks; + +} /* namespace hackrf */ +} /* namespace one */ +} /* namespace cpld */ + +#endif/*__HACKRF_CPLD_DATA_H__*/ diff --git a/firmware/tools/extract_svf_data_xc2c64a.py b/firmware/tools/extract_svf_data_xc2c64a.py index 1c1b8c1b5..8ec3afd54 100755 --- a/firmware/tools/extract_svf_data_xc2c64a.py +++ b/firmware/tools/extract_svf_data_xc2c64a.py @@ -36,7 +36,7 @@ def crack_variable_path(variable_path): parser = argparse.ArgumentParser() parser.add_argument('input_file_path', type=str) parser.add_argument('variable_path', type=str) -parser.add_argument('header_file_path', type=str) +# parser.add_argument('header_file_path', type=str) parser.add_argument('data_file_path', type=str) args = parser.parse_args() @@ -330,12 +330,13 @@ for block in verify: if block['id'] == 0x05: block['tdo'] = program_done[0]['tdi'] -header_file_name = os.path.split(args.header_file_path)[1] +# header_file_name = os.path.split(args.header_file_path)[1] +header_file_name = 'hackrf_cpld_data.hpp' -header_includes = ('cpld_xilinx.hpp',) +# header_includes = ('cpld_xilinx.hpp',) data_includes = (header_file_name,) type_name = '::cpld::xilinx::XC2C64A::verify_blocks_t' -HeaderGen(header_includes, namespaces, type_name, variable_name).to_file(args.header_file_path) +# HeaderGen(header_includes, namespaces, type_name, variable_name).to_file(args.header_file_path) DataGen(data_includes, namespaces, type_name, variable_name, verify).to_file(args.data_file_path)