Commit c6b9dc72 authored by Raymond Knopp's avatar Raymond Knopp

mbmssim functional again for 15kHz SCS

parent 1410512f
......@@ -86,19 +86,6 @@ uint32_t sub_block_interleaving_turbo(uint32_t D, uint8_t *d,uint8_t *w)
w[Kpi+1+k2] = d3[index3];//d[index3-ND3+5];
#ifdef RM_DEBUG
printf("row %d, index %d, index-Nd %d index-Nd+1 %d (k,Kpi+2k,Kpi+2k+1) (%d,%d,%d) w(%d,%d,%d)\n",row,index,index-ND,((index+1)%Kpi)-ND,k,Kpi+(k<<1),Kpi+(k<<1)+1,w[k],w[Kpi+(k<<1)],w[Kpi+1+(k<<1)]);
if (w[k]== LTE_NULL)
nulled++;
if (w[Kpi+(k<<1)] ==LTE_NULL)
nulled++;
if (w[Kpi+1+(k<<1)] ==LTE_NULL)
nulled++;
#endif
index3+=96;
k++;k2+=2;
}
......@@ -706,7 +693,7 @@ int lte_rate_matching_turbo_rx(uint32_t RTC,
int nulled=0;
#endif
AssertFatal(Kmimo>0 && C>0 && Qm>1 && Qm<3 && Nl>0 && Mdlharq>=0,
AssertFatal(Kmimo>0 && C>0 && (Qm==2 || Qm==4 || Qm==6) && Nl>0 && Mdlharq>=0,
"invalid parameters (Kmimo %d, Mdlharq %d, C %d, Qm %d, Nl %d\n",
Kmimo,Mdlharq,C,Qm,Nl);
......
......@@ -784,7 +784,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
LOG_D(PHY,"[INIT] NB_ANTENNA_PORTS_ENB:%d fp->nb_antenna_ports_eNB:%d\n", NB_ANTENNA_PORTS_ENB, fp->nb_antenna_ports_eNB);
for (i=0; i<NB_ANTENNA_PORTS_ENB; i++) {
if (i<fp->nb_antenna_ports_eNB || i==4 || i==5) {
if (i<fp->nb_antenna_ports_eNB || i==4 || i==5 || i==7 || i==8) {
common_vars->txdataF[i] = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t) );
LOG_D(PHY,"[INIT] common_vars->txdataF[%d] = %p (%lu bytes)\n",
......
......@@ -117,7 +117,7 @@ int phy_init_RU(RU_t *ru) {
for (i=0; i<RC.nb_L1_inst; i++) {
for (p=0;p<15;p++) {
LOG_D(PHY,"[INIT] %s() nb_antenna_ports_eNB:%d \n", __FUNCTION__, ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB);
if (p<ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB || p==5) {
if (p<ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB || p==4 || p==5) {
LOG_D(PHY,"[INIT] %s() DO BEAM WEIGHTS nb_antenna_ports_eNB:%d nb_tx:%d\n", __FUNCTION__, ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB, ru->nb_tx);
ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*));
for (j=0; j<ru->nb_tx; j++) {
......
......@@ -43,7 +43,7 @@
#include <syscall.h>
#include "targets/RT/USER/rt_wrapper.h"
#define DEBUG_DLSCH_CODING
//#define DEBUG_DLSCH_CODING
//#define DEBUG_DLSCH_FREE 1
/*
......
......@@ -60,7 +60,7 @@ int generate_mbsfn_pilot(PHY_VARS_eNB *eNB,
//antenna 4 symbol 2 Slot 0
lte_dl_mbsfn(eNB,
&txdataF[0][subframe_offset+(2*samples_per_symbol)],
&txdataF[4][subframe_offset+(2*samples_per_symbol)],
amp,
subframe,
0);
......@@ -69,14 +69,14 @@ int generate_mbsfn_pilot(PHY_VARS_eNB *eNB,
//antenna 4 symbol 0 slot 1
lte_dl_mbsfn(eNB,
&txdataF[0][subframe_offset+(6*samples_per_symbol)],
&txdataF[4][subframe_offset+(6*samples_per_symbol)],
amp,
subframe,
1);
//antenna 4 symbol 4 slot 1
lte_dl_mbsfn(eNB,
&txdataF[0][subframe_offset+(10*samples_per_symbol)],
&txdataF[4][subframe_offset+(10*samples_per_symbol)],
amp,
subframe,
2);
......
......@@ -56,7 +56,7 @@ void fill_eNB_dlsch_MCH(PHY_VARS_eNB *eNB,int Qm,int TBS)
dlsch->active=1;
dlsch->harq_processes[0]->Nl = 1;
dlsch->harq_processes[0]->TBS = TBS;
AssertFatal(Qm >= 0 && Qm < 3, "Illegal value for Qm %d\n",Qm);
AssertFatal(Qm == 2 || Qm == 4 || Qm == 6, "Illegal value for Qm %d\n",Qm);
dlsch->harq_processes[0]->Qm = Qm;
dlsch->harq_processes[0]->nb_rb = frame_parms->N_RB_DL;
......
......@@ -38,8 +38,7 @@
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
//#define DEBUG_DLSCH_DECODING
#define UE_DEBUG_TRACE 1
//#define UE_DEBUG_TRACE 1
void free_ue_dlsch(LTE_UE_DLSCH_t *dlsch)
{
......@@ -359,32 +358,26 @@ decoder_if_t *tc;
#ifdef DEBUG_DLSCH_DECODING
printf(" in decoding dlsch->harq_processes[harq_pid]->rvidx = %d\n", dlsch->harq_processes[harq_pid]->rvidx);
#endif
if (lte_rate_matching_turbo_rx(harq_process->RTC[r],
G,
harq_process->w[r],
(uint8_t*)&dummy_w[r][0],
dlsch_llr+r_offset,
harq_process->C,
dlsch->Nsoft,
dlsch->Mdlharq,
dlsch->Kmimo,
harq_process->rvidx,
(harq_process->round==0)?1:0,
harq_process->Qm,
harq_process->Nl,
r,
&E)==-1) {
AssertFatal(lte_rate_matching_turbo_rx(harq_process->RTC[r],
G,
harq_process->w[r],
(uint8_t*)&dummy_w[r][0],
dlsch_llr+r_offset,
harq_process->C,
dlsch->Nsoft,
dlsch->Mdlharq,
dlsch->Kmimo,
harq_process->rvidx,
(harq_process->round==0)?1:0,
harq_process->Qm,
harq_process->Nl,
r,
&E)!=-1,
"Problem in rate_matching\n");
#if UE_TIMING_TRACE
stop_meas(dlsch_rate_unmatching_stats);
stop_meas(dlsch_rate_unmatching_stats);
#endif
LOG_E(PHY,"dlsch_decoding.c: Problem in rate_matching\n");
return(dlsch->max_turbo_iterations);
} else
{
#if UE_TIMING_TRACE
stop_meas(dlsch_rate_unmatching_stats);
#endif
}
r_offset += E;
/*
......@@ -402,39 +395,14 @@ decoder_if_t *tc;
#if UE_TIMING_TRACE
stop_meas(dlsch_deinterleaving_stats);
#endif
#ifdef DEBUG_DLSCH_DECODING
/*
if (r==0) {
LOG_M("decoder_llr.m","decllr",dlsch_llr,G,1,0);
LOG_M("decoder_in.m","dec",&harq_process->d[0][96],(3*8*Kr_bytes)+12,1,0);
}
printf("decoder input(segment %d) :",r);
int i; for (i=0;i<(3*8*Kr_bytes)+12;i++)
printf("%d : %d\n",i,harq_process->d[r][96+i]);
printf("\n");*/
#endif
// printf("Clearing c, %p\n",harq_process->c[r]);
memset(harq_process->c[r],0,Kr_bytes);
// printf("done\n");
if (harq_process->C == 1)
crc_type = CRC24_A;
else
crc_type = CRC24_B;
/*
printf("decoder input(segment %d)\n",r);
for (i=0;i<(3*8*Kr_bytes)+12;i++)
if ((harq_process->d[r][96+i]>7) ||
(harq_process->d[r][96+i] < -8))
printf("%d : %d\n",i,harq_process->d[r][96+i]);
printf("\n");
*/
//#ifndef __AVX2__
#if 1
if (err_flag == 0) {
/*
......@@ -442,12 +410,12 @@ decoder_if_t *tc;
Kr,r,harq_process->C,harq_process->nb_rb,crc_type,A,harq_process->TBS,
harq_process->B,harq_process->mcs,harq_process->Qm,harq_process->rvidx,harq_process->round,dlsch->max_turbo_iterations);
*/
if (llr8_flag) {
AssertFatal (Kr >= 256, "turbo algo issue Kr=%d cb_cnt=%d C=%d nbRB=%d TBSInput=%d TBSHarq=%d TBSplus24=%d mcs=%d Qm=%d RIV=%d round=%d\n",
Kr,r,harq_process->C,harq_process->nb_rb,A,harq_process->TBS,harq_process->B,harq_process->mcs,harq_process->Qm,harq_process->rvidx,harq_process->round);
}
if (llr8_flag) {
AssertFatal (Kr >= 256, "turbo algo issue Kr=%d cb_cnt=%d C=%d nbRB=%d TBSInput=%d TBSHarq=%d TBSplus24=%d mcs=%d Qm=%d RIV=%d round=%d\n",
Kr,r,harq_process->C,harq_process->nb_rb,A,harq_process->TBS,harq_process->B,harq_process->mcs,harq_process->Qm,harq_process->rvidx,harq_process->round);
}
#if UE_TIMING_TRACE
start_meas(dlsch_turbo_decoding_stats);
start_meas(dlsch_turbo_decoding_stats);
#endif
LOG_D(PHY,"AbsSubframe %d.%d Start turbo segment %d/%d \n",frame%1024,subframe,r,harq_process->C-1);
ret = tc
......
......@@ -61,7 +61,7 @@ int beam_precoding(int32_t **txdataF,
int aa,
int p)
{
LOG_D(PHY,"Starting precoding for symbol %d, physical antenna %d, logical port %d\n",symbol,aa,p);
// LOG_D(PHY,"Starting precoding for symbol %d, physical antenna %d, logical port %d\n",symbol,aa,p);
int rb_offset_neg0 = frame_parms->ofdm_symbol_size - (6*frame_parms->N_RB_DL);
int rb_offset_neg = (subframe*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti) + rb_offset_neg0;
int rb_offset_pos = (subframe*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti);
......@@ -79,7 +79,7 @@ int beam_precoding(int32_t **txdataF,
7*frame_parms->N_RB_DL, // to allow for extra RE at the end, 12 useless multipy-adds (first one at DC and 11 at end)
15);
return 0;
return 0;
}
......
......@@ -459,7 +459,7 @@ void feptx_prec(RU_t *ru) {
} //if (p<fp->nb_antenna_ports_eNB)
// PDSCH region
if (p<fp->nb_antenna_ports_eNB || p==5 || p==7 || p==8) {
if (p<fp->nb_antenna_ports_eNB || p==4 || p==5 || p==7 || p==8) {
for (l=pdcch_vars->num_pdcch_symbols;l<fp->symbols_per_tti;l++) {
beam_precoding(eNB->common_vars.txdataF,
ru->common.txdataF_BF,
......
......@@ -60,9 +60,14 @@ void ue_send_mch_sdu(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
uint8_t * sdu, uint16_t sdu_len, uint8_t eNB_index,
uint8_t sync_area){}
int mch_mcs;
int ue_query_mch(module_id_t Mod_id, uint8_t CC_id, uint32_t frame,
sub_frame_t subframe, uint8_t eNB_index,
uint8_t * sync_area, uint8_t * mcch_active){ return(0);}
uint8_t * sync_area, uint8_t * mcch_active){
*mcch_active=0;
*sync_area = 0;
return(mch_mcs);
}
void dl_phy_sync_success(module_id_t module_idP,
frame_t frameP,
......
......@@ -68,14 +68,14 @@ uint16_t m_rnti=0x1234;
int nfapi_mode=0;
int codingw = 0;
int emulate_rf = 0;
extern int mch_mcs;
void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR, int tx_lev,int hold_channel,int trials,
channel_desc_t *eNB2UE,
double *s_re[2],double *s_im[2],double *r_re[2],double *r_im[2]) {
int i,u;
int aa,aarx,aatx;
double channelx,channely;
int i;
int aa,aarx;
double sigma2_dB,sigma2;
double iqim=0.0;
......@@ -208,15 +208,13 @@ int main(int argc, char **argv)
char c;
int i,l,l2,aa,aarx,k;
double sigma2, sigma2_dB=0,SNR,snr0=-2.0,snr1=0.0;
int i,aa;
double SNR,snr0=-2.0,snr1=0.0;
uint8_t snr1set=0;
double snr_step=1,input_snr_step=1;
int **txdata;
double s_re0[2*30720],s_im0[2*30720],s_re1[2*30720],s_im1[2*30720];
double r_re0[2*30720],r_im0[2*30720],r_re1[2*30720],r_im1[2*30720];
double *s_re[2]={s_re0,s_re1},*s_im[2]={s_im0,s_im1},*r_re[2]={r_re0,r_re1},*r_im[2]={r_im0,r_im1};
double iqim = 0.0;
int subframe=1;
char fname[40];//, vname[40];
uint8_t transmission_mode = 1,n_tx=1,n_rx=2;
......@@ -225,13 +223,11 @@ int main(int argc, char **argv)
FILE *fd;
int eNB_id = 0;
unsigned char mcs=0,awgn_flag=0,round;
unsigned char mcs=0,awgn_flag=0;
int n_frames=1;
channel_desc_t *eNB2UE;
uint32_t nsymb,tx_lev,tx_lev_dB;
uint8_t extended_prefix_flag=1;
LTE_DL_FRAME_PARMS *frame_parms;
int hold_channel=0;
......@@ -256,7 +252,6 @@ int main(int argc, char **argv)
unsigned char *input_buffer;
unsigned short input_buffer_length;
unsigned int ret;
unsigned int trials;
......@@ -267,27 +262,7 @@ int main(int argc, char **argv)
uint32_t Nsoft = 1827072;
switch (N_RB_DL) {
case 6:
MCH_RB_ALLOC = 0x3f;
break;
case 25:
MCH_RB_ALLOC = 0x1fff;
break;
case 50:
MCH_RB_ALLOC = 0x1ffff;
break;
case 100:
MCH_RB_ALLOC = 0x1ffffff;
break;
}
NB_RB=conv_nprb(0,MCH_RB_ALLOC,N_RB_DL);
/*
#ifdef XFORMS
......@@ -420,6 +395,29 @@ int main(int argc, char **argv)
if (awgn_flag == 1)
channel_model = AWGN;
mch_mcs = mcs;
switch (N_RB_DL) {
case 6:
MCH_RB_ALLOC = 0x3f;
break;
case 25:
MCH_RB_ALLOC = 0x1fff;
break;
case 50:
MCH_RB_ALLOC = 0x1ffff;
break;
case 100:
MCH_RB_ALLOC = 0x1ffffff;
break;
}
NB_RB=conv_nprb(0,MCH_RB_ALLOC,N_RB_DL);
// check that subframe is legal for eMBMS
if ((subframe == 0) || (subframe == 5) || // TDD and FDD SFn 0,5;
......@@ -575,7 +573,6 @@ int main(int argc, char **argv)
for (trials = 0; trials<n_frames; trials++) {
// printf("Trial %d\n",trials);
fflush(stdout);
round=0;
DL_req.sfn_sf = (proc_eNB->frame_tx<<4)+subframe;
......@@ -589,7 +586,9 @@ int main(int argc, char **argv)
schedule_response(&sched_resp);
phy_procedures_eNB_TX(eNB,proc_eNB,1);
ru->proc.subframe_tx=(subframe+1)%10;
ru->proc.subframe_tx=subframe;
ru->do_precoding=1;
feptx_prec(ru);
feptx_ofdm(ru);
......@@ -600,6 +599,10 @@ int main(int argc, char **argv)
if (n_frames==1) {
LOG_M("txsigF0.m","txsF0", &eNB->common_vars.txdataF[0][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],
nsymb*eNB->frame_parms.ofdm_symbol_size,1,1);
LOG_M("txsigF4.m","txsF4", &eNB->common_vars.txdataF[4][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],
nsymb*eNB->frame_parms.ofdm_symbol_size,1,1);
LOG_M("txsigF_BF.m","txsF_BF", &ru->common.txdataF_BF[0][0],
nsymb*eNB->frame_parms.ofdm_symbol_size,1,1);
//if (eNB->frame_parms.nb_antennas_tx>1)
//LOG_M("txsigF1.m","txsF1", &eNB->lte_eNB_common_vars.txdataF[eNB_id][1][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],nsymb*eNB->frame_parms.ofdm_symbol_size,1,1);
}
......
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