From 34174c98f38a9096adc71665fbb9c00aed345293 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 30 May 2017 23:23:26 -0700 Subject: eiscat/mpm: Moved EISCAT full init sequence to UHD --- host/include/uhd/rfnoc/blocks/radio_eiscat.xml | 4 ++++ .../usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp | 21 +++++++++++++++++++-- .../usrp/dboard/eiscat/eiscat_radio_ctrl_impl.hpp | 2 ++ 3 files changed, 25 insertions(+), 2 deletions(-) (limited to 'host') diff --git a/host/include/uhd/rfnoc/blocks/radio_eiscat.xml b/host/include/uhd/rfnoc/blocks/radio_eiscat.xml index a7077d503..69f7ffc50 100644 --- a/host/include/uhd/rfnoc/blocks/radio_eiscat.xml +++ b/host/include/uhd/rfnoc/blocks/radio_eiscat.xml @@ -47,6 +47,10 @@ SR_FIR_BRAM_WRITE_TAPS
201
+ + SR_SYSREF +
221
+
SR_CHANNEL_GAIN_0
204
diff --git a/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp b/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp index ce5c4ca26..d948a89c0 100644 --- a/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp +++ b/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp @@ -35,7 +35,6 @@ namespace { const size_t SR_ANTENNA_SELECT_BASE = 192; // Note: On other dboards, 192 is DB_GPIO address space const size_t RB_CHOOSE_BEAMS = 10; - const double EISCAT_TICK_RATE = 208e6; // Hz const double EISCAT_RADIO_RATE = 104e6; // Hz const double EISCAT_CENTER_FREQ = 104e6; // Hz @@ -394,9 +393,27 @@ bool eiscat_radio_ctrl_impl::check_radio_config() void eiscat_radio_ctrl_impl::set_rpc_client( uhd::rpc_client::sptr rpcc, - const uhd::device_addr_t & /* block_args */ + const uhd::device_addr_t &block_args ) { _rpcc = rpcc; + std::function send_sysref; + if (block_args.has_key("use_mpm_sysref")) { + send_sysref = [rpcc](){ rpcc->call("db_0_send_sysref"); }; + } else { + send_sysref = [this](){ this->sr_write("SR_SYSREF", 1); }; + } + + UHD_LOG_INFO( + "EISCAT", + "Finalizing dboard initialization using internal PPS" + ); + send_sysref(); + rpcc->call_with_token("db_0_init_adcs_and_deframers"); + rpcc->call_with_token("db_1_init_adcs_and_deframers"); + send_sysref(); + std::this_thread::sleep_for(std::chrono::milliseconds(500)); + rpcc->call_with_token("db_0_check_deframer_status"); + rpcc->call_with_token("db_1_check_deframer_status"); } /**************************************************************************** diff --git a/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.hpp b/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.hpp index edc44631e..33708f3b3 100644 --- a/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.hpp +++ b/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.hpp @@ -87,6 +87,8 @@ public: protected: virtual bool check_radio_config(); + /*! Finalize initialization sequence + */ void set_rpc_client( uhd::rpc_client::sptr rpcc, const uhd::device_addr_t &block_args -- cgit v1.2.3