Adding channel modifications for FPGA acceleration

This commit is contained in:
Javier Arribas 2019-03-22 16:03:09 +01:00
parent 52aa4290d8
commit f9b450bc80
3 changed files with 28 additions and 5 deletions

View File

@ -56,6 +56,7 @@ Channel::Channel(ConfigurationInterface* configuration, uint32_t channel, std::s
channel_fsm_ = std::make_shared<ChannelFsm>();
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<std::mutex> 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";

View File

@ -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<std::mutex> 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<std::mutex> lk(mx);

View File

@ -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<TelemetryDecoderInterface> 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();