Commit 25fdc1d2 authored by francescomani's avatar francescomani

beam association for prach

parent 0a8e1b49
...@@ -1800,20 +1800,20 @@ int get_nr_prach_info_from_index(uint8_t index, ...@@ -1800,20 +1800,20 @@ int get_nr_prach_info_from_index(uint8_t index,
y = table_6_3_3_2_4_prachConfig_Index[index][3]; y = table_6_3_3_2_4_prachConfig_Index[index][3];
y2 = table_6_3_3_2_4_prachConfig_Index[index][4]; y2 = table_6_3_3_2_4_prachConfig_Index[index][4];
// checking n_sfn mod x = y // checking n_sfn mod x = y
if ( (frame%x)==y || (frame%x)==y2 ) { if ((frame % x) == y || (frame % x) == y2) {
slot_60khz = slot >> (mu-2); // in table slots are numbered wrt 60kHz slot_60khz = slot >> (mu - 2); // in table slots are numbered wrt 60kHz
s_map = table_6_3_3_2_4_prachConfig_Index[index][5]; s_map = table_6_3_3_2_4_prachConfig_Index[index][5];
if ((s_map >> slot_60khz) & 0x01 ) { if ((s_map >> slot_60khz) & 0x01) {
for(int i = 0; i <= slot_60khz ;i++) { for(int i = 0; i <= slot_60khz ;i++) {
if ( (s_map >> i) & 0x01) { if ((s_map >> i) & 0x01) {
(*RA_sfn_index)++; (*RA_sfn_index)++;
} }
} }
} }
if ( ((s_map>>slot_60khz)&0x01) ) { if (((s_map >> slot_60khz) & 0x01)) {
*N_RA_slot = table_6_3_3_2_4_prachConfig_Index[index][7]; // Number of RACH slots within a subframe *N_RA_slot = table_6_3_3_2_4_prachConfig_Index[index][7]; // Number of RACH slots within a subframe
if (mu == 3) { if (mu == 3) {
if ( (*N_RA_slot == 1) && (slot%2 == 0) ) if ((*N_RA_slot == 1) && (slot % 2 == 0) )
return 0; // no prach in even slots @ 120kHz for 1 prach per 60khz slot return 0; // no prach in even slots @ 120kHz for 1 prach per 60khz slot
} }
if (start_symbol != NULL && N_t_slot != NULL && N_dur != NULL && format != NULL){ if (start_symbol != NULL && N_t_slot != NULL && N_dur != NULL && format != NULL){
...@@ -1850,23 +1850,23 @@ int get_nr_prach_info_from_index(uint8_t index, ...@@ -1850,23 +1850,23 @@ int get_nr_prach_info_from_index(uint8_t index,
if (unpaired) { if (unpaired) {
x = table_6_3_3_2_3_prachConfig_Index[index][2]; x = table_6_3_3_2_3_prachConfig_Index[index][2];
y = table_6_3_3_2_3_prachConfig_Index[index][3]; y = table_6_3_3_2_3_prachConfig_Index[index][3];
if ( (frame%x)==y ) { if ((frame % x) == y) {
subframe = slot >> mu; subframe = slot >> mu;
s_map = table_6_3_3_2_3_prachConfig_Index[index][4]; s_map = table_6_3_3_2_3_prachConfig_Index[index][4];
if ((s_map >> subframe) & 0x01 ) { if ((s_map >> subframe) & 0x01) {
for(int i = 0; i <= subframe ;i++) { for(int i = 0; i <= subframe ;i++) {
if ( (s_map >> i) & 0x01) { if ((s_map >> i) & 0x01) {
(*RA_sfn_index)++; (*RA_sfn_index)++;
} }
} }
} }
if ( (s_map>>subframe)&0x01 ) { if ((s_map >> subframe) & 0x01 ) {
*N_RA_slot = table_6_3_3_2_3_prachConfig_Index[index][6]; // Number of RACH slots within a subframe *N_RA_slot = table_6_3_3_2_3_prachConfig_Index[index][6]; // Number of RACH slots within a subframe
if (mu == 1 && index >= 67) { if (mu == 1 && index >= 67) {
if ( (*N_RA_slot <= 1) && (slot%2 == 0) ) if ((*N_RA_slot <= 1) && (slot % 2 == 0))
return 0; // no prach in even slots @ 30kHz for 1 prach per subframe return 0; // no prach in even slots @ 30kHz for 1 prach per subframe
} }
if (start_symbol != NULL && N_t_slot != NULL && N_dur != NULL && format != NULL){ if (start_symbol != NULL && N_t_slot != NULL && N_dur != NULL && format != NULL) {
*config_period = x; *config_period = x;
*start_symbol = table_6_3_3_2_3_prachConfig_Index[index][5]; *start_symbol = table_6_3_3_2_3_prachConfig_Index[index][5];
*N_t_slot = table_6_3_3_2_3_prachConfig_Index[index][7]; *N_t_slot = table_6_3_3_2_3_prachConfig_Index[index][7];
...@@ -1874,17 +1874,19 @@ int get_nr_prach_info_from_index(uint8_t index, ...@@ -1874,17 +1874,19 @@ int get_nr_prach_info_from_index(uint8_t index,
if (table_6_3_3_2_3_prachConfig_Index[index][1] != -1) if (table_6_3_3_2_3_prachConfig_Index[index][1] != -1)
format2 = (uint8_t) table_6_3_3_2_3_prachConfig_Index[index][1]; format2 = (uint8_t) table_6_3_3_2_3_prachConfig_Index[index][1];
*format = ((uint8_t) table_6_3_3_2_3_prachConfig_Index[index][0]) | (format2<<8); *format = ((uint8_t) table_6_3_3_2_3_prachConfig_Index[index][0]) | (format2<<8);
LOG_D(MAC,"Frame %d slot %d: Getting PRACH info from index %d (col 6 %lu) absoluteFrequencyPointA %u mu %u frame_type %u start_symbol %u N_t_slot %u N_dur %u N_RA_slot %u RA_sfn_index %u \n", frame, LOG_D(MAC,"Frame %d slot %d: Getting PRACH info from index %d (col 6 %lu) absoluteFrequencyPointA %u mu %u frame_type %u start_symbol %u N_t_slot %u N_dur %u N_RA_slot %u RA_sfn_index %u \n",
slot, frame,
index, table_6_3_3_2_3_prachConfig_Index[index][6], slot,
pointa, index,
mu, table_6_3_3_2_3_prachConfig_Index[index][6],
unpaired, pointa,
*start_symbol, mu,
*N_t_slot, unpaired,
*N_dur, *start_symbol,
*N_RA_slot, *N_t_slot,
*RA_sfn_index); *N_dur,
*N_RA_slot,
*RA_sfn_index);
} }
return 1; return 1;
} }
...@@ -1897,10 +1899,10 @@ int get_nr_prach_info_from_index(uint8_t index, ...@@ -1897,10 +1899,10 @@ int get_nr_prach_info_from_index(uint8_t index,
else { // FDD else { // FDD
x = table_6_3_3_2_2_prachConfig_Index[index][2]; x = table_6_3_3_2_2_prachConfig_Index[index][2];
y = table_6_3_3_2_2_prachConfig_Index[index][3]; y = table_6_3_3_2_2_prachConfig_Index[index][3];
if ( (frame%x)==y ) { if ((frame % x) == y) {
subframe = slot >> mu; subframe = slot >> mu;
s_map = table_6_3_3_2_2_prachConfig_Index[index][4]; s_map = table_6_3_3_2_2_prachConfig_Index[index][4];
if ( (s_map>>subframe)&0x01 ) { if ((s_map>>subframe) & 0x01) {
*N_RA_slot = table_6_3_3_2_2_prachConfig_Index[index][6]; // Number of RACH slots within a subframe *N_RA_slot = table_6_3_3_2_2_prachConfig_Index[index][6]; // Number of RACH slots within a subframe
if (mu == 1) { if (mu == 1) {
if ((*N_RA_slot <= 1) && (slot % 2 == 0)){ if ((*N_RA_slot <= 1) && (slot % 2 == 0)){
...@@ -1908,7 +1910,7 @@ int get_nr_prach_info_from_index(uint8_t index, ...@@ -1908,7 +1910,7 @@ int get_nr_prach_info_from_index(uint8_t index,
} }
} }
for(int i = 0; i <= subframe ; i++) { for(int i = 0; i <= subframe ; i++) {
if ( (s_map >> i) & 0x01) { if ((s_map >> i) & 0x01) {
(*RA_sfn_index)++; (*RA_sfn_index)++;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment