Commit 839a7997 authored by laurent's avatar laurent

UE attach complete, added traces ulsch coding, remove temporary renaming

parent f112de54
...@@ -171,7 +171,8 @@ void prach_eNB_fromsplit(uint8_t *bufferZone, int bufSize, PHY_VARS_eNB *eNB) { ...@@ -171,7 +171,8 @@ void prach_eNB_fromsplit(uint8_t *bufferZone, int bufSize, PHY_VARS_eNB *eNB) {
} }
} }
void sendFs6Ulharq(enum pckType type, int UEid, PHY_VARS_eNB *eNB, int frame, int subframe, uint8_t *harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask, uint16_t rnti, int32_t stat) { void sendFs6Ulharq(enum pckType type, int UEid, PHY_VARS_eNB *eNB, int frame, int subframe, uint8_t *harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask, uint16_t rnti,
int32_t stat) {
static int current_fsf=-1; static int current_fsf=-1;
int fsf=frame*16+subframe; int fsf=frame*16+subframe;
uint8_t *bufferZone=eNB->FS6bufferZone; uint8_t *bufferZone=eNB->FS6bufferZone;
...@@ -209,8 +210,10 @@ void sendFs6Ulharq(enum pckType type, int UEid, PHY_VARS_eNB *eNB, int frame, in ...@@ -209,8 +210,10 @@ void sendFs6Ulharq(enum pckType type, int UEid, PHY_VARS_eNB *eNB, int frame, in
tmp->UEid=UEid; tmp->UEid=UEid;
tmp->frame=frame; tmp->frame=frame;
tmp->subframe=subframe; tmp->subframe=subframe;
if (harq_ack != NULL) if (harq_ack != NULL)
memcpy(tmp->harq_ack, harq_ack, 4); memcpy(tmp->harq_ack, harq_ack, 4);
tmp->tdd_mapping_mode=tdd_mapping_mode; tmp->tdd_mapping_mode=tdd_mapping_mode;
tmp->tdd_multiplexing_mask=tdd_multiplexing_mask; tmp->tdd_multiplexing_mask=tdd_multiplexing_mask;
tmp->n0_subband_power_dB=eNB->measurements.n0_subband_power_dB[0][0]; tmp->n0_subband_power_dB=eNB->measurements.n0_subband_power_dB[0][0];
...@@ -240,6 +243,9 @@ void sendFs6Ul(PHY_VARS_eNB *eNB, int UE_id, int harq_pid, int segmentID, int16_ ...@@ -240,6 +243,9 @@ void sendFs6Ul(PHY_VARS_eNB *eNB, int UE_id, int harq_pid, int segmentID, int16_
hULUE(newUDPheader)->type=fs6ULsch; hULUE(newUDPheader)->type=fs6ULsch;
hULUE(newUDPheader)->UE_id=UE_id; hULUE(newUDPheader)->UE_id=UE_id;
hULUE(newUDPheader)->harq_id=harq_pid; hULUE(newUDPheader)->harq_id=harq_pid;
memcpy(hULUE(newUDPheader)->ulsch_power,
eNB->pusch_vars[UE_id]->ulsch_power,
sizeof(int)*2);
hULUE(newUDPheader)->segment=segmentID; hULUE(newUDPheader)->segment=segmentID;
memcpy(hULUE(newUDPheader)+1, data, dataLen); memcpy(hULUE(newUDPheader)+1, data, dataLen);
hULUE(newUDPheader)->segLen=dataLen; hULUE(newUDPheader)->segLen=dataLen;
...@@ -444,12 +450,12 @@ int ulsch_decoding_process(PHY_VARS_eNB *eNB, int UE_id, int llr8_flag) { ...@@ -444,12 +450,12 @@ int ulsch_decoding_process(PHY_VARS_eNB *eNB, int UE_id, int llr8_flag) {
Kr_bytes = Kr>>3; Kr_bytes = Kr>>3;
if (r==0) { if (r==0) {
memcpy(ulsch_harq->bb, memcpy(ulsch_harq->b,
&ulsch_harq->c[0][(ulsch_harq->F>>3)], &ulsch_harq->c[0][(ulsch_harq->F>>3)],
Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0)); Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0));
offset = Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0); offset = Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0);
} else { } else {
memcpy(ulsch_harq->bb+offset, memcpy(ulsch_harq->b+offset,
ulsch_harq->c[r], ulsch_harq->c[r],
Kr_bytes - ((ulsch_harq->C>1)?3:0)); Kr_bytes - ((ulsch_harq->C>1)?3:0));
offset += (Kr_bytes- ((ulsch_harq->C>1)?3:0)); offset += (Kr_bytes- ((ulsch_harq->C>1)?3:0));
...@@ -638,10 +644,14 @@ void recvFs6Ul(uint8_t *bufferZone, int nbBlocks, PHY_VARS_eNB *eNB) { ...@@ -638,10 +644,14 @@ void recvFs6Ul(uint8_t *bufferZone, int nbBlocks, PHY_VARS_eNB *eNB) {
memcpy(&ulsch_harq->d[hULUE(bufPtr)->segment][96], memcpy(&ulsch_harq->d[hULUE(bufPtr)->segment][96],
hULUE(bufPtr)+1, hULUE(bufPtr)+1,
hULUE(bufPtr)->segLen); hULUE(bufPtr)->segLen);
memcpy(eNB->pusch_vars[hULUE(bufPtr)->UE_id]->ulsch_power,
hULUE(bufPtr)->ulsch_power,
sizeof(int)*2);
LOG_W(PHY,"Received ulsch data for: rnti:%d, fsf: %d/%d\n", ulsch->rnti, eNB->proc.frame_rx, eNB->proc.subframe_rx); LOG_W(PHY,"Received ulsch data for: rnti:%d, fsf: %d/%d\n", ulsch->rnti, eNB->proc.frame_rx, eNB->proc.subframe_rx);
} else if ( type == fs6ULcch ) { } else if ( type == fs6ULcch ) {
int nb_uci=hULUEuci(bufPtr)->nb_active_ue; int nb_uci=hULUEuci(bufPtr)->nb_active_ue;
fs6_ul_uespec_uci_element_t *tmp=(fs6_ul_uespec_uci_element_t *)(hULUEuci(bufPtr)+1); fs6_ul_uespec_uci_element_t *tmp=(fs6_ul_uespec_uci_element_t *)(hULUEuci(bufPtr)+1);
for (int j=0; j < nb_uci ; j++) { for (int j=0; j < nb_uci ; j++) {
LOG_D(PHY,"FS6 cu, block: %d/%d: received ul harq/sr: %d, rnti: %d, ueid: %d\n", LOG_D(PHY,"FS6 cu, block: %d/%d: received ul harq/sr: %d, rnti: %d, ueid: %d\n",
i, j, type, tmp->rnti, tmp->UEid); i, j, type, tmp->rnti, tmp->UEid);
...@@ -655,6 +665,7 @@ void recvFs6Ul(uint8_t *bufferZone, int nbBlocks, PHY_VARS_eNB *eNB) { ...@@ -655,6 +665,7 @@ void recvFs6Ul(uint8_t *bufferZone, int nbBlocks, PHY_VARS_eNB *eNB) {
fill_sr_indication(tmp->UEid, eNB,tmp->rnti,tmp->frame,tmp->subframe,tmp->stat); fill_sr_indication(tmp->UEid, eNB,tmp->rnti,tmp->frame,tmp->subframe,tmp->stat);
else else
LOG_E(PHY, "Split FS6: impossible UL harq type\n"); LOG_E(PHY, "Split FS6: impossible UL harq type\n");
tmp++; tmp++;
} }
} else } else
...@@ -739,6 +750,10 @@ void rcvFs6DL(uint8_t *bufferZone, int nbBlocks, PHY_VARS_eNB *eNB, int frame, i ...@@ -739,6 +750,10 @@ void rcvFs6DL(uint8_t *bufferZone, int nbBlocks, PHY_VARS_eNB *eNB, int frame, i
ulsch_harq->frame = frame; ulsch_harq->frame = frame;
ulsch_harq->subframe = subframe; ulsch_harq->subframe = subframe;
ulsch_harq->first_rb=hTxULUE(bufPtr)->first_rb; ulsch_harq->first_rb=hTxULUE(bufPtr)->first_rb;
ulsch_harq->O_RI=hTxULUE(bufPtr)->O_RI;
ulsch_harq->Or1=hTxULUE(bufPtr)->Or1;
ulsch_harq->Msc_initial=hTxULUE(bufPtr)->Msc_initial;
ulsch_harq->Nsymb_initial=hTxULUE(bufPtr)->Nsymb_initial;
ulsch_harq->V_UL_DAI=hTxULUE(bufPtr)->V_UL_DAI; ulsch_harq->V_UL_DAI=hTxULUE(bufPtr)->V_UL_DAI;
ulsch_harq->Qm=hTxULUE(bufPtr)->Qm; ulsch_harq->Qm=hTxULUE(bufPtr)->Qm;
ulsch_harq->srs_active=hTxULUE(bufPtr)->srs_active; ulsch_harq->srs_active=hTxULUE(bufPtr)->srs_active;
...@@ -913,6 +928,10 @@ void appendFs6TxULUE(uint8_t *bufferZone, LTE_DL_FRAME_PARMS *fp, int curUE, LTE ...@@ -913,6 +928,10 @@ void appendFs6TxULUE(uint8_t *bufferZone, LTE_DL_FRAME_PARMS *fp, int curUE, LTE
memcpy(hTxULUE(newUDPheader)->cba_rnti,ulsch->cba_rnti,sizeof(ulsch->cba_rnti));//NUM_MAX_CBA_GROUP]; memcpy(hTxULUE(newUDPheader)->cba_rnti,ulsch->cba_rnti,sizeof(ulsch->cba_rnti));//NUM_MAX_CBA_GROUP];
cpyToDu(rnti); cpyToDu(rnti);
cpyToDuHarq(nb_rb); cpyToDuHarq(nb_rb);
cpyToDuHarq(Msc_initial);
cpyToDuHarq(Nsymb_initial);
cpyToDuHarq(O_RI);
cpyToDuHarq(Or1);
cpyToDuHarq(first_rb); cpyToDuHarq(first_rb);
cpyToDuHarq(V_UL_DAI); cpyToDuHarq(V_UL_DAI);
cpyToDuHarq(Qm); cpyToDuHarq(Qm);
...@@ -1280,8 +1299,10 @@ void UL_cu_fs6(RU_t *ru, uint64_t *TS) { ...@@ -1280,8 +1299,10 @@ void UL_cu_fs6(RU_t *ru, uint64_t *TS) {
setAllfromTS(hUDP(bufferZone)->timestamp); setAllfromTS(hUDP(bufferZone)->timestamp);
PHY_VARS_eNB *eNB = RC.eNB[0][0]; PHY_VARS_eNB *eNB = RC.eNB[0][0];
if (is_prach_subframe(&eNB->frame_parms, eNB->proc.frame_prach,eNB->proc.subframe_prach)>0) if (is_prach_subframe(&eNB->frame_parms, eNB->proc.frame_prach,eNB->proc.subframe_prach)>0)
prach_eNB_fromsplit(bufferZone, sizeof(bufferZone), eNB); prach_eNB_fromsplit(bufferZone, sizeof(bufferZone), eNB);
release_UE_in_freeList(eNB->Mod_id); release_UE_in_freeList(eNB->Mod_id);
if (NFAPI_MODE==NFAPI_MONOLITHIC || NFAPI_MODE==NFAPI_MODE_PNF) { if (NFAPI_MODE==NFAPI_MONOLITHIC || NFAPI_MODE==NFAPI_MODE_PNF) {
...@@ -1296,11 +1317,13 @@ void *cu_fs6(void *arg) { ...@@ -1296,11 +1317,13 @@ void *cu_fs6(void *arg) {
init_frame_parms(&ru->frame_parms,1); init_frame_parms(&ru->frame_parms,1);
phy_init_RU(ru); phy_init_RU(ru);
wait_sync("ru_thread"); wait_sync("ru_thread");
char * remoteIP; char *remoteIP;
if ( getenv("FS6_REMOTE_IP") ) if ( getenv("FS6_REMOTE_IP") )
remoteIP=getenv("FS6_REMOTE_IP"); remoteIP=getenv("FS6_REMOTE_IP");
else else
remoteIP=DU_IP; remoteIP=DU_IP;
AssertFatal(createUDPsock(NULL, CU_PORT, remoteIP, DU_PORT, &sockFS6), ""); AssertFatal(createUDPsock(NULL, CU_PORT, remoteIP, DU_PORT, &sockFS6), "");
uint64_t timeStamp=0; uint64_t timeStamp=0;
...@@ -1321,11 +1344,13 @@ void *du_fs6(void *arg) { ...@@ -1321,11 +1344,13 @@ void *du_fs6(void *arg) {
phy_init_RU(ru); phy_init_RU(ru);
openair0_device_load(&ru->rfdevice,&ru->openair0_cfg); openair0_device_load(&ru->rfdevice,&ru->openair0_cfg);
wait_sync("ru_thread"); wait_sync("ru_thread");
char * remoteIP; char *remoteIP;
if ( getenv("FS6_REMOTE_IP") ) if ( getenv("FS6_REMOTE_IP") )
remoteIP=getenv("FS6_REMOTE_IP"); remoteIP=getenv("FS6_REMOTE_IP");
else else
remoteIP=CU_IP; remoteIP=CU_IP;
AssertFatal(createUDPsock(NULL, DU_PORT, remoteIP, CU_PORT, &sockFS6), ""); AssertFatal(createUDPsock(NULL, DU_PORT, remoteIP, CU_PORT, &sockFS6), "");
if (ru->start_rf) { if (ru->start_rf) {
......
...@@ -80,6 +80,10 @@ typedef struct { ...@@ -80,6 +80,10 @@ typedef struct {
uint16_t nb_rb; uint16_t nb_rb;
uint8_t Qm; uint8_t Qm;
uint16_t first_rb; uint16_t first_rb;
uint8_t O_RI;
uint8_t Or1;
uint16_t Msc_initial;
uint8_t Nsymb_initial;
uint8_t V_UL_DAI; uint8_t V_UL_DAI;
uint8_t srs_active; uint8_t srs_active;
uint32_t TBS; uint32_t TBS;
...@@ -131,6 +135,7 @@ typedef struct { ...@@ -131,6 +135,7 @@ typedef struct {
short harq_id; short harq_id;
short segment; short segment;
short segLen; short segLen;
int ulsch_power[2];
} fs6_ul_uespec_t; } fs6_ul_uespec_t;
typedef struct { typedef struct {
......
...@@ -266,11 +266,11 @@ typedef struct { ...@@ -266,11 +266,11 @@ typedef struct {
/// coded RI bits /// coded RI bits
int16_t q_RI[MAX_RI_PAYLOAD]; int16_t q_RI[MAX_RI_PAYLOAD];
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18) /// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
int16_t eE[MAX_NUM_CHANNEL_BITS] __attribute__((aligned(32))); int16_t e[MAX_NUM_CHANNEL_BITS] __attribute__((aligned(32)));
/// Temporary h sequence to flag PUSCH_x/PUSCH_y symbols which are not scrambled /// Temporary h sequence to flag PUSCH_x/PUSCH_y symbols which are not scrambled
uint8_t h[MAX_NUM_CHANNEL_BITS]; uint8_t h[MAX_NUM_CHANNEL_BITS];
/// Pointer to the payload /// Pointer to the payload
uint8_t *bb; uint8_t *b;
/// Pointers to transport block segments /// Pointers to transport block segments
uint8_t *c[MAX_NUM_ULSCH_SEGMENTS]; uint8_t *c[MAX_NUM_ULSCH_SEGMENTS];
/// RTC values for each segment (for definition see 36-212 V8.6 2009-03, p.15) /// RTC values for each segment (for definition see 36-212 V8.6 2009-03, p.15)
......
...@@ -55,9 +55,9 @@ void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch) { ...@@ -55,9 +55,9 @@ void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch) {
if (ulsch) { if (ulsch) {
for (i=0; i<8; i++) { for (i=0; i<8; i++) {
if (ulsch->harq_processes[i]) { if (ulsch->harq_processes[i]) {
if (ulsch->harq_processes[i]->bb) { if (ulsch->harq_processes[i]->b) {
free16(ulsch->harq_processes[i]->bb,MAX_ULSCH_PAYLOAD_BYTES); free16(ulsch->harq_processes[i]->b,MAX_ULSCH_PAYLOAD_BYTES);
ulsch->harq_processes[i]->bb = NULL; ulsch->harq_processes[i]->b = NULL;
} }
for (r=0; r<MAX_NUM_ULSCH_SEGMENTS; r++) { for (r=0; r<MAX_NUM_ULSCH_SEGMENTS; r++) {
...@@ -116,10 +116,10 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uin ...@@ -116,10 +116,10 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uin
if (ulsch->harq_processes[i]) { if (ulsch->harq_processes[i]) {
memset(ulsch->harq_processes[i],0,sizeof(LTE_UL_eNB_HARQ_t)); memset(ulsch->harq_processes[i],0,sizeof(LTE_UL_eNB_HARQ_t));
ulsch->harq_processes[i]->bb = (uint8_t *)malloc16(MAX_ULSCH_PAYLOAD_BYTES/bw_scaling); ulsch->harq_processes[i]->b = (uint8_t *)malloc16(MAX_ULSCH_PAYLOAD_BYTES/bw_scaling);
if (ulsch->harq_processes[i]->bb) if (ulsch->harq_processes[i]->b)
memset(ulsch->harq_processes[i]->bb,0,MAX_ULSCH_PAYLOAD_BYTES/bw_scaling); memset(ulsch->harq_processes[i]->b,0,MAX_ULSCH_PAYLOAD_BYTES/bw_scaling);
else else
exit_flag=3; exit_flag=3;
...@@ -292,7 +292,7 @@ int ulsch_decoding_data_2thread0(td_params *tdp) { ...@@ -292,7 +292,7 @@ int ulsch_decoding_data_2thread0(td_params *tdp) {
G, G,
ulsch_harq->w[r], ulsch_harq->w[r],
(uint8_t *) &dummy_w[r][0], (uint8_t *) &dummy_w[r][0],
ulsch_harq->eE+r_offset, ulsch_harq->e+r_offset,
ulsch_harq->C, ulsch_harq->C,
NSOFT, NSOFT,
0, //Uplink 0, //Uplink
...@@ -342,7 +342,7 @@ int ulsch_decoding_data_2thread0(td_params *tdp) { ...@@ -342,7 +342,7 @@ int ulsch_decoding_data_2thread0(td_params *tdp) {
Kr = ulsch_harq->Kplus; Kr = ulsch_harq->Kplus;
Kr_bytes = Kr>>3; Kr_bytes = Kr>>3;
memcpy(ulsch_harq->bb+offset, memcpy(ulsch_harq->b+offset,
ulsch_harq->c[r], ulsch_harq->c[r],
Kr_bytes - ((ulsch_harq->C>1)?3:0)); Kr_bytes - ((ulsch_harq->C>1)?3:0));
offset += (Kr_bytes- ((ulsch_harq->C>1)?3:0)); offset += (Kr_bytes- ((ulsch_harq->C>1)?3:0));
...@@ -467,7 +467,7 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr ...@@ -467,7 +467,7 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr
G, G,
ulsch_harq->w[r], ulsch_harq->w[r],
(uint8_t *) &dummy_w[r][0], (uint8_t *) &dummy_w[r][0],
ulsch_harq->eE+r_offset, ulsch_harq->e+r_offset,
ulsch_harq->C, ulsch_harq->C,
NSOFT, NSOFT,
0, //Uplink 0, //Uplink
...@@ -523,12 +523,12 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr ...@@ -523,12 +523,12 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr
Kr_bytes = Kr>>3; Kr_bytes = Kr>>3;
if (r==0) { if (r==0) {
memcpy(ulsch_harq->bb, memcpy(ulsch_harq->b,
&ulsch_harq->c[0][(ulsch_harq->F>>3)], &ulsch_harq->c[0][(ulsch_harq->F>>3)],
Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0)); Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0));
offset = Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0); offset = Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0);
} else { } else {
memcpy(ulsch_harq->bb+offset, memcpy(ulsch_harq->b+offset,
ulsch_harq->c[r], ulsch_harq->c[r],
Kr_bytes - ((ulsch_harq->C>1)?3:0)); Kr_bytes - ((ulsch_harq->C>1)?3:0));
offset += (Kr_bytes- ((ulsch_harq->C>1)?3:0)); offset += (Kr_bytes- ((ulsch_harq->C>1)?3:0));
...@@ -555,7 +555,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag) ...@@ -555,7 +555,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id]; LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id];
LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid]; LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid];
int G = ulsch_harq->G; int G = ulsch_harq->G;
unsigned int EE; unsigned int E;
decoder_if_t *tc; decoder_if_t *tc;
if (llr8_flag == 0) if (llr8_flag == 0)
...@@ -580,8 +580,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag) ...@@ -580,8 +580,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
printf("Rate Matching Segment %u (coded bits (G) %d,unpunctured/repeated bits %u, Q_m %d, nb_rb %d, Nl %d)...\n", printf("Rate Matching Segment %u (coded bits (G) %d,unpunctured/repeated bits %u, Q_m %d, nb_rb %d, Nl %d)...\n",
r, G, r, G,
Kr*3, Kr*3,
Q_m, ulsch_harq->Qm,
nb_rb,
ulsch_harq->Nl); ulsch_harq->Nl);
#endif #endif
start_meas(&eNB->ulsch_rate_unmatching_stats); start_meas(&eNB->ulsch_rate_unmatching_stats);
...@@ -590,7 +589,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag) ...@@ -590,7 +589,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
G, G,
ulsch_harq->w[r], ulsch_harq->w[r],
(uint8_t *) &dummy_w[r][0], (uint8_t *) &dummy_w[r][0],
ulsch_harq->eE+r_offset, ulsch_harq->e+r_offset,
ulsch_harq->C, ulsch_harq->C,
NSOFT, NSOFT,
0, //Uplink 0, //Uplink
...@@ -600,13 +599,13 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag) ...@@ -600,13 +599,13 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
ulsch_harq->Qm, ulsch_harq->Qm,
1, 1,
r, r,
&EE)==-1) { &E)==-1) {
LOG_E(PHY,"ulsch_decoding.c: Problem in rate matching\n"); LOG_E(PHY,"ulsch_decoding.c: Problem in rate matching\n");
return(-1); return(-1);
} }
stop_meas(&eNB->ulsch_rate_unmatching_stats); stop_meas(&eNB->ulsch_rate_unmatching_stats);
r_offset += EE; r_offset += E;
start_meas(&eNB->ulsch_deinterleaving_stats); start_meas(&eNB->ulsch_deinterleaving_stats);
sub_block_deinterleaving_turbo(4+Kr, sub_block_deinterleaving_turbo(4+Kr,
&ulsch_harq->d[r][96], &ulsch_harq->d[r][96],
...@@ -623,6 +622,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag) ...@@ -623,6 +622,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
// Kr is the segment length in short // Kr is the segment length in short
// *3 because LTE redudancy scheme // *3 because LTE redudancy scheme
sendFs6Ul(eNB, UE_id, harq_pid, r, &ulsch_harq->d[r][96], Kr*sizeof(int16_t)*3); sendFs6Ul(eNB, UE_id, harq_pid, r, &ulsch_harq->d[r][96], Kr*sizeof(int16_t)*3);
/*
int iter=tc(&ulsch_harq->d[r][96], int iter=tc(&ulsch_harq->d[r][96],
NULL, NULL,
ulsch_harq->c[r], ulsch_harq->c[r],
...@@ -644,7 +644,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag) ...@@ -644,7 +644,7 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
printf("%hx:", ulsch_harq->d[r][96+i]); printf("%hx:", ulsch_harq->d[r][96+i]);
printf("\n"); printf("\n");
} }
*/
return 0; return 0;
} }
...@@ -679,12 +679,12 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag) ...@@ -679,12 +679,12 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
Kr_bytes = Kr>>3; Kr_bytes = Kr>>3;
if (r==0) { if (r==0) {
memcpy(ulsch_harq->bb, memcpy(ulsch_harq->b,
&ulsch_harq->c[0][(ulsch_harq->F>>3)], &ulsch_harq->c[0][(ulsch_harq->F>>3)],
Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0)); Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0));
offset = Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0); offset = Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0);
} else { } else {
memcpy(ulsch_harq->bb+offset, memcpy(ulsch_harq->b+offset,
ulsch_harq->c[r], ulsch_harq->c[r],
Kr_bytes - ((ulsch_harq->C>1)?3:0)); Kr_bytes - ((ulsch_harq->C>1)?3:0));
offset += (Kr_bytes- ((ulsch_harq->C>1)?3:0)); offset += (Kr_bytes- ((ulsch_harq->C>1)?3:0));
...@@ -794,6 +794,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, ...@@ -794,6 +794,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
A = ulsch_harq->TBS; A = ulsch_harq->TBS;
Q_m = ulsch_harq->Qm; Q_m = ulsch_harq->Qm;
G = nb_rb * (12 * Q_m) * ulsch_harq->Nsymb_pusch; G = nb_rb * (12 * Q_m) * ulsch_harq->Nsymb_pusch;
LOG_D(PHY, "PUSCH nb_rb %d Q_m %d ulsch_harq->Nsymb_pusch %d\n",nb_rb, Q_m, ulsch_harq->Nsymb_pusch);
//#ifdef DEBUG_ULSCH_DECODING //#ifdef DEBUG_ULSCH_DECODING
LOG_D(PHY,"[PUSCH harq %d] Frame %d, Subframe %d: ulsch_decoding (Nid_cell %d, rnti %x, x2 %x): TBS %d, round %d, RV %d, O_r1 %d, O_RI %d, O_ACK %d, G %d, Q_m %d Nsymb_pusch %d nb_rb %d\n", LOG_D(PHY,"[PUSCH harq %d] Frame %d, Subframe %d: ulsch_decoding (Nid_cell %d, rnti %x, x2 %x): TBS %d, round %d, RV %d, O_r1 %d, O_RI %d, O_ACK %d, G %d, Q_m %d Nsymb_pusch %d nb_rb %d\n",
harq_pid, harq_pid,
...@@ -848,6 +849,12 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, ...@@ -848,6 +849,12 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
subframe); subframe);
// Compute Q_ri // Compute Q_ri
Qprime = ulsch_harq->O_RI*ulsch_harq->Msc_initial*ulsch_harq->Nsymb_initial * ulsch->beta_offset_ri_times8; Qprime = ulsch_harq->O_RI*ulsch_harq->Msc_initial*ulsch_harq->Nsymb_initial * ulsch->beta_offset_ri_times8;
LOG_D(PHY, "Qprime %d, O_RI %d, Msc %d, Nym %d beta %d\n",
Qprime,
ulsch_harq->O_RI,
ulsch_harq->Msc_initial,
ulsch_harq->Nsymb_initial,
ulsch->beta_offset_ri_times8);
if (Qprime > 0 ) { if (Qprime > 0 ) {
if ((Qprime % (8*sumKr)) > 0) if ((Qprime % (8*sumKr)) > 0)
...@@ -1224,8 +1231,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, ...@@ -1224,8 +1231,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
j2+=2; j2+=2;
} }
ulsch_harq->eE[iprime++] = y[j2++]; ulsch_harq->e[iprime++] = y[j2++];
ulsch_harq->eE[iprime++] = y[j2++]; ulsch_harq->e[iprime++] = y[j2++];
} }
break; break;
...@@ -1237,10 +1244,10 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, ...@@ -1237,10 +1244,10 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
j2+=4; j2+=4;
} }
ulsch_harq->eE[iprime++] = y[j2++]; ulsch_harq->e[iprime++] = y[j2++];
ulsch_harq->eE[iprime++] = y[j2++]; ulsch_harq->e[iprime++] = y[j2++];
ulsch_harq->eE[iprime++] = y[j2++]; ulsch_harq->e[iprime++] = y[j2++];
ulsch_harq->eE[iprime++] = y[j2++]; ulsch_harq->e[iprime++] = y[j2++];
} }
break; break;
...@@ -1252,12 +1259,12 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, ...@@ -1252,12 +1259,12 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
j2+=6; j2+=6;
} }
ulsch_harq->eE[iprime++] = y[j2++]; ulsch_harq->e[iprime++] = y[j2++];
ulsch_harq->eE[iprime++] = y[j2++]; ulsch_harq->e[iprime++] = y[j2++];
ulsch_harq->eE[iprime++] = y[j2++]; ulsch_harq->e[iprime++] = y[j2++];
ulsch_harq->eE[iprime++] = y[j2++]; ulsch_harq->e[iprime++] = y[j2++];
ulsch_harq->eE[iprime++] = y[j2++]; ulsch_harq->e[iprime++] = y[j2++];
ulsch_harq->eE[iprime++] = y[j2++]; ulsch_harq->e[iprime++] = y[j2++];
} }
break; break;
...@@ -1295,7 +1302,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc, ...@@ -1295,7 +1302,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,
*/ */
int16_t *yp,*ep; int16_t *yp,*ep;
for (iprime=0,yp=&y[j2],ep=&ulsch_harq->eE[0]; for (iprime=0,yp=&y[j2],ep=&ulsch_harq->e[0];
iprime<G; iprime<G;
iprime+=8,j2+=8,ep+=8,yp+=8) { iprime+=8,j2+=8,ep+=8,yp+=8) {
ep[0] = yp[0]; ep[0] = yp[0];
......
...@@ -353,11 +353,6 @@ uint32_t ulsch_encoding(uint8_t *a, ...@@ -353,11 +353,6 @@ uint32_t ulsch_encoding(uint8_t *a,
(r==0) ? ulsch->harq_processes[harq_pid]->F : 0 (r==0) ? ulsch->harq_processes[harq_pid]->F : 0
); );
stop_meas(te_stats); stop_meas(te_stats);
/*
for (int i=0; i< Kr ; i++ )
printf("%hx", ulsch->harq_processes[harq_pid]->d[r][96+i]);
printf ("\n");
*/
#ifdef DEBUG_ULSCH_CODING #ifdef DEBUG_ULSCH_CODING
if (r==0) if (r==0)
...@@ -451,6 +446,13 @@ uint32_t ulsch_encoding(uint8_t *a, ...@@ -451,6 +446,13 @@ uint32_t ulsch_encoding(uint8_t *a,
Qprime = (ulsch->O + L) * ulsch->harq_processes[harq_pid]->Msc_initial*ulsch->harq_processes[harq_pid]->Nsymb_initial * ulsch->beta_offset_cqi_times8; Qprime = (ulsch->O + L) * ulsch->harq_processes[harq_pid]->Msc_initial*ulsch->harq_processes[harq_pid]->Nsymb_initial * ulsch->beta_offset_cqi_times8;
else else
Qprime = 0; Qprime = 0;
LOG_D(PHY,"Qprime %d, O_RI %d + %d, Msc %d, Nym %d beta %d\n",
Qprime,
ulsch->O, L,
ulsch->harq_processes[harq_pid]->Msc_initial,
ulsch->harq_processes[harq_pid]->Nsymb_initial,
ulsch->beta_offset_cqi_times8);
if (Qprime > 0) { if (Qprime > 0) {
if ((Qprime % (8*sumKr)) > 0) if ((Qprime % (8*sumKr)) > 0)
...@@ -460,7 +462,7 @@ uint32_t ulsch_encoding(uint8_t *a, ...@@ -460,7 +462,7 @@ uint32_t ulsch_encoding(uint8_t *a,
} }
G = ulsch->harq_processes[harq_pid]->nb_rb * (12 * Q_m) * (ulsch->Nsymb_pusch); G = ulsch->harq_processes[harq_pid]->nb_rb * (12 * Q_m) * (ulsch->Nsymb_pusch);
LOG_D(PHY,"G: rb %d * ( 12 * Qm %d ) * nsymb %d, Qprime %d, O_RI %d\n", ulsch->harq_processes[harq_pid]->nb_rb, Q_m, ulsch->Nsymb_pusch, Qprime, ulsch->O_RI);
if (Qprime > (G - ulsch->O_RI)) if (Qprime > (G - ulsch->O_RI))
Qprime = G - ulsch->O_RI; Qprime = G - ulsch->O_RI;
...@@ -470,6 +472,7 @@ uint32_t ulsch_encoding(uint8_t *a, ...@@ -470,6 +472,7 @@ uint32_t ulsch_encoding(uint8_t *a,
G = G - Q_RI - Q_CQI; G = G - Q_RI - Q_CQI;
LOG_D(PHY,"new G: %d, Q_RI %d Q_CQI %d\n", G , Q_RI , Q_CQI);
ulsch->harq_processes[harq_pid]->G = G; ulsch->harq_processes[harq_pid]->G = G;
/* /*
......
...@@ -410,10 +410,10 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -410,10 +410,10 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
ul_frame = pdcch_alloc2ul_frame (fp, frame, subframe); ul_frame = pdcch_alloc2ul_frame (fp, frame, subframe);
// clear previous allocation information for all UEs // clear previous allocation information for all UEs
//for (i = 0; i < NUMBER_OF_UE_MAX; i++) { for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
//if (eNB->dlsch[i][0]) if (eNB->dlsch[i][0])
//eNB->dlsch[i][0]->subframe_tx[subframe] = 0; eNB->dlsch[i][0]->subframe_tx[subframe] = 0;
//} }
/* TODO: check the following test - in the meantime it is put back as it was before */ /* TODO: check the following test - in the meantime it is put back as it was before */
//if ((ul_subframe < 10)&& //if ((ul_subframe < 10)&&
...@@ -549,7 +549,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -549,7 +549,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
#endif #endif
) { ) {
// clear subframe TX flag since UE is not scheduled for PDSCH in this subframe (so that we don't look for PUCCH later) // clear subframe TX flag since UE is not scheduled for PDSCH in this subframe (so that we don't look for PUCCH later)
//dlsch0->subframe_tx[subframe]=0; dlsch0->subframe_tx[subframe]=0;
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,0);
...@@ -1424,7 +1424,7 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe) { ...@@ -1424,7 +1424,7 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe) {
pdu->rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG; pdu->rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
pdu->rx_indication_rel8.length = eNB->ulsch[UE_id]->harq_processes[harq_pid]->TBS>>3; pdu->rx_indication_rel8.length = eNB->ulsch[UE_id]->harq_processes[harq_pid]->TBS>>3;
pdu->rx_indication_rel8.offset = 1; // DJP - I dont understand - but broken unless 1 ???? 0; // filled in at the end of the UL_INFO formation pdu->rx_indication_rel8.offset = 1; // DJP - I dont understand - but broken unless 1 ???? 0; // filled in at the end of the UL_INFO formation
pdu->data = eNB->ulsch[UE_id]->harq_processes[harq_pid]->bb; pdu->data = eNB->ulsch[UE_id]->harq_processes[harq_pid]->b;
// estimate timing advance for MAC // estimate timing advance for MAC
sync_pos = lte_est_timing_advance_pusch(eNB,UE_id); sync_pos = lte_est_timing_advance_pusch(eNB,UE_id);
timing_advance_update = sync_pos; // - eNB->frame_parms.nb_prefix_samples/4; //to check timing_advance_update = sync_pos; // - eNB->frame_parms.nb_prefix_samples/4; //to check
......
...@@ -2836,7 +2836,7 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP, ...@@ -2836,7 +2836,7 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP,
} }
if (tpc!=1) { if (tpc!=1) {
LOG_D(MAC,"[eNB %d] ULSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, accumulated %d, snr/target snr %d/%d\n", LOG_D(MAC,"[eNB %d] ULSCH schedulerRR: frame %d, subframe %d, harq_pid %d, tpc %d, accumulated %d, snr/target snr %d/%d\n",
module_idP,frameP,subframeP,harq_pid,tpc, module_idP,frameP,subframeP,harq_pid,tpc,
tpc_accumulated,snr,target_snr); tpc_accumulated,snr,target_snr);
} }
......
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