From 376de5807fd0fd7d044a15b2395d147258cae902 Mon Sep 17 00:00:00 2001 From: mmajoral Date: Tue, 20 Mar 2018 18:06:20 +0100 Subject: [PATCH] Added FPGA-related changes --- src/core/receiver/control_thread.cc | 7 ++++++ src/core/receiver/gnss_flowgraph.cc | 33 ++++++++++++++++++++++++++++- src/core/receiver/gnss_flowgraph.h | 2 ++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index db3e3841b..15646a4d3 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -138,6 +138,13 @@ void ControlThread::run() keyboard_thread_ = boost::thread(&ControlThread::keyboard_listener, this); sysv_queue_thread_ = boost::thread(&ControlThread::sysv_queue_listener, this); + bool enable_FPGA = configuration_->property("Channel.enable_FPGA", false); + + if (enable_FPGA == true) + { + flowgraph_->start_acquisition_helper(); + } + // Main loop to read and process the control messages while (flowgraph_->running() && !stop_) { diff --git a/src/core/receiver/gnss_flowgraph.cc b/src/core/receiver/gnss_flowgraph.cc index e379220a5..b30c18c8d 100644 --- a/src/core/receiver/gnss_flowgraph.cc +++ b/src/core/receiver/gnss_flowgraph.cc @@ -107,6 +107,8 @@ void GNSSFlowgraph::connect() } for (int i = 0; i < sources_count_; i++) + { + if (configuration_->property(sig_source_.at(i)->role() + ".enable_FPGA", false)==false) { try { @@ -120,9 +122,12 @@ void GNSSFlowgraph::connect() return; } } + } // Signal Source > Signal conditioner > for (unsigned int i = 0; i < sig_conditioner_.size(); i++) + { + if (configuration_->property(sig_conditioner_.at(i)->role() + ".enable_FPGA", false)==false) { try { @@ -136,6 +141,7 @@ void GNSSFlowgraph::connect() return; } } + } for (unsigned int i = 0; i < channels_count_; i++) { @@ -184,6 +190,10 @@ void GNSSFlowgraph::connect() for (int i = 0; i < sources_count_; i++) { + //FPGA Accelerators do not need signal sources or conditioners + //as the samples are feed directly to the FPGA fabric, so, if enabled, do not connect any source + if (configuration_->property(sig_source_.at(i)->role() + ".enable_FPGA", false)==false) + { try { //TODO: Remove this array implementation and create generic multistream connector @@ -244,12 +254,17 @@ void GNSSFlowgraph::connect() return; } } + } DLOG(INFO) << "Signal source connected to signal conditioner"; // Signal conditioner (selected_signal_source) >> channels (i) (dependent of their associated SignalSource_ID) int selected_signal_conditioner_ID; for (unsigned int i = 0; i < channels_count_; i++) { + + bool FPGA_enabled = configuration_->property(sig_conditioner_.at(selected_signal_conditioner_ID)->role() + ".enable_FPGA", false); + if (FPGA_enabled == false) + { selected_signal_conditioner_ID = configuration_->property("Channel" + boost::lexical_cast(i) + ".RF_channel_ID", 0); try { @@ -265,7 +280,7 @@ void GNSSFlowgraph::connect() } DLOG(INFO) << "signal conditioner " << selected_signal_conditioner_ID << " connected to channel " << i; - + } // Signal Source > Signal conditioner >> Channels >> Observables try { @@ -285,7 +300,10 @@ void GNSSFlowgraph::connect() if (channels_state_[i] == 1) { + if (FPGA_enabled == false) + { channels_.at(i)->start_acquisition(); + } available_GNSS_signals_.pop_front(); LOG(INFO) << "Channel " << i << " assigned to " << channels_.at(i)->get_signal(); LOG(INFO) << "Channel " << i << " connected to observables and ready for acquisition"; @@ -295,11 +313,14 @@ void GNSSFlowgraph::connect() LOG(INFO) << "Channel " << i << " connected to observables in standby mode"; } //connect the sample counter to the channel 0 + if (FPGA_enabled == false) + { if (i == 0) { ch_out_sample_counter = gnss_sdr_make_sample_counter(); top_block_->connect(channels_.at(i)->get_right_block(), 0, ch_out_sample_counter, 0); } + } } /* @@ -326,6 +347,16 @@ void GNSSFlowgraph::connect() top_block_->dump(); } +void GNSSFlowgraph::start_acquisition_helper() +{ + for (unsigned int i = 0; i < channels_count_; i++) + { + if (channels_state_[i] == 1) + { + channels_.at(i)->start_acquisition(); + } + } +} void GNSSFlowgraph::wait() { diff --git a/src/core/receiver/gnss_flowgraph.h b/src/core/receiver/gnss_flowgraph.h index 615ee0dc4..a0f09e4bf 100644 --- a/src/core/receiver/gnss_flowgraph.h +++ b/src/core/receiver/gnss_flowgraph.h @@ -86,6 +86,8 @@ public: void wait(); + void start_acquisition_helper(); + /*! * \brief Applies an action to the flowgraph *