Merge remote-tracking branch 'origin/develop' into NR_SA_band_96
This commit is contained in:
@@ -34,6 +34,8 @@
|
||||
#include "assertions.h"
|
||||
#include "nr_common.h"
|
||||
|
||||
const char *duplex_mode[]={"FDD","TDD"};
|
||||
|
||||
// Table 5.2-1 NR operating bands in FR1 & FR2 (3GPP TS 38.101)
|
||||
// Table 5.4.2.3-1 Applicable NR-ARFCN per operating band in FR1 & FR2 (3GPP TS 38.101)
|
||||
// Notes:
|
||||
@@ -250,6 +252,184 @@ int get_dmrs_port(int nl, uint16_t dmrs_ports) {
|
||||
return p;
|
||||
}
|
||||
|
||||
int get_num_dmrs(uint16_t dmrs_mask ) {
|
||||
|
||||
int num_dmrs=0;
|
||||
|
||||
for (int i=0;i<16;i++) num_dmrs+=((dmrs_mask>>i)&1);
|
||||
return(num_dmrs);
|
||||
}
|
||||
|
||||
lte_frame_type_t get_frame_type(uint16_t current_band, uint8_t scs_index)
|
||||
{
|
||||
lte_frame_type_t current_type;
|
||||
int32_t delta_duplex = get_delta_duplex(current_band, scs_index);
|
||||
|
||||
if (delta_duplex == 0)
|
||||
current_type = TDD;
|
||||
else
|
||||
current_type = FDD;
|
||||
|
||||
LOG_I(NR_MAC, "NR band %d, duplex mode %s, duplex spacing = %d KHz\n", current_band, duplex_mode[current_type], delta_duplex);
|
||||
|
||||
return current_type;
|
||||
}
|
||||
|
||||
// Computes the duplex spacing (either positive or negative) in KHz
|
||||
int32_t get_delta_duplex(int nr_bandP, uint8_t scs_index)
|
||||
{
|
||||
int nr_table_idx = get_nr_table_idx(nr_bandP, scs_index);
|
||||
|
||||
int32_t delta_duplex = (nr_bandtable[nr_table_idx].ul_min - nr_bandtable[nr_table_idx].dl_min);
|
||||
|
||||
LOG_I(NR_MAC, "NR band duplex spacing is %d KHz (nr_bandtable[%d].band = %d)\n", delta_duplex, nr_table_idx, nr_bandtable[nr_table_idx].band);
|
||||
|
||||
return delta_duplex;
|
||||
}
|
||||
|
||||
uint16_t config_bandwidth(int mu, int nb_rb, int nr_band)
|
||||
{
|
||||
|
||||
if (nr_band < 100) { //FR1
|
||||
switch(mu) {
|
||||
case 0 :
|
||||
if (nb_rb<=25)
|
||||
return 5;
|
||||
if (nb_rb<=52)
|
||||
return 10;
|
||||
if (nb_rb<=79)
|
||||
return 15;
|
||||
if (nb_rb<=106)
|
||||
return 20;
|
||||
if (nb_rb<=133)
|
||||
return 25;
|
||||
if (nb_rb<=160)
|
||||
return 30;
|
||||
if (nb_rb<=216)
|
||||
return 40;
|
||||
if (nb_rb<=270)
|
||||
return 50;
|
||||
AssertFatal(1==0,"Number of DL resource blocks %d undefined for mu %d and band %d\n", nb_rb, mu, nr_band);
|
||||
break;
|
||||
case 1 :
|
||||
if (nb_rb<=11)
|
||||
return 5;
|
||||
if (nb_rb<=24)
|
||||
return 10;
|
||||
if (nb_rb<=38)
|
||||
return 15;
|
||||
if (nb_rb<=51)
|
||||
return 20;
|
||||
if (nb_rb<=65)
|
||||
return 25;
|
||||
if (nb_rb<=78)
|
||||
return 30;
|
||||
if (nb_rb<=106)
|
||||
return 40;
|
||||
if (nb_rb<=133)
|
||||
return 50;
|
||||
if (nb_rb<=162)
|
||||
return 60;
|
||||
if (nb_rb<=189)
|
||||
return 70;
|
||||
if (nb_rb<=217)
|
||||
return 80;
|
||||
if (nb_rb<=245)
|
||||
return 90;
|
||||
if (nb_rb<=273)
|
||||
return 100;
|
||||
AssertFatal(1==0,"Number of DL resource blocks %d undefined for mu %d and band %d\n", nb_rb, mu, nr_band);
|
||||
break;
|
||||
case 2 :
|
||||
if (nb_rb<=11)
|
||||
return 10;
|
||||
if (nb_rb<=18)
|
||||
return 15;
|
||||
if (nb_rb<=24)
|
||||
return 20;
|
||||
if (nb_rb<=31)
|
||||
return 25;
|
||||
if (nb_rb<=38)
|
||||
return 30;
|
||||
if (nb_rb<=51)
|
||||
return 40;
|
||||
if (nb_rb<=65)
|
||||
return 50;
|
||||
if (nb_rb<=79)
|
||||
return 60;
|
||||
if (nb_rb<=93)
|
||||
return 70;
|
||||
if (nb_rb<=107)
|
||||
return 80;
|
||||
if (nb_rb<=121)
|
||||
return 90;
|
||||
if (nb_rb<=135)
|
||||
return 100;
|
||||
AssertFatal(1==0,"Number of DL resource blocks %d undefined for mu %d and band %d\n", nb_rb, mu, nr_band);
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Numerology %d undefined for band %d in FR1\n", mu,nr_band);
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch(mu) {
|
||||
case 2 :
|
||||
if (nb_rb<=66)
|
||||
return 50;
|
||||
if (nb_rb<=132)
|
||||
return 100;
|
||||
if (nb_rb<=264)
|
||||
return 200;
|
||||
AssertFatal(1==0,"Number of DL resource blocks %d undefined for mu %d and band %d\n", nb_rb, mu, nr_band);
|
||||
break;
|
||||
case 3 :
|
||||
if (nb_rb<=32)
|
||||
return 50;
|
||||
if (nb_rb<=66)
|
||||
return 100;
|
||||
if (nb_rb<=132)
|
||||
return 200;
|
||||
if (nb_rb<=264)
|
||||
return 400;
|
||||
AssertFatal(1==0,"Number of DL resource blocks %d undefined for mu %d and band %d\n", nb_rb, mu, nr_band);
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Numerology %d undefined for band %d in FR1\n", mu,nr_band);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the corresponding row index of the NR table
|
||||
int get_nr_table_idx(int nr_bandP, uint8_t scs_index) {
|
||||
int i, j;
|
||||
int scs_khz = 15 << scs_index;
|
||||
int supplementary_bands[] = {29,75,76,80,81,82,83,84,86,89,95};
|
||||
size_t s = sizeof(supplementary_bands)/sizeof(supplementary_bands[0]);
|
||||
|
||||
for(j = 0; j < s; j++){
|
||||
if (nr_bandP == supplementary_bands[j])
|
||||
AssertFatal(0 == 1, "Band %d is a supplementary band (%d). This is not supported yet.\n", nr_bandP, supplementary_bands[j]);
|
||||
}
|
||||
|
||||
AssertFatal(nr_bandP <= nr_bandtable[nr_bandtable_size-1].band, "NR band %d exceeds NR bands table maximum limit %d\n", nr_bandP, nr_bandtable[nr_bandtable_size-1].band);
|
||||
for (i = 0; i < nr_bandtable_size && nr_bandtable[i].band != nr_bandP; i++);
|
||||
|
||||
// In frequency bands with two deltaFRaster,
|
||||
// the higher deltaFRaster applies to channels using only the SCS that is equal to or larger than the higher deltaFRaster
|
||||
// and SSB SCS is equal to the higher deltaFRaster.
|
||||
while(((i+1)<nr_bandtable_size) &&
|
||||
(nr_bandtable[i+1].band == nr_bandtable[i].band) &&
|
||||
(nr_bandtable[i].deltaf_raster != scs_khz)) {
|
||||
i++;
|
||||
}
|
||||
|
||||
AssertFatal(nr_bandtable[i].band == nr_bandP, "Found band table %d does not correspond to the input one %d\n",nr_bandtable[i].band,nr_bandP);
|
||||
|
||||
|
||||
LOG_D(PHY, "NR band table index %d (Band %d, dl_min %lu, ul_min %lu)\n", i, nr_bandtable[i].band, nr_bandtable[i].dl_min,nr_bandtable[i].ul_min);
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
int get_subband_size(int NPRB,int size) {
|
||||
// implements table 5.2.1.4-2 from 36.214
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include "assertions.h"
|
||||
#include "PHY/defs_common.h"
|
||||
|
||||
typedef struct nr_bandentry_s {
|
||||
int16_t band;
|
||||
@@ -50,6 +51,11 @@ typedef struct nr_bandentry_s {
|
||||
extern const size_t nr_bandtable_size;
|
||||
extern nr_bandentry_t nr_bandtable[];
|
||||
|
||||
int get_num_dmrs(uint16_t dmrs_mask);
|
||||
uint16_t config_bandwidth(int mu, int nb_rb, int nr_band);
|
||||
int get_nr_table_idx(int nr_bandP, uint8_t scs_index);
|
||||
int32_t get_delta_duplex(int nr_bandP, uint8_t scs_index);
|
||||
lte_frame_type_t get_frame_type(uint16_t nr_bandP, uint8_t scs_index);
|
||||
uint16_t get_band(uint64_t downlink_frequency, int32_t delta_duplex);
|
||||
int NRRIV2BW(int locationAndBandwidth,int N_RB);
|
||||
int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB);
|
||||
|
||||
Reference in New Issue
Block a user