Commit 2932d172 authored by Raymond Knopp's avatar Raymond Knopp

dlsim and ulsim are functional

parent 2245d822
...@@ -375,7 +375,7 @@ set (NR_RRC_FULL_DIR ${asn1_generated_dir}/${NR_RRC_ASN1_VERSION}) ...@@ -375,7 +375,7 @@ set (NR_RRC_FULL_DIR ${asn1_generated_dir}/${NR_RRC_ASN1_VERSION})
message("calling ASN1C_PREFIX=NR asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D ${NR_RRC_FULL_DIR} ${NR_RRC_GRAMMAR}") message("calling ASN1C_PREFIX=NR asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D ${NR_RRC_FULL_DIR} ${NR_RRC_GRAMMAR}")
execute_process(COMMAND mkdir -p ${NR_RRC_FULL_DIR} execute_process(COMMAND mkdir -p ${NR_RRC_FULL_DIR}
COMMAND env "ASN1C_PREFIX=NR" asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D ${NR_RRC_FULL_DIR} ${NR_RRC_GRAMMAR} COMMAND env "ASN1C_PREFIX=NR_" asn1c -findirect-choice -fcompound-names -fno-include-deps -gen-PER -no-gen-OER -no-gen-example -D ${NR_RRC_FULL_DIR} ${NR_RRC_GRAMMAR}
RESULT_VARIABLE ret) RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0) if (NOT ${ret} STREQUAL 0)
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "RadioResourceConfigDedicated.h" #include "RadioResourceConfigDedicated.h"
#include "TDD-Config.h" #include "TDD-Config.h"
#include "MBSFN-SubframeConfigList.h" #include "MBSFN-SubframeConfigList.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "common/utils/LOG/vcd_signal_dumper.h"
#include "assertions.h" #include "assertions.h"
#include <math.h> #include <math.h>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "PHY/phy_extern_ue.h" #include "PHY/phy_extern_ue.h"
#include "lte_estimation.h" #include "lte_estimation.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "common/utils/LOG/vcd_signal_dumper.h"
#include "openair2/LAYER2/MAC/mac_proto.h" #include "openair2/LAYER2/MAC/mac_proto.h"
#define DEBUG_PHY #define DEBUG_PHY
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#ifndef __TRANSPORT_ENB__H__ #ifndef __TRANSPORT_ENB__H__
#define __TRANSPORT_ENB__H__ #define __TRANSPORT_ENB__H__
#include "transport_common.h" #include "transport_common.h"
#include "PHY/defs_eNB.h" //#include "PHY/defs_eNB.h"
#include "dci.h" #include "dci.h"
#include "mdci.h" #include "mdci.h"
#include "uci_common.h" #include "uci_common.h"
......
...@@ -44,7 +44,7 @@ void remove_7_5_kHz(RU_t *ru,uint8_t slot) ...@@ -44,7 +44,7 @@ void remove_7_5_kHz(RU_t *ru,uint8_t slot)
uint32_t slot_offset,slot_offset2; uint32_t slot_offset,slot_offset2;
uint8_t aa; uint8_t aa;
uint32_t i; uint32_t i;
LTE_DL_FRAME_PARMS *frame_parms=&ru->frame_parms; LTE_DL_FRAME_PARMS *frame_parms=ru->frame_parms;
switch (frame_parms->N_RB_UL) { switch (frame_parms->N_RB_UL) {
......
...@@ -82,7 +82,6 @@ ...@@ -82,7 +82,6 @@
#endif
#define NUMBER_OF_SUBBANDS_MAX 13 #define NUMBER_OF_SUBBANDS_MAX 13
#define NUMBER_OF_HARQ_PID_MAX 8 #define NUMBER_OF_HARQ_PID_MAX 8
......
...@@ -40,8 +40,8 @@ ...@@ -40,8 +40,8 @@
#include "LAYER2/MAC/mac_extern.h" #include "LAYER2/MAC/mac_extern.h"
#include "LAYER2/MAC/mac.h" #include "LAYER2/MAC/mac.h"
#include "UTIL/LOG/log.h" #include "common/utils/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "common/utils/LOG/vcd_signal_dumper.h"
#include "T.h" #include "T.h"
......
...@@ -1249,10 +1249,6 @@ LOG_DEBUG_END ...@@ -1249,10 +1249,6 @@ LOG_DEBUG_END
ulsch_start = (frame_parms->samples_per_tti*subframe_tx)-ue->N_TA_offset; //-ue->timing_advance; ulsch_start = (frame_parms->samples_per_tti*subframe_tx)-ue->N_TA_offset; //-ue->timing_advance;
#endif //else EXMIMO #endif //else EXMIMO
<<<<<<< HEAD
//#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706)
=======
>>>>>>> origin/develop
if (empty_subframe) if (empty_subframe)
{ {
overflow = ulsch_start - 9*frame_parms->samples_per_tti; overflow = ulsch_start - 9*frame_parms->samples_per_tti;
...@@ -2160,22 +2156,6 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ...@@ -2160,22 +2156,6 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
case pucch_format1a: case pucch_format1a:
case pucch_format1b: case pucch_format1b:
{ {
<<<<<<< HEAD
if (ue->mac_enabled == 1) {
Po_PUCCH = pucch_power_cntl(ue,proc,subframe_tx,eNB_id,format);
}
else {
Po_PUCCH = ue->tx_power_max_dBm;
}
ue->tx_power_dBm[subframe_tx] = Po_PUCCH;
ue->tx_total_RE[subframe_tx] = 12;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706)
tx_amp = get_tx_amp(Po_PUCCH,
ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL,
1);
=======
if (ue->mac_enabled == 1) { if (ue->mac_enabled == 1) {
Po_PUCCH = pucch_power_cntl(ue,proc,subframe_tx,eNB_id,format); Po_PUCCH = pucch_power_cntl(ue,proc,subframe_tx,eNB_id,format);
} }
...@@ -2190,7 +2170,6 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ...@@ -2190,7 +2170,6 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
ue->tx_power_max_dBm, ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL, ue->frame_parms.N_RB_UL,
1); 1);
>>>>>>> origin/develop
#else #else
tx_amp = AMP; tx_amp = AMP;
#endif #endif
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "PHY/types.h" #include "PHY/types.h"
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h" #include "PHY/defs_UE.h"
#include "PHY/defs_nr_UE.h"
#include "PHY/phy_vars.h" #include "PHY/phy_vars.h"
#include "SCHED/sched_eNB.h" #include "SCHED/sched_eNB.h"
...@@ -152,7 +153,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR, ...@@ -152,7 +153,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
// printf("Copying tx ..., nsymb %d (n_tx %d), awgn %d\n",nsymb,eNB->frame_parms.nb_antennas_tx,awgn_flag); // printf("Copying tx ..., nsymb %d (n_tx %d), awgn %d\n",nsymb,eNB->frame_parms.nb_antennas_tx,awgn_flag);
for (i=0; i<2*UE->frame_parms.samples_per_tti; i++) { for (i=0; i<2*UE->frame_parms.samples_per_tti; i++) {
for (aa=0; aa<ru->frame_parms.nb_antennas_tx; aa++) { for (aa=0; aa<ru->frame_parms->nb_antennas_tx; aa++) {
if (awgn_flag == 0) { if (awgn_flag == 0) {
s_re[aa][i] = ((double)(((short *)ru->common.txdata[aa]))[(2*subframe*UE->frame_parms.samples_per_tti) + (i<<1)]); s_re[aa][i] = ((double)(((short *)ru->common.txdata[aa]))[(2*subframe*UE->frame_parms.samples_per_tti) + (i<<1)]);
s_im[aa][i] = ((double)(((short *)ru->common.txdata[aa]))[(2*subframe*UE->frame_parms.samples_per_tti) +(i<<1)+1]); s_im[aa][i] = ((double)(((short *)ru->common.txdata[aa]))[(2*subframe*UE->frame_parms.samples_per_tti) +(i<<1)+1]);
...@@ -198,11 +199,11 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR, ...@@ -198,11 +199,11 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
if(abstx) { if(abstx) {
if (trials==0 && round==0) { if (trials==0 && round==0) {
// calculate freq domain representation to compute SINR // calculate freq domain representation to compute SINR
freq_channel(eNB2UE[0], ru->frame_parms.N_RB_DL,2*ru->frame_parms.N_RB_DL + 1); freq_channel(eNB2UE[0], ru->frame_parms->N_RB_DL,2*ru->frame_parms->N_RB_DL + 1);
// snr=pow(10.0,.1*SNR); // snr=pow(10.0,.1*SNR);
fprintf(csv_fd,"%f,",SNR); fprintf(csv_fd,"%f,",SNR);
for (u=0; u<2*ru->frame_parms.N_RB_DL; u++) { for (u=0; u<2*ru->frame_parms->N_RB_DL; u++) {
for (aarx=0; aarx<eNB2UE[0]->nb_rx; aarx++) { for (aarx=0; aarx<eNB2UE[0]->nb_rx; aarx++) {
for (aatx=0; aatx<eNB2UE[0]->nb_tx; aatx++) { for (aatx=0; aatx<eNB2UE[0]->nb_tx; aatx++) {
channelx = eNB2UE[0]->chF[aarx+(aatx*eNB2UE[0]->nb_rx)][u].x; channelx = eNB2UE[0]->chF[aarx+(aatx*eNB2UE[0]->nb_rx)][u].x;
...@@ -213,9 +214,9 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR, ...@@ -213,9 +214,9 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
} }
if(num_rounds>1) { if(num_rounds>1) {
freq_channel(eNB2UE[1], ru->frame_parms.N_RB_DL,2*ru->frame_parms.N_RB_DL + 1); freq_channel(eNB2UE[1], ru->frame_parms->N_RB_DL,2*ru->frame_parms->N_RB_DL + 1);
for (u=0; u<2*ru->frame_parms.N_RB_DL; u++) { for (u=0; u<2*ru->frame_parms->N_RB_DL; u++) {
for (aarx=0; aarx<eNB2UE[1]->nb_rx; aarx++) { for (aarx=0; aarx<eNB2UE[1]->nb_rx; aarx++) {
for (aatx=0; aatx<eNB2UE[1]->nb_tx; aatx++) { for (aatx=0; aatx<eNB2UE[1]->nb_tx; aatx++) {
channelx = eNB2UE[1]->chF[aarx+(aatx*eNB2UE[1]->nb_rx)][u].x; channelx = eNB2UE[1]->chF[aarx+(aatx*eNB2UE[1]->nb_rx)][u].x;
...@@ -225,9 +226,9 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR, ...@@ -225,9 +226,9 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
} }
} }
freq_channel(eNB2UE[2], ru->frame_parms.N_RB_DL,2*ru->frame_parms.N_RB_DL + 1); freq_channel(eNB2UE[2], ru->frame_parms->N_RB_DL,2*ru->frame_parms->N_RB_DL + 1);
for (u=0; u<2*ru->frame_parms.N_RB_DL; u++) { for (u=0; u<2*ru->frame_parms->N_RB_DL; u++) {
for (aarx=0; aarx<eNB2UE[2]->nb_rx; aarx++) { for (aarx=0; aarx<eNB2UE[2]->nb_rx; aarx++) {
for (aatx=0; aatx<eNB2UE[2]->nb_tx; aatx++) { for (aatx=0; aatx<eNB2UE[2]->nb_tx; aatx++) {
channelx = eNB2UE[2]->chF[aarx+(aatx*eNB2UE[2]->nb_rx)][u].x; channelx = eNB2UE[2]->chF[aarx+(aatx*eNB2UE[2]->nb_rx)][u].x;
...@@ -237,9 +238,9 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR, ...@@ -237,9 +238,9 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
} }
} }
freq_channel(eNB2UE[3], ru->frame_parms.N_RB_DL,2*ru->frame_parms.N_RB_DL + 1); freq_channel(eNB2UE[3], ru->frame_parms->N_RB_DL,2*ru->frame_parms->N_RB_DL + 1);
for (u=0; u<2*ru->frame_parms.N_RB_DL; u++) { for (u=0; u<2*ru->frame_parms->N_RB_DL; u++) {
for (aarx=0; aarx<eNB2UE[3]->nb_rx; aarx++) { for (aarx=0; aarx<eNB2UE[3]->nb_rx; aarx++) {
for (aatx=0; aatx<eNB2UE[3]->nb_tx; aatx++) { for (aatx=0; aatx<eNB2UE[3]->nb_tx; aatx++) {
channelx = eNB2UE[3]->chF[aarx+(aatx*eNB2UE[3]->nb_rx)][u].x; channelx = eNB2UE[3]->chF[aarx+(aatx*eNB2UE[3]->nb_rx)][u].x;
...@@ -255,7 +256,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR, ...@@ -255,7 +256,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
//AWGN //AWGN
// tx_lev is the average energy over the whole subframe // tx_lev is the average energy over the whole subframe
// but SNR should be better defined wrt the energy in the reference symbols // but SNR should be better defined wrt the energy in the reference symbols
sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)ru->frame_parms.ofdm_symbol_size/(double)(ru->frame_parms.N_RB_DL*12)) - SNR; sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)ru->frame_parms->ofdm_symbol_size/(double)(ru->frame_parms->N_RB_DL*12)) - SNR;
sigma2 = pow(10,sigma2_dB/10); sigma2 = pow(10,sigma2_dB/10);
for (i=0; i<2*UE->frame_parms.samples_per_tti; i++) { for (i=0; i<2*UE->frame_parms.samples_per_tti; i++) {
...@@ -1124,7 +1125,7 @@ int main(int argc, char **argv) ...@@ -1124,7 +1125,7 @@ int main(int argc, char **argv)
printf("lte_param_init done\n"); printf("lte_param_init done\n");
if ((transmission_mode==1) || (transmission_mode==7)) { if ((transmission_mode==1) || (transmission_mode==7)) {
for (aa=0; aa<ru->nb_tx; aa++) for (aa=0; aa<ru->nb_tx; aa++)
for (re=0; re<ru->frame_parms.ofdm_symbol_size; re++) for (re=0; re<ru->frame_parms->ofdm_symbol_size; re++)
ru->beam_weights[0][0][aa][re] = 0x00007fff/eNB->frame_parms.nb_antennas_tx; ru->beam_weights[0][0][aa][re] = 0x00007fff/eNB->frame_parms.nb_antennas_tx;
} }
...@@ -1630,7 +1631,7 @@ int main(int argc, char **argv) ...@@ -1630,7 +1631,7 @@ int main(int argc, char **argv)
start_meas(&eNB->ofdm_mod_stats); start_meas(&eNB->ofdm_mod_stats);
ru->proc.subframe_tx=subframe; ru->proc.subframe_tx=subframe;
memcpy((void*)&ru->frame_parms,(void*)&eNB->frame_parms,sizeof(LTE_DL_FRAME_PARMS)); memcpy((void*)ru->frame_parms,(void*)&eNB->frame_parms,sizeof(LTE_DL_FRAME_PARMS));
feptx_prec(ru); feptx_prec(ru);
feptx_ofdm(ru); feptx_ofdm(ru);
......
...@@ -90,3 +90,32 @@ int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return(0); } ...@@ -90,3 +90,32 @@ int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return(0); }
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { return(0); } int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { return(0); }
int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0); } int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0); }
int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
uint8_t eNB_id,
uint8_t eNB_offset,
unsigned char Ns,
unsigned char p,
unsigned char l,
unsigned char symbol,
unsigned short bwp_start_subcarrier,
unsigned short nb_rb_pdsch) {return(0);}
int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
uint8_t eNB_id,
uint8_t eNB_offset,
unsigned char Ns,
unsigned char p,
unsigned char l,
unsigned char symbol) {return(0);}
int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
uint8_t eNB_id,
uint8_t eNB_offset,
unsigned char Ns,
unsigned char p,
unsigned char l,
unsigned char symbol,
unsigned short coreset_start_subcarrier,
unsigned short nb_rb_coreset) {return(0);}
...@@ -104,15 +104,15 @@ void do_DL_sig(sim_t *sim, ...@@ -104,15 +104,15 @@ void do_DL_sig(sim_t *sim,
if (sim->RU_output_mask[UE_id] == 0) { // This is the first eNodeB for this UE, clear the buffer if (sim->RU_output_mask[UE_id] == 0) { // This is the first eNodeB for this UE, clear the buffer
for (aa=0; aa<nb_antennas_rx; aa++) { for (aa=0; aa<nb_antennas_rx; aa++) {
memset((void*)sim->r_re_DL[UE_id][aa],0,(RC.ru[0]->frame_parms.samples_per_tti)*sizeof(double)); memset((void*)sim->r_re_DL[UE_id][aa],0,(RC.ru[0]->frame_parms->samples_per_tti)*sizeof(double));
memset((void*)sim->r_im_DL[UE_id][aa],0,(RC.ru[0]->frame_parms.samples_per_tti)*sizeof(double)); memset((void*)sim->r_im_DL[UE_id][aa],0,(RC.ru[0]->frame_parms->samples_per_tti)*sizeof(double));
} }
} }
pthread_mutex_unlock(&sim->RU_output_mutex[UE_id]); pthread_mutex_unlock(&sim->RU_output_mutex[UE_id]);
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) { for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
txdata = RC.ru[ru_id]->common.txdata; txdata = RC.ru[ru_id]->common.txdata;
frame_parms = &RC.ru[ru_id]->frame_parms; frame_parms = RC.ru[ru_id]->frame_parms;
// sf_offset = (subframe*frame_parms->samples_per_tti) + offset; // sf_offset = (subframe*frame_parms->samples_per_tti) + offset;
sf_offset = (subframe*frame_parms->samples_per_tti); sf_offset = (subframe*frame_parms->samples_per_tti);
......
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