added configurable "sf_ahead" for NR/LTE in RU section. Tested in NR with sf_ahead=2 (normally 3)
This commit is contained in:
@@ -99,6 +99,7 @@ typedef enum {
|
||||
#define CONFIG_STRING_RU_IF_FREQUENCY "if_freq"
|
||||
#define CONFIG_STRING_RU_IF_FREQ_OFFSET "if_offset"
|
||||
#define CONFIG_STRING_RU_DO_PRECODING "do_precoding"
|
||||
#define CONFIG_STRING_RU_SF_AHEAD "sf_ahead"
|
||||
#define CONFIG_STRING_RU_NR_FLAG "nr_flag"
|
||||
#define CONFIG_STRING_RU_NR_SCS_FOR_RASTER "nr_scs_for_raster"
|
||||
|
||||
@@ -131,8 +132,9 @@ typedef enum {
|
||||
#define RU_IF_FREQUENCY 26
|
||||
#define RU_IF_FREQ_OFFSET 27
|
||||
#define RU_DO_PRECODING 28
|
||||
#define RU_NR_FLAG 29
|
||||
#define RU_NR_SCS_FOR_RASTER 30
|
||||
#define RU_SF_AHEAD 29
|
||||
#define RU_NR_FLAG 30
|
||||
#define RU_NR_SCS_FOR_RASTER 31
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* RU configuration parameters */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
@@ -167,6 +169,7 @@ typedef enum {
|
||||
{CONFIG_STRING_RU_IF_FREQUENCY, NULL, 0, u64ptr:NULL, defuintval:0, TYPE_UINT64, 0}, \
|
||||
{CONFIG_STRING_RU_IF_FREQ_OFFSET, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_RU_DO_PRECODING, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_RU_SF_AHEAD, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_RU_NR_FLAG, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_RU_NR_SCS_FOR_RASTER, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \
|
||||
}
|
||||
|
||||
@@ -423,7 +423,6 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts
|
||||
|
||||
}
|
||||
|
||||
extern uint16_t sl_ahead;
|
||||
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
int ssb_SubcarrierOffset,
|
||||
int pdsch_AntennaPorts,
|
||||
@@ -453,7 +452,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
* variable sl_ahead seems to not be correctly initialized, but I leave
|
||||
* it for information purposes here (the fix would always put 0, what
|
||||
* happens now, too) */
|
||||
req->SFN = i < sl_ahead;
|
||||
req->SFN = i < RC.nrmac[Mod_idP]->if_inst->sl_ahead;
|
||||
req->Slot = i;
|
||||
}
|
||||
|
||||
|
||||
@@ -400,7 +400,7 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot,
|
||||
uint16_t monitoring_slot_period,
|
||||
uint16_t monitoring_offset,uint8_t beam_index,
|
||||
uint8_t num_active_ssb,
|
||||
int16_t *tdd_beam_association){
|
||||
int16_t *tdd_beam_association, int sl_ahead){
|
||||
|
||||
// preferentially we schedule the msg2 in the mixed slot or in the last dl slot
|
||||
// if they are allowed by search space configuration
|
||||
@@ -628,7 +628,8 @@ void nr_initiate_ra_proc(module_id_t module_idP,
|
||||
monitoring_offset,
|
||||
beam_index,
|
||||
cc->num_active_ssb,
|
||||
nr_mac->tdd_beam_association);
|
||||
nr_mac->tdd_beam_association,
|
||||
nr_mac->if_inst->sl_ahead);
|
||||
|
||||
ra->Msg2_frame = msg2_frame;
|
||||
ra->Msg2_slot = msg2_slot;
|
||||
|
||||
@@ -57,8 +57,6 @@ extern int oai_nfapi_nr_srs_indication(nfapi_nr_srs_indication_t *ind);
|
||||
extern int oai_nfapi_nr_uci_indication(nfapi_nr_uci_indication_t *ind);
|
||||
extern int oai_nfapi_nr_rach_indication(nfapi_nr_rach_indication_t *ind);
|
||||
extern uint8_t nfapi_mode;
|
||||
extern uint16_t sf_ahead;
|
||||
extern uint16_t sl_ahead;
|
||||
|
||||
|
||||
void handle_nr_rach(NR_UL_IND_t *UL_info)
|
||||
@@ -472,14 +470,14 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) {
|
||||
nfapi_nr_config_request_scf_t *cfg = &mac->config[CC_id];
|
||||
int spf = get_spf(cfg);
|
||||
gNB_dlsch_ulsch_scheduler(module_id,
|
||||
(UL_info->frame+((UL_info->slot>(spf-1-sl_ahead))?1:0)) % 1024,
|
||||
(UL_info->slot+sl_ahead)%spf);
|
||||
(UL_info->frame+((UL_info->slot>(spf-1-ifi->sl_ahead))?1:0)) % 1024,
|
||||
(UL_info->slot+ifi->sl_ahead)%spf);
|
||||
|
||||
ifi->CC_mask = 0;
|
||||
sched_info->module_id = module_id;
|
||||
sched_info->CC_id = CC_id;
|
||||
sched_info->frame = (UL_info->frame + ((UL_info->slot>(spf-1-sl_ahead)) ? 1 : 0)) % 1024;
|
||||
sched_info->slot = (UL_info->slot+sl_ahead)%spf;
|
||||
sched_info->frame = (UL_info->frame + ((UL_info->slot>(spf-1-ifi->sl_ahead)) ? 1 : 0)) % 1024;
|
||||
sched_info->slot = (UL_info->slot+ifi->sl_ahead)%spf;
|
||||
sched_info->DL_req = &mac->DL_req[CC_id];
|
||||
sched_info->UL_dci_req = &mac->UL_dci_req[CC_id];
|
||||
|
||||
|
||||
@@ -115,6 +115,7 @@ typedef struct NR_IF_Module_s {
|
||||
uint16_t current_frame;
|
||||
uint8_t current_slot;
|
||||
pthread_mutex_t if_mutex;
|
||||
int sl_ahead;
|
||||
} NR_IF_Module_t;
|
||||
|
||||
/*Initial */
|
||||
|
||||
@@ -16,7 +16,7 @@ extern int oai_nfapi_cqi_indication(nfapi_cqi_indication_t *cqi_ind);
|
||||
extern int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind);
|
||||
extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind);
|
||||
|
||||
extern uint16_t sf_ahead;
|
||||
int sf_ahead=4;
|
||||
extern UL_RCC_IND_t UL_RCC_INFO;
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
Reference in New Issue
Block a user