diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py
index ee9f726c11..8092febe39 100644
--- a/ci-scripts/cls_containerize.py
+++ b/ci-scripts/cls_containerize.py
@@ -757,9 +757,13 @@ class Containerize():
cmd = 'cd ' + self.yamlPath[0] + ' && docker-compose -f docker-compose-ci.yml config | grep com.docker.network.bridge.name | sed -e "s@^.*name: @@"'
networkNames = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
if re.search('4g.*rfsimulator', self.yamlPath[0]) is not None:
+ # Excluding any traffic from LTE-UE container (192.168.61.30)
+ # From the trf-gen, keeping only PING traffic
cmd = 'sudo nohup tshark -f "(host 192.168.61.11 and icmp) or (not host 192.168.61.11 and not host 192.168.61.30 and not arp and not port 53 and not port 2152)"'
elif re.search('5g.*rfsimulator', self.yamlPath[0]) is not None:
- cmd = 'sudo nohup tshark -f "(host 192.168.72.135 and icmp) or (not host 192.168.72.135 and not host 192.168.71.150 and not arp and not port 53 and not port 2152 and not port 2153)"'
+ # Excluding any traffic from NR-UE containers (192.168.71.150 and 192.168.71.151)
+ # From the ext-dn, keeping only PING traffic
+ cmd = 'sudo nohup tshark -f "(host 192.168.72.135 and icmp) or (not host 192.168.72.135 and not host 192.168.71.150 and not host 192.168.71.151 and not arp and not port 53 and not port 2152 and not port 2153)"'
elif re.search('5g_l2sim', self.yamlPath[0]) is not None:
cmd = 'sudo nohup tshark -f "(host 192.168.72.135 and icmp) or (not host 192.168.72.135 and not arp and not port 53 and not port 2152 and not port 2153)"'
else:
@@ -817,46 +821,48 @@ class Containerize():
# Analyzing log file(s)!
listOfPossibleRanContainers = ['enb', 'gnb', 'cu', 'du']
for container in listOfPossibleRanContainers:
- filename = self.yamlPath[0] + '/*-oai-' + container + '.log'
- cmd = 'ls ' + filename
+ filenames = self.yamlPath[0] + '/*-oai-' + container + '.log'
+ cmd = 'ls ' + filenames
containerStatus = True
try:
lsStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
- filename = str(lsStatus).strip()
+ filenames = str(lsStatus).strip()
except:
containerStatus = False
if not containerStatus:
continue
- logging.debug('\u001B[1m Analyzing xNB logfile ' + filename + ' \u001B[0m')
- logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML, self.ran_checkers)
- if (logStatus < 0):
- fullStatus = False
- self.exitStatus = 1
- HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus)
- else:
- HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK)
+ for filename in filenames.split('\n'):
+ logging.debug('\u001B[1m Analyzing xNB logfile ' + filename + ' \u001B[0m')
+ logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML, self.ran_checkers)
+ if (logStatus < 0):
+ fullStatus = False
+ self.exitStatus = 1
+ HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus)
+ else:
+ HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK)
listOfPossibleUeContainers = ['lte-ue*', 'nr-ue*']
for container in listOfPossibleUeContainers:
- filename = self.yamlPath[0] + '/*-oai-' + container + '.log'
- cmd = 'ls ' + filename
+ filenames = self.yamlPath[0] + '/*-oai-' + container + '.log'
+ cmd = 'ls ' + filenames
containerStatus = True
try:
lsStatus = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True, timeout=10)
- filename = str(lsStatus).strip()
+ filenames = str(lsStatus).strip()
except:
containerStatus = False
if not containerStatus:
continue
- logging.debug('\u001B[1m Analyzing UE logfile ' + filename + ' \u001B[0m')
- logStatus = UE.AnalyzeLogFile_UE(filename, HTML, RAN)
- if (logStatus < 0):
- fullStatus = False
- HTML.CreateHtmlTestRow('UE log Analysis', 'KO', logStatus)
- else:
- HTML.CreateHtmlTestRow('UE log Analysis', 'OK', CONST.ALL_PROCESSES_OK)
+ for filename in filenames.split('\n'):
+ logging.debug('\u001B[1m Analyzing UE logfile ' + filename + ' \u001B[0m')
+ logStatus = UE.AnalyzeLogFile_UE(filename, HTML, RAN)
+ if (logStatus < 0):
+ fullStatus = False
+ HTML.CreateHtmlTestRow('UE log Analysis', 'KO', logStatus)
+ else:
+ HTML.CreateHtmlTestRow('UE log Analysis', 'OK', CONST.ALL_PROCESSES_OK)
cmd = 'rm ' + self.yamlPath[0] + '/*.log'
logging.debug(cmd)
diff --git a/ci-scripts/conf_files/gNB_SA_CU.conf b/ci-scripts/conf_files/gNB_SA_CU.conf
index 33cc3a51a7..9d64ae1976 100644
--- a/ci-scripts/conf_files/gNB_SA_CU.conf
+++ b/ci-scripts/conf_files/gNB_SA_CU.conf
@@ -45,8 +45,6 @@ gNBs =
remote_s_portc = 500;
remote_s_portd = 2152;
ssb_SubcarrierOffset = 0;
- pdsch_AntennaPorts = 1;
- pusch_AntennaPorts = 1;
min_rxtxtime = 6;
pdcch_ConfigSIB1 = (
diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf
index 0feb0bb811..60fb16318f 100644
--- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf
+++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.asue.conf
@@ -42,7 +42,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
- pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 2;
ul_prbblacklist = "51,52,53,54"
do_SRS = 1;
diff --git a/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf
index f667959f15..e26fc3030d 100644
--- a/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf
+++ b/ci-scripts/conf_files/gnb.sa.band66.fr1.106PRB.usrpn300.conf
@@ -33,8 +33,6 @@ gNBs =
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
- pdsch_AntennaPorts = 1;
- pusch_AntennaPorts = 1;
min_rxtxtime = 6;
pdcch_ConfigSIB1 = (
diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py
index 1551c1ea9a..287a0a3c09 100644
--- a/ci-scripts/ran.py
+++ b/ci-scripts/ran.py
@@ -997,8 +997,18 @@ class RANManagement():
for k in keys:
result = re.search(k, line)
if result is not None:
+ ue_prefix = 'ue0'
+ ue_res = re.search('UE ID 1|UE 1:', line)
+ if ue_res is not None:
+ ue_prefix = 'ue1'
+ ue_res = re.search('UE ID 2|UE 2:', line)
+ if ue_res is not None:
+ ue_prefix = 'ue2'
+ ue_res = re.search('UE ID 3|UE 3:', line)
+ if ue_res is not None:
+ ue_prefix = 'ue3'
#remove 1- all useless char before relevant info (ulsch or dlsch) 2- trailing char
- dlsch_ulsch_stats[k]=re.sub(r'^.*\]\s+', r'' , line.rstrip())
+ dlsch_ulsch_stats[ue_prefix+k]=re.sub(r'^.*\]\s+', r'' , line.rstrip())
result = re.search('Received NR_RRCReconfigurationComplete from UE', str(line))
if result is not None:
diff --git a/ci-scripts/xml_files/container_5g_rfsim.xml b/ci-scripts/xml_files/container_5g_rfsim.xml
index bab7f9637a..a1f50948a5 100644
--- a/ci-scripts/xml_files/container_5g_rfsim.xml
+++ b/ci-scripts/xml_files/container_5g_rfsim.xml
@@ -31,8 +31,11 @@
000001
000002
000003
+ 000004
020001
020002
+ 020003
+ 020004
030001
030002
100001
@@ -71,6 +74,14 @@
8
+
+ DeployGenObject
+ Deploy Second OAI 5G NR-UE RF sim SA
+ yaml_files/5g_rfsimulator
+ oai-nr-ue2
+ 9
+
+
PingFromContainer
Ping ext-dn from NR-UE
@@ -87,6 +98,22 @@
5
+
+ PingFromContainer
+ Ping ext-dn from Second NR-UE
+ rfsim5g-oai-nr-ue2
+ -I oaitun_ue1 -c 20 192.168.72.135
+ 5
+
+
+
+ PingFromContainer
+ Ping Second NR-UE from ext-dn
+ rfsim5g-oai-ext-dn
+ -c 20 12.1.1.3
+ 5
+
+
IperfFromContainer
Iperf UDP Downlink
diff --git a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
index 284ef22fc4..5f8a856028 100644
--- a/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
+++ b/nfapi/open-nFAPI/nfapi/public_inc/fapi_nr_ue_interface.h
@@ -464,7 +464,8 @@ typedef struct {
uint8_t nEpreRatioOfPDSCHToPTRS;
/// MCS table for this DLSCH
uint8_t mcs_table;
-
+ uint8_t nscid;
+ uint16_t dlDmrsScramblingId;
uint16_t pduBitmap;
} fapi_nr_dl_config_dlsch_pdu_rel15_t;
diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c
index 6a8faa6669..9ffc0f75ad 100644
--- a/openair1/PHY/INIT/nr_init.c
+++ b/openair1/PHY/INIT/nr_init.c
@@ -536,6 +536,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
}
nr_generate_modulation_table();
+ gNB->pdcch_gold_init = cfg->cell_config.phy_cell_id.value;
nr_init_pdcch_dmrs(gNB, cfg->cell_config.phy_cell_id.value);
nr_init_pbch_interleaver(gNB->nr_pbch_interleaver);
@@ -549,28 +550,30 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
pdsch_dmrs[slot] = (uint32_t ***)malloc16(fp->symbols_per_slot*sizeof(uint32_t **));
AssertFatal(pdsch_dmrs[slot]!=NULL, "NR init: pdsch_dmrs for slot %d - malloc failed\n", slot);
- int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
for (int symb=0; symbsymbols_per_slot; symb++) {
- pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(nb_codewords*sizeof(uint32_t *));
+ pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(NR_NB_NSCID*sizeof(uint32_t *));
AssertFatal(pdsch_dmrs[slot][symb]!=NULL, "NR init: pdsch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb);
- for (int q=0; qcell_config.phy_cell_id.value);
+
+ for (int nscid = 0; nscid < NR_NB_NSCID; nscid++) {
+ gNB->pdsch_gold_init[nscid] = cfg->cell_config.phy_cell_id.value;
+ nr_init_pdsch_dmrs(gNB, nscid, cfg->cell_config.phy_cell_id.value);
+ }
//PUSCH DMRS init
- gNB->nr_gold_pusch_dmrs = (uint32_t ****)malloc16(2*sizeof(uint32_t ***));
+ gNB->nr_gold_pusch_dmrs = (uint32_t ****)malloc16(NR_NB_NSCID*sizeof(uint32_t ***));
uint32_t ****pusch_dmrs = gNB->nr_gold_pusch_dmrs;
- // ceil(((NB_RB*6(k)*2(QPSK)/32) // 3 RE *2(QPSK)
int pusch_dmrs_init_length = ((fp->N_RB_UL*12)>>5)+1;
- for(int nscid=0; nscid<2; nscid++) {
+ for(int nscid=0; nscidslots_per_frame*sizeof(uint32_t **));
AssertFatal(pusch_dmrs[nscid]!=NULL, "NR init: pusch_dmrs for nscid %d - malloc failed\n", nscid);
@@ -585,9 +588,10 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
}
}
- uint32_t Nid_pusch[2] = {cfg->cell_config.phy_cell_id.value,cfg->cell_config.phy_cell_id.value};
- LOG_D(PHY,"Initializing PUSCH DMRS Gold sequence with (%x,%x)\n",Nid_pusch[0],Nid_pusch[1]);
- nr_gold_pusch(gNB, &Nid_pusch[0]);
+ for (int nscid=0; nscidpusch_gold_init[nscid] = cfg->cell_config.phy_cell_id.value;
+ nr_gold_pusch(gNB, nscid, gNB->pusch_gold_init[nscid]);
+ }
//CSI RS init
gNB->nr_gold_csi_rs = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **));
@@ -607,6 +611,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
}
}
+ gNB->csi_gold_init = cfg->cell_config.phy_cell_id.value;
nr_init_csi_rs(gNB, cfg->cell_config.phy_cell_id.value);
for (int id=0; idbeam_id = (uint8_t **)malloc16(Ptx*sizeof(uint8_t*));
for (i=0;itxdataF[i] = (int32_t*)malloc16_clear(fp->samples_per_frame_wCP*sizeof(int32_t)); // [hna] samples_per_frame without CP
- LOG_D(PHY,"[INIT] common_vars->txdataF[%d] = %p (%lu bytes)\n",
- i,common_vars->txdataF[i],
- fp->samples_per_frame_wCP*sizeof(int32_t));
- common_vars->beam_id[i] = (uint8_t*)malloc16_clear(fp->symbols_per_slot*fp->slots_per_frame*sizeof(uint8_t));
- memset(common_vars->beam_id[i],255,fp->symbols_per_slot*fp->slots_per_frame);
+ common_vars->txdataF[i] = (int32_t*)malloc16_clear(fp->samples_per_frame_wCP*sizeof(int32_t)); // [hna] samples_per_frame without CP
+ LOG_D(PHY,"[INIT] common_vars->txdataF[%d] = %p (%lu bytes)\n",
+ i,common_vars->txdataF[i],
+ fp->samples_per_frame_wCP*sizeof(int32_t));
+ common_vars->beam_id[i] = (uint8_t*)malloc16_clear(fp->symbols_per_slot*fp->slots_per_frame*sizeof(uint8_t));
+ memset(common_vars->beam_id[i],255,fp->symbols_per_slot*fp->slots_per_frame);
}
for (i=0;irxdataF[i] = (int32_t*)malloc16_clear(fp->samples_per_frame_wCP*sizeof(int32_t));
@@ -740,10 +745,9 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
free_and_zero(pdcch_dmrs);
uint32_t ****pdsch_dmrs = gNB->nr_gold_pdsch_dmrs;
- int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
for (int slot = 0; slot < fp->slots_per_frame; slot++) {
for (int symb = 0; symb < fp->symbols_per_slot; symb++) {
- for (int q = 0; q < nb_codewords; q++)
+ for (int q = 0; q < NR_NB_NSCID; q++)
free_and_zero(pdsch_dmrs[slot][symb][q]);
free_and_zero(pdsch_dmrs[slot][symb]);
}
@@ -771,7 +775,7 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
free_and_zero(csi_rs);
for (int id = 0; id < NUMBER_OF_NR_SRS_MAX; id++) {
- for (int i = 0; i < Prx; i++){
+ for (int i = 0; i < Prx; i++) {
free_and_zero(gNB->nr_srs_info[id]->srs_received_signal[i]);
free_and_zero(gNB->nr_srs_info[id]->srs_ls_estimated_channel[i]);
free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_freq[i]);
diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c
index 142ef9b1d9..e5bf08abf6 100644
--- a/openair1/PHY/INIT/nr_init_ue.c
+++ b/openair1/PHY/INIT/nr_init_ue.c
@@ -210,18 +210,21 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
// ceil(((NB_RB*6(k)*2(QPSK)/32) // 3 RE *2(QPSK)
int pusch_dmrs_init_length = ((fp->N_RB_UL*12)>>5)+1;
-
- ue->nr_gold_pusch_dmrs = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **));
- uint32_t ***pusch_dmrs = ue->nr_gold_pusch_dmrs;
+ ue->nr_gold_pusch_dmrs = (uint32_t ****)malloc16(fp->slots_per_frame*sizeof(uint32_t ***));
+ uint32_t ****pusch_dmrs = ue->nr_gold_pusch_dmrs;
for (slot=0; slotslots_per_frame; slot++) {
- pusch_dmrs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *));
+ pusch_dmrs[slot] = (uint32_t ***)malloc16(fp->symbols_per_slot*sizeof(uint32_t **));
AssertFatal(pusch_dmrs[slot]!=NULL, "init_nr_ue_signal: pusch_dmrs for slot %d - malloc failed\n", slot);
for (symb=0; symbsymbols_per_slot; symb++) {
- pusch_dmrs[slot][symb] = (uint32_t *)malloc16(pusch_dmrs_init_length*sizeof(uint32_t));
+ pusch_dmrs[slot][symb] = (uint32_t **)malloc16(NR_NB_NSCID*sizeof(uint32_t *));
AssertFatal(pusch_dmrs[slot][symb]!=NULL, "init_nr_ue_signal: pusch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb);
+ for (int q=0; qsymbols_per_slot*sizeof(uint32_t **));
AssertFatal(pdsch_dmrs[slot]!=NULL, "NR init: pdsch_dmrs for slot %d - malloc failed\n", slot);
- int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
for (int symb=0; symbsymbols_per_slot; symb++) {
- pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(nb_codewords*sizeof(uint32_t *));
+ pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(NR_NB_NSCID*sizeof(uint32_t *));
AssertFatal(pdsch_dmrs[slot][symb]!=NULL, "NR init: pdsch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb);
- for (int q=0; qn_connected_gNB; gNB_id++) {
+ for (gNB_id = 0; gNB_id < ue->n_connected_gNB+1; gNB_id++) {
for (th_id=0; th_idpdsch_vars[th_id][gNB_id] = (NR_UE_PDSCH *)malloc16_clear(sizeof(NR_UE_PDSCH));
}
+ for (th_id=0; th_idpdsch_vars[th_id][gNB_id], fp );
+ }
+ int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
+ for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->llr[i] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );//Q_m = 8 bits/Sym, Code_Rate=3, Number of Segments =8, Circular Buffer K_cb = 8448
+ }
+ for (i=0; ipdsch_vars[th_id][gNB_id]->layer_llr[i] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );//Q_m = 8 bits/Sym, Code_Rate=3, Number of Segments =8, Circular Buffer K_cb = 8448
+ }
+ }
+ }
+
+ for (gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) {
for (th_id=0; th_idpdcch_vars[th_id][gNB_id] = (NR_UE_PDCCH *)malloc16_clear(sizeof(NR_UE_PDCCH));
}
@@ -342,21 +359,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
ue->nr_srs_info->srs_estimated_channel_time_shifted[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
}
-
- for (th_id=0; th_idpdsch_vars[th_id][gNB_id], fp );
- }
-
- int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
- for (th_id=0; th_idpdsch_vars[th_id][gNB_id]->llr[i] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );//Q_m = 8 bits/Sym, Code_Rate=3, Number of Segments =8, Circular Buffer K_cb = 8448
- }
- for (i=0; ipdsch_vars[th_id][gNB_id]->layer_llr[i] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );//Q_m = 8 bits/Sym, Code_Rate=3, Number of Segments =8, Circular Buffer K_cb = 8448
- }
- }
-
// 100 PRBs * 12 REs/PRB * 4 PDCCH SYMBOLS * 2 LLRs/RE
for (th_id=0; th_idpdcch_vars[th_id][gNB_id]->llr = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
@@ -424,6 +426,8 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
for (int slot = 0; slot < fp->slots_per_frame; slot++) {
for (int symb = 0; symb < fp->symbols_per_slot; symb++) {
+ for (int q=0; qnr_gold_pusch_dmrs[slot][symb][q]);
free_and_zero(ue->nr_gold_pusch_dmrs[slot][symb]);
}
free_and_zero(ue->nr_gold_pusch_dmrs[slot]);
@@ -457,10 +461,9 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
}
free_and_zero(ue->nr_gold_pdcch[0]);
- int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
for (int slot=0; slotslots_per_frame; slot++) {
for (int symb=0; symbsymbols_per_slot; symb++) {
- for (int q=0; qnr_gold_pdsch[0][slot][symb][q]);
free_and_zero(ue->nr_gold_pdsch[0][slot][symb]);
}
@@ -468,16 +471,18 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
}
free_and_zero(ue->nr_gold_pdsch[0]);
- for (int gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) {
+ for (int gNB_id = 0; gNB_id < ue->n_connected_gNB+1; gNB_id++) {
// PDSCH
for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
-
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr_shifts);
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr128_2ndstream);
phy_term_nr_ue__PDSCH(ue->pdsch_vars[th_id][gNB_id], fp);
free_and_zero(ue->pdsch_vars[th_id][gNB_id]);
}
+ }
+
+ for (int gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) {
for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
for (int i = 0; i < fp->nb_antennas_rx; i++) {
diff --git a/openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h b/openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h
index 6b84a5f969..b4ae44f6ea 100644
--- a/openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h
+++ b/openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h
@@ -155,8 +155,6 @@ typedef struct {
uint8_t h[MAX_NUM_CHANNEL_BITS];
/// Scrambled "b"-sequences (for definition see 36-211 V8.6 2009-03, p.14)
uint8_t b_tilde[MAX_NUM_CHANNEL_BITS];
- /// Modulated "d"-sequences (for definition see 36-211 V8.6 2009-03, p.14)
- int32_t d[MAX_NUM_RE];
/// Transform-coded "z"-sequences (for definition see 36-211 V8.6 2009-03, p.14-15)
int32_t z[MAX_NUM_RE];
/// "q" sequences for CQI/PMI (for definition see 36-212 V8.6 2009-03, p.27)
diff --git a/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c b/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c
index 7ec3e7bfb6..6a663e8940 100644
--- a/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c
+++ b/openair1/PHY/LTE_UE_TRANSPORT/ulsch_modulation.c
@@ -42,7 +42,7 @@
//#define DEBUG_ULSCH_MODULATION
-void dft_lte(int32_t *z,int32_t *d, int32_t Msc_PUSCH, uint8_t Nsymb)
+void dft_lte(int32_t *z,struct complex16 *input, int32_t Msc_PUSCH, uint8_t Nsymb)
{
#if defined(__x86_64__) || defined(__i386__)
@@ -66,7 +66,7 @@ void dft_lte(int32_t *z,int32_t *d, int32_t Msc_PUSCH, uint8_t Nsymb)
#endif
// printf("Doing lte_dft for Msc_PUSCH %d\n",Msc_PUSCH);
- d0 = (uint32_t *)d;
+ d0 = (uint32_t *)input;
d1 = d0+Msc_PUSCH;
d2 = d1+Msc_PUSCH;
d3 = d2+Msc_PUSCH;
@@ -476,7 +476,8 @@ void ulsch_modulation(int32_t **txdataF,
// Modulation
ulsch_Msymb = G/Q_m;
-
+ /// Modulated "d"-sequences (for definition see 36-211 V8.6 2009-03, p.14)
+ struct complex16 d[MAX_NUM_RE] __attribute__((aligned(32)));
if(ulsch->cooperation_flag == 2)
// For Distributed Alamouti Scheme in Collabrative Communication
{
@@ -488,14 +489,14 @@ void ulsch_modulation(int32_t **txdataF,
//UE1, -x1*
- ((int16_t*)&ulsch->d[i])[0] = (ulsch->b_tilde[j] == 1) ? (gain_lin_QPSK) : -gain_lin_QPSK;
- ((int16_t*)&ulsch->d[i])[1] = (ulsch->b_tilde[j+1] == 1)? (-gain_lin_QPSK) : gain_lin_QPSK;
+ d[i].r = (ulsch->b_tilde[j] == 1) ? (gain_lin_QPSK) : -gain_lin_QPSK;
+ d[i].i = (ulsch->b_tilde[j+1] == 1)? (-gain_lin_QPSK) : gain_lin_QPSK;
// if (id[i],((int16_t*)&ulsch->d[i])[0],((int16_t*)&ulsch->d[i])[1]);
// UE1, x0*
- ((int16_t*)&ulsch->d[i+1])[0] = (ulsch->b_tilde[j-2] == 1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
- ((int16_t*)&ulsch->d[i+1])[1] = (ulsch->b_tilde[j-1] == 1)? (gain_lin_QPSK) : -gain_lin_QPSK;
+ d[i+1].r = (ulsch->b_tilde[j-2] == 1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
+ d[i+1].i = (ulsch->b_tilde[j-1] == 1)? (gain_lin_QPSK) : -gain_lin_QPSK;
break;
@@ -521,8 +522,8 @@ void ulsch_modulation(int32_t **txdataF,
qam16_table_offset_im+=1;
- ((int16_t*)&ulsch->d[i])[0]=-(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15);
- ((int16_t*)&ulsch->d[i])[1]=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15);
+ d[i].r =-(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15);
+ d[i].i =(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15);
//UE1,x0*
qam16_table_offset_re = 0;
@@ -544,8 +545,8 @@ void ulsch_modulation(int32_t **txdataF,
// ((int16_t*)&ulsch->d[i+1])[0]=-(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15);
// ((int16_t*)&ulsch->d[i+1])[1]=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15);
- ((int16_t*)&ulsch->d[i+1])[0]=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15);
- ((int16_t*)&ulsch->d[i+1])[1]=-(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15);
+ d[i+1].r=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15);
+ d[i+1].i=-(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15);
break;
@@ -578,8 +579,8 @@ void ulsch_modulation(int32_t **txdataF,
qam64_table_offset_im+=1;
- ((int16_t*)&ulsch->d[i])[0]=-(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_re])>>15);
- ((int16_t*)&ulsch->d[i])[1]=(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_im])>>15);
+ d[i].r=-(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_re])>>15);
+ d[i].i=(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_im])>>15);
//UE1,x0*
qam64_table_offset_re = 0;
@@ -605,8 +606,8 @@ void ulsch_modulation(int32_t **txdataF,
qam64_table_offset_im+=1;
- ((int16_t*)&ulsch->d[i+1])[0]=(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_re])>>15);
- ((int16_t*)&ulsch->d[i+1])[1]=-(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_im])>>15);
+ d[i+1].r=(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_re])>>15);
+ d[i+1].i=-(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_im])>>15);
break;
@@ -621,8 +622,8 @@ void ulsch_modulation(int32_t **txdataF,
case 2:
// TODO: this has to be updated!!!
- ((int16_t*)&ulsch->d[i])[0] = (ulsch->b_tilde[j] == 1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
- ((int16_t*)&ulsch->d[i])[1] = (ulsch->b_tilde[j+1] == 1)? (-gain_lin_QPSK) : gain_lin_QPSK;
+ d[i].r = (ulsch->b_tilde[j] == 1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
+ d[i].i = (ulsch->b_tilde[j+1] == 1)? (-gain_lin_QPSK) : gain_lin_QPSK;
// if (id[i],((int16_t*)&ulsch->d[i])[0],((int16_t*)&ulsch->d[i])[1]);
@@ -646,8 +647,8 @@ void ulsch_modulation(int32_t **txdataF,
qam16_table_offset_im+=1;
- ((int16_t*)&ulsch->d[i])[0]=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15);
- ((int16_t*)&ulsch->d[i])[1]=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15);
+ d[i].r=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15);
+ d[i].i=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15);
// printf("input(16qam) %d (%p): %d,%d\n", i,&ulsch->d[i],((int16_t*)&ulsch->d[i])[0],((int16_t*)&ulsch->d[i])[1]);
break;
@@ -676,8 +677,8 @@ void ulsch_modulation(int32_t **txdataF,
qam64_table_offset_im+=1;
- ((int16_t*)&ulsch->d[i])[0]=(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_re])>>15);
- ((int16_t*)&ulsch->d[i])[1]=(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_im])>>15);
+ d[i].r=(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_re])>>15);
+ d[i].i=(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_im])>>15);
break;
@@ -688,7 +689,7 @@ void ulsch_modulation(int32_t **txdataF,
// Transform Precoding
- dft_lte(ulsch->z,ulsch->d,Msc_PUSCH,ulsch->Nsymb_pusch);
+ dft_lte(ulsch->z,d,Msc_PUSCH,ulsch->Nsymb_pusch);
DevAssert(txdataF);
diff --git a/openair1/PHY/MODULATION/slot_fep.c b/openair1/PHY/MODULATION/slot_fep.c
index 8f41735f10..b2c7d934c6 100644
--- a/openair1/PHY/MODULATION/slot_fep.c
+++ b/openair1/PHY/MODULATION/slot_fep.c
@@ -91,7 +91,7 @@ int slot_fep(PHY_VARS_UE *ue,
}
// subframe_offset_F = frame_parms->ofdm_symbol_size * frame_parms->symbols_per_tti * (Ns>>1);
-
+
if (l<0 || l>=7-frame_parms->Ncp) {
printf("slot_fep: l must be between 0 and %d\n",7-frame_parms->Ncp);
return(-1);
diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
index 9aaba7fb66..4a6f8ef9af 100644
--- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
+++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
@@ -165,6 +165,11 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
//------------------generate DMRS------------------//
+ if(pusch_pdu->ul_dmrs_scrambling_id != gNB->pusch_gold_init[pusch_pdu->scid]) {
+ gNB->pusch_gold_init[pusch_pdu->scid] = pusch_pdu->ul_dmrs_scrambling_id;
+ nr_gold_pusch(gNB, pusch_pdu->scid, pusch_pdu->ul_dmrs_scrambling_id);
+ }
+
// transform precoding = 1 means disabled
if (pusch_pdu->transform_precoding == 1) {
nr_pusch_dmrs_rx(gNB, Ns, gNB->nr_gold_pusch_dmrs[pusch_pdu->scid][Ns][symbol], &pilot[0], 1000, 0, nb_rb_pusch,
@@ -1247,4 +1252,4 @@ int nr_srs_channel_estimation(PHY_VARS_gNB *gNB,
#endif
return 0;
-}
\ No newline at end of file
+}
diff --git a/openair1/PHY/NR_REFSIG/nr_gold.c b/openair1/PHY/NR_REFSIG/nr_gold.c
index b593dcbb47..279afc8110 100644
--- a/openair1/PHY/NR_REFSIG/nr_gold.c
+++ b/openair1/PHY/NR_REFSIG/nr_gold.c
@@ -78,57 +78,47 @@ void nr_init_pdcch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid)
}
-void nr_init_pdsch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid)
-{
+void nr_init_pdsch_dmrs(PHY_VARS_gNB* gNB, uint8_t nscid, uint32_t Nid) {
uint32_t x1, x2;
uint8_t reset;
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
uint32_t ****pdsch_dmrs = gNB->nr_gold_pdsch_dmrs;
int pdsch_dmrs_init_length = ((fp->N_RB_DL*12)>>5)+1;
- int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
- uint16_t N_n_scid[2]={Nid, Nid};
- uint8_t n_scid=0; // again works only for 1_0
+
for (uint8_t slot=0; slotslots_per_frame; slot++) {
for (uint8_t symb=0; symbsymbols_per_slot; symb++) {
- reset = 1;
- x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((N_n_scid[n_scid]<<1)+1) +((N_n_scid[n_scid]<<1)+n_scid));
- LOG_D(PHY,"PDSCH DMRS slot %d, symb %d x2 %x, N_n_scid %d,n_scid %d\n",slot,symb,x2,N_n_scid[n_scid],n_scid);
- for (uint32_t n=0; n1)
- memcpy(pdsch_dmrs[slot][symb][1],pdsch_dmrs[slot][symb][0],sizeof(uint32_t)*pdsch_dmrs_init_length);
+ reset = 1;
+ x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((Nid<<1)+1) +((Nid<<1)+nscid));
+ LOG_D(PHY,"PDSCH DMRS slot %d, symb %d x2 %x, Nid %d,nscid %d\n",slot,symb,x2,Nid,nscid);
+ for (uint32_t n=0; nframe_parms;
unsigned short l;
int pusch_dmrs_init_length = ((fp->N_RB_UL*12)>>5)+1;
- for (nscid=0; nscid<2; nscid++) {
- nid = Nid[nscid];
- for (ns=0; nsslots_per_frame; ns++) {
- for (l=0; lsymbols_per_slot; l++) {
- reset = 1;
- x2 = ((1<<17) * (fp->symbols_per_slot*ns+l+1) * ((nid<<1)+1) +((nid<<1)+nscid));
- LOG_D(PHY,"DMRS slot %d, symb %d x2 %x\n",ns,l,x2);
+ for (ns=0; nsslots_per_frame; ns++) {
+ for (l=0; lsymbols_per_slot; l++) {
+ reset = 1;
+ x2 = ((1<<17) * (fp->symbols_per_slot*ns+l+1) * ((nid<<1)+1) +((nid<<1)+nscid));
+ LOG_D(PHY,"DMRS slot %d, symb %d x2 %x\n",ns,l,x2);
- for (n=0; nnr_gold_pusch_dmrs[nscid][ns][l][n] = lte_gold_generic(&x1, &x2, reset);
- reset = 0;
- }
+ for (n=0; nnr_gold_pusch_dmrs[nscid][ns][l][n] = lte_gold_generic(&x1, &x2, reset);
+ reset = 0;
}
}
}
diff --git a/openair1/PHY/NR_REFSIG/nr_gold_ue.c b/openair1/PHY/NR_REFSIG/nr_gold_ue.c
index 932cdba538..203d6c8625 100644
--- a/openair1/PHY/NR_REFSIG/nr_gold_ue.c
+++ b/openair1/PHY/NR_REFSIG/nr_gold_ue.c
@@ -76,46 +76,38 @@ void nr_gold_pdcch(PHY_VARS_NR_UE* ue,
}
void nr_gold_pdsch(PHY_VARS_NR_UE* ue,
- unsigned short *n_idDMRS)
-{
+ int nscid,
+ uint32_t nid) {
unsigned int x1,x2,x2tmp0;
- unsigned int nid;
uint8_t reset;
int pdsch_dmrs_init_length = ((ue->frame_parms.N_RB_DL*12)>>5)+1;
- int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
- /// to be updated from higher layer
- //unsigned short lbar = 0;
- for (int nscid=0; nscidframe_parms.slots_per_frame; ns++) {
+ for (int ns=0; nsframe_parms.slots_per_frame; ns++) {
- nid = n_idDMRS[nscid];
+ for (int l=0; lframe_parms.symbols_per_slot; l++) {
- for (int l=0; lframe_parms.symbols_per_slot; l++) {
+ reset = 1;
+ x2tmp0 = ((ue->frame_parms.symbols_per_slot*ns+l+1)*((nid<<1)+1))<<17;
+ x2 = (x2tmp0+(nid<<1)+nscid)%(1U<<31); //cinit
+ LOG_D(PHY,"UE DMRS slot %d, symb %d, x2 %x, nscid %d\n",ns,l,x2,nscid);
- reset = 1;
- x2tmp0 = ((ue->frame_parms.symbols_per_slot*ns+l+1)*((nid<<1)+1))<<17;
- x2 = (x2tmp0+(nid<<1)+nscid)%(1U<<31); //cinit
- LOG_D(PHY,"UE DMRS slot %d, symb %d, x2 %x, nscid %d\n",ns,l,x2,nscid);
-
- for (int n=0; nnr_gold_pdsch[0][ns][l][nscid][n] = lte_gold_generic(&x1, &x2, reset);
- reset = 0;
- }
+ for (int n=0; nnr_gold_pdsch[0][ns][l][nscid][n] = lte_gold_generic(&x1, &x2, reset);
+ reset = 0;
}
}
}
}
void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue,
- uint16_t *N_n_scid,
+ uint16_t N_n_scid,
uint8_t n_scid)
{
uint32_t x1, x2, n;
uint8_t reset, slot, symb;
NR_DL_FRAME_PARMS *fp = &ue->frame_parms;
- uint32_t ***pusch_dmrs = ue->nr_gold_pusch_dmrs;
+ uint32_t ****pusch_dmrs = ue->nr_gold_pusch_dmrs;
int pusch_dmrs_init_length = ((fp->N_RB_UL*12)>>5)+1;
for (slot=0; slotslots_per_frame; slot++) {
@@ -123,10 +115,10 @@ void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue,
for (symb=0; symbsymbols_per_slot; symb++) {
reset = 1;
- x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((N_n_scid[n_scid]<<1)+1) +((N_n_scid[n_scid]<<1)+n_scid));
-
+ x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((N_n_scid<<1)+1) +((N_n_scid<<1)+n_scid));
+ LOG_D(PHY,"DMRS slot %d, symb %d x2 %x\n",slot,symb,x2);
for (n=0; nframe_parms;
@@ -52,20 +51,10 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
AssertFatal(b!=0, "Invalid CSI frequency domain mapping: no bit selected in bitmap\n");
- // pre-computed for scrambling id equel to cell id
- // if the scrambling id is not the cell id we need to re-initialize the rs
- if (csi_params.scramb_id != cell_id) {
- uint8_t reset;
- uint32_t x1, x2;
- uint32_t Nid = csi_params.scramb_id;
- for (uint8_t symb=0; symb>5)+1; n++) {
- gold_csi_rs[symb][n] = lte_gold_generic(&x1, &x2, reset);
- reset = 0;
- }
- }
+ // if the scrambling id is not the one previously used to initialize we need to re-initialize the rs
+ if (csi_params.scramb_id != gNB->csi_gold_init) {
+ gNB->csi_gold_init = csi_params.scramb_id;
+ nr_init_csi_rs(gNB, csi_params.scramb_id);
}
switch (csi_params.row) {
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c
index 0af56ba706..ba7e539429 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dci.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c
@@ -66,11 +66,12 @@ void nr_pdcch_scrambling(uint32_t *in,
}
}
-void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15,
- uint32_t **gold_pdcch_dmrs,
+void nr_generate_dci(PHY_VARS_gNB *gNB,
+ nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15,
int32_t *txdataF,
int16_t amp,
- NR_DL_FRAME_PARMS *frame_parms) {
+ NR_DL_FRAME_PARMS *frame_parms,
+ int slot) {
int16_t mod_dmrs[NR_MAX_CSET_DURATION][NR_MAX_PDCCH_DMRS_LENGTH>>1] __attribute__((aligned(16))); // 3 for the max coreset duration
uint16_t cset_start_sc;
@@ -81,7 +82,7 @@ void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15,
int rb_offset;
int n_rb;
-
+
// compute rb_offset and n_prb based on frequency allocation
nr_cce_t cce_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL];
nr_fill_cce_list(cce_list,0,pdcch_pdu_rel15);
@@ -95,6 +96,13 @@ void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15,
* in time: by its first slot and its first symbol*/
const nfapi_nr_dl_dci_pdu_t *dci_pdu = &pdcch_pdu_rel15->dci_pdu[d];
+ if(dci_pdu->ScramblingId != gNB->pdcch_gold_init) {
+ gNB->pdcch_gold_init = dci_pdu->ScramblingId;
+ nr_init_pdcch_dmrs(gNB, dci_pdu->ScramblingId);
+ }
+
+ uint32_t **gold_pdcch_dmrs = gNB->nr_gold_pdcch_dmrs[slot];
+
cset_start_symb = pdcch_pdu_rel15->StartSymbolIndex;
cset_nsymb = pdcch_pdu_rel15->DurationSymbols;
dci_idx = 0;
@@ -104,8 +112,8 @@ void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15,
uint32_t dmrs_length = n_rb*6; //2(QPSK)*3(per RB)*6(REG per CCE)
uint32_t encoded_length = dci_pdu->AggregationLevel*108; //2(QPSK)*9(per RB)*6(REG per CCE)
LOG_D(PHY, "DL_DCI : rb_offset %d, nb_rb %d, DMRS length per symbol %d\t DCI encoded length %d (precoder_granularity %d,reg_mapping %d),Scrambling_Id %d,ScramblingRNTI %x,PayloadSizeBits %d\n",
- rb_offset, n_rb,dmrs_length, encoded_length,pdcch_pdu_rel15->precoderGranularity,pdcch_pdu_rel15->CceRegMappingType,
- dci_pdu->ScramblingId,dci_pdu->ScramblingRNTI,dci_pdu->PayloadSizeBits);
+ rb_offset, n_rb,dmrs_length, encoded_length,pdcch_pdu_rel15->precoderGranularity,pdcch_pdu_rel15->CceRegMappingType,
+ dci_pdu->ScramblingId,dci_pdu->ScramblingRNTI,dci_pdu->PayloadSizeBits);
dmrs_length += rb_offset*6; // To accommodate more DMRS symbols in case of rb offset
/// DMRS QPSK modulation
@@ -115,10 +123,10 @@ void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15,
#ifdef DEBUG_PDCCH_DMRS
if(dci_pdu->RNTI!=0xFFFF) {
- for (int i=0; i>1; i++)
- printf("symb %d i %d %p gold seq 0x%08x mod_dmrs %d %d\n", symb, i,
- &gold_pdcch_dmrs[symb][i>>5],gold_pdcch_dmrs[symb][i>>5], mod_dmrs[symb][i<<1], mod_dmrs[symb][(i<<1)+1] );
- }
+ for (int i=0; i>1; i++)
+ printf("symb %d i %d %p gold seq 0x%08x mod_dmrs %d %d\n", symb, i,
+ &gold_pdcch_dmrs[symb][i>>5],gold_pdcch_dmrs[symb][i>>5], mod_dmrs[symb][i<<1], mod_dmrs[symb][(i<<1)+1] );
+ }
#endif
}
@@ -248,15 +256,16 @@ void nr_generate_dci(nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15,
}
void nr_generate_dci_top(processingData_L1tx_t *msgTx,
- uint32_t **gold_pdcch_dmrs,
+ int slot,
int32_t *txdataF,
int16_t amp,
NR_DL_FRAME_PARMS *frame_parms) {
+
for (int i=0; inum_ul_pdcch; i++)
- nr_generate_dci(&msgTx->ul_pdcch_pdu[i].pdcch_pdu.pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms);
+ nr_generate_dci(msgTx->gNB,&msgTx->ul_pdcch_pdu[i].pdcch_pdu.pdcch_pdu_rel15,txdataF,amp,frame_parms,slot);
for (int i=0; inum_dl_pdcch; i++)
- nr_generate_dci(&msgTx->pdcch_pdu[i].pdcch_pdu_rel15,gold_pdcch_dmrs,txdataF,amp,frame_parms);
+ nr_generate_dci(msgTx->gNB,&msgTx->pdcch_pdu[i].pdcch_pdu_rel15,txdataF,amp,frame_parms,slot);
}
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.h b/openair1/PHY/NR_TRANSPORT/nr_dci.h
index bdc8509d12..490a8b5286 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dci.h
+++ b/openair1/PHY/NR_TRANSPORT/nr_dci.h
@@ -30,7 +30,7 @@ uint16_t nr_get_dci_size(nfapi_nr_dci_format_e format,
uint16_t N_RB);
void nr_generate_dci_top(processingData_L1tx_t *msgTx,
- uint32_t **gold_pdcch_dmrs,
+ int slot,
int32_t *txdataF,
int16_t amp,
NR_DL_FRAME_PARMS *frame_parms);
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c
index 47d6c48373..19b56f6dba 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c
@@ -58,7 +58,6 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
PHY_VARS_gNB *gNB = msgTx->gNB;
NR_gNB_DLSCH_t *dlsch;
- uint32_t ***pdsch_dmrs = gNB->nr_gold_pdsch_dmrs[slot];
int32_t** txdataF = gNB->common_vars.txdataF;
int16_t amp = AMP;
int xOverhead = 0;
@@ -93,12 +92,17 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
}
n_dmrs = (rel15->BWPStart+rel15->rbStart+rel15->rbSize)*nb_re_dmrs;
+ if(rel15->dlDmrsScramblingId != gNB->pdsch_gold_init[rel15->SCID]) {
+ gNB->pdsch_gold_init[rel15->SCID] = rel15->dlDmrsScramblingId;
+ nr_init_pdsch_dmrs(gNB, rel15->SCID, rel15->dlDmrsScramblingId);
+ }
+
+ uint32_t ***pdsch_dmrs = gNB->nr_gold_pdsch_dmrs[slot];
uint16_t dmrs_symbol_map = rel15->dlDmrsSymbPos;//single DMRS: 010000100 Double DMRS 110001100
uint8_t dmrs_len = get_num_dmrs(rel15->dlDmrsSymbPos);
uint16_t nb_re = ((12*rel15->NrOfSymbols)-nb_re_dmrs*dmrs_len-xOverhead)*rel15->rbSize*rel15->nrOfLayers;
uint8_t Qm = rel15->qamModOrder[0];
uint32_t encoded_length = nb_re*Qm;
- uint32_t scrambled_output[rel15->NrOfCodewords][(encoded_length>>5)+1];
int16_t mod_dmrs[n_dmrs<<1] __attribute__ ((aligned(16)));
/* PTRS */
@@ -147,63 +151,61 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
printf("\n");
#endif
- /// scrambling
- start_meas(dlsch_scrambling_stats);
for (int q=0; qNrOfCodewords; q++) {
- memset((void*)scrambled_output[q], 0, ((encoded_length>>5)+1)*sizeof(uint32_t));
+ /// scrambling
+ start_meas(dlsch_scrambling_stats);
+ uint32_t scrambled_output[(encoded_length>>5)+4]; // modulator acces by 4 bytes in some cases
+ memset(scrambled_output, 0, sizeof(scrambled_output));
+ if ( encoded_length > rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * Qm * rel15->nrOfLayers) abort();
nr_pdsch_codeword_scrambling(output,
encoded_length,
q,
rel15->dataScramblingId,
rel15->rnti,
- scrambled_output[q]);
- }
-
- stop_meas(dlsch_scrambling_stats);
+ scrambled_output);
#ifdef DEBUG_DLSCH
- printf("PDSCH scrambling:\n");
- for (int i=0; i>8; i++) {
- for (int j=0; j<8; j++)
- printf("0x%08x\t", scrambled_output[0][(i<<3)+j]);
- printf("\n");
- }
-#endif
-
- /// Modulation
- start_meas(dlsch_modulation_stats);
- VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PDSCH_MODULATION, 1);
- for (int q=0; qNrOfCodewords; q++)
- nr_modulation(scrambled_output[q],
- encoded_length,
- Qm,
- mod_symbs[q]);
- VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PDSCH_MODULATION, 0);
- stop_meas(dlsch_modulation_stats);
-#ifdef DEBUG_DLSCH
- printf("PDSCH Modulation: Qm %d(%d)\n", Qm, nb_re);
- for (int i=0; i>3; i++) {
- for (int j=0; j<8; j++) {
- printf("%d %d\t", mod_symbs[0][((i<<3)+j)<<1], mod_symbs[0][(((i<<3)+j)<<1)+1]);
+ printf("PDSCH scrambling:\n");
+ for (int i=0; i>8; i++) {
+ for (int j=0; j<8; j++)
+ printf("0x%08x\t", scrambled_output[(i<<3)+j]);
+ printf("\n");
}
- printf("\n");
- }
#endif
+ stop_meas(dlsch_scrambling_stats);
+ /// Modulation
+ start_meas(dlsch_modulation_stats);
+ nr_modulation(scrambled_output,
+ encoded_length,
+ Qm,
+ mod_symbs[q]);
+ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PDSCH_MODULATION, 0);
+ stop_meas(dlsch_modulation_stats);
+#ifdef DEBUG_DLSCH
+ printf("PDSCH Modulation: Qm %d(%d)\n", Qm, nb_re);
+ for (int i=0; i>3; i++) {
+ for (int j=0; j<8; j++) {
+ printf("%d %d\t", mod_symbs[0][((i<<3)+j)<<1], mod_symbs[0][(((i<<3)+j)<<1)+1]);
+ }
+ printf("\n");
+ }
+#endif
+ }
start_meas(&gNB->dlsch_layer_mapping_stats);
/// Layer mapping
nr_layer_mapping(mod_symbs,
- rel15->nrOfLayers,
- nb_re,
- tx_layers);
+ rel15->nrOfLayers,
+ nb_re,
+ tx_layers);
#ifdef DEBUG_DLSCH
printf("Layer mapping (%d layers):\n", rel15->nrOfLayers);
for (int l=0; lnrOfLayers; l++)
for (int i=0; i<(nb_re/rel15->nrOfLayers)>>3; i++) {
- printf("layer %d, Re %d..%d : ",l,i<<3,(i<<3)+7);
- for (int j=0; j<8; j++) {
- printf("l%d %d\t", tx_layers[l][((i<<3)+j)<<1], tx_layers[l][(((i<<3)+j)<<1)+1]);
- }
- printf("\n");
+ printf("layer %d, Re %d..%d : ",l,i<<3,(i<<3)+7);
+ for (int j=0; j<8; j++) {
+ printf("l%d %d\t", tx_layers[l][((i<<3)+j)<<1], tx_layers[l][(((i<<3)+j)<<1)+1]);
+ }
+ printf("\n");
}
#endif
@@ -222,7 +224,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
#ifdef DEBUG_DLSCH_MAPPING
printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_re %d,nb_layers %d)\n",
- start_sc, rel15->StartSymbolIndex, rel15->rbSize, nb_re,rel15->nrOfLayers);
+ start_sc, rel15->StartSymbolIndex, rel15->rbSize, nb_re,rel15->nrOfLayers);
#endif
start_meas(&gNB->dlsch_resource_mapping_stats);
@@ -275,7 +277,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
l_prime = 0;
}
/// DMRS QPSK modulation
- nr_modulation(pdsch_dmrs[l][0], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated
+ nr_modulation(pdsch_dmrs[l][rel15->SCID], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // Qm = 2 as DMRS is QPSK modulated
#ifdef DEBUG_DLSCH
printf("DMRS modulation (symbol %d, %d symbols, type %d):\n", l, n_dmrs, dmrs_Type);
@@ -296,7 +298,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
if(ptrs_symbol) {
/* PTRS QPSK Modulation for each OFDM symbol in a slot */
LOG_D(PHY,"Doing ptrs modulation for symbol %d, n_ptrs %d\n",l,n_ptrs);
- nr_modulation(pdsch_dmrs[l][0], (n_ptrs<<1), DMRS_MOD_ORDER, mod_ptrs);
+ nr_modulation(pdsch_dmrs[l][rel15->SCID], (n_ptrs<<1), DMRS_MOD_ORDER, mod_ptrs);
}
}
uint16_t k = start_sc;
diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
index f9478b7633..9b24504a14 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
+++ b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
@@ -338,7 +338,6 @@ uint8_t get_nr_prach_duration(uint8_t prach_format);
void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
int16_t amp,
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t csi_params,
- uint16_t cell_id,
int slot);
void free_nr_prach_entry(PHY_VARS_gNB *gNB, int prach_id);
diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c
index 50c3b62f50..8652cbac39 100644
--- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c
+++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c
@@ -282,23 +282,35 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
}
int n2;
+ int nb_re_pucch = 12*pucch_pdu->prb_size; // prb size is 1
+ int32_t rp[frame_parms->nb_antennas_rx][pucch_pdu->nr_of_symbols][nb_re_pucch],*tmp_rp;
+
for (int l=0; lnr_of_symbols; l++) {
l2 = l+pucch_pdu->start_symbol_index;
+
re_offset[l] = (12*prb_offset[l]) + frame_parms->first_carrier_offset;
if (re_offset[l]>= frame_parms->ofdm_symbol_size)
re_offset[l]-=frame_parms->ofdm_symbol_size;
-
- AssertFatal(re_offset[l]+12 < frame_parms->ofdm_symbol_size,"pucch straddles DC carrier, handle this!\n");
- int16_t *r;
+
for (int aa=0;aanb_antennas_rx;aa++) {
- r=(int16_t*)&rxdataF[aa][soffset+(l2*frame_parms->ofdm_symbol_size)+re_offset[l]];
+ tmp_rp = &rxdataF[aa][soffset + l2*frame_parms->ofdm_symbol_size];
+ if(re_offset[l] + nb_re_pucch > frame_parms->ofdm_symbol_size) {
+ int neg_length = frame_parms->ofdm_symbol_size-re_offset[l];
+ int pos_length = nb_re_pucch-neg_length;
+ memcpy1((void*)rp[aa][l],(void*)&tmp_rp[re_offset[l]],neg_length*sizeof(int32_t));
+ memcpy1((void*)&rp[aa][l][neg_length],(void*)tmp_rp,pos_length*sizeof(int32_t));
+ }
+ else
+ memcpy1((void*)rp[aa][l],(void*)&tmp_rp[re_offset[l]],nb_re_pucch*sizeof(int32_t));
+
+ int16_t *r = (int16_t*)&rp[aa][l];
n2=0;
- for (n=0;n<12;n++,n2+=2) {
+ for (n=0;n>15);
xr[aa][l][n2+1]+=(int16_t)(((int32_t)x_re[l][n]*r[n2+1]-(int32_t)x_im[l][n]*r[n2])>>15);
#ifdef DEBUG_NR_PUCCH_RX
printf("x (%d,%d), r%d.%d (%d,%d), xr (%d,%d)\n",
- x_re[l][n],x_im[l][n],l2,re_offset[l],r[n2],r[n2+1],xr[aa][l][n2],xr[aa][l][n2+1]);
+ x_re[l][n],x_im[l][n],l2,re_offset[l],r[n2],r[n2+1],xr[aa][l][n2],xr[aa][l][n2+1]);
#endif
}
}
@@ -395,9 +407,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
int max_n0 = uci_stats->pucch0_n00>uci_stats->pucch0_n01 ? uci_stats->pucch0_n00:uci_stats->pucch0_n01;
int SNRtimes10,sigenergy=0;
for (int aa=0;aanb_antennas_rx;aa++)
- sigenergy += signal_energy_nodc(&rxdataF[aa][soffset+
- (pucch_pdu->start_symbol_index*frame_parms->ofdm_symbol_size)+
- re_offset[0]],12);
+ sigenergy += signal_energy_nodc(rp[aa][0],12);
SNRtimes10 = xrtmag_dBtimes10-(10*max_n0);
int cqi;
if (SNRtimes10 < -640) cqi=0;
diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
index 55deb686ad..5c415e7d40 100644
--- a/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
+++ b/openair1/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
@@ -466,6 +466,7 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
uint8_t gNB_id,
unsigned char Ns,
unsigned char symbol,
+ unsigned short scrambling_id,
unsigned short coreset_start_subcarrier,
unsigned short nb_rb_coreset)
{
@@ -493,13 +494,11 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
fm = filt16a_m1;
fr = filt16a_r1;
-
// checking if re-initialization of scrambling IDs is needed (should be done here but scrambling ID for PDCCH is not taken from RRC)
-/* if (( != ue->scramblingID_pdcch){
- ue->scramblingID_pdcch=;
- nr_gold_pdsch(ue,ue->scramblingID_pdcch);
- }*/
-
+ if (scrambling_id != ue->scramblingID_pdcch){
+ ue->scramblingID_pdcch = scrambling_id;
+ nr_gold_pdcch(ue,ue->scramblingID_pdcch);
+ }
// generate pilot
int pilot[nb_rb_coreset * 3] __attribute__((aligned(16)));
@@ -666,6 +665,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
unsigned char Ns,
unsigned short p,
unsigned char symbol,
+ unsigned char nscid,
+ unsigned short scrambling_id,
unsigned short BWPStart,
uint8_t config_type,
unsigned short bwp_start_subcarrier,
@@ -703,11 +704,10 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
int8_t delta = get_delta(p, config_type);
// checking if re-initialization of scrambling IDs is needed
- /*if ((XXX.scramblingID0 != ue->scramblingID[0]) || (XXX.scramblingID1 != ue->scramblingID[1])){
- ue->scramblingID[0] = XXX.scramblingID0;
- ue->scramblingID[1] = XXX.scramblingID1;
- nr_gold_pdsch(ue,ue->scramblingID);
- }*/
+ if (scrambling_id != ue->scramblingID_dlsch[nscid]){
+ ue->scramblingID_dlsch[nscid] = scrambling_id;
+ nr_gold_pdsch(ue, nscid, scrambling_id);
+ }
nr_pdsch_dmrs_rx(ue, Ns, ue->nr_gold_pdsch[gNB_id][Ns][symbol][0], &pilot[0], 1000+p, 0, nb_rb_pdsch+rb_offset, config_type);
diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
index aa4b78e145..963a845876 100644
--- a/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
+++ b/openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h
@@ -44,6 +44,7 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
uint8_t gNB_id,
unsigned char Ns,
unsigned char symbol,
+ unsigned short scrambling_id,
unsigned short coreset_start_subcarrier,
unsigned short nb_rb_coreset);
@@ -74,6 +75,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
unsigned char Ns,
unsigned short p,
unsigned char symbol,
+ unsigned char nscid,
+ unsigned short scrambling_id,
unsigned short BWPStart,
uint8_t config_type,
unsigned short bwp_start_subcarrier,
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
index a48bc1b58d..b806e4c381 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
@@ -352,15 +352,17 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
nr_gold_pdcch(ue,fp->Nid_cell);
// compute the scrambling IDs for PDSCH DMRS
- for (int i=0; i<2; i++)
- ue->scramblingID[i]=fp->Nid_cell;
-
- nr_gold_pdsch(ue,ue->scramblingID);
+ for (int i=0; iscramblingID_dlsch[i]=fp->Nid_cell;
+ nr_gold_pdsch(ue, i, ue->scramblingID_dlsch[i]);
+ }
// initialize the pusch dmrs
- uint16_t N_n_scid[2] = {fp->Nid_cell,fp->Nid_cell};
- int n_scid = 0; // This quantity is indicated by higher layer parameter dmrs-SeqInitialization
- nr_init_pusch_dmrs(ue, N_n_scid, n_scid);
+ for (int i=0; iscramblingID_ulsch[i]=fp->Nid_cell;
+ nr_init_pusch_dmrs(ue, ue->scramblingID_ulsch[i], i);
+ }
+
// we also need to take into account the shift by samples_per_frame in case the if is true
if (ue->ssb_offset < sync_pos_frame){
@@ -551,6 +553,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
0,
pdcch_vars->slot,
l,
+ fp->Nid_cell,
fp->first_carrier_offset+(pdcch_vars->pdcch_config[n_ss].BWPStart + coreset_start_rb)*12,
coreset_nb_rb);
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
index e479271a5c..7b5019edfe 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
@@ -259,6 +259,8 @@ typedef struct {
uint16_t ptrs_symbols;
// PTRS symbol index, to be updated every PTRS symbol within a slot.
uint8_t ptrs_symbol_index;
+ uint8_t nscid;
+ uint16_t dlDmrsScramblingId;
/// PDU BITMAP
uint16_t pduBitmap;
} NR_DL_UE_HARQ_t;
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
index 802cb55e03..bab0c75aff 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
@@ -32,6 +32,7 @@
#include
#include "PHY/NR_REFSIG/dmrs_nr.h"
#include "PHY/NR_REFSIG/ptrs_nr.h"
+#include "PHY/NR_REFSIG/refsig_defs_ue.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
#include "PHY/MODULATION/nr_modulation.h"
@@ -215,9 +216,16 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
/////////////////////////DMRS Modulation/////////////////////////
///////////
- uint32_t **pusch_dmrs = UE->nr_gold_pusch_dmrs[slot];
+
+ if(pusch_pdu->ul_dmrs_scrambling_id != UE->scramblingID_ulsch[pusch_pdu->scid]) {
+ UE->scramblingID_ulsch[pusch_pdu->scid] = pusch_pdu->ul_dmrs_scrambling_id;
+ nr_init_pusch_dmrs(UE, pusch_pdu->scid, pusch_pdu->ul_dmrs_scrambling_id);
+ }
+
+ uint32_t ***pusch_dmrs = UE->nr_gold_pusch_dmrs[slot];
uint16_t n_dmrs = (pusch_pdu->bwp_start + start_rb + nb_rb)*((dmrs_type == pusch_dmrs_type1) ? 6:4);
int16_t mod_dmrs[n_dmrs<<1] __attribute((aligned(16)));
+
///////////
////////////////////////////////////////////////////////////////////////
@@ -382,7 +390,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
// TODO: performance improvement, we can skip the modulation of DMRS symbols outside the bandwidth part
// Perform this on gold sequence, not required when SC FDMA operation is done,
LOG_D(PHY,"DMRS in symbol %d\n",l);
- nr_modulation(pusch_dmrs[l], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // Qm = 2 as DMRS is QPSK modulated
+ nr_modulation(pusch_dmrs[l][pusch_pdu->scid], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated
} else {
dmrs_idx = 0;
}
@@ -392,7 +400,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
if(is_ptrs_symbol(l, ulsch_ue->ptrs_symbols)) {
is_ptrs_sym = 1;
- nr_modulation(pusch_dmrs[l], nb_rb, DMRS_MOD_ORDER, mod_ptrs);
+ nr_modulation(pusch_dmrs[l][pusch_pdu->scid], nb_rb, DMRS_MOD_ORDER, mod_ptrs);
}
}
diff --git a/openair1/PHY/NR_UE_TRANSPORT/sss_nr.c b/openair1/PHY/NR_UE_TRANSPORT/sss_nr.c
index dc73fe0add..88585e6094 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/sss_nr.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/sss_nr.c
@@ -558,6 +558,9 @@ int rx_sss_nr(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int32_t *tot_metric,
}
//#endif
+ if (Nid1==N_ID_1_NUMBER)
+ return -1;
+
int re = 0;
int im = 0;
d = (int16_t *)&d_sss[Nid2][Nid1];
diff --git a/openair1/PHY/TOOLS/oai_dfts.c b/openair1/PHY/TOOLS/oai_dfts.c
index 83207426fd..c2b6a55210 100644
--- a/openair1/PHY/TOOLS/oai_dfts.c
+++ b/openair1/PHY/TOOLS/oai_dfts.c
@@ -7082,43 +7082,40 @@ static inline void dft12f(simd_q15_t *x0,
simd_q15_t tmp_dft12[12];
- simd_q15_t *tmp_dft12_ptr = &tmp_dft12[0];
-
// msg("dft12\n");
bfly4_tw1(x0,
x3,
x6,
x9,
- tmp_dft12_ptr,
- tmp_dft12_ptr+3,
- tmp_dft12_ptr+6,
- tmp_dft12_ptr+9);
-
+ tmp_dft12,
+ tmp_dft12+3,
+ tmp_dft12+6,
+ tmp_dft12+9);
bfly4_tw1(x1,
x4,
x7,
x10,
- tmp_dft12_ptr+1,
- tmp_dft12_ptr+4,
- tmp_dft12_ptr+7,
- tmp_dft12_ptr+10);
+ tmp_dft12+1,
+ tmp_dft12+4,
+ tmp_dft12+7,
+ tmp_dft12+10);
bfly4_tw1(x2,
x5,
x8,
x11,
- tmp_dft12_ptr+2,
- tmp_dft12_ptr+5,
- tmp_dft12_ptr+8,
- tmp_dft12_ptr+11);
+ tmp_dft12+2,
+ tmp_dft12+5,
+ tmp_dft12+8,
+ tmp_dft12+11);
// k2=0;
- bfly3_tw1(tmp_dft12_ptr,
- tmp_dft12_ptr+1,
- tmp_dft12_ptr+2,
+ bfly3_tw1(tmp_dft12,
+ tmp_dft12+1,
+ tmp_dft12+2,
y0,
y4,
y8);
@@ -7126,9 +7123,9 @@ static inline void dft12f(simd_q15_t *x0,
// k2=1;
- bfly3(tmp_dft12_ptr+3,
- tmp_dft12_ptr+4,
- tmp_dft12_ptr+5,
+ bfly3(tmp_dft12+3,
+ tmp_dft12+4,
+ tmp_dft12+5,
y1,
y5,
y9,
@@ -7138,9 +7135,9 @@ static inline void dft12f(simd_q15_t *x0,
// k2=2;
- bfly3(tmp_dft12_ptr+6,
- tmp_dft12_ptr+7,
- tmp_dft12_ptr+8,
+ bfly3(tmp_dft12+6,
+ tmp_dft12+7,
+ tmp_dft12+8,
y2,
y6,
y10,
@@ -7148,9 +7145,9 @@ static inline void dft12f(simd_q15_t *x0,
W4_12);
// k2=3;
- bfly3(tmp_dft12_ptr+9,
- tmp_dft12_ptr+10,
- tmp_dft12_ptr+11,
+ bfly3(tmp_dft12+9,
+ tmp_dft12+10,
+ tmp_dft12+11,
y3,
y7,
y11,
@@ -10606,15 +10603,43 @@ int dfts_autoinit(void)
#ifndef MR_MAIN
-void dft(uint8_t sizeidx, int16_t *sigF,int16_t *sig,unsigned char scale_flag){
- AssertFatal((sizeidx>=0 && sizeidx<(int)DFT_SIZE_IDXTABLESIZE),"Invalid dft size index %i\n",sizeidx);
- dft_ftab[sizeidx](sigF,sig,scale_flag);
+void dft(uint8_t sizeidx, int16_t *input,int16_t *output,unsigned char scale_flag){
+ AssertFatal((sizeidx >= 0 && sizeidx=0 && sizeidx<(int)IDFT_SIZE_IDXTABLESIZE),"Invalid idft size index %i\n",sizeidx);
- idft_ftab[sizeidx](sigF,sig,scale_flag);
+void idft(uint8_t sizeidx, int16_t *input,int16_t *output,unsigned char scale_flag){
+ AssertFatal((sizeidx>=0 && sizeidxnr_gold_pdcch_dmrs[slot],
+ nr_generate_dci_top(msgTx, slot,
&gNB->common_vars.txdataF[0][txdataF_offset],
AMP, fp);
@@ -178,7 +177,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
if (csirs->active == 1) {
LOG_D(PHY, "CSI-RS generation started in frame %d.%d\n",frame,slot);
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t csi_params = csirs->csirs_pdu.csi_rs_pdu_rel15;
- nr_generate_csi_rs(gNB, AMP, csi_params, gNB->gNB_config.cell_config.phy_cell_id.value, slot);
+ nr_generate_csi_rs(gNB, AMP, csi_params, slot);
csirs->active = 0;
}
}
diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
index 257b727258..415f966617 100644
--- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
+++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
@@ -315,6 +315,8 @@ void configure_dlsch(NR_UE_DLSCH_t *dlsch0,
dlsch0_harq->mcs = dlsch_config_pdu->mcs;
dlsch0_harq->rvidx = dlsch_config_pdu->rv;
dlsch0->g_pucch = dlsch_config_pdu->accumulated_delta_PUCCH;
+ dlsch0_harq->nscid = dlsch_config_pdu->nscid;
+ dlsch0_harq->dlDmrsScramblingId = dlsch_config_pdu->dlDmrsScramblingId;
//get nrOfLayers from DCI info
uint8_t Nl = 0;
for (int i = 0; i < 12; i++) { // max 12 ports
diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
index a0539ae4b3..34cbfb6c73 100644
--- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
+++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
@@ -580,6 +580,8 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int gNB_
nr_slot_rx,
get_dmrs_port(aatx,dlsch0_harq->dmrs_ports),
m,
+ dlsch0_harq->nscid,
+ dlsch0_harq->dlDmrsScramblingId,
BWPStart,
dlsch0_harq->dmrsConfigType,
ue->frame_parms.first_carrier_offset+(BWPStart + pdsch_start_rb)*12,
@@ -1489,6 +1491,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
gNB_id,
nr_slot_rx,
l,
+ pdcch_vars->pdcch_config[n_ss].coreset.pdcch_dmrs_scrambling_id,
fp->first_carrier_offset+(pdcch_vars->pdcch_config[n_ss].BWPStart + coreset_start_rb)*12,
coreset_nb_rb);
diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c
index 69f3f983af..1a30b060b2 100644
--- a/openair1/SIMULATION/NR_PHY/dlsim.c
+++ b/openair1/SIMULATION/NR_PHY/dlsim.c
@@ -961,10 +961,10 @@ int main(int argc, char **argv)
nr_gold_pdcch(UE, frame_parms->Nid_cell);
// compute the scrambling IDs for PDSCH DMRS
- for (int i = 0; i < 2; i++)
- UE->scramblingID[i] = frame_parms->Nid_cell;
-
- nr_gold_pdsch(UE, UE->scramblingID);
+ for (int i = 0; i < 2; i++) {
+ UE->scramblingID_dlsch[i] = frame_parms->Nid_cell;
+ nr_gold_pdsch(UE, i, UE->scramblingID_dlsch[i]);
+ }
nr_l2_init_ue(NULL);
UE_mac = get_mac_inst(0);
diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c
index 151d51d726..5d85135677 100644
--- a/openair1/SIMULATION/NR_PHY/pucchsim.c
+++ b/openair1/SIMULATION/NR_PHY/pucchsim.c
@@ -640,6 +640,7 @@ int main(int argc, char **argv)
pucch_pdu.initial_cyclic_shift = 0;
pucch_pdu.start_symbol_index = startingSymbolIndex;
pucch_pdu.prb_start = startingPRB;
+ pucch_pdu.prb_size = 1;
pucch_pdu.bwp_start = 0;
pucch_pdu.bwp_size = N_RB_DL;
if (nrofSymbols>1) {
diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c
index 2646e5da58..09499248b2 100644
--- a/openair1/SIMULATION/NR_PHY/ulsim.c
+++ b/openair1/SIMULATION/NR_PHY/ulsim.c
@@ -782,10 +782,10 @@ int main(int argc, char **argv)
init_nr_ue_transport(UE);
- // initialize the pusch dmrs
- uint16_t N_n_scid[2] = {frame_parms->Nid_cell,frame_parms->Nid_cell};
- int n_scid = 0; // This quantity is indicated by higher layer parameter dmrs-SeqInitialization
- nr_init_pusch_dmrs(UE, N_n_scid, n_scid);
+ for(int n_scid = 0; n_scid<2; n_scid++) {
+ UE->scramblingID_ulsch[n_scid] = frame_parms->Nid_cell;
+ nr_init_pusch_dmrs(UE, frame_parms->Nid_cell, n_scid);
+ }
//Configure UE
NR_UE_RRC_INST_t rrcue;
diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
index 4542b919e5..e301cded44 100644
--- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
@@ -281,7 +281,6 @@ int get_rnti_type(NR_UE_MAC_INST_t *mac, uint16_t rnti){
LOG_D(MAC, "In %s: returning rnti_type %s \n", __FUNCTION__, rnti_types[rnti_type]);
return rnti_type;
-
}
@@ -883,15 +882,27 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
if(pdsch_TimeDomainAllocationList && rnti!=SI_RNTI)
mappingtype = pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType;
+ struct NR_DMRS_DownlinkConfig *dl_dmrs_config = NULL;
+ if(mac->DLbwp[0])
+ dl_dmrs_config = (mappingtype == typeA) ?
+ mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup :
+ mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup;
+
+ dlsch_config_pdu_1_0->nscid = 0;
+ if(dl_dmrs_config && dl_dmrs_config->scramblingID0)
+ dlsch_config_pdu_1_0->dlDmrsScramblingId = *dl_dmrs_config->scramblingID0;
+ else
+ dlsch_config_pdu_1_0->dlDmrsScramblingId = mac->physCellId;
+
/* dmrs symbol positions*/
dlsch_config_pdu_1_0->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config,
(get_softmodem_params()->nsa) ? mac->scc->dmrs_TypeA_Position : mac->mib->dmrs_TypeA_Position,
dlsch_config_pdu_1_0->number_symbols,
dlsch_config_pdu_1_0->start_symbol,
- mappingtype,
- 1);
- dlsch_config_pdu_1_0->dmrsConfigType = (dl_bwp_id>0 && mac->DLbwp[dl_bwp_id-1] != NULL) ?
- (mac->DLbwp[dl_bwp_id-1]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1) : 0;
+ mappingtype, 1);
+ dlsch_config_pdu_1_0->dmrsConfigType = (dl_dmrs_config != NULL) ?
+ (dl_dmrs_config->dmrs_Type == NULL ? 0 : 1) : 0;
+
/* number of DM-RS CDM groups without data according to subclause 5.1.6.2 of 3GPP TS 38.214 version 15.9.0 Release 15 */
if (dlsch_config_pdu_1_0->number_symbols == 2)
dlsch_config_pdu_1_0->n_dmrs_cdm_groups = 1;
@@ -1084,7 +1095,30 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
if(pdsch_TimeDomainAllocationList)
mappingtype = pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType;
- dlsch_config_pdu_1_1->dmrsConfigType = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? NFAPI_NR_DMRS_TYPE1 : NFAPI_NR_DMRS_TYPE2;
+ struct NR_DMRS_DownlinkConfig *dl_dmrs_config = (mappingtype == typeA) ?
+ pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup :
+ pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup;
+
+ switch (dci->dmrs_sequence_initialization.val) {
+ case 0:
+ dlsch_config_pdu_1_1->nscid = 0;
+ if(dl_dmrs_config->scramblingID0)
+ dlsch_config_pdu_1_1->dlDmrsScramblingId = *dl_dmrs_config->scramblingID0;
+ else
+ dlsch_config_pdu_1_1->dlDmrsScramblingId = mac->physCellId;
+ break;
+ case 1:
+ dlsch_config_pdu_1_1->nscid = 1;
+ if(dl_dmrs_config->scramblingID1)
+ dlsch_config_pdu_1_1->dlDmrsScramblingId = *dl_dmrs_config->scramblingID1;
+ else
+ dlsch_config_pdu_1_1->dlDmrsScramblingId = mac->physCellId;
+ break;
+ default:
+ AssertFatal(1==0,"Invalid dmrs sequence initialization value\n");
+ }
+
+ dlsch_config_pdu_1_1->dmrsConfigType = dl_dmrs_config->dmrs_Type == NULL ? NFAPI_NR_DMRS_TYPE1 : NFAPI_NR_DMRS_TYPE2;
/* TODO: fix number of DM-RS CDM groups without data according to subclause 5.1.6.2 of 3GPP TS 38.214,
using tables 7.3.1.2.2-1, 7.3.1.2.2-2, 7.3.1.2.2-3, 7.3.1.2.2-4 of 3GPP TS 38.212 */
@@ -1145,17 +1179,11 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
/* ANTENNA_PORTS */
uint8_t n_codewords = 1; // FIXME!!!
- long *max_length = NULL;
- long *dmrs_type = NULL;
+ long *max_length = dl_dmrs_config->maxLength;
+ long *dmrs_type = dl_dmrs_config->dmrs_Type;
+
dlsch_config_pdu_1_1->n_front_load_symb = 1; // default value
- if (pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA) {
- max_length = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->maxLength;
- dmrs_type = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type;
- }
- if (pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB) {
- max_length = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup->maxLength;
- dmrs_type = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup->dmrs_Type;
- }
+
if ((dmrs_type == NULL) && (max_length == NULL)){
// Table 7.3.1.2.2-1: Antenna port(s) (1000 + DMRS port), dmrs-Type=1, maxLength=1
dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_1[dci->antenna_ports.val][0];
@@ -2329,11 +2357,9 @@ int8_t nr_ue_get_SR(module_id_t module_idP, frame_t frameP, slot_t slot){
// start the sr-prohibittimer : rel 9 and above
if (mac->scheduling_info.sr_ProhibitTimer > 0) { // timer configured
mac->scheduling_info.sr_ProhibitTimer--;
- mac->scheduling_info.
- sr_ProhibitTimer_Running = 1;
+ mac->scheduling_info.sr_ProhibitTimer_Running = 1;
} else {
- mac->scheduling_info.
- sr_ProhibitTimer_Running = 0;
+ mac->scheduling_info.sr_ProhibitTimer_Running = 0;
}
//mac->ul_active =1;
return (1); //instruct phy to signal SR
diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
index 5355ad63e6..5f179c0203 100644
--- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
+++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
@@ -742,6 +742,11 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
? pusch_Config->dmrs_UplinkForPUSCH_MappingTypeA->choice.setup : pusch_Config->dmrs_UplinkForPUSCH_MappingTypeB->choice.setup;
}
+ pusch_config_pdu->scid = 0;
+ pusch_config_pdu->ul_dmrs_scrambling_id = mac->physCellId;
+ if(*dci_format == NR_UL_DCI_FORMAT_0_1)
+ pusch_config_pdu->scid = dci->dmrs_sequence_initialization.val;
+
/* TRANSFORM PRECODING ------------------------------------------------------------------------------------------*/
if (pusch_config_pdu->transform_precoding == NR_PUSCH_Config__transformPrecoder_enabled) {
@@ -768,6 +773,14 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
LOG_D(NR_MAC,"TRANSFORM PRECODING IS ENABLED. CDM groups: %d, U: %d \n", pusch_config_pdu->num_dmrs_cdm_grps_no_data,
pusch_config_pdu->dfts_ofdm.low_papr_group_number);
}
+ else {
+ if (pusch_config_pdu->scid == 0 &&
+ NR_DMRS_ulconfig->transformPrecodingDisabled->scramblingID0)
+ pusch_config_pdu->ul_dmrs_scrambling_id = *NR_DMRS_ulconfig->transformPrecodingDisabled->scramblingID0;
+ if (pusch_config_pdu->scid == 1 &&
+ NR_DMRS_ulconfig->transformPrecodingDisabled->scramblingID1)
+ pusch_config_pdu->ul_dmrs_scrambling_id = *NR_DMRS_ulconfig->transformPrecodingDisabled->scramblingID1;
+ }
/* TRANSFORM PRECODING --------------------------------------------------------------------------------------------------------*/
diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h
index d1bcf57ccc..5651ccf254 100644
--- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h
+++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h
@@ -525,4 +525,7 @@ bool nr_find_nb_rb(uint16_t Qm,
void nr_sr_reporting(int Mod_idP, frame_t frameP, sub_frame_t slotP);
void dump_mac_stats(gNB_MAC_INST *gNB, char *output, int strlen, bool reset_rsrp);
+
+void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_sched_ctrl_t *sched_ctrl);
+
#endif /*__LAYER2_NR_MAC_PROTO_H__*/
diff --git a/openair2/RRC/NR/L2_nr_interface.c b/openair2/RRC/NR/L2_nr_interface.c
index c34f20aca4..b5d83a1345 100644
--- a/openair2/RRC/NR/L2_nr_interface.c
+++ b/openair2/RRC/NR/L2_nr_interface.c
@@ -359,7 +359,8 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP,
memcpy(msg->rrc_container, sduP, sdu_lenP);
msg->rrc_container_length=sdu_lenP;
itti_send_msg_to_task(TASK_DU_F1, 0, tmp);
- return(0);
+
+ return 0;
}
protocol_ctxt_t ctxt;
@@ -372,7 +373,6 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP,
nr_rrc_gNB_decode_ccch(&ctxt, sduP, sdu_lenP, NULL, CC_id);
}
}
-
return 0;
}
diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c
index b815dc1216..569170883b 100755
--- a/openair2/RRC/NR/MESSAGES/asn1_msg.c
+++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c
@@ -1294,11 +1294,13 @@ void fill_default_uplinkBWP(NR_BWP_Uplink_t *ubwp,
}
void fill_initial_SpCellConfig(int uid,
- NR_SpCellConfig_t *SpCellConfig,
+ NR_CellGroupConfig_t *cellGroupConfig,
NR_ServingCellConfigCommon_t *scc,
NR_ServingCellConfig_t *servingcellconfigdedicated,
- const gNB_RrcConfigurationReq *configuration)
-{
+ const gNB_RrcConfigurationReq *configuration) {
+
+ NR_SpCellConfig_t *SpCellConfig = cellGroupConfig->spCellConfig;
+
// This assert will never happen in the current implementation because NUMBER_OF_UE_MAX = 4.
// However, if in the future NUMBER_OF_UE_MAX is increased, it will be necessary to improve the allocation of SRS resources,
// where the startPosition = 2 or 3 and sl160 = 17, 17, 27 ... 157 only give us 30 different allocations.
@@ -1321,30 +1323,12 @@ void fill_initial_SpCellConfig(int uid,
initialUplinkBWP->pucch_Config->choice.setup=pucch_Config;
pucch_Config->resourceSetToAddModList = calloc(1,sizeof(*pucch_Config->resourceSetToAddModList));
pucch_Config->resourceSetToReleaseList = NULL;
- NR_PUCCH_ResourceSet_t *pucchresset0=calloc(1,sizeof(*pucchresset0));
- pucchresset0->pucch_ResourceSetId = 0;
- NR_PUCCH_ResourceId_t *pucchresset0id0=calloc(1,sizeof(*pucchresset0id0));
- *pucchresset0id0=0;
- ASN_SEQUENCE_ADD(&pucchresset0->resourceList.list,pucchresset0id0);
- pucchresset0->maxPayloadSize=NULL;
- ASN_SEQUENCE_ADD(&pucch_Config->resourceSetToAddModList->list,pucchresset0);
-
pucch_Config->resourceToAddModList = calloc(1,sizeof(*pucch_Config->resourceToAddModList));
pucch_Config->resourceToReleaseList = NULL;
- // configure one single PUCCH0 opportunity for initial connection procedure
- // one symbol (13)
- NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0));
- pucchres0->pucch_ResourceId=0;
- pucchres0->startingPRB=(8+uid) % curr_bwp;
- LOG_D(NR_RRC, "pucchres0->startPRB %ld uid %d curr_bwp %d\n", pucchres0->startingPRB, uid, curr_bwp);
- pucchres0->intraSlotFrequencyHopping=NULL;
- pucchres0->secondHopPRB=NULL;
- pucchres0->format.present= NR_PUCCH_Resource__format_PR_format0;
- pucchres0->format.choice.format0=calloc(1,sizeof(*pucchres0->format.choice.format0));
- pucchres0->format.choice.format0->initialCyclicShift=0;
- pucchres0->format.choice.format0->nrofSymbols=1;
- pucchres0->format.choice.format0->startingSymbolIndex=13;
- ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres0);
+ config_pucch_resset0(pucch_Config, uid, curr_bwp, NULL);
+ config_pucch_resset1(pucch_Config, NULL);
+ set_pucch_power_config(pucch_Config, configuration->do_CSIRS);
+
initialUplinkBWP->pusch_Config = calloc(1,sizeof(*initialUplinkBWP->pusch_Config));
initialUplinkBWP->pusch_Config->present = NR_SetupRelease_PUSCH_Config_PR_setup;
NR_PUSCH_Config_t *pusch_Config = calloc(1,sizeof(*pusch_Config));
@@ -1492,40 +1476,9 @@ void fill_initial_SpCellConfig(int uid,
srs_res0->spatialRelationInfo->referenceSignal.choice.csi_RS_Index=0;
ASN_SEQUENCE_ADD(&srs_Config->srs_ResourceToAddModList->list,srs_res0);
- // configure Scheduling request
- // 40 slot period
- pucch_Config->schedulingRequestResourceToAddModList = calloc(1,sizeof(*pucch_Config->schedulingRequestResourceToAddModList));
- NR_SchedulingRequestResourceConfig_t *schedulingRequestResourceConfig = calloc(1,sizeof(*schedulingRequestResourceConfig));
- schedulingRequestResourceConfig->schedulingRequestResourceId = 1;
- schedulingRequestResourceConfig->schedulingRequestID = 0;
- schedulingRequestResourceConfig->periodicityAndOffset = calloc(1,sizeof(*schedulingRequestResourceConfig->periodicityAndOffset));
- schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl40;
- // note: make sure that there is no issue here. Later choose the RNTI accordingly.
- // Here we would be limited to 3 UEs on this resource (1 1/2 Frames 30 kHz SCS, 5 ms TDD periodicity => slots 7,8,9).
- // This should be a temporary resource until the first RRCReconfiguration gives new pucch resources.
- // Check for above configuration and exit for now if it is not the case
- AssertFatal(scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters.subcarrierSpacing==NR_SubcarrierSpacing_kHz30,
- "SCS != 30kHz\n");
+ scheduling_request_config(scc, cellGroupConfig->mac_CellGroupConfig, pucch_Config);
- if (scc->tdd_UL_DL_ConfigurationCommon) {
- AssertFatal(scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity == NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms5,
- "TDD period != 5ms : %ld\n", scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity);
- }
-
- schedulingRequestResourceConfig->periodicityAndOffset->choice.sl40 = 8;
- schedulingRequestResourceConfig->resource = calloc(1,sizeof(*schedulingRequestResourceConfig->resource));
- *schedulingRequestResourceConfig->resource = 0;
- ASN_SEQUENCE_ADD(&pucch_Config->schedulingRequestResourceToAddModList->list,schedulingRequestResourceConfig);
-
- pucch_Config->dl_DataToUL_ACK = calloc(1,sizeof(*pucch_Config->dl_DataToUL_ACK));
- long *delay[8];
- for (int i=0;i<8;i++) {
- delay[i] = calloc(1,sizeof(*delay[i]));
- AssertFatal(configuration->minRXTXTIME >= 2 && configuration->minRXTXTIME < 7,
- "minRXTXTIME is %d but should be within [2,7)\n", configuration->minRXTXTIME);
- *delay[i] = i + configuration->minRXTXTIME;
- ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]);
- }
+ set_dl_DataToUL_ACK(pucch_Config, configuration->minRXTXTIME);
SpCellConfig->spCellConfigDedicated->initialDownlinkBWP = calloc(1,sizeof(*SpCellConfig->spCellConfigDedicated->initialDownlinkBWP));
NR_BWP_DownlinkDedicated_t *bwp_Dedicated = SpCellConfig->spCellConfigDedicated->initialDownlinkBWP;
@@ -1764,6 +1717,7 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
const gNB_RrcConfigurationReq* configuration) {
NR_SpCellConfig_t *SpCellConfig = cellGroupConfig->spCellConfig;
+
if (SpCellConfig == NULL) return;
NR_ServingCellConfigCommon_t *scc = configuration->scc;
@@ -1785,7 +1739,6 @@ void update_cellGroupConfig(NR_CellGroupConfig_t *cellGroupConfig,
}
-
void fill_initial_cellGroupConfig(int uid,
NR_CellGroupConfig_t *cellGroupConfig,
NR_ServingCellConfigCommon_t *scc,
@@ -1841,36 +1794,25 @@ void fill_initial_cellGroupConfig(int uid,
cellGroupConfig->rlc_BearerToReleaseList = NULL;
/* mac CellGroup Config */
- if (1) {
- mac_CellGroupConfig = calloc(1, sizeof(*mac_CellGroupConfig));
- if (1) {
- mac_CellGroupConfig->schedulingRequestConfig = calloc(1, sizeof(*mac_CellGroupConfig->schedulingRequestConfig));
- mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList = CALLOC(1,sizeof(*mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList));
- struct NR_SchedulingRequestToAddMod *schedulingrequestlist;
- schedulingrequestlist = CALLOC(1,sizeof(*schedulingrequestlist));
- schedulingrequestlist->schedulingRequestId = 0;
- schedulingrequestlist->sr_ProhibitTimer = CALLOC(1,sizeof(*schedulingrequestlist->sr_ProhibitTimer));
- *(schedulingrequestlist->sr_ProhibitTimer) = 0;
- schedulingrequestlist->sr_TransMax = NR_SchedulingRequestToAddMod__sr_TransMax_n64;
- ASN_SEQUENCE_ADD(&(mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList->list),schedulingrequestlist);
- }
- mac_CellGroupConfig->bsr_Config = calloc(1, sizeof(*mac_CellGroupConfig->bsr_Config));
- mac_CellGroupConfig->bsr_Config->periodicBSR_Timer = NR_BSR_Config__periodicBSR_Timer_sf10;
- mac_CellGroupConfig->bsr_Config->retxBSR_Timer = NR_BSR_Config__retxBSR_Timer_sf80;
- mac_CellGroupConfig->tag_Config = calloc(1, sizeof(*mac_CellGroupConfig->tag_Config));
- mac_CellGroupConfig->tag_Config->tag_ToReleaseList = NULL;
- mac_CellGroupConfig->tag_Config->tag_ToAddModList = calloc(1,sizeof(*mac_CellGroupConfig->tag_Config->tag_ToAddModList));
- struct NR_TAG *tag=calloc(1,sizeof(*tag));
- tag->tag_Id = 0;
- tag->timeAlignmentTimer = NR_TimeAlignmentTimer_infinity;
- ASN_SEQUENCE_ADD(&mac_CellGroupConfig->tag_Config->tag_ToAddModList->list,tag);
- mac_CellGroupConfig->phr_Config = calloc(1, sizeof(*mac_CellGroupConfig->phr_Config));
- mac_CellGroupConfig->phr_Config->present = NR_SetupRelease_PHR_Config_PR_setup;
- mac_CellGroupConfig->phr_Config->choice.setup = calloc(1, sizeof(*mac_CellGroupConfig->phr_Config->choice.setup));
- mac_CellGroupConfig->phr_Config->choice.setup->phr_PeriodicTimer = NR_PHR_Config__phr_PeriodicTimer_sf10;
- mac_CellGroupConfig->phr_Config->choice.setup->phr_ProhibitTimer = NR_PHR_Config__phr_ProhibitTimer_sf10;
- mac_CellGroupConfig->phr_Config->choice.setup->phr_Tx_PowerFactorChange = NR_PHR_Config__phr_Tx_PowerFactorChange_dB1;
- }
+ mac_CellGroupConfig = calloc(1, sizeof(*mac_CellGroupConfig));
+
+ mac_CellGroupConfig->bsr_Config = calloc(1, sizeof(*mac_CellGroupConfig->bsr_Config));
+ mac_CellGroupConfig->bsr_Config->periodicBSR_Timer = NR_BSR_Config__periodicBSR_Timer_sf10;
+ mac_CellGroupConfig->bsr_Config->retxBSR_Timer = NR_BSR_Config__retxBSR_Timer_sf80;
+ mac_CellGroupConfig->tag_Config = calloc(1, sizeof(*mac_CellGroupConfig->tag_Config));
+ mac_CellGroupConfig->tag_Config->tag_ToReleaseList = NULL;
+ mac_CellGroupConfig->tag_Config->tag_ToAddModList = calloc(1,sizeof(*mac_CellGroupConfig->tag_Config->tag_ToAddModList));
+ struct NR_TAG *tag=calloc(1,sizeof(*tag));
+ tag->tag_Id = 0;
+ tag->timeAlignmentTimer = NR_TimeAlignmentTimer_infinity;
+ ASN_SEQUENCE_ADD(&mac_CellGroupConfig->tag_Config->tag_ToAddModList->list,tag);
+ mac_CellGroupConfig->phr_Config = calloc(1, sizeof(*mac_CellGroupConfig->phr_Config));
+ mac_CellGroupConfig->phr_Config->present = NR_SetupRelease_PHR_Config_PR_setup;
+ mac_CellGroupConfig->phr_Config->choice.setup = calloc(1, sizeof(*mac_CellGroupConfig->phr_Config->choice.setup));
+ mac_CellGroupConfig->phr_Config->choice.setup->phr_PeriodicTimer = NR_PHR_Config__phr_PeriodicTimer_sf10;
+ mac_CellGroupConfig->phr_Config->choice.setup->phr_ProhibitTimer = NR_PHR_Config__phr_ProhibitTimer_sf10;
+ mac_CellGroupConfig->phr_Config->choice.setup->phr_Tx_PowerFactorChange = NR_PHR_Config__phr_Tx_PowerFactorChange_dB1;
+
cellGroupConfig->mac_CellGroupConfig = mac_CellGroupConfig;
physicalCellGroupConfig = calloc(1,sizeof(*physicalCellGroupConfig));
@@ -1879,9 +1821,7 @@ void fill_initial_cellGroupConfig(int uid,
physicalCellGroupConfig->pdsch_HARQ_ACK_Codebook = NR_PhysicalCellGroupConfig__pdsch_HARQ_ACK_Codebook_dynamic;
cellGroupConfig->physicalCellGroupConfig = physicalCellGroupConfig;
- cellGroupConfig->spCellConfig = calloc(1,sizeof(*cellGroupConfig->spCellConfig));
-
- fill_initial_SpCellConfig(uid,cellGroupConfig->spCellConfig,scc,servingcellconfigdedicated,configuration);
+ fill_initial_SpCellConfig(uid,cellGroupConfig,scc,servingcellconfigdedicated,configuration);
cellGroupConfig->sCellToAddModList = NULL;
cellGroupConfig->sCellToReleaseList = NULL;
diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.h b/openair2/RRC/NR/MESSAGES/asn1_msg.h
index e040837c27..ddb2a7f3db 100644
--- a/openair2/RRC/NR/MESSAGES/asn1_msg.h
+++ b/openair2/RRC/NR/MESSAGES/asn1_msg.h
@@ -102,8 +102,8 @@ uint8_t do_RRCReject(uint8_t Mod_id,
uint8_t *const buffer);
void fill_initial_SpCellConfig(int uid,
- NR_SpCellConfig_t *SpCellConfig,
- NR_ServingCellConfigCommon_t *scc,
+ NR_CellGroupConfig_t *cellGroupConfig,
+ NR_ServingCellConfigCommon_t *scc,
NR_ServingCellConfig_t *servingcellconfigdedicated,
const gNB_RrcConfigurationReq *configuration);
diff --git a/openair2/RRC/NR/nr_rrc_config.c b/openair2/RRC/NR/nr_rrc_config.c
index aab525fcd7..e94933416f 100644
--- a/openair2/RRC/NR/nr_rrc_config.c
+++ b/openair2/RRC/NR/nr_rrc_config.c
@@ -235,6 +235,7 @@ void prepare_sim_uecap(NR_UE_NR_Capability_t *cap,
int rbsize,
int mcs_table) {
+ NR_Phy_Parameters_t *phy_Parameters = &cap->phy_Parameters;
int band = *scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
NR_BandNR_t *nr_bandnr = CALLOC(1,sizeof(NR_BandNR_t));
nr_bandnr->bandNR = band;
@@ -248,8 +249,8 @@ void prepare_sim_uecap(NR_UE_NR_Capability_t *cap,
*bandNRinfo->pdsch_256QAM_FR2 = NR_BandNR__pdsch_256QAM_FR2_supported;
}
else{
- cap->phy_Parameters.phy_ParametersFR1 = CALLOC(1,sizeof(*cap->phy_Parameters.phy_ParametersFR1));
- NR_Phy_ParametersFR1_t *phy_fr1 = cap->phy_Parameters.phy_ParametersFR1;
+ phy_Parameters->phy_ParametersFR1 = CALLOC(1,sizeof(*phy_Parameters->phy_ParametersFR1));
+ NR_Phy_ParametersFR1_t *phy_fr1 = phy_Parameters->phy_ParametersFR1;
phy_fr1->pdsch_256QAM_FR1 = CALLOC(1,sizeof(*phy_fr1->pdsch_256QAM_FR1));
*phy_fr1->pdsch_256QAM_FR1 = NR_Phy_ParametersFR1__pdsch_256QAM_FR1_supported;
}
@@ -271,6 +272,9 @@ void prepare_sim_uecap(NR_UE_NR_Capability_t *cap,
ASN_SEQUENCE_ADD(&fs->featureSetsDownlinkPerCC->list,
fs_cc);
}
+
+ phy_Parameters->phy_ParametersFRX_Diff = CALLOC(1,sizeof(*phy_Parameters->phy_ParametersFRX_Diff));
+ phy_Parameters->phy_ParametersFRX_Diff->pucch_F0_2WithoutFH = NULL;
}
void nr_rrc_config_dl_tda(struct NR_PDSCH_TimeDomainResourceAllocationList *pdsch_TimeDomainAllocationList,
@@ -348,6 +352,213 @@ void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay){
}
}
+void set_dl_DataToUL_ACK(NR_PUCCH_Config_t *pucch_Config, int min_feedback_time) {
+
+ pucch_Config->dl_DataToUL_ACK = calloc(1,sizeof(*pucch_Config->dl_DataToUL_ACK));
+ long *delay[8];
+ for (int i=0;i<8;i++) {
+ delay[i] = calloc(1,sizeof(*delay[i]));
+ *delay[i] = i+min_feedback_time;
+ ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]);
+ }
+}
+
+// PUCCH resource set 0 for configuration with O_uci <= 2 bits and/or a positive or negative SR (section 9.2.1 of 38.213)
+void config_pucch_resset0(NR_PUCCH_Config_t *pucch_Config, int uid, int curr_bwp, NR_UE_NR_Capability_t *uecap) {
+
+ NR_PUCCH_ResourceSet_t *pucchresset = calloc(1,sizeof(*pucchresset));
+ pucchresset->pucch_ResourceSetId = 0;
+ NR_PUCCH_ResourceId_t *pucchid=calloc(1,sizeof(*pucchid));
+ *pucchid=0;
+ ASN_SEQUENCE_ADD(&pucchresset->resourceList.list,pucchid);
+ pucchresset->maxPayloadSize=NULL;
+
+ if(uecap) {
+ long *pucch_F0_2WithoutFH = uecap->phy_Parameters.phy_ParametersFRX_Diff->pucch_F0_2WithoutFH;
+ AssertFatal(pucch_F0_2WithoutFH == NULL,"UE does not support PUCCH F0 without frequency hopping. Current configuration is without FH\n");
+ }
+
+ NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0));
+ pucchres0->pucch_ResourceId=*pucchid;
+ pucchres0->startingPRB= (8 + uid) % curr_bwp;
+ pucchres0->intraSlotFrequencyHopping=NULL;
+ pucchres0->secondHopPRB=NULL;
+ pucchres0->format.present= NR_PUCCH_Resource__format_PR_format0;
+ pucchres0->format.choice.format0=calloc(1,sizeof(*pucchres0->format.choice.format0));
+ pucchres0->format.choice.format0->initialCyclicShift=0;
+ pucchres0->format.choice.format0->nrofSymbols=1;
+ pucchres0->format.choice.format0->startingSymbolIndex=13;
+ ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres0);
+
+ ASN_SEQUENCE_ADD(&pucch_Config->resourceSetToAddModList->list,pucchresset);
+}
+
+
+// PUCCH resource set 1 for configuration with O_uci > 2 bits (currently format2)
+void config_pucch_resset1(NR_PUCCH_Config_t *pucch_Config, NR_UE_NR_Capability_t *uecap) {
+
+ NR_PUCCH_ResourceSet_t *pucchresset=calloc(1,sizeof(*pucchresset));
+ pucchresset->pucch_ResourceSetId = 1;
+ NR_PUCCH_ResourceId_t *pucchressetid=calloc(1,sizeof(*pucchressetid));
+ *pucchressetid=2;
+ ASN_SEQUENCE_ADD(&pucchresset->resourceList.list,pucchressetid);
+ pucchresset->maxPayloadSize=NULL;
+
+ if(uecap) {
+ long *pucch_F0_2WithoutFH = uecap->phy_Parameters.phy_ParametersFRX_Diff->pucch_F0_2WithoutFH;
+ AssertFatal(pucch_F0_2WithoutFH == NULL,"UE does not support PUCCH F2 without frequency hopping. Current configuration is without FH\n");
+ }
+
+ NR_PUCCH_Resource_t *pucchres2=calloc(1,sizeof(*pucchres2));
+ pucchres2->pucch_ResourceId=*pucchressetid;
+ pucchres2->startingPRB=0;
+ pucchres2->intraSlotFrequencyHopping=NULL;
+ pucchres2->secondHopPRB=NULL;
+ pucchres2->format.present= NR_PUCCH_Resource__format_PR_format2;
+ pucchres2->format.choice.format2=calloc(1,sizeof(*pucchres2->format.choice.format2));
+ pucchres2->format.choice.format2->nrofPRBs=8;
+ pucchres2->format.choice.format2->nrofSymbols=1;
+ pucchres2->format.choice.format2->startingSymbolIndex=13;
+ ASN_SEQUENCE_ADD(&pucch_Config->resourceToAddModList->list,pucchres2);
+
+ ASN_SEQUENCE_ADD(&pucch_Config->resourceSetToAddModList->list,pucchresset);
+
+ pucch_Config->format2=calloc(1,sizeof(*pucch_Config->format2));
+ pucch_Config->format2->present=NR_SetupRelease_PUCCH_FormatConfig_PR_setup;
+ NR_PUCCH_FormatConfig_t *pucchfmt2 = calloc(1,sizeof(*pucchfmt2));
+ pucch_Config->format2->choice.setup = pucchfmt2;
+ pucchfmt2->interslotFrequencyHopping=NULL;
+ pucchfmt2->additionalDMRS=NULL;
+ pucchfmt2->maxCodeRate=calloc(1,sizeof(*pucchfmt2->maxCodeRate));
+ *pucchfmt2->maxCodeRate=NR_PUCCH_MaxCodeRate_zeroDot35;
+ pucchfmt2->nrofSlots=NULL;
+ pucchfmt2->pi2BPSK=NULL;
+
+ // to check UE capabilities for that in principle
+ pucchfmt2->simultaneousHARQ_ACK_CSI=calloc(1,sizeof(*pucchfmt2->simultaneousHARQ_ACK_CSI));
+ *pucchfmt2->simultaneousHARQ_ACK_CSI=NR_PUCCH_FormatConfig__simultaneousHARQ_ACK_CSI_true;
+
+}
+
+void set_pucch_power_config(NR_PUCCH_Config_t *pucch_Config, int do_csirs) {
+
+ pucch_Config->pucch_PowerControl = calloc(1,sizeof(*pucch_Config->pucch_PowerControl));
+ NR_P0_PUCCH_t *p00 = calloc(1,sizeof(*p00));
+ p00->p0_PUCCH_Id = 1;
+ p00->p0_PUCCH_Value = 0;
+ pucch_Config->pucch_PowerControl->p0_Set = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->p0_Set));
+ ASN_SEQUENCE_ADD(&pucch_Config->pucch_PowerControl->p0_Set->list,p00);
+
+ pucch_Config->pucch_PowerControl->pathlossReferenceRSs = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->pathlossReferenceRSs));
+ struct NR_PUCCH_PathlossReferenceRS *PL_ref_RS = calloc(1,sizeof(*PL_ref_RS));
+ PL_ref_RS->pucch_PathlossReferenceRS_Id = 0;
+ if(do_csirs) {
+ PL_ref_RS->referenceSignal.present = NR_PUCCH_PathlossReferenceRS__referenceSignal_PR_csi_RS_Index;
+ PL_ref_RS->referenceSignal.choice.csi_RS_Index = 0;
+ }
+ else {
+ PL_ref_RS->referenceSignal.present = NR_PUCCH_PathlossReferenceRS__referenceSignal_PR_ssb_Index;
+ PL_ref_RS->referenceSignal.choice.ssb_Index = 0;
+ }
+ ASN_SEQUENCE_ADD(&pucch_Config->pucch_PowerControl->pathlossReferenceRSs->list,PL_ref_RS);
+
+ pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0));
+ *pucch_Config->pucch_PowerControl->deltaF_PUCCH_f0 = 0;
+ pucch_Config->pucch_PowerControl->deltaF_PUCCH_f2 = calloc(1,sizeof(*pucch_Config->pucch_PowerControl->deltaF_PUCCH_f2));
+ *pucch_Config->pucch_PowerControl->deltaF_PUCCH_f2 = 0;
+
+ pucch_Config->spatialRelationInfoToAddModList = calloc(1,sizeof(*pucch_Config->spatialRelationInfoToAddModList));
+ pucch_Config->spatialRelationInfoToReleaseList=NULL;
+ NR_PUCCH_SpatialRelationInfo_t *pucchspatial = calloc(1,sizeof(*pucchspatial));
+ pucchspatial->pucch_SpatialRelationInfoId = 1;
+ pucchspatial->servingCellId = NULL;
+ if(do_csirs) {
+ pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_csi_RS_Index;
+ pucchspatial->referenceSignal.choice.csi_RS_Index = 0;
+ }
+ else {
+ pucchspatial->referenceSignal.present = NR_PUCCH_SpatialRelationInfo__referenceSignal_PR_ssb_Index;
+ pucchspatial->referenceSignal.choice.ssb_Index = 0;
+ }
+
+ pucchspatial->pucch_PathlossReferenceRS_Id = PL_ref_RS->pucch_PathlossReferenceRS_Id;
+ pucchspatial->p0_PUCCH_Id = p00->p0_PUCCH_Id;
+ pucchspatial->closedLoopIndex = NR_PUCCH_SpatialRelationInfo__closedLoopIndex_i0;
+ ASN_SEQUENCE_ADD(&pucch_Config->spatialRelationInfoToAddModList->list,pucchspatial);
+}
+
+void set_SR_periodandoffset(NR_SchedulingRequestResourceConfig_t *schedulingRequestResourceConfig,
+ NR_ServingCellConfigCommon_t *scc) {
+
+ const NR_TDD_UL_DL_Pattern_t *tdd = scc->tdd_UL_DL_ConfigurationCommon ? &scc->tdd_UL_DL_ConfigurationCommon->pattern1 : NULL;
+ int sr_slot = 1; // in FDD SR in slot 1
+ if(tdd)
+ sr_slot = tdd->nrofDownlinkSlots; // SR in the first uplink slot
+
+ schedulingRequestResourceConfig->periodicityAndOffset = calloc(1,sizeof(*schedulingRequestResourceConfig->periodicityAndOffset));
+
+ if(sr_slot<10){
+ schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl10;
+ schedulingRequestResourceConfig->periodicityAndOffset->choice.sl10 = sr_slot;
+ return;
+ }
+ if(sr_slot<20){
+ schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl20;
+ schedulingRequestResourceConfig->periodicityAndOffset->choice.sl20 = sr_slot;
+ return;
+ }
+ if(sr_slot<40){
+ schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl40;
+ schedulingRequestResourceConfig->periodicityAndOffset->choice.sl40 = sr_slot;
+ return;
+ }
+ if(sr_slot<80){
+ schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl80;
+ schedulingRequestResourceConfig->periodicityAndOffset->choice.sl80 = sr_slot;
+ return;
+ }
+ if(sr_slot<160){
+ schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl160;
+ schedulingRequestResourceConfig->periodicityAndOffset->choice.sl160 = sr_slot;
+ return;
+ }
+ if(sr_slot<320){
+ schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl320;
+ schedulingRequestResourceConfig->periodicityAndOffset->choice.sl320 = sr_slot;
+ return;
+ }
+ schedulingRequestResourceConfig->periodicityAndOffset->present = NR_SchedulingRequestResourceConfig__periodicityAndOffset_PR_sl640;
+ schedulingRequestResourceConfig->periodicityAndOffset->choice.sl640 = sr_slot;
+}
+
+void scheduling_request_config(NR_ServingCellConfigCommon_t *scc,
+ NR_MAC_CellGroupConfig_t *mac_CellGroupConfig,
+ NR_PUCCH_Config_t *pucch_Config) {
+
+ mac_CellGroupConfig->schedulingRequestConfig = calloc(1, sizeof(*mac_CellGroupConfig->schedulingRequestConfig));
+ mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList = CALLOC(1,sizeof(*mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList));
+ struct NR_SchedulingRequestToAddMod *schedulingrequestlist = CALLOC(1,sizeof(*schedulingrequestlist));
+ schedulingrequestlist->schedulingRequestId = 0;
+ schedulingrequestlist->sr_ProhibitTimer = NULL;
+ schedulingrequestlist->sr_TransMax = NR_SchedulingRequestToAddMod__sr_TransMax_n64;
+ ASN_SEQUENCE_ADD(&(mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList->list),schedulingrequestlist);
+
+ // format with <=2 bits in pucch resource set 0
+ NR_PUCCH_ResourceSet_t *pucchresset = pucch_Config->resourceSetToAddModList->list.array[0];
+ // assigning the 1st pucch resource in the set to scheduling request
+ NR_PUCCH_ResourceId_t *pucchressetid = pucchresset->resourceList.list.array[0];
+
+ pucch_Config->schedulingRequestResourceToAddModList = calloc(1,sizeof(*pucch_Config->schedulingRequestResourceToAddModList));
+ NR_SchedulingRequestResourceConfig_t *schedulingRequestResourceConfig = calloc(1,sizeof(*schedulingRequestResourceConfig));
+ schedulingRequestResourceConfig->schedulingRequestResourceId = 1;
+ schedulingRequestResourceConfig->schedulingRequestID = 0;
+
+ set_SR_periodandoffset(schedulingRequestResourceConfig, scc);
+
+ schedulingRequestResourceConfig->resource = calloc(1,sizeof(*schedulingRequestResourceConfig->resource));
+ *schedulingRequestResourceConfig->resource = *pucchressetid;
+ ASN_SEQUENCE_ADD(&pucch_Config->schedulingRequestResourceToAddModList->list,schedulingRequestResourceConfig);
+}
void set_dl_mcs_table(int scs, NR_UE_NR_Capability_t *cap,
NR_BWP_DownlinkDedicated_t *bwp_Dedicated,
@@ -393,7 +604,6 @@ void set_dl_mcs_table(int scs, NR_UE_NR_Capability_t *cap,
bwp_Dedicated->pdsch_Config->choice.setup->mcs_Table = NULL;
}
-
void config_downlinkBWP(NR_BWP_Downlink_t *bwp,
NR_ServingCellConfigCommon_t *scc,
NR_ServingCellConfig_t *servingcellconfigdedicated,
@@ -571,5 +781,3 @@ void config_downlinkBWP(NR_BWP_Downlink_t *bwp,
}
}
-
-
diff --git a/openair2/RRC/NR/nr_rrc_config.h b/openair2/RRC/NR/nr_rrc_config.h
index 6bbc74263a..2a477e8d14 100644
--- a/openair2/RRC/NR/nr_rrc_config.h
+++ b/openair2/RRC/NR/nr_rrc_config.h
@@ -120,6 +120,13 @@ void nr_rrc_config_dl_tda(struct NR_PDSCH_TimeDomainResourceAllocationList *pdsc
NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon,
int curr_bwp);
void nr_rrc_config_ul_tda(NR_ServingCellConfigCommon_t *scc, int min_fb_delay);
+void config_pucch_resset0(NR_PUCCH_Config_t *pucch_Config, int uid, int curr_bwp, NR_UE_NR_Capability_t *uecap);
+void config_pucch_resset1(NR_PUCCH_Config_t *pucch_Config, NR_UE_NR_Capability_t *uecap);
+void set_dl_DataToUL_ACK(NR_PUCCH_Config_t *pucch_Config, int min_feedback_time);
+void set_pucch_power_config(NR_PUCCH_Config_t *pucch_Config, int do_csirs);
+void scheduling_request_config(NR_ServingCellConfigCommon_t *scc,
+ NR_MAC_CellGroupConfig_t *mac_CellGroupConfig,
+ NR_PUCCH_Config_t *pucch_Config);
void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
NR_CSI_MeasConfig_t *csi_MeasConfig,
int uid,
diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c
index fde4df8b37..687d6268d1 100644
--- a/openair2/RRC/NR/rrc_gNB_reconfig.c
+++ b/openair2/RRC/NR/rrc_gNB_reconfig.c
@@ -427,15 +427,6 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
secondaryCellGroup->mac_CellGroupConfig=calloc(1,sizeof(*secondaryCellGroup->mac_CellGroupConfig));
secondaryCellGroup->mac_CellGroupConfig->drx_Config = NULL;
- secondaryCellGroup->mac_CellGroupConfig->schedulingRequestConfig = calloc(1,sizeof(*secondaryCellGroup->mac_CellGroupConfig->schedulingRequestConfig));
- secondaryCellGroup->mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList = calloc(1,sizeof(*secondaryCellGroup->mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList));
- NR_SchedulingRequestToAddMod_t *SchedulingRequestConf = calloc(1,sizeof(*SchedulingRequestConf));
- SchedulingRequestConf->schedulingRequestId = 0; //Could be changed
- SchedulingRequestConf->sr_ProhibitTimer = calloc(1,sizeof(*SchedulingRequestConf->sr_ProhibitTimer));
- *SchedulingRequestConf->sr_ProhibitTimer = NR_SchedulingRequestToAddMod__sr_ProhibitTimer_ms16;
- SchedulingRequestConf->sr_TransMax = NR_SchedulingRequestToAddMod__sr_TransMax_n32;
- ASN_SEQUENCE_ADD(&secondaryCellGroup->mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToAddModList->list,SchedulingRequestConf);
- secondaryCellGroup->mac_CellGroupConfig->schedulingRequestConfig->schedulingRequestToReleaseList = NULL;
secondaryCellGroup->mac_CellGroupConfig->bsr_Config=calloc(1,sizeof(*secondaryCellGroup->mac_CellGroupConfig->bsr_Config));
secondaryCellGroup->mac_CellGroupConfig->bsr_Config->periodicBSR_Timer = NR_BSR_Config__periodicBSR_Timer_sf10;