Commit d04a83ea authored by francescomani's avatar francescomani

defs_gNB cleanup

parent 46a1d2a6
...@@ -498,7 +498,6 @@ void init_gNB(int wait_for_sync) { ...@@ -498,7 +498,6 @@ void init_gNB(int wait_for_sync) {
LOG_I(PHY,"[nr-gnb.c] gNB structure RC.gNB[%d] allocated @ %p\n",inst,RC.gNB[inst]); LOG_I(PHY,"[nr-gnb.c] gNB structure RC.gNB[%d] allocated @ %p\n",inst,RC.gNB[inst]);
} }
gNB = RC.gNB[inst]; gNB = RC.gNB[inst];
gNB->abstraction_flag = 0;
/*nr_polar_init(&gNB->nrPolar_params, /*nr_polar_init(&gNB->nrPolar_params,
NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_MESSAGE_TYPE,
NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_PAYLOAD_BITS,
......
...@@ -162,11 +162,6 @@ void pdcp_run(const protocol_ctxt_t *const ctxt_pP) ...@@ -162,11 +162,6 @@ void pdcp_run(const protocol_ctxt_t *const ctxt_pP)
abort(); abort();
} }
/* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed
* this is very hackish - find a proper solution
*/
uint8_t abstraction_flag=0;
/* forward declarations */ /* forward declarations */
void set_default_frame_parms(nfapi_nr_config_request_scf_t *config[MAX_NUM_CCs], NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]); void set_default_frame_parms(nfapi_nr_config_request_scf_t *config[MAX_NUM_CCs], NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]);
......
...@@ -262,7 +262,6 @@ void oai_create_gnb(void) { ...@@ -262,7 +262,6 @@ void oai_create_gnb(void) {
gNB->Mod_id = bodge_counter; gNB->Mod_id = bodge_counter;
gNB->CC_id = bodge_counter; gNB->CC_id = bodge_counter;
gNB->abstraction_flag = 0;
RC.nb_nr_CC[bodge_counter] = 1; RC.nb_nr_CC[bodge_counter] = 1;
if (gNB->if_inst==0) { if (gNB->if_inst==0) {
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "PHY/defs_nr_UE.h" #include "PHY/defs_nr_UE.h"
//#include "PHY/defs_gNB.h"
/** @addtogroup _PHY_PARAMETER_ESTIMATION_BLOCKS_ /** @addtogroup _PHY_PARAMETER_ESTIMATION_BLOCKS_
* @{ * @{
*/ */
......
...@@ -417,7 +417,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue, ...@@ -417,7 +417,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
//printf("start rx segment %d\n",r); //printf("start rx segment %d\n",r);
uint32_t E = nr_get_E(G, harq_process->C, dlsch->dlsch_config.qamModOrder, dlsch->Nl, r); uint32_t E = nr_get_E(G, harq_process->C, dlsch->dlsch_config.qamModOrder, dlsch->Nl, r);
decParams.R = nr_get_R_ldpc_decoder(dlsch->dlsch_config.rv, E, decParams.BG, decParams.Z, &harq_process->llrLen, harq_process->DLround); decParams.R = nr_get_R_ldpc_decoder(dlsch->dlsch_config.rv, E, decParams.BG, decParams.Z, &harq_process->llrLen, harq_process->DLround);
union ldpcReqUnion id = {.s={dlsch->rnti,frame,nr_slot_rx,0,0}}; union ldpcReqUnion id = {.s = {dlsch->rnti, frame, nr_slot_rx, 0, 0}};
notifiedFIFO_elt_t *req = newNotifiedFIFO_elt(sizeof(ldpcDecode_ue_t), id.p, &nf, &nr_processDLSegment); notifiedFIFO_elt_t *req = newNotifiedFIFO_elt(sizeof(ldpcDecode_ue_t), id.p, &nf, &nr_processDLSegment);
ldpcDecode_ue_t * rdata=(ldpcDecode_ue_t *) NotifiedFifoData(req); ldpcDecode_ue_t * rdata=(ldpcDecode_ue_t *) NotifiedFifoData(req);
......
...@@ -53,7 +53,6 @@ typedef struct { ...@@ -53,7 +53,6 @@ typedef struct {
int lut[MAX_PUCCH0_NID][160][14]; int lut[MAX_PUCCH0_NID][160][14];
} NR_gNB_PUCCH0_LUT_t; } NR_gNB_PUCCH0_LUT_t;
typedef struct { typedef struct {
uint32_t pbch_a; uint32_t pbch_a;
uint32_t pbch_a_interleaved; uint32_t pbch_a_interleaved;
...@@ -61,15 +60,6 @@ typedef struct { ...@@ -61,15 +60,6 @@ typedef struct {
uint32_t pbch_e[NR_POLAR_PBCH_E_DWORD]; uint32_t pbch_e[NR_POLAR_PBCH_E_DWORD];
} NR_gNB_PBCH; } NR_gNB_PBCH;
typedef enum {
NR_SCH_IDLE,
NR_ACTIVE,
NR_CBA_ACTIVE,
NR_DISABLED
} NR_SCH_status_t;
typedef struct { typedef struct {
/// Nfapi DLSCH PDU /// Nfapi DLSCH PDU
nfapi_nr_dl_tti_pdsch_pdu pdsch_pdu; nfapi_nr_dl_tti_pdsch_pdu pdsch_pdu;
...@@ -81,8 +71,6 @@ typedef struct { ...@@ -81,8 +71,6 @@ typedef struct {
uint8_t **c; uint8_t **c;
/// Frame where current HARQ round was sent /// Frame where current HARQ round was sent
uint32_t frame; uint32_t frame;
/// Subframe where current HARQ round was sent
uint32_t subframe;
/// Interleaver outputs /// Interleaver outputs
uint8_t *f; uint8_t *f;
/// LDPC lifting size /// LDPC lifting size
...@@ -221,6 +209,7 @@ typedef struct { ...@@ -221,6 +209,7 @@ typedef struct {
int llrLen; int llrLen;
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
} NR_UL_gNB_HARQ_t; } NR_UL_gNB_HARQ_t;
static inline int lenWithCrc(int nbSeg, int len) static inline int lenWithCrc(int nbSeg, int len)
{ {
if (nbSeg > 1) if (nbSeg > 1)
...@@ -237,24 +226,8 @@ static inline int crcType(int nbSeg, int len) ...@@ -237,24 +226,8 @@ static inline int crcType(int nbSeg, int len)
typedef struct { typedef struct {
//! estimated rssi (dBm) //! estimated rssi (dBm)
int rx_rssi_dBm; int rx_rssi_dBm;
//! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation)
int rx_correlation[2];
//! estimated correlation (wideband dB) between spatial channels (computed in dlsch_demodulation)
int rx_correlation_dB[2];
/// Wideband CQI (= SINR)
int wideband_cqi[MAX_NUM_RU_PER_gNB];
/// Wideband CQI in dB (= SINR dB)
int wideband_cqi_dB[MAX_NUM_RU_PER_gNB];
/// Wideband CQI (sum of all RX antennas, in dB) /// Wideband CQI (sum of all RX antennas, in dB)
char wideband_cqi_tot; char wideband_cqi_tot;
/// Subband CQI per RX antenna and RB (= SINR)
int subband_cqi[MAX_NUM_RU_PER_gNB][275];
/// Total Subband CQI and RB (= SINR)
int subband_cqi_tot[275];
/// Subband CQI in dB and RB (= SINR dB)
int subband_cqi_dB[MAX_NUM_RU_PER_gNB][275];
/// Total Subband CQI and RB
int subband_cqi_tot_dB[275];
} ulsch_measurements_gNB; } ulsch_measurements_gNB;
typedef struct { typedef struct {
...@@ -393,25 +366,10 @@ typedef struct { ...@@ -393,25 +366,10 @@ typedef struct {
/// \brief Instance count for RXn-TXnp4 processing thread. /// \brief Instance count for RXn-TXnp4 processing thread.
/// \internal This variable is protected by \ref mutex_rxtx. /// \internal This variable is protected by \ref mutex_rxtx.
int instance_cnt; int instance_cnt;
/// pthread structure for RXn-TXnp4 processing thread
pthread_t pthread;
/// pthread attributes for RXn-TXnp4 processing thread
pthread_attr_t attr;
/// condition variable for tx processing thread /// condition variable for tx processing thread
pthread_cond_t cond; pthread_cond_t cond;
/// mutex for RXn-TXnp4 processing thread /// mutex for RXn-TXnp4 processing thread
pthread_mutex_t mutex; pthread_mutex_t mutex;
/// scheduling parameters for RXn-TXnp4 thread
struct sched_param sched_param_rxtx;
/// \internal This variable is protected by \ref mutex_RUs_tx.
int instance_cnt_RUs;
/// condition variable for tx processing thread
pthread_cond_t cond_RUs;
/// mutex for L1 RXTX processing thread
pthread_mutex_t mutex_RUs;
/// mutex for L1 TX FH synchronization
pthread_mutex_t mutex_RUs_tx;
} gNB_L1_rxtx_proc_t; } gNB_L1_rxtx_proc_t;
...@@ -419,85 +377,21 @@ typedef struct { ...@@ -419,85 +377,21 @@ typedef struct {
typedef struct gNB_L1_proc_t_s { typedef struct gNB_L1_proc_t_s {
/// Component Carrier index /// Component Carrier index
uint8_t CC_id; uint8_t CC_id;
/// thread index
int thread_index;
/// timestamp received from HW /// timestamp received from HW
openair0_timestamp timestamp_rx; openair0_timestamp timestamp_rx;
/// timestamp to send to "slave rru" /// timestamp to send to "slave rru"
openair0_timestamp timestamp_tx; openair0_timestamp timestamp_tx;
/// slot to act upon for reception /// slot to act upon for reception
int slot_rx; int slot_rx;
/// slot to act upon for PRACH
int slot_prach;
/// frame to act upon for reception /// frame to act upon for reception
int frame_rx; int frame_rx;
/// frame to act upon for transmission /// frame to act upon for transmission
int frame_tx; int frame_tx;
/// frame to act upon for PRACH
int frame_prach;
/// \internal This variable is protected by \ref mutex_td.
int instance_cnt_td;
/// \internal This variable is protected by \ref mutex_te.
int instance_cnt_te;
/// \internal This variable is protected by \ref mutex_prach.
int instance_cnt_prach;
/// \internal This variable is protected by \ref mutex_asynch_rxtx.
int instance_cnt_asynch_rxtx;
/// pthread structure for eNB single processing thread
pthread_t pthread_single;
/// pthread structure for asychronous RX/TX processing thread
pthread_t pthread_asynch_rxtx;
/// pthread structure for dumping L1 stats /// pthread structure for dumping L1 stats
pthread_t L1_stats_thread; pthread_t L1_stats_thread;
/// pthread structure for printing time meas
pthread_t process_stats_thread;
/// pthread structure for reordering L1 tx thread messages
pthread_t pthread_tx_reorder;
/// flag to indicate first RX acquisition
int first_rx;
/// flag to indicate first TX transmission
int first_tx;
/// pthread attributes for single gNB processing thread
pthread_attr_t attr_single;
/// pthread attributes for prach processing thread
pthread_attr_t attr_prach;
/// pthread attributes for asynchronous RX thread
pthread_attr_t attr_asynch_rxtx;
/// scheduling parameters for parallel turbo-decoder thread
struct sched_param sched_param_td;
/// scheduling parameters for parallel turbo-encoder thread
struct sched_param sched_param_te;
/// scheduling parameters for single eNB thread
struct sched_param sched_param_single;
/// scheduling parameters for prach thread
struct sched_param sched_param_prach;
/// scheduling parameters for asynch_rxtx thread
struct sched_param sched_param_asynch_rxtx;
pthread_cond_t cond_prach;
/// condition variable for asynch RX/TX thread
pthread_cond_t cond_asynch_rxtx;
/// mutex for parallel turbo-decoder thread
pthread_mutex_t mutex_td;
/// mutex for parallel turbo-encoder thread
pthread_mutex_t mutex_te;
/// mutex for PRACH thread
pthread_mutex_t mutex_prach;
/// mutex for asynch RX/TX thread
pthread_mutex_t mutex_asynch_rxtx;
/// mutex for RU access to eNB processing (PDSCH/PUSCH)
pthread_mutex_t mutex_RU;
/// mutex for RU_tx access to eNB_tx processing (PDSCH/PUSCH)
pthread_mutex_t mutex_RU_tx;
/// mutex for RU access to eNB processing (PRACH)
pthread_mutex_t mutex_RU_PRACH;
/// mutex for RU access to eNB processing (PRACH BR)
pthread_mutex_t mutex_RU_PRACH_br;
/// mask for RUs serving eNB (PDSCH/PUSCH)
int RU_mask, RU_mask_tx;
/// mask for RUs serving eNB (PRACH)
int RU_mask_prach;
/// set of scheduling variables RXn-TXnp4 threads /// set of scheduling variables RXn-TXnp4 threads
gNB_L1_rxtx_proc_t L1_proc, L1_proc_tx; gNB_L1_rxtx_proc_t L1_proc;
gNB_L1_rxtx_proc_t L1_proc_tx;
} gNB_L1_proc_t; } gNB_L1_proc_t;
typedef struct { typedef struct {
...@@ -524,7 +418,6 @@ typedef struct { ...@@ -524,7 +418,6 @@ typedef struct {
int n0_subband_power_tot_dBm[275]; int n0_subband_power_tot_dBm[275];
/// PRACH background noise level /// PRACH background noise level
int prach_I0; int prach_I0;
} PHY_MEASUREMENTS_gNB; } PHY_MEASUREMENTS_gNB;
...@@ -543,7 +436,6 @@ typedef struct PHY_VARS_gNB_s { ...@@ -543,7 +436,6 @@ typedef struct PHY_VARS_gNB_s {
uint8_t CC_id; uint8_t CC_id;
uint8_t configured; uint8_t configured;
gNB_L1_proc_t proc; gNB_L1_proc_t proc;
int abstraction_flag;
int num_RU; int num_RU;
RU_t *RU_list[MAX_NUM_RU_PER_gNB]; RU_t *RU_list[MAX_NUM_RU_PER_gNB];
/// Ethernet parameters for northbound midhaul interface /// Ethernet parameters for northbound midhaul interface
...@@ -552,7 +444,6 @@ typedef struct PHY_VARS_gNB_s { ...@@ -552,7 +444,6 @@ typedef struct PHY_VARS_gNB_s {
eth_params_t eth_params; eth_params_t eth_params;
int rx_total_gain_dB; int rx_total_gain_dB;
int (*nr_start_if)(struct RU_t_s *ru, struct PHY_VARS_gNB_s *gNB); int (*nr_start_if)(struct RU_t_s *ru, struct PHY_VARS_gNB_s *gNB);
uint8_t local_flag;
nfapi_nr_config_request_scf_t gNB_config; nfapi_nr_config_request_scf_t gNB_config;
NR_DL_FRAME_PARMS frame_parms; NR_DL_FRAME_PARMS frame_parms;
PHY_MEASUREMENTS_gNB measurements; PHY_MEASUREMENTS_gNB measurements;
...@@ -635,15 +526,11 @@ typedef struct PHY_VARS_gNB_s { ...@@ -635,15 +526,11 @@ typedef struct PHY_VARS_gNB_s {
uint64_t bad_pucch; uint64_t bad_pucch;
int num_ulprbbl; int num_ulprbbl;
int ulprbbl[275]; int ulprbbl[275];
/*
time_stats_t phy_proc;
*/
time_stats_t phy_proc_tx; time_stats_t phy_proc_tx;
time_stats_t phy_proc_rx; time_stats_t phy_proc_rx;
time_stats_t rx_prach; time_stats_t rx_prach;
/*
time_stats_t ofdm_mod_stats;
*/
time_stats_t dlsch_encoding_stats; time_stats_t dlsch_encoding_stats;
time_stats_t dlsch_modulation_stats; time_stats_t dlsch_modulation_stats;
time_stats_t dlsch_scrambling_stats; time_stats_t dlsch_scrambling_stats;
...@@ -678,10 +565,6 @@ typedef struct PHY_VARS_gNB_s { ...@@ -678,10 +565,6 @@ typedef struct PHY_VARS_gNB_s {
time_stats_t srs_beam_report_stats; time_stats_t srs_beam_report_stats;
time_stats_t srs_iq_matrix_stats; time_stats_t srs_iq_matrix_stats;
/*
time_stats_t rx_dft_stats;
time_stats_t ulsch_freq_offset_estimation_stats;
*/
notifiedFIFO_t respPuschSymb; notifiedFIFO_t respPuschSymb;
notifiedFIFO_t respDecode; notifiedFIFO_t respDecode;
notifiedFIFO_t resp_L1; notifiedFIFO_t resp_L1;
...@@ -739,7 +622,7 @@ typedef struct LDPCDecode_s { ...@@ -739,7 +622,7 @@ typedef struct LDPCDecode_s {
struct ldpcReqId { struct ldpcReqId {
uint16_t rnti; uint16_t rnti;
uint16_t frame; uint16_t frame;
uint8_t subframe; uint8_t slot;
uint8_t codeblock; uint8_t codeblock;
uint16_t spare; uint16_t spare;
} __attribute__((packed)); } __attribute__((packed));
...@@ -756,12 +639,6 @@ typedef struct processingData_L1 { ...@@ -756,12 +639,6 @@ typedef struct processingData_L1 {
PHY_VARS_gNB *gNB; PHY_VARS_gNB *gNB;
} processingData_L1_t; } processingData_L1_t;
typedef enum {
FILLED,
FILLING,
NOT_FILLED
} msgStatus_t;
typedef struct processingData_L1tx { typedef struct processingData_L1tx {
int frame; int frame;
int slot; int slot;
......
...@@ -135,11 +135,6 @@ int main(int argc, char **argv){ ...@@ -135,11 +135,6 @@ int main(int argc, char **argv){
int prachOccasion = 0; int prachOccasion = 0;
double DS_TDL = .03; double DS_TDL = .03;
// int8_t interf1=-19,interf2=-19;
// uint8_t abstraction_flag=0,calibration_flag=0;
// double prach_sinr;
// uint32_t nsymb;
// uint16_t preamble_max, preamble_energy_max;
FILE *input_fd=NULL; FILE *input_fd=NULL;
char* input_file=NULL; char* input_file=NULL;
int n_bytes=0; int n_bytes=0;
......
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