Skip to content

Commit

Permalink
Resource Allocation and PDSCH: handle Rel-16 PBCH repetition. Repeate…
Browse files Browse the repository at this point in the history
…d symbols are not used in PBCH decoding, just taken out of PDSCH.
  • Loading branch information
kuehnhammer committed Oct 5, 2023
1 parent 5d9d5f6 commit 3f08ef5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
4 changes: 3 additions & 1 deletion lib/include/srsran/phy/common/phy_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ extern "C" {

typedef enum { SRSRAN_CP_NORM = 0, SRSRAN_CP_EXT } srsran_cp_t;
typedef enum { SRSRAN_SF_NORM = 0, SRSRAN_SF_MBSFN } srsran_sf_t;
typedef enum { SRSRAN_SCS_15KHZ = 0, SRSRAN_SCS_7KHZ5, SRSRAN_SCS_1KHZ25 } srsran_scs_t;
//typedef enum { SRSRAN_SCS_15KHZ = 0, SRSRAN_SCS_7KHZ5, SRSRAN_SCS_2KHZ5, SRSRAN_SCS_1KHZ25, SRSRAN_SCS_0KHZ37 } srsran_scs_t;
typedef enum { SRSRAN_SCS_15KHZ = 0, SRSRAN_SCS_7KHZ5, SRSRAN_SCS_1KHZ25 } srsran_scs_t;

#define SRSRAN_INVALID_RNTI 0x0 // TS 36.321 - Table 7.1-1 RNTI 0x0 isn't a valid DL RNTI
#define SRSRAN_CRNTI_START 0x000B
Expand Down Expand Up @@ -272,6 +273,7 @@ typedef struct SRSRAN_API {
uint8_t additional_non_mbms_frames;
uint8_t mbsfn_prb;
uint32_t semi_static_cfi;
bool has_pbch_repetition_r16;
} srsran_cell_t;

// Common downlink properties that may change every subframe
Expand Down
7 changes: 7 additions & 0 deletions lib/src/phy/phch/pdsch.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ static inline bool pdsch_cp_skip_symbol(const srsran_cell_t* cell,
if (s == 0 && (sf_idx == 0 || sf_idx == 5) && (l >= grant->nof_symb_slot[s] - 2)) {
return true;
}
if (cell->mbms_dedicated && cell->nof_prb > 6 &&
cell->has_pbch_repetition_r16 && sf_idx == 0 &&
( (s == 0 && l == 3) ||
(s == 1 && l == 4) ||
(s == 1 && l == 5))) {
return true;
}
} else {
// TDD SSS
if (s == 1 && (sf_idx == 0 || sf_idx == 5) && (l >= grant->nof_symb_slot[s] - 1)) {
Expand Down
20 changes: 16 additions & 4 deletions lib/src/phy/phch/ra_dl.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,27 @@ uint32_t ra_re_x_prb(const srsran_cell_t* cell, srsran_dl_sf_cfg_t* sf, uint32_t
}

/* if it's the prb in the middle, there are less RE due to PBCH and PSS/SSS */

/* when nof_prb > 6, the cell is MBMS dedicated and PBCH repetiton is configured,
* 3 REs will be used for repeated PBCH symbols. Subtract them as well. */
bool has_pbch_repetition = cell->mbms_dedicated && cell->nof_prb > 6 && cell->has_pbch_repetition_r16;

if (cell->frame_type == SRSRAN_FDD) {
if ((subframe == 0 || subframe == 5) &&
(prb_idx >= cell->nof_prb / 2 - 3 && prb_idx < cell->nof_prb / 2 + 3 + (cell->nof_prb % 2))) {
if (subframe == 0) {
if (slot == 0) {
re = (nof_symbols - nof_ctrl_symbols - 2) * SRSRAN_NRE;
re = (nof_symbols - nof_ctrl_symbols - (has_pbch_repetition ? 3 : 2)) * SRSRAN_NRE;
if (has_pbch_repetition) {
skip_refs = false;
}
} else {
if (SRSRAN_CP_ISEXT(cp_)) {
re = (nof_symbols - 4) * SRSRAN_NRE;
re = (nof_symbols - (has_pbch_repetition ? 6 : 4)) * SRSRAN_NRE;
skip_refs = false;
} else {
re = (nof_symbols - 4) * SRSRAN_NRE + 2 * cell->nof_ports;

}
}
} else if (subframe == 5) {
Expand All @@ -91,9 +100,12 @@ uint32_t ra_re_x_prb(const srsran_cell_t* cell, srsran_dl_sf_cfg_t* sf, uint32_t
}
if ((cell->nof_prb % 2) && (prb_idx == cell->nof_prb / 2 - 3 || prb_idx == cell->nof_prb / 2 + 3)) {
if (slot == 0) {
re += 2 * SRSRAN_NRE / 2;
re += (has_pbch_repetition ? 3 : 2) * SRSRAN_NRE / 2;
if (has_pbch_repetition) {
re -= cell->nof_ports > 2 ? 2 : cell->nof_ports;
}
} else if (subframe == 0) {
re += 4 * SRSRAN_NRE / 2 - cell->nof_ports;
re += (has_pbch_repetition ? 6 : 4) * SRSRAN_NRE / 2 - cell->nof_ports;
if (SRSRAN_CP_ISEXT(cp_)) {
re -= cell->nof_ports > 2 ? 2 : cell->nof_ports;
}
Expand Down
3 changes: 1 addition & 2 deletions lib/src/phy/ue/ue_mib.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,7 @@ int srsran_ue_mib_sync_decode_prb(srsran_ue_mib_sync_t* q,
return -1;
}

if (srsran_ue_sync_get_sfn(&q->ue_sync)%4 == 0 && srsran_ue_sync_get_sfidx(&q->ue_sync) == 0) {
// if (srsran_ue_sync_get_sfidx(&q->ue_sync) == 0 ) { // [TODO] fix for mixed-mode
if (srsran_ue_sync_get_sfidx(&q->ue_sync) == 0 ) {
if (ret == 1) {
mib_ret = srsran_ue_mib_decode(&q->ue_mib, bch_payload, nof_tx_ports, sfn_offset);
} else {
Expand Down

0 comments on commit 3f08ef5

Please sign in to comment.