From ac3319d9066c09606f4c578025b92b9f31a5a365 Mon Sep 17 00:00:00 2001 From: Marc Majoral Date: Wed, 20 Dec 2023 17:01:24 +0100 Subject: [PATCH] remove EZDMA files --- .../signal_source/libs/fpga_ezdma.cc | 68 ------------------- .../signal_source/libs/fpga_ezdma.h | 64 ----------------- 2 files changed, 132 deletions(-) delete mode 100644 src/algorithms/signal_source/libs/fpga_ezdma.cc delete mode 100644 src/algorithms/signal_source/libs/fpga_ezdma.h diff --git a/src/algorithms/signal_source/libs/fpga_ezdma.cc b/src/algorithms/signal_source/libs/fpga_ezdma.cc deleted file mode 100644 index cb8f5497e..000000000 --- a/src/algorithms/signal_source/libs/fpga_ezdma.cc +++ /dev/null @@ -1,68 +0,0 @@ -/*! - * \file fpga_edma.cc - * \brief FPGA DMA control using the ezdma (See https://github.com/jeremytrimble/ezdma). - * \author Marc Majoral, mmajoral(at)cttc.es - * - * ----------------------------------------------------------------------------- - * - * GNSS-SDR is a Global Navigation Satellite System software-defined receiver. - * This file is part of GNSS-SDR. - * - * Copyright (C) 2010-2022 (see AUTHORS file for a list of contributors) - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ----------------------------------------------------------------------------- - */ -#include "fpga_ezdma.h" -#include -#include // for std::cerr -#include - -int Fpga_DMA::DMA_open() -{ - tx_fd = open("/dev/loop_tx", O_WRONLY); - if (tx_fd < 1) - { - return tx_fd; - } - // note: a problem was identified with the DMA: when switching from tx to rx or rx to tx mode - // the DMA transmission may hang. This problem will be fixed soon. - // for the moment this problem can be avoided by closing and opening the DMA a second time - if (close(tx_fd) < 0) - { - std::cerr << "Error closing loop device " << '\n'; - return -1; - } - // open the DMA a second time - tx_fd = open("/dev/loop_tx", O_WRONLY); - if (tx_fd < 1) - { - std::cerr << "Cannot open loop device\n"; - // stop the receiver - return tx_fd; - } - return 0; -} - - -int8_t *Fpga_DMA::get_buffer_address() -{ - return buffer; -} - - -int Fpga_DMA::DMA_write(int nbytes) const -{ - const int num_bytes_sent = write(tx_fd, buffer, nbytes); - if (num_bytes_sent != nbytes) - { - return -1; - } - return 0; -} - - -int Fpga_DMA::DMA_close() const -{ - return close(tx_fd); -} diff --git a/src/algorithms/signal_source/libs/fpga_ezdma.h b/src/algorithms/signal_source/libs/fpga_ezdma.h deleted file mode 100644 index 801d2a6b7..000000000 --- a/src/algorithms/signal_source/libs/fpga_ezdma.h +++ /dev/null @@ -1,64 +0,0 @@ -/*! - * \file fpga_ezdma.h - * \brief FPGA DMA control using the ezdma (See https://github.com/jeremytrimble/ezdma). - * \author Marc Majoral, mmajoral(at)cttc.es - * - * ----------------------------------------------------------------------------- - * - * GNSS-SDR is a Global Navigation Satellite System software-defined receiver. - * This file is part of GNSS-SDR. - * - * Copyright (C) 2010-2022 (see AUTHORS file for a list of contributors) - * SPDX-License-Identifier: GPL-3.0-or-later - * - * ----------------------------------------------------------------------------- - */ - - -#ifndef GNSS_SDR_FPGA_EDMA_H -#define GNSS_SDR_FPGA_EDMA_H - -#include // for std::int8_t - -/*! - * \brief Class that controls the switch DMA in the FPGA - */ -class Fpga_DMA -{ -public: - /*! - * \brief Default constructor. - */ - Fpga_DMA() = default; - - /*! - * \brief Default destructor. - */ - ~Fpga_DMA() = default; - - /*! - * \brief Open the DMA device driver. - */ - int DMA_open(void); - - /*! - * \brief Obtain DMA buffer address. - */ - int8_t *get_buffer_address(void); // NOLINT(readability-make-member-function-const) - - /*! - * \brief Transfer DMA data - */ - int DMA_write(int nbytes) const; - - /*! - * \brief Close the DMA device driver - */ - int DMA_close(void) const; - -private: - static const uint32_t DMA_MAX_BUFFER_SIZE = 4 * 16384; // 4-channel 16384-sample buffers - int8_t buffer[DMA_MAX_BUFFER_SIZE]; - int tx_fd; -}; -#endif // GNSS_SDR_FPGA_EDMA_H