Commit 41a26126 authored by Florian Kaltenberger's avatar Florian Kaltenberger

fixing some bugs

parent 358e6926
...@@ -553,8 +553,8 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB, ...@@ -553,8 +553,8 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
return(0); return(0);
} }
int dlsch_encoding(unsigned char *a, int dlsch_encoding(PHY_VARS_eNB *eNB,
LTE_DL_FRAME_PARMS *frame_parms, unsigned char *a,
uint8_t num_pdcch_symbols, uint8_t num_pdcch_symbols,
LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t *dlsch,
int frame, int frame,
...@@ -568,6 +568,7 @@ int dlsch_encoding(unsigned char *a, ...@@ -568,6 +568,7 @@ int dlsch_encoding(unsigned char *a,
unsigned int crc=1; unsigned int crc=1;
unsigned short iind; unsigned short iind;
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
unsigned char harq_pid = dlsch->current_harq_pid; unsigned char harq_pid = dlsch->current_harq_pid;
unsigned short nb_rb = dlsch->harq_processes[harq_pid]->nb_rb; unsigned short nb_rb = dlsch->harq_processes[harq_pid]->nb_rb;
unsigned int A; unsigned int A;
...@@ -602,7 +603,7 @@ int dlsch_encoding(unsigned char *a, ...@@ -602,7 +603,7 @@ int dlsch_encoding(unsigned char *a,
printf("\n"); printf("\n");
*/ */
// Add 24-bit crc (polynomial A) to payload // Add 24-bit crc (polynomial A) to payload
crc = crc24a(a, //input bits for computation, A is a size of a crc = crc24a(a,
A)>>8; A)>>8;
a[A>>3] = ((uint8_t*)&crc)[2]; a[A>>3] = ((uint8_t*)&crc)[2];
a[1+(A>>3)] = ((uint8_t*)&crc)[1]; a[1+(A>>3)] = ((uint8_t*)&crc)[1];
...@@ -613,15 +614,15 @@ int dlsch_encoding(unsigned char *a, ...@@ -613,15 +614,15 @@ int dlsch_encoding(unsigned char *a,
// dlsch->harq_processes[harq_pid]->b = a; // dlsch->harq_processes[harq_pid]->b = a;
memcpy(dlsch->harq_processes[harq_pid]->b,a,(A/8)+4); memcpy(dlsch->harq_processes[harq_pid]->b,a,(A/8)+4);
if (lte_segmentation(dlsch->harq_processes[harq_pid]->b, // bits after CRC attachement if (lte_segmentation(dlsch->harq_processes[harq_pid]->b,
dlsch->harq_processes[harq_pid]->c, // output from segmentation dlsch->harq_processes[harq_pid]->c,
dlsch->harq_processes[harq_pid]->B, //size of B=L+A dlsch->harq_processes[harq_pid]->B,
&dlsch->harq_processes[harq_pid]->C, //number of codeblocks &dlsch->harq_processes[harq_pid]->C,
&dlsch->harq_processes[harq_pid]->Cplus, //Number of segments of size K+ &dlsch->harq_processes[harq_pid]->Cplus,
&dlsch->harq_processes[harq_pid]->Cminus,//Number of segments of size K_ &dlsch->harq_processes[harq_pid]->Cminus,
&dlsch->harq_processes[harq_pid]->Kplus, //First segmentation size &dlsch->harq_processes[harq_pid]->Kplus,
&dlsch->harq_processes[harq_pid]->Kminus, //Second segmentation size &dlsch->harq_processes[harq_pid]->Kminus,
&dlsch->harq_processes[harq_pid]->F)<0) //Number of filler bits &dlsch->harq_processes[harq_pid]->F)<0)
return(-1); return(-1);
for (r=0; r<dlsch->harq_processes[harq_pid]->C; r++) { for (r=0; r<dlsch->harq_processes[harq_pid]->C; r++) {
...@@ -703,7 +704,7 @@ int dlsch_encoding(unsigned char *a, ...@@ -703,7 +704,7 @@ int dlsch_encoding(unsigned char *a,
r_offset += lte_rate_matching_turbo(dlsch->harq_processes[harq_pid]->RTC[r], r_offset += lte_rate_matching_turbo(dlsch->harq_processes[harq_pid]->RTC[r],
G, //G G, //G
dlsch->harq_processes[harq_pid]->w[r], dlsch->harq_processes[harq_pid]->w[r],
dlsch->harq_processes[harq_pid]->e+r_offset, // sequence of bits for transmission dlsch->harq_processes[harq_pid]->e+r_offset,
dlsch->harq_processes[harq_pid]->C, // C dlsch->harq_processes[harq_pid]->C, // C
dlsch->Nsoft, // Nsoft, dlsch->Nsoft, // Nsoft,
dlsch->Mdlharq, dlsch->Mdlharq,
...@@ -715,7 +716,6 @@ int dlsch_encoding(unsigned char *a, ...@@ -715,7 +716,6 @@ int dlsch_encoding(unsigned char *a,
nb_rb, nb_rb,
m); // r m); // r
stop_meas(rm_stats); stop_meas(rm_stats);
//printf("dlsch->harq_processes[harq_pid]->rvidx = %d\n", dlsch->harq_processes[harq_pid]->rvidx);
#ifdef DEBUG_DLSCH_CODING #ifdef DEBUG_DLSCH_CODING
if (r==dlsch->harq_processes[harq_pid]->C-1) if (r==dlsch->harq_processes[harq_pid]->C-1)
......
...@@ -312,8 +312,8 @@ void generate_mch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t *a) ...@@ -312,8 +312,8 @@ void generate_mch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t *a)
AMP); AMP);
if (dlsch_encoding(a, if (dlsch_encoding(eNB,
&eNB->frame_parms, a,
1, 1,
eNB->dlsch_MCH, eNB->dlsch_MCH,
proc->frame_tx, proc->frame_tx,
......
...@@ -111,8 +111,8 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag); ...@@ -111,8 +111,8 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag);
@param i_stats Time statistics for interleaving @param i_stats Time statistics for interleaving
@returns status @returns status
*/ */
int32_t dlsch_encoding(uint8_t *a, int32_t dlsch_encoding(PHY_VARS_eNB *eNB,
LTE_DL_FRAME_PARMS *frame_parms, uint8_t *a,
uint8_t num_pdcch_symbols, uint8_t num_pdcch_symbols,
LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t *dlsch,
int frame, int frame,
......
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