Commit 3bb1407e authored by cig's avatar cig

NR PRACH generation fixes for correct reception of msg1

parent 6982e6f4
This diff is collapsed.
...@@ -20,10 +20,10 @@ ...@@ -20,10 +20,10 @@
*/ */
/*! \file nr_l1_helper.c /*! \file nr_l1_helper.c
* \brief PHY helper function adapted to NR * \brief PHY helper functions for PRACH adapted to NR
* \author Guido Casati * \author Guido Casati
* \date 2019 * \date 2019
* \version 1.0 * \version 2.0
* \email guido.casati@iis.fraunhofer.de * \email guido.casati@iis.fraunhofer.de
* @ingroup _mac * @ingroup _mac
...@@ -41,15 +41,14 @@ int8_t nr_get_DELTA_PREAMBLE(module_id_t mod_id, int CC_id, uint16_t prach_forma ...@@ -41,15 +41,14 @@ int8_t nr_get_DELTA_PREAMBLE(module_id_t mod_id, int CC_id, uint16_t prach_forma
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id); NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
NR_ServingCellConfigCommon_t *scc = mac->scc; NR_ServingCellConfigCommon_t *scc = mac->scc;
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup; NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
NR_SubcarrierSpacing_t scs = *nr_rach_ConfigCommon->msg1_SubcarrierSpacing;
int prach_sequence_length = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present - 1;
uint8_t prachConfigIndex, mu;
AssertFatal(CC_id == 0, "Transmission on secondary CCs is not supported yet\n"); AssertFatal(CC_id == 0, "Transmission on secondary CCs is not supported yet\n");
uint8_t prachConfigIndex, mu;
// SCS configuration from msg1_SubcarrierSpacing and table 4.2-1 in TS 38.211 // SCS configuration from msg1_SubcarrierSpacing and table 4.2-1 in TS 38.211
NR_SubcarrierSpacing_t scs = *nr_rach_ConfigCommon->msg1_SubcarrierSpacing;
switch (scs){ switch (scs){
case NR_SubcarrierSpacing_kHz15: case NR_SubcarrierSpacing_kHz15:
mu = 0; mu = 0;
...@@ -91,7 +90,10 @@ int8_t nr_get_DELTA_PREAMBLE(module_id_t mod_id, int CC_id, uint16_t prach_forma ...@@ -91,7 +90,10 @@ int8_t nr_get_DELTA_PREAMBLE(module_id_t mod_id, int CC_id, uint16_t prach_forma
prachConfigIndex = nr_rach_ConfigCommon->rach_ConfigGeneric.prach_ConfigurationIndex; prachConfigIndex = nr_rach_ConfigCommon->rach_ConfigGeneric.prach_ConfigurationIndex;
if (prach_sequence_length == 0) {
switch (prach_format) { switch (prach_format) {
AssertFatal(prach_format < 4, "Illegal PRACH format %d for sequence length 839\n", prach_format);
// long preamble formats // long preamble formats
case 0: case 0:
case 3: case 3:
...@@ -102,30 +104,32 @@ int8_t nr_get_DELTA_PREAMBLE(module_id_t mod_id, int CC_id, uint16_t prach_forma ...@@ -102,30 +104,32 @@ int8_t nr_get_DELTA_PREAMBLE(module_id_t mod_id, int CC_id, uint16_t prach_forma
case 2: case 2:
return -6; return -6;
}
// short preamble formats } else {
case 0xa1: switch (prach_format) { // short preamble formats
case 0xb1: case 0:
case 3:
return 8 + 3*mu; return 8 + 3*mu;
case 0xa2: case 1:
case 0xb2: case 4:
case 0xc2: case 8:
return 5 + 3*mu; return 5 + 3*mu;
case 0xa3: case 2:
case 0xb3: case 5:
return 3 + 3*mu; return 3 + 3*mu;
case 0xb4: case 6:
return 3*mu; return 3*mu;
case 0xc0: case 7:
return 5 + 3*mu; return 5 + 3*mu;
default: default:
AssertFatal(1 == 0, "[UE %d] ue_procedures.c: FATAL, Illegal preambleFormat %d, prachConfigIndex %d\n", mod_id, prach_format, prachConfigIndex); AssertFatal(1 == 0, "[UE %d] ue_procedures.c: FATAL, Illegal preambleFormat %d, prachConfigIndex %d\n", mod_id, prach_format, prachConfigIndex);
} }
}
} }
/* TS 38.321 subclause 5.1.3 - RA preamble transmission - ra_PREAMBLE_RECEIVED_TARGET_POWER configuration */ /* TS 38.321 subclause 5.1.3 - RA preamble transmission - ra_PREAMBLE_RECEIVED_TARGET_POWER configuration */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment