SRSUE: Initial UL channel simulator

master
Xavier Arteaga 6 years ago committed by Xavier Arteaga
parent ad9808c2aa
commit 1f4cf8121b

@ -763,6 +763,7 @@ typedef struct {
bool pregenerate_signals;
srslte::channel::args_t dl_channel_args;
srslte::channel::args_t ul_channel_args;
} phy_args_t;
/* RAT agnostic Interface MAC -> PHY */

@ -123,7 +123,7 @@ void channel::run(cf_t* in[SRSLTE_MAX_PORTS], cf_t* out[SRSLTE_MAX_PORTS], uint3
}
// Copy output buffer
memcpy(out[i], buffer_out, sizeof(cf_t) * len);
memcpy(out[i], buffer_in, sizeof(cf_t) * len);
}
}

@ -177,6 +177,7 @@ private:
radio_interface_phy* radio_h;
float cfo;
srslte::log* log_h;
srslte::channel_ptr ul_channel = nullptr;
int rar_grant_tti;

@ -146,7 +146,7 @@ void parse_args(all_args_t* args, int argc, char* argv[])
("gw.ip_devname", bpo::value<string>(&args->stack.gw.tun_dev_name)->default_value("tun_srsue"), "Name of the tun_srsue device")
("gw.ip_netmask", bpo::value<string>(&args->stack.gw.tun_dev_netmask)->default_value("255.255.255.0"), "Netmask of the tun_srsue device")
/* Channel emulator section */
/* Downlink Channel emulator section */
("channel.dl.enable", bpo::value<bool>(&args->phy.dl_channel_args.enable)->default_value(false), "Enable/Disable internal Downlink channel emulator")
("channel.dl.fading.enable", bpo::value<bool>(&args->phy.dl_channel_args.fading_enable)->default_value(false), "Enable/Disable Fading model")
("channel.dl.fading.model", bpo::value<std::string>(&args->phy.dl_channel_args.fading_model)->default_value("none"), "Fading model + maximum doppler (E.g. none, epa5, eva70, etu300, etc)")
@ -158,6 +158,18 @@ void parse_args(all_args_t* args, int argc, char* argv[])
("channel.dl.rlf.t_on_ms", bpo::value<uint32_t >(&args->phy.dl_channel_args.rlf_t_on_ms)->default_value(10000), "Time for On state of the channel (ms)")
("channel.dl.rlf.t_off_ms", bpo::value<uint32_t >(&args->phy.dl_channel_args.rlf_t_off_ms)->default_value(2000), "Time for Off state of the channel (ms)")
/* Uplink Channel emulator section */
("channel.ul.enable", bpo::value<bool>(&args->phy.ul_channel_args.enable)->default_value(false), "Enable/Disable internal Uplink channel emulator")
("channel.ul.fading.enable", bpo::value<bool>(&args->phy.ul_channel_args.fading_enable)->default_value(false), "Enable/Disable Fading model")
("channel.ul.fading.model", bpo::value<std::string>(&args->phy.ul_channel_args.fading_model)->default_value("none"), "Fading model + maximum doppler (E.g. none, epa5, eva70, etu300, etc)")
("channel.ul.delay.enable", bpo::value<bool>(&args->phy.ul_channel_args.delay_enable)->default_value(false), "Enable/Disable Delay simulator")
("channel.ul.delay.period", bpo::value<uint32_t>(&args->phy.ul_channel_args.delay_period_s)->default_value(3600), "Delay period in seconds (integer)")
("channel.ul.delay.maximum_us", bpo::value<float>(&args->phy.ul_channel_args.delay_max_us)->default_value(100.0f), "Maximum delay in microseconds")
("channel.ul.delay.minimum_us", bpo::value<float>(&args->phy.ul_channel_args.delay_min_us)->default_value(10.0f), "Minimum delay in microseconds")
("channel.ul.rlf.enable", bpo::value<bool>(&args->phy.ul_channel_args.rlf_enable)->default_value(false), "Enable/Disable Radio-Link Failure simulator")
("channel.ul.rlf.t_on_ms", bpo::value<uint32_t >(&args->phy.ul_channel_args.rlf_t_on_ms)->default_value(10000), "Time for On state of the channel (ms)")
("channel.ul.rlf.t_off_ms", bpo::value<uint32_t >(&args->phy.ul_channel_args.rlf_t_off_ms)->default_value(2000), "Time for Off state of the channel (ms)")
/* Expert section */
("expert.phy.worker_cpu_mask",
bpo::value<int>(&args->phy.worker_cpu_mask)->default_value(-1),

@ -125,6 +125,12 @@ void phy_common::init(phy_args_t* _args,
args = _args;
is_first_tx = true;
sr_last_tx_tti = -1;
// Instantiate UL channel emulator
if (args->ul_channel_args.enable) {
ul_channel =
srslte::channel_ptr(new srslte::channel(args->ul_channel_args, args->nof_rf_channels * args->nof_rx_ant));
}
}
void phy_common::set_ue_dl_cfg(srslte_ue_dl_cfg_t* ue_dl_cfg)
@ -565,11 +571,21 @@ void phy_common::worker_end(uint32_t tti,
// For each radio, transmit
for (uint32_t i = 0; i < args->nof_radios; i++) {
if (tx_enable && !srslte_timestamp_iszero(&tx_time[i])) {
if (ul_channel) {
ul_channel->run(buffer[i], buffer[i], nof_samples[i], tx_time[i]);
}
radio_h->tx(i, buffer[i], nof_samples[i], tx_time[i]);
is_first_of_burst[i] = false;
} else {
if (radio_h->is_continuous_tx()) {
if (!is_first_of_burst[i]) {
if (ul_channel && !srslte_timestamp_iszero(&tx_time[i])) {
ul_channel->run(buffer[i], buffer[i], nof_samples[i], tx_time[i]);
}
radio_h->tx(i, zeros_multi, nof_samples[i], tx_time[i]);
}
} else {
@ -588,6 +604,10 @@ void phy_common::worker_end(uint32_t tti,
void phy_common::set_cell(const srslte_cell_t& c)
{
cell = c;
if (ul_channel) {
ul_channel->set_srate((uint32_t)srslte_sampling_freq_hz(cell.nof_prb));
}
}
uint32_t phy_common::get_nof_prb()

@ -93,8 +93,7 @@ void sync::init(radio_interface_phy* _radio,
}
if (worker_com->args->dl_channel_args.enable) {
channel_emulator = srslte::channel_ptr(new srslte::channel(
worker_com->args->dl_channel_args, worker_com->args->nof_rx_ant * worker_com->args->nof_rx_ant));
channel_emulator = srslte::channel_ptr(new srslte::channel(worker_com->args->dl_channel_args, nof_rf_channels));
}
nof_workers = workers_pool->get_nof_workers();

@ -210,6 +210,16 @@ enable = false
#dl.rlf.enable = false
#dl.rlf.t_on_ms = 10000
#dl.rlf.t_off_ms = 2000
#ul.enable = false
#ul.fading.enable = false
#ul.fading.model = none
#ul.delay.enable = false
#ul.delay.period = 3600
#ul.delay.maximum_us = 100
#ul.delay.minimum_us = 10
#ul.rlf.enable = false
#ul.rlf.t_on_ms = 10000
#ul.rlf.t_off_ms = 2000
#####################################################################
# Expert configuration options

Loading…
Cancel
Save