Added PDSCH DMRS aditional unpacking

master
Xavier Arteaga 4 years ago committed by Andre Puschmann
parent 334b308c35
commit 6c39a5e4ff

@ -47,6 +47,7 @@ struct pucch_res_s;
struct sched_request_res_cfg_s;
struct pusch_cfg_s;
struct pdsch_cfg_s;
struct dmrs_dl_cfg_s;
struct dmrs_ul_cfg_s;
struct beta_offsets_s;
struct uci_on_pusch_s;
@ -93,7 +94,9 @@ bool make_phy_pusch_alloc_type(const asn1::rrc_nr::pusch_cfg_s& pusch_cfg,
srsran_resource_alloc_t* in_srsran_resource_alloc);
bool make_phy_pdsch_alloc_type(const asn1::rrc_nr::pdsch_cfg_s& pdsch_cfg,
srsran_resource_alloc_t* in_srsran_resource_alloc);
bool make_phy_dmrs_additional_pos(const asn1::rrc_nr::dmrs_ul_cfg_s& dmrs_ul_cfg,
bool make_phy_dmrs_dl_additional_pos(const asn1::rrc_nr::dmrs_dl_cfg_s& dmrs_dl_cfg,
srsran_dmrs_sch_add_pos_t* in_srsran_dmrs_sch_add_pos);
bool make_phy_dmrs_ul_additional_pos(const asn1::rrc_nr::dmrs_ul_cfg_s& dmrs_ul_cfg,
srsran_dmrs_sch_add_pos_t* srsran_dmrs_sch_add_pos);
bool make_phy_beta_offsets(const asn1::rrc_nr::beta_offsets_s& beta_offsets,
srsran_beta_offsets_t* srsran_beta_offsets);

@ -829,7 +829,33 @@ bool make_phy_pdsch_alloc_type(const asn1::rrc_nr::pdsch_cfg_s& pdsch_cfg,
return true;
}
bool make_phy_dmrs_additional_pos(const dmrs_ul_cfg_s& dmrs_ul_cfg,
bool make_phy_dmrs_dl_additional_pos(const dmrs_dl_cfg_s& dmrs_dl_cfg,
srsran_dmrs_sch_add_pos_t* in_srsran_dmrs_sch_add_pos)
{
srsran_dmrs_sch_add_pos_t srsran_dmrs_sch_add_pos = {};
if (not dmrs_dl_cfg.dmrs_add_position_present) {
asn1::log_warning("dmrs_add_position option not present");
}
switch (dmrs_dl_cfg.dmrs_add_position) {
case dmrs_dl_cfg_s::dmrs_add_position_opts::pos0:
srsran_dmrs_sch_add_pos = srsran_dmrs_sch_add_pos_0;
break;
case dmrs_dl_cfg_s::dmrs_add_position_opts::pos1:
srsran_dmrs_sch_add_pos = srsran_dmrs_sch_add_pos_1;
break;
case dmrs_dl_cfg_s::dmrs_add_position_opts::pos3:
srsran_dmrs_sch_add_pos = srsran_dmrs_sch_add_pos_3;
break;
default:
asn1::log_warning("Invalid option for dmrs_add_position %s", dmrs_dl_cfg.dmrs_add_position.to_string());
return false;
}
*in_srsran_dmrs_sch_add_pos = srsran_dmrs_sch_add_pos;
return true;
}
bool make_phy_dmrs_ul_additional_pos(const dmrs_ul_cfg_s& dmrs_ul_cfg,
srsran_dmrs_sch_add_pos_t* in_srsran_dmrs_sch_add_pos)
{
srsran_dmrs_sch_add_pos_t srsran_dmrs_sch_add_pos = {};

@ -486,7 +486,7 @@ int make_phy_dmrs_additional_pos_test()
dmrs_ul_cfg.dmrs_add_position_present = true;
dmrs_ul_cfg.dmrs_add_position = dmrs_ul_cfg_s::dmrs_add_position_opts::pos1;
srsran_dmrs_sch_add_pos_t srsran_dmrs_sch_add_pos;
TESTASSERT(make_phy_dmrs_additional_pos(dmrs_ul_cfg, &srsran_dmrs_sch_add_pos) == true);
TESTASSERT(make_phy_dmrs_ul_additional_pos(dmrs_ul_cfg, &srsran_dmrs_sch_add_pos) == true);
TESTASSERT(srsran_dmrs_sch_add_pos == srsran_dmrs_sch_add_pos_1);

@ -606,6 +606,26 @@ bool rrc_nr::apply_sp_cell_init_dl_pdcch(const asn1::rrc_nr::pdcch_cfg_s& pdcch_
bool rrc_nr::apply_sp_cell_init_dl_pdsch(const asn1::rrc_nr::pdsch_cfg_s& pdsch_cfg)
{
if (pdsch_cfg.dmrs_dl_for_pdsch_map_type_a_present) {
if (pdsch_cfg.dmrs_dl_for_pdsch_map_type_a.type() == setup_release_c<dmrs_dl_cfg_s>::types_opts::setup) {
srsran_dmrs_sch_add_pos_t srsran_dmrs_sch_add_pos;
if (make_phy_dmrs_dl_additional_pos(pdsch_cfg.dmrs_dl_for_pdsch_map_type_a.setup(), &srsran_dmrs_sch_add_pos) ==
true) {
phy_cfg.pdsch.dmrs_typeA.additional_pos = srsran_dmrs_sch_add_pos;
phy_cfg.pdsch.dmrs_typeA.present = true;
} else {
logger.warning("Warning while build srsran_dmrs_sch_add_pos structure");
return false;
}
} else {
logger.warning("Option dmrs_dl_for_pdsch_map_type_a not of type setup");
return false;
}
} else {
logger.warning("Option dmrs_dl_for_pdsch_map_type_a not present");
return false;
}
srsran_resource_alloc_t resource_alloc;
if (make_phy_pdsch_alloc_type(pdsch_cfg, &resource_alloc) == true) {
phy_cfg.pdsch.alloc = resource_alloc;
@ -1004,7 +1024,7 @@ bool rrc_nr::apply_sp_cell_ded_ul_pusch(const asn1::rrc_nr::pusch_cfg_s& pusch_c
if (pusch_cfg.dmrs_ul_for_pusch_map_type_a_present) {
if (pusch_cfg.dmrs_ul_for_pusch_map_type_a.type() == setup_release_c<dmrs_ul_cfg_s>::types_opts::setup) {
srsran_dmrs_sch_add_pos_t srsran_dmrs_sch_add_pos;
if (make_phy_dmrs_additional_pos(pusch_cfg.dmrs_ul_for_pusch_map_type_a.setup(), &srsran_dmrs_sch_add_pos) ==
if (make_phy_dmrs_ul_additional_pos(pusch_cfg.dmrs_ul_for_pusch_map_type_a.setup(), &srsran_dmrs_sch_add_pos) ==
true) {
phy_cfg.pusch.dmrs_typeA.additional_pos = srsran_dmrs_sch_add_pos;
phy_cfg.pusch.dmrs_typeA.present = true;

Loading…
Cancel
Save