From f9b450bc80e2520f622a3d8fb3ba42c1d879ef2e Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Fri, 22 Mar 2019 16:03:09 +0100 Subject: [PATCH 1/3] Adding channel modifications for FPGA acceleration --- src/algorithms/channel/adapters/channel.cc | 11 ++++++++++- src/algorithms/channel/libs/channel_fsm.cc | 15 ++++++++++++++- src/algorithms/channel/libs/channel_fsm.h | 7 ++++--- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index 9620e5d67..a344b9580 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -56,6 +56,7 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, std::s channel_fsm_ = std::make_shared(); flag_enable_fpga = configuration->property("GNSS-SDR.enable_FPGA", false); + acq_->set_channel(channel_); acq_->set_channel_fsm(channel_fsm_); trk_->set_channel(channel_); @@ -236,7 +237,15 @@ void Channel::start_acquisition() { std::lock_guard lk(mx); bool result = false; - result = channel_fsm_->Event_start_acquisition(); + if (!flag_enable_fpga) + { + result = channel_fsm_->Event_start_acquisition(); + } + else + { + result = channel_fsm_->Event_start_acquisition_fpga(); + channel_fsm_->start_acquisition(); + } if (!result) { LOG(WARNING) << "Invalid channel event"; diff --git a/src/algorithms/channel/libs/channel_fsm.cc b/src/algorithms/channel/libs/channel_fsm.cc index 533bbd2d4..f5e75ed7c 100644 --- a/src/algorithms/channel/libs/channel_fsm.cc +++ b/src/algorithms/channel/libs/channel_fsm.cc @@ -1,7 +1,8 @@ /*! * \file channel_fsm.cc * \brief Implementation of a State Machine for channel - * \authors Antonio Ramos, 2017. antonio.ramos(at)cttc.es + * \authors Javier Arribas, 2019. javiarribas@gmail.com + * Antonio Ramos, 2017. antonio.ramos(at)cttc.es * Luis Esteve, 2011. luis(at)epsilon-formacion.com * * ------------------------------------------------------------------------- @@ -74,6 +75,18 @@ bool ChannelFsm::Event_stop_channel() } +bool ChannelFsm::Event_start_acquisition_fpga() +{ + std::lock_guard lk(mx); + if ((d_state == 1) || (d_state == 2)) + { + return false; + } + d_state = 1; + DLOG(INFO) << "CH = " << channel_ << ". Ev start acquisition FPGA"; + return true; +} + bool ChannelFsm::Event_start_acquisition() { std::lock_guard lk(mx); diff --git a/src/algorithms/channel/libs/channel_fsm.h b/src/algorithms/channel/libs/channel_fsm.h index bb26b3c08..8a3342511 100644 --- a/src/algorithms/channel/libs/channel_fsm.h +++ b/src/algorithms/channel/libs/channel_fsm.h @@ -1,7 +1,8 @@ /*! * \file channel_fsm.h * \brief Interface of the State Machine for channel - * \authors Antonio Ramos, 2017. antonio.ramos(at)cttc.es + * \authors Javier Arribas, 2019. javiarribas@gmail.com + * Antonio Ramos, 2017. antonio.ramos(at)cttc.es * Luis Esteve, 2011. luis(at)epsilon-formacion.com * * ------------------------------------------------------------------------- @@ -55,9 +56,10 @@ public: void set_telemetry(std::shared_ptr telemetry); void set_queue(gr::msg_queue::sptr queue); void set_channel(uint32_t channel); - + void start_acquisition(); // FSM EVENTS bool Event_start_acquisition(); + bool Event_start_acquisition_fpga(); bool Event_valid_acquisition(); bool Event_stop_channel(); bool Event_failed_acquisition_repeat(); @@ -65,7 +67,6 @@ public: bool Event_failed_tracking_standby(); private: - void start_acquisition(); void start_tracking(); void stop_acquisition(); void stop_tracking(); From c877e745652d43e2d35d136130f2f626a75d56b7 Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Fri, 22 Mar 2019 18:11:45 +0100 Subject: [PATCH 2/3] -Adding more FPGA helpers to channel operations --- src/algorithms/channel/adapters/channel.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/algorithms/channel/adapters/channel.cc b/src/algorithms/channel/adapters/channel.cc index a344b9580..419df642c 100644 --- a/src/algorithms/channel/adapters/channel.cc +++ b/src/algorithms/channel/adapters/channel.cc @@ -216,6 +216,11 @@ void Channel::set_signal(const Gnss_Signal& gnss_signal) gnss_synchro_.PRN = gnss_signal_.get_satellite().get_PRN(); gnss_synchro_.System = gnss_signal_.get_satellite().get_system_short().c_str()[0]; acq_->set_local_code(); + if (flag_enable_fpga) + { + //set again the gnss_synchro pointer to trigger the preloading of the current PRN code to the FPGA fabric + trk_->set_gnss_synchro(&gnss_synchro_); + } nav_->set_satellite(gnss_signal_.get_satellite()); } From a94e74def289dbfaf3b46b6a9ae55e27370622b7 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 23 Mar 2019 00:43:01 +0100 Subject: [PATCH 3/3] Search for generic BLAS and LAPACK implementations --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 356eec9db..f4418eb8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1335,6 +1335,9 @@ if(OS_IS_MACOSX) # Avoid using the implementation that comes with the Accelerate framework include(AvoidAccelerate) else() + if(NOT BLA_VENDOR) + set(BLA_VENDOR "Generic") + endif() find_package(BLAS) set_package_properties(BLAS PROPERTIES URL "http://www.netlib.org/blas/"