1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 04:30:33 +00:00

Added FPGA-related changes

This commit is contained in:
mmajoral 2018-03-20 18:06:20 +01:00
parent 7c406bb6eb
commit 376de5807f
3 changed files with 41 additions and 1 deletions

View File

@ -138,6 +138,13 @@ void ControlThread::run()
keyboard_thread_ = boost::thread(&ControlThread::keyboard_listener, this); keyboard_thread_ = boost::thread(&ControlThread::keyboard_listener, this);
sysv_queue_thread_ = boost::thread(&ControlThread::sysv_queue_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 // Main loop to read and process the control messages
while (flowgraph_->running() && !stop_) while (flowgraph_->running() && !stop_)
{ {

View File

@ -107,6 +107,8 @@ void GNSSFlowgraph::connect()
} }
for (int i = 0; i < sources_count_; i++) for (int i = 0; i < sources_count_; i++)
{
if (configuration_->property(sig_source_.at(i)->role() + ".enable_FPGA", false)==false)
{ {
try try
{ {
@ -120,9 +122,12 @@ void GNSSFlowgraph::connect()
return; return;
} }
} }
}
// Signal Source > Signal conditioner > // Signal Source > Signal conditioner >
for (unsigned int i = 0; i < sig_conditioner_.size(); i++) for (unsigned int i = 0; i < sig_conditioner_.size(); i++)
{
if (configuration_->property(sig_conditioner_.at(i)->role() + ".enable_FPGA", false)==false)
{ {
try try
{ {
@ -136,6 +141,7 @@ void GNSSFlowgraph::connect()
return; return;
} }
} }
}
for (unsigned int i = 0; i < channels_count_; i++) for (unsigned int i = 0; i < channels_count_; i++)
{ {
@ -183,6 +189,10 @@ void GNSSFlowgraph::connect()
int signal_conditioner_ID = 0; int signal_conditioner_ID = 0;
for (int i = 0; i < sources_count_; i++) 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 try
{ {
@ -244,11 +254,16 @@ void GNSSFlowgraph::connect()
return; return;
} }
} }
}
DLOG(INFO) << "Signal source connected to signal conditioner"; DLOG(INFO) << "Signal source connected to signal conditioner";
// Signal conditioner (selected_signal_source) >> channels (i) (dependent of their associated SignalSource_ID) // Signal conditioner (selected_signal_source) >> channels (i) (dependent of their associated SignalSource_ID)
int selected_signal_conditioner_ID; int selected_signal_conditioner_ID;
for (unsigned int i = 0; i < channels_count_; i++) 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<std::string>(i) + ".RF_channel_ID", 0); selected_signal_conditioner_ID = configuration_->property("Channel" + boost::lexical_cast<std::string>(i) + ".RF_channel_ID", 0);
try try
@ -265,7 +280,7 @@ void GNSSFlowgraph::connect()
} }
DLOG(INFO) << "signal conditioner " << selected_signal_conditioner_ID << " connected to channel " << i; DLOG(INFO) << "signal conditioner " << selected_signal_conditioner_ID << " connected to channel " << i;
}
// Signal Source > Signal conditioner >> Channels >> Observables // Signal Source > Signal conditioner >> Channels >> Observables
try try
{ {
@ -284,8 +299,11 @@ void GNSSFlowgraph::connect()
channels_.at(i)->set_signal(search_next_signal(gnss_signal, false)); channels_.at(i)->set_signal(search_next_signal(gnss_signal, false));
if (channels_state_[i] == 1) if (channels_state_[i] == 1)
{
if (FPGA_enabled == false)
{ {
channels_.at(i)->start_acquisition(); channels_.at(i)->start_acquisition();
}
available_GNSS_signals_.pop_front(); available_GNSS_signals_.pop_front();
LOG(INFO) << "Channel " << i << " assigned to " << channels_.at(i)->get_signal(); LOG(INFO) << "Channel " << i << " assigned to " << channels_.at(i)->get_signal();
LOG(INFO) << "Channel " << i << " connected to observables and ready for acquisition"; LOG(INFO) << "Channel " << i << " connected to observables and ready for acquisition";
@ -295,12 +313,15 @@ void GNSSFlowgraph::connect()
LOG(INFO) << "Channel " << i << " connected to observables in standby mode"; LOG(INFO) << "Channel " << i << " connected to observables in standby mode";
} }
//connect the sample counter to the channel 0 //connect the sample counter to the channel 0
if (FPGA_enabled == false)
{
if (i == 0) if (i == 0)
{ {
ch_out_sample_counter = gnss_sdr_make_sample_counter(); ch_out_sample_counter = gnss_sdr_make_sample_counter();
top_block_->connect(channels_.at(i)->get_right_block(), 0, ch_out_sample_counter, 0); top_block_->connect(channels_.at(i)->get_right_block(), 0, ch_out_sample_counter, 0);
} }
} }
}
/* /*
* Connect the observables output of each channel to the PVT block * Connect the observables output of each channel to the PVT block
@ -326,6 +347,16 @@ void GNSSFlowgraph::connect()
top_block_->dump(); 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() void GNSSFlowgraph::wait()
{ {

View File

@ -86,6 +86,8 @@ public:
void wait(); void wait();
void start_acquisition_helper();
/*! /*!
* \brief Applies an action to the flowgraph * \brief Applies an action to the flowgraph
* *