build for NR UE
This commit is contained in:
@@ -1004,6 +1004,62 @@ long rrc_get_max_nr_csrs(uint8_t max_rbs, long b_SRS) {
|
|||||||
return c_srs;
|
return c_srs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||||
|
NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||||
|
int dl_antenna_ports,
|
||||||
|
int curr_bwp,
|
||||||
|
int do_csirs) {
|
||||||
|
|
||||||
|
if (do_csirs) {
|
||||||
|
csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList));
|
||||||
|
NR_NZP_CSI_RS_Resource_t *nzpcsi0 = calloc(1,sizeof(*nzpcsi0));
|
||||||
|
nzpcsi0->nzp_CSI_RS_ResourceId = 0;
|
||||||
|
NR_CSI_RS_ResourceMapping_t resourceMapping;
|
||||||
|
switch (dl_antenna_ports) {
|
||||||
|
case 1:
|
||||||
|
resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2;
|
||||||
|
resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t));
|
||||||
|
resourceMapping.frequencyDomainAllocation.choice.row2.size = 2;
|
||||||
|
resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 4;
|
||||||
|
resourceMapping.frequencyDomainAllocation.choice.row2.buf[0] = 0;
|
||||||
|
resourceMapping.frequencyDomainAllocation.choice.row2.buf[1] = 16;
|
||||||
|
resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
|
||||||
|
resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other;
|
||||||
|
resourceMapping.frequencyDomainAllocation.choice.other.buf = calloc(2, sizeof(uint8_t));
|
||||||
|
resourceMapping.frequencyDomainAllocation.choice.other.size = 1;
|
||||||
|
resourceMapping.frequencyDomainAllocation.choice.other.bits_unused = 2;
|
||||||
|
resourceMapping.frequencyDomainAllocation.choice.other.buf[0] = 4;
|
||||||
|
resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p2;
|
||||||
|
resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
AssertFatal(1==0,"Number of ports not yet supported\n");
|
||||||
|
}
|
||||||
|
resourceMapping.firstOFDMSymbolInTimeDomain = 6;
|
||||||
|
resourceMapping.firstOFDMSymbolInTimeDomain2 = NULL;
|
||||||
|
resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one;
|
||||||
|
resourceMapping.density.choice.one = (NULL_t)0;
|
||||||
|
resourceMapping.freqBand.startingRB = 0;
|
||||||
|
resourceMapping.freqBand.nrofRBs = ((curr_bwp>>2)+(curr_bwp%4>0))<<2;
|
||||||
|
nzpcsi0->resourceMapping = resourceMapping;
|
||||||
|
nzpcsi0->powerControlOffset = 0;
|
||||||
|
nzpcsi0->powerControlOffsetSS=calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS));
|
||||||
|
*nzpcsi0->powerControlOffsetSS = NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
|
||||||
|
nzpcsi0->scramblingID = *servingcellconfigcommon->physCellId;
|
||||||
|
nzpcsi0->periodicityAndOffset = calloc(1,sizeof(*nzpcsi0->periodicityAndOffset));
|
||||||
|
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320;
|
||||||
|
nzpcsi0->periodicityAndOffset->choice.slots320 = 0;
|
||||||
|
nzpcsi0->qcl_InfoPeriodicCSI_RS = calloc(1,sizeof(*nzpcsi0->qcl_InfoPeriodicCSI_RS));
|
||||||
|
*nzpcsi0->qcl_InfoPeriodicCSI_RS=0;
|
||||||
|
ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
void fill_initial_SpCellConfig(int uid,
|
void fill_initial_SpCellConfig(int uid,
|
||||||
NR_SpCellConfig_t *SpCellConfig,
|
NR_SpCellConfig_t *SpCellConfig,
|
||||||
NR_ServingCellConfigCommon_t *scc,
|
NR_ServingCellConfigCommon_t *scc,
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
|||||||
int do_srs,
|
int do_srs,
|
||||||
int uid);
|
int uid);
|
||||||
|
|
||||||
|
|
||||||
void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||||
NR_CSI_MeasConfig_t *csi_MeasConfig,
|
NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||||
int dl_antenna_ports,
|
int dl_antenna_ports,
|
||||||
|
|||||||
@@ -1318,61 +1318,6 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
|
||||||
NR_CSI_MeasConfig_t *csi_MeasConfig,
|
|
||||||
int dl_antenna_ports,
|
|
||||||
int curr_bwp,
|
|
||||||
int do_csirs) {
|
|
||||||
|
|
||||||
if (do_csirs) {
|
|
||||||
csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList));
|
|
||||||
NR_NZP_CSI_RS_Resource_t *nzpcsi0 = calloc(1,sizeof(*nzpcsi0));
|
|
||||||
nzpcsi0->nzp_CSI_RS_ResourceId = 0;
|
|
||||||
NR_CSI_RS_ResourceMapping_t resourceMapping;
|
|
||||||
switch (dl_antenna_ports) {
|
|
||||||
case 1:
|
|
||||||
resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2;
|
|
||||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf = calloc(2, sizeof(uint8_t));
|
|
||||||
resourceMapping.frequencyDomainAllocation.choice.row2.size = 2;
|
|
||||||
resourceMapping.frequencyDomainAllocation.choice.row2.bits_unused = 4;
|
|
||||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf[0] = 0;
|
|
||||||
resourceMapping.frequencyDomainAllocation.choice.row2.buf[1] = 16;
|
|
||||||
resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p1;
|
|
||||||
resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_noCDM;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
resourceMapping.frequencyDomainAllocation.present = NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other;
|
|
||||||
resourceMapping.frequencyDomainAllocation.choice.other.buf = calloc(2, sizeof(uint8_t));
|
|
||||||
resourceMapping.frequencyDomainAllocation.choice.other.size = 1;
|
|
||||||
resourceMapping.frequencyDomainAllocation.choice.other.bits_unused = 2;
|
|
||||||
resourceMapping.frequencyDomainAllocation.choice.other.buf[0] = 4;
|
|
||||||
resourceMapping.nrofPorts = NR_CSI_RS_ResourceMapping__nrofPorts_p2;
|
|
||||||
resourceMapping.cdm_Type = NR_CSI_RS_ResourceMapping__cdm_Type_fd_CDM2;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
AssertFatal(1==0,"Number of ports not yet supported\n");
|
|
||||||
}
|
|
||||||
resourceMapping.firstOFDMSymbolInTimeDomain = 6;
|
|
||||||
resourceMapping.firstOFDMSymbolInTimeDomain2 = NULL;
|
|
||||||
resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one;
|
|
||||||
resourceMapping.density.choice.one = (NULL_t)0;
|
|
||||||
resourceMapping.freqBand.startingRB = 0;
|
|
||||||
resourceMapping.freqBand.nrofRBs = ((curr_bwp>>2)+(curr_bwp%4>0))<<2;
|
|
||||||
nzpcsi0->resourceMapping = resourceMapping;
|
|
||||||
nzpcsi0->powerControlOffset = 0;
|
|
||||||
nzpcsi0->powerControlOffsetSS=calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS));
|
|
||||||
*nzpcsi0->powerControlOffsetSS = NR_NZP_CSI_RS_Resource__powerControlOffsetSS_db0;
|
|
||||||
nzpcsi0->scramblingID = *servingcellconfigcommon->physCellId;
|
|
||||||
nzpcsi0->periodicityAndOffset = calloc(1,sizeof(*nzpcsi0->periodicityAndOffset));
|
|
||||||
nzpcsi0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320;
|
|
||||||
nzpcsi0->periodicityAndOffset->choice.slots320 = 0;
|
|
||||||
nzpcsi0->qcl_InfoPeriodicCSI_RS = calloc(1,sizeof(*nzpcsi0->qcl_InfoPeriodicCSI_RS));
|
|
||||||
*nzpcsi0->qcl_InfoPeriodicCSI_RS=0;
|
|
||||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList->list,nzpcsi0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||||
|
|||||||
@@ -673,7 +673,7 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
|
|||||||
if (samples_received == nsamps) s->wait_for_first_pps=0;
|
if (samples_received == nsamps) s->wait_for_first_pps=0;
|
||||||
|
|
||||||
// bring RX data into 12 LSBs for softmodem RX
|
// bring RX data into 12 LSBs for softmodem RX
|
||||||
for (int i=0; i<cc; i++) {
|
for (int i=0; i<cc; i++) {
|
||||||
|
|
||||||
#if defined(__x86_64__) || defined(__i386__)
|
#if defined(__x86_64__) || defined(__i386__)
|
||||||
#ifdef __AVX2__
|
#ifdef __AVX2__
|
||||||
@@ -693,7 +693,6 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
|
|||||||
for (int j=0; j<nsamps2; j++)
|
for (int j=0; j<nsamps2; j++)
|
||||||
((int16x8_t *)buff[i])[j] = vshrq_n_s16(buff_tmp[i][j],rxshift);
|
((int16x8_t *)buff[i])[j] = vshrq_n_s16(buff_tmp[i][j],rxshift);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (samples_received < nsamps) {
|
if (samples_received < nsamps) {
|
||||||
@@ -1096,7 +1095,6 @@ extern "C" {
|
|||||||
if (device->type==USRP_X300_DEV) {
|
if (device->type==USRP_X300_DEV) {
|
||||||
openair0_cfg[0].rx_gain_calib_table = calib_table_x310;
|
openair0_cfg[0].rx_gain_calib_table = calib_table_x310;
|
||||||
std::cerr << "-- Using calibration table: calib_table_x310" << std::endl;
|
std::cerr << "-- Using calibration table: calib_table_x310" << std::endl;
|
||||||
// s->usrp->set_rx_dc_offset(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (device->type==USRP_N300_DEV) {
|
if (device->type==USRP_N300_DEV) {
|
||||||
|
|||||||
Reference in New Issue
Block a user