gNb creates PUSCH decode PDU

master
Xavier Arteaga 3 years ago committed by Andre Puschmann
parent ac39607c22
commit 3ae131b336

@ -240,9 +240,8 @@ public:
}; };
struct pusch_t { struct pusch_t {
uint32_t pid = 0; ///< HARQ process ID uint32_t pid = 0; ///< HARQ process ID
srsran_sch_cfg_nr_t sch = {}; ///< PUSCH configuration srsran_sch_cfg_nr_t sch = {}; ///< PUSCH configuration
std::array<uint8_t*, SRSRAN_MAX_TB> data = {}; ///< Data pointer
}; };
/** /**
@ -272,11 +271,19 @@ public:
}; };
struct pusch_info_t { struct pusch_info_t {
uint16_t rnti; // Context
uint32_t pid = 0; ///< HARQ process ID uint16_t rnti; ///< UE temporal identifier
uint32_t pid = 0; ///< HARQ process ID
// SCH and UCI payload information
srsran_pusch_res_nr_t pusch_data; srsran_pusch_res_nr_t pusch_data;
srsran_uci_cfg_nr_t uci_cfg; ///< Provides UCI configuration, so stack does not need to keep the pending state srsran_uci_cfg_nr_t uci_cfg; ///< Provides UCI configuration, so stack does not need to keep the pending state
// ... add signal measurements here
// Actual SCH PDU
srsran::unique_byte_buffer_t pdu = nullptr;
// PUSCH signal measurements
// ...
}; };
struct rach_info_t { struct rach_info_t {

@ -549,11 +549,18 @@ static int sch_nr_decode(srsran_sch_nr_t* q,
return SRSRAN_ERROR_INVALID_INPUTS; return SRSRAN_ERROR_INVALID_INPUTS;
} }
// Protect softbuffer access
if (!tb->softbuffer.rx) { if (!tb->softbuffer.rx) {
ERROR("Missing softbuffer!"); ERROR("Missing softbuffer!");
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }
// Protect PDU access
if (!res->payload) {
ERROR("Missing payload pointer!");
return SRSRAN_ERROR;
}
int8_t* input_ptr = e_bits; int8_t* input_ptr = e_bits;
uint32_t nof_iter_sum = 0; uint32_t nof_iter_sum = 0;

@ -11,16 +11,15 @@
*/ */
#include "srsenb/hdr/phy/nr/slot_worker.h" #include "srsenb/hdr/phy/nr/slot_worker.h"
#include <srsran/common/common.h> #include "srsran/common/buffer_pool.h"
#include "srsran/common/common.h"
namespace srsenb { namespace srsenb {
namespace nr { namespace nr {
slot_worker::slot_worker(srsran::phy_common_interface& common_, slot_worker::slot_worker(srsran::phy_common_interface& common_,
stack_interface_phy_nr& stack_, stack_interface_phy_nr& stack_,
srslog::basic_logger& logger_) : srslog::basic_logger& logger_) :
common(common_), common(common_), stack(stack_), logger(logger_)
stack(stack_),
logger(logger_)
{ {
// Do nothing // Do nothing
} }
@ -203,12 +202,13 @@ bool slot_worker::work_ul()
// For each PUSCH... // For each PUSCH...
for (stack_interface_phy_nr::pusch_t& pusch : ul_sched.pusch) { for (stack_interface_phy_nr::pusch_t& pusch : ul_sched.pusch) {
// Get payload PDU // Prepare PUSCH
stack_interface_phy_nr::pusch_info_t pusch_info = {}; stack_interface_phy_nr::pusch_info_t pusch_info = {};
pusch_info.uci_cfg = pusch.sch.uci; pusch_info.uci_cfg = pusch.sch.uci;
pusch_info.pid = pusch.pid; pusch_info.pid = pusch.pid;
pusch_info.pusch_data.tb[0].payload = pusch.data[0]; pusch_info.pdu = srsran::make_byte_buffer();
pusch_info.pusch_data.tb[1].payload = pusch.data[1]; pusch_info.pusch_data.tb[0].payload = pusch_info.pdu->data();
pusch_info.pusch_data.tb[1].payload = pusch_info.pdu->data();
// Decode PUSCH // Decode PUSCH
if (srsran_gnb_ul_get_pusch(&gnb_ul, &ul_slot_cfg, &pusch.sch, &pusch.sch.grant, &pusch_info.pusch_data) < if (srsran_gnb_ul_get_pusch(&gnb_ul, &ul_slot_cfg, &pusch.sch, &pusch.sch.grant, &pusch_info.pusch_data) <
@ -369,7 +369,10 @@ bool slot_worker::set_common_cfg(const srsran_carrier_nr_t& carrier, const srsra
// Set gNb UL carrier // Set gNb UL carrier
if (srsran_gnb_ul_set_carrier(&gnb_ul, &carrier) < SRSRAN_SUCCESS) { if (srsran_gnb_ul_set_carrier(&gnb_ul, &carrier) < SRSRAN_SUCCESS) {
logger.error("Error setting UL carrier"); logger.error("Error setting UL carrier (pci=%d, nof_prb=%d, max_mimo_layers=%d)",
carrier.pci,
carrier.nof_prb,
carrier.max_mimo_layers);
return false; return false;
} }

@ -283,13 +283,7 @@ int mac_nr::get_ul_sched(const srsran_slot_cfg_t& slot_cfg, ul_sched_t& ul_sched
pusch_slot++; pusch_slot++;
} }
int ret = sched.get_ul_sched(pusch_slot, 0, ul_sched); return sched.get_ul_sched(pusch_slot, 0, ul_sched);
for (pusch_t& pusch : ul_sched.pusch) {
pusch.data[0] = nullptr; // FIXME: add ptr to data to be filled
pusch.data[1] = nullptr;
}
return SRSRAN_SUCCESS;
} }
int mac_nr::pucch_info(const srsran_slot_cfg_t& slot_cfg, const mac_interface_phy_nr::pucch_info_t& pucch_info) int mac_nr::pucch_info(const srsran_slot_cfg_t& slot_cfg, const mac_interface_phy_nr::pucch_info_t& pucch_info)
@ -314,7 +308,7 @@ bool mac_nr::handle_uci_data(const uint16_t rnti, const srsran_uci_cfg_nr_t& cfg
int mac_nr::pusch_info(const srsran_slot_cfg_t& slot_cfg, const mac_interface_phy_nr::pusch_info_t& pusch_info) int mac_nr::pusch_info(const srsran_slot_cfg_t& slot_cfg, const mac_interface_phy_nr::pusch_info_t& pusch_info)
{ {
uint16_t rnti = pusch_info.rnti; uint16_t rnti = pusch_info.rnti;
// Handle UCI data // Handle UCI data
if (not handle_uci_data(rnti, pusch_info.uci_cfg, pusch_info.pusch_data.uci)) { if (not handle_uci_data(rnti, pusch_info.uci_cfg, pusch_info.pusch_data.uci)) {

@ -264,7 +264,8 @@ private:
} }
// Set softbuffer // Set softbuffer
pusch_cfg.grant.tb[0].softbuffer.rx = &rx_harq_proc[slot_cfg.idx].get_softbuffer(dci.ndi); pusch_cfg.grant.tb[0].softbuffer.rx =
&rx_harq_proc[slot_cfg.idx].get_softbuffer(dci.ndi, pusch_cfg.grant.tb[0].tbs);
// Push scheduling results // Push scheduling results
dl_sched.pdcch_ul.push_back(pdcch); dl_sched.pdcch_ul.push_back(pdcch);
@ -464,11 +465,6 @@ public:
if (not use_dummy_sched) { if (not use_dummy_sched) {
int ret = sched->get_ul_sched(pusch_slot, 0, ul_sched); int ret = sched->get_ul_sched(pusch_slot, 0, ul_sched);
for (pusch_t& pusch : ul_sched.pusch) {
pusch.data[0] = rx_harq_proc[pusch.pid].get_tb(pusch.sch.grant.tb[0].tbs).data();
pusch.data[1] = nullptr;
}
return ret; return ret;
} }
@ -495,10 +491,6 @@ public:
// Schedule PUSCH // Schedule PUSCH
if (has_pusch) { if (has_pusch) {
// Generate data
pusch.data[0] = rx_harq_proc[pusch.pid].get_tb(pusch.sch.grant.tb[0].tbs).data();
pusch.data[1] = nullptr;
// Put UCI configuration in PUSCH config // Put UCI configuration in PUSCH config
if (not phy_cfg.get_pusch_uci_cfg(slot_cfg, uci_cfg, pusch.sch)) { if (not phy_cfg.get_pusch_uci_cfg(slot_cfg, uci_cfg, pusch.sch)) {
logger.error("Error setting UCI configuration in PUSCH"); logger.error("Error setting UCI configuration in PUSCH");

@ -41,17 +41,12 @@ public:
~dummy_rx_harq_proc() { srsran_softbuffer_rx_free(&softbuffer); } ~dummy_rx_harq_proc() { srsran_softbuffer_rx_free(&softbuffer); }
srsran::byte_buffer_t& get_tb(uint32_t tbs_) srsran_softbuffer_rx_t& get_softbuffer(uint32_t ndi_, uint32_t tbs_)
{
tbs = tbs_;
return data;
}
srsran_softbuffer_rx_t& get_softbuffer(uint32_t ndi_)
{ {
if (ndi != ndi_ || first) { if (ndi != ndi_ || first) {
srsran_softbuffer_rx_reset(&softbuffer); srsran_softbuffer_rx_reset(&softbuffer);
ndi = ndi_; ndi = ndi_;
tbs = tbs_;
first = false; first = false;
} }

@ -77,7 +77,7 @@ public:
void new_grant_dl(const uint32_t cc_idx, const mac_nr_grant_dl_t& grant, tb_action_dl_t* action) override void new_grant_dl(const uint32_t cc_idx, const mac_nr_grant_dl_t& grant, tb_action_dl_t* action) override
{ {
action->tb.enabled = true; action->tb.enabled = true;
action->tb.softbuffer = &rx_harq_proc[grant.pid].get_softbuffer(grant.ndi); action->tb.softbuffer = &rx_harq_proc[grant.pid].get_softbuffer(grant.ndi, grant.tbs);
} }
void tb_decoded(const uint32_t cc_idx, const mac_nr_grant_dl_t& grant, tb_action_dl_result_t result) override {} void tb_decoded(const uint32_t cc_idx, const mac_nr_grant_dl_t& grant, tb_action_dl_result_t result) override {}
void new_grant_ul(const uint32_t cc_idx, const mac_nr_grant_ul_t& grant, tb_action_ul_t* action) override void new_grant_ul(const uint32_t cc_idx, const mac_nr_grant_ul_t& grant, tb_action_ul_t* action) override

Loading…
Cancel
Save