Commit 6551ec4c authored by ISIP CS/NCTU's avatar ISIP CS/NCTU

isip turbo decoder thread parallel according to code segment

parent ae0494b0
......@@ -29,6 +29,18 @@
* \note
* \warning
*/
/*! \function isip_ulsch_decoding_data
* \brief Implementation of turbo decoder paralleling
* \author YT Liao (Yuan-Te), TY Hsu, TH Wang(Judy)
* \date 2019
* \version 0.1
* \company ISIP@NCTU and Eurecom
* \email: ytliao.cs97g@nctu.edu.tw, tyhsu@cs.nctu.edu.tw, Tsu-Han.Wang@eurecom.fr
* \note
* \warning
*/
#ifndef __LTE_TRANSPORT_PROTO__H__
#define __LTE_TRANSPORT_PROTO__H__
#include "PHY/defs.h"
......@@ -1903,6 +1915,12 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,
int harq_pid,
int llr8_flag);
int isip_ulsch_decoding_data(PHY_VARS_eNB *eNB,
int UE_id,
int harq_pid,
int llr8_flag,
int current_thread_num);
uint32_t ulsch_decoding_emul(PHY_VARS_eNB *phy_vars_eNB,
eNB_rxtx_proc_t *proc,
uint8_t UE_index,
......
......@@ -30,6 +30,17 @@
* \warning
*/
/*! \function isip_ulsch_decoding_data
* \brief Implementation of turbo decoder paralleling
* \author YT Liao (Yuan-Te), TY Hsu, TH Wang(Judy)
* \date 2019
* \version 0.1
* \company ISIP@NCTU and Eurecom
* \email: ytliao.cs97g@nctu.edu.tw, tyhsu@cs.nctu.edu.tw, Tsu-Han.Wang@eurecom.fr
* \note
* \warning
*/
//#include "defs.h"
#include "PHY/defs.h"
......@@ -812,6 +823,231 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr8_flag)
return(ret);
}
// ISIP Turbo Decoder
int isip_ulsch_decoding_data(PHY_VARS_eNB *eNB, int UE_id, int harq_pid, int llr8_flag, int current_thread_num)
{
unsigned int r, r_offset = 0, Kr, Kr_bytes, iind;
uint8_t crc_type;
int offset = 0;
// int ret = 1;
int ret = 0;
int16_t dummy_w[MAX_NUM_ULSCH_SEGMENTS][3 * (6144 + 64)];
LTE_eNB_ULSCH_t *ulsch = eNB->ulsch[UE_id];
LTE_UL_eNB_HARQ_t *ulsch_harq = ulsch->harq_processes[harq_pid];
//int Q_m = get_Qm_ul(ulsch_harq->mcs);
int G = ulsch_harq->G;
unsigned int E;
uint8_t (*tc)(int16_t * y,
uint8_t *,
uint16_t,
uint16_t,
uint16_t,
uint8_t,
uint8_t,
uint8_t,
time_stats_t *,
time_stats_t *,
time_stats_t *,
time_stats_t *,
time_stats_t *,
time_stats_t *,
time_stats_t *);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ISIP_THREAD0 + current_thread_num, 1);
if (llr8_flag == 0)
tc = phy_threegpplte_turbo_decoder16;
else
tc = phy_threegpplte_turbo_decoder8;
// for (r = 0; r < ulsch_harq->C; r++)
for (r = (ulsch_harq->C * current_thread_num) / (ISIP_TURBO_THREAD_NUM); r < (ulsch_harq->C * (current_thread_num + 1)) / (ISIP_TURBO_THREAD_NUM); r++)
{
// printf("before subblock deinterleaving c[%d] = %p\n",r,ulsch_harq->c[r]);
// Get Turbo interleaver parameters
if (r < ulsch_harq->Cminus)
Kr = ulsch_harq->Kminus;
else
Kr = ulsch_harq->Kplus;
Kr_bytes = Kr >> 3;
if (Kr_bytes <= 64)
iind = (Kr_bytes - 5);
else if (Kr_bytes <= 128)
iind = 59 + ((Kr_bytes - 64) >> 1);
else if (Kr_bytes <= 256)
iind = 91 + ((Kr_bytes - 128) >> 2);
else if (Kr_bytes <= 768)
iind = 123 + ((Kr_bytes - 256) >> 3);
else
{
LOG_E(PHY, "ulsch_decoding: Illegal codeword size %d!!!\n", Kr_bytes);
return (-1);
}
#ifdef DEBUG_ULSCH_DECODING
printf("[ISIP %d]f1 %d, f2 %d, F %d\n", current_thread_num, f1f2mat_old[2 * iind], f1f2mat_old[1 + (2 * iind)], (r == 0) ? ulsch_harq->F : 0);
#endif
memset(&dummy_w[r][0], 0, 3 * (6144 + 64) * sizeof(short));
ulsch_harq->RTC[r] = generate_dummy_w(4 + (Kr_bytes * 8),
(uint8_t *)&dummy_w[r][0],
(r == 0) ? ulsch_harq->F : 0);
#ifdef DEBUG_ULSCH_DECODING
printf("[ISIP %d]Rate Matching Segment %d (coded bits (G) %d,unpunctured/repeated bits %d, Q_m %d, nb_rb %d, Nl %d)...\n",
current_thread_num, r, G,
Kr * 3,
Q_m,
nb_rb,
ulsch_harq->Nl);
#endif
start_meas(&eNB->ulsch_rate_unmatching_stats);
if (r == (ulsch_harq->C * current_thread_num) / (ISIP_TURBO_THREAD_NUM))
{
r_offset = r * E;
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ISIP_THREAD_TEST0 + current_thread_num, 1);
if (lte_rate_matching_turbo_rx(ulsch_harq->RTC[r],
G,
ulsch_harq->w[r],
(uint8_t *)&dummy_w[r][0],
ulsch_harq->e + r_offset,
ulsch_harq->C,
NSOFT,
0, //Uplink
1,
ulsch_harq->rvidx,
(ulsch_harq->round == 0) ? 1 : 0, // clear
get_Qm_ul(ulsch_harq->mcs),
1,
r,
&E) == -1)
{
LOG_E(PHY, "ulsch_decoding.c: Problem in rate matching\n");
return (-1);
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ISIP_THREAD_TEST0 + current_thread_num, 0);
stop_meas(&eNB->ulsch_rate_unmatching_stats);
r_offset += E;
start_meas(&eNB->ulsch_deinterleaving_stats);
sub_block_deinterleaving_turbo(4 + Kr,
&ulsch_harq->d[r][96],
ulsch_harq->w[r]);
stop_meas(&eNB->ulsch_deinterleaving_stats);
if (ulsch_harq->C == 1)
crc_type = CRC24_A;
else
crc_type = CRC24_B;
// start_meas(&eNB->ulsch_turbo_decoding_stats);
start_meas(&eNB->isip_ulsch_turbo_decoding_stats[current_thread_num]);
// printf("[Thread %d] ulsch_harq->F = %d \n\n", current_thread_num,ulsch_harq->F);
ret = tc(&ulsch_harq->d[r][96],
ulsch_harq->c[r],
Kr,
f1f2mat_old[iind * 2],
f1f2mat_old[(iind * 2) + 1],
ulsch->max_turbo_iterations, //MAX_TURBO_ITERATIONS,
crc_type,
(r == 0) ? ulsch_harq->F : 0,
&eNB->ulsch_tc_init_stats[current_thread_num],
&eNB->ulsch_tc_alpha_stats[current_thread_num],
&eNB->ulsch_tc_beta_stats[current_thread_num],
&eNB->ulsch_tc_gamma_stats[current_thread_num],
&eNB->ulsch_tc_ext_stats[current_thread_num],
&eNB->ulsch_tc_intl1_stats[current_thread_num],
&eNB->ulsch_tc_intl2_stats[current_thread_num]);
// stop_meas(&eNB->ulsch_turbo_decoding_stats);
stop_meas(&eNB->isip_ulsch_turbo_decoding_stats[current_thread_num]);
// Reassembly of Transport block here
if (ret != (1 + ulsch->max_turbo_iterations))
{
if (r < ulsch_harq->Cminus)
Kr = ulsch_harq->Kminus;
else
Kr = ulsch_harq->Kplus;
Kr_bytes = Kr >> 3;
// if (r == 0)
// {
// memcpy(ulsch_harq->b,
// &ulsch_harq->c[0][(ulsch_harq->F >> 3)],
// 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
// {
// memcpy(ulsch_harq->b + offset,
// ulsch_harq->c[r],
// Kr_bytes - ((ulsch_harq->C > 1) ? 3 : 0));
// offset += (Kr_bytes - ((ulsch_harq->C > 1) ? 3 : 0));
// }
if (r == (ulsch_harq->C * current_thread_num) / (ISIP_TURBO_THREAD_NUM))
{
//fprintf(fp, "First... \n");
if (r == 0)
{
// fprintf(fp, "r = %d, ulsch_harq->b = %d, offset = %d, harq_pid = %d \n", r, ulsch_harq->b, offset, harq_pid);
memcpy(ulsch_harq->b,
&ulsch_harq->c[0][(ulsch_harq->F >> 3)],
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
{
offset = Kr_bytes - (ulsch_harq->F >> 3) - ((ulsch_harq->C > 1) ? 3 : 0) + (r - 1) * (Kr_bytes - ((ulsch_harq->C > 1) ? 3 : 0));
// fprintf(fp, "r = %d, ulsch_harq->b = %d, offset = %d, harq_pid = %d \n", r, ulsch_harq->b, offset, harq_pid);
memcpy(ulsch_harq->b + offset,
ulsch_harq->c[r],
Kr_bytes - ((ulsch_harq->C > 1) ? 3 : 0));
offset += (Kr_bytes - ((ulsch_harq->C > 1) ? 3 : 0));
}
}
else
{
// TODO: offset for parallelizing
/*
if (r)
*/
// fprintf(fp, "r = %d, ulsch_harq->b = %d, offset = %d, harq_pid = %d \n", r, ulsch_harq->b, offset, harq_pid);
memcpy(ulsch_harq->b + offset,
ulsch_harq->c[r],
Kr_bytes - ((ulsch_harq->C > 1) ? 3 : 0));
offset += (Kr_bytes - ((ulsch_harq->C > 1) ? 3 : 0));
}
}
else
{
break;
}
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ISIP_THREAD0 + current_thread_num, 0);
return (ret);
}
static inline unsigned int lte_gold_unscram(unsigned int *x1, unsigned int *x2, unsigned char reset) __attribute__((always_inline));
static inline unsigned int lte_gold_unscram(unsigned int *x1, unsigned int *x2, unsigned char reset)
{
......@@ -1604,11 +1840,94 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
#endif
}
// Do ULSCH Decoding for data portion
// Original OAI Code
// ret = eNB->td(eNB,UE_id,harq_pid,llr8_flag);
// ISIP Turbo Decoder Parallel Start
int isip_thread_cnt;
int16_t isip_turbo_complete_status = 0;
int turbo_complete = (1 << ISIP_TURBO_THREAD_NUM) - 1;
start_meas(&eNB->isip_turbo_stats);
ret = eNB->td(eNB,UE_id,harq_pid,llr8_flag);
for (isip_thread_cnt = 0; isip_thread_cnt < ISIP_TURBO_THREAD_NUM; isip_thread_cnt++)
{
eNB->isip_turbo_thread[isip_thread_cnt].thread_id = isip_thread_cnt;
eNB->isip_turbo_thread[isip_thread_cnt].UE_id = UE_id; // ISIP Thread
eNB->isip_turbo_thread[isip_thread_cnt].harq_pid = harq_pid; // ISIP Thread
eNB->isip_turbo_thread[isip_thread_cnt].llr8_flag = llr8_flag; // ISIP Thread
eNB->isip_turbo_thread[isip_thread_cnt].eNB = eNB; // ISIP Thread
eNB->isip_turbo_thread[isip_thread_cnt].flag_done = 0;
pthread_cond_signal(&eNB->isip_turbo_thread[isip_thread_cnt].cond_rx); // ISIP Thread
}
start_meas(&eNB->isip_wait_loop);
do
{
#if (ISIP_TURBO_THREAD_NUM == 1)
isip_turbo_complete_status = eNB->isip_turbo_thread[0].flag_done;
#elif (ISIP_TURBO_THREAD_NUM == 2)
isip_turbo_complete_status = eNB->isip_turbo_thread[0].flag_done | eNB->isip_turbo_thread[1].flag_done;
#elif (ISIP_TURBO_THREAD_NUM == 3)
isip_turbo_complete_status = eNB->isip_turbo_thread[0].flag_done | eNB->isip_turbo_thread[1].flag_done | eNB->isip_turbo_thread[2].flag_done;
#elif (ISIP_TURBO_THREAD_NUM == 4)
isip_turbo_complete_status = eNB->isip_turbo_thread[0].flag_done | eNB->isip_turbo_thread[1].flag_done | eNB->isip_turbo_thread[2].flag_done | eNB->isip_turbo_thread[3].flag_done;
#elif (ISIP_TURBO_THREAD_NUM == 5)
isip_turbo_complete_status = eNB->isip_turbo_thread[0].flag_done | eNB->isip_turbo_thread[1].flag_done | eNB->isip_turbo_thread[2].flag_done | eNB->isip_turbo_thread[3].flag_done | eNB->isip_turbo_thread[4].flag_done;
#elif (ISIP_TURBO_THREAD_NUM == 6)
isip_turbo_complete_status = eNB->isip_turbo_thread[0].flag_done | eNB->isip_turbo_thread[1].flag_done | eNB->isip_turbo_thread[2].flag_done | eNB->isip_turbo_thread[3].flag_done | eNB->isip_turbo_thread[4].flag_done | eNB->isip_turbo_thread[5].flag_done;
#elif (ISIP_TURBO_THREAD_NUM == 7)
isip_turbo_complete_status = eNB->isip_turbo_thread[0].flag_done | eNB->isip_turbo_thread[1].flag_done | eNB->isip_turbo_thread[2].flag_done | eNB->isip_turbo_thread[3].flag_done | eNB->isip_turbo_thread[4].flag_done | eNB->isip_turbo_thread[5].flag_done | eNB->isip_turbo_thread[6].flag_done;
#elif (ISIP_TURBO_THREAD_NUM == 8)
isip_turbo_complete_status = eNB->isip_turbo_thread[0].flag_done | eNB->isip_turbo_thread[1].flag_done | eNB->isip_turbo_thread[2].flag_done | eNB->isip_turbo_thread[3].flag_done | eNB->isip_turbo_thread[4].flag_done | eNB->isip_turbo_thread[5].flag_done | eNB->isip_turbo_thread[6].flag_done | eNB->isip_turbo_thread[7].flag_done;
#elif (ISIP_TURBO_THREAD_NUM == 9)
isip_turbo_complete_status = eNB->isip_turbo_thread[0].flag_done | eNB->isip_turbo_thread[1].flag_done | eNB->isip_turbo_thread[2].flag_done | eNB->isip_turbo_thread[3].flag_done | eNB->isip_turbo_thread[4].flag_done | eNB->isip_turbo_thread[5].flag_done | eNB->isip_turbo_thread[6].flag_done | eNB->isip_turbo_thread[7].flag_done | eNB->isip_turbo_thread[8].flag_done;
#elif (ISIP_TURBO_THREAD_NUM == 10)
isip_turbo_complete_status = eNB->isip_turbo_thread[0].flag_done | eNB->isip_turbo_thread[1].flag_done | eNB->isip_turbo_thread[2].flag_done | eNB->isip_turbo_thread[3].flag_done | eNB->isip_turbo_thread[4].flag_done | eNB->isip_turbo_thread[5].flag_done | eNB->isip_turbo_thread[6].flag_done | eNB->isip_turbo_thread[7].flag_done | eNB->isip_turbo_thread[8].flag_done | eNB->isip_turbo_thread[9].flag_done;
#elif (ISIP_TURBO_THREAD_NUM == 11)
isip_turbo_complete_status = eNB->isip_turbo_thread[0].flag_done | eNB->isip_turbo_thread[1].flag_done | eNB->isip_turbo_thread[2].flag_done | eNB->isip_turbo_thread[3].flag_done | eNB->isip_turbo_thread[4].flag_done | eNB->isip_turbo_thread[5].flag_done | eNB->isip_turbo_thread[6].flag_done | eNB->isip_turbo_thread[7].flag_done | eNB->isip_turbo_thread[8].flag_done | eNB->isip_turbo_thread[9].flag_done | eNB->isip_turbo_thread[10].flag_done;
#elif (ISIP_TURBO_THREAD_NUM == 12)
isip_turbo_complete_status = eNB->isip_turbo_thread[0].flag_done | eNB->isip_turbo_thread[1].flag_done | eNB->isip_turbo_thread[2].flag_done | eNB->isip_turbo_thread[3].flag_done | eNB->isip_turbo_thread[4].flag_done | eNB->isip_turbo_thread[5].flag_done | eNB->isip_turbo_thread[6].flag_done | eNB->isip_turbo_thread[7].flag_done | eNB->isip_turbo_thread[8].flag_done | eNB->isip_turbo_thread[9].flag_done | eNB->isip_turbo_thread[10].flag_done | eNB->isip_turbo_thread[11].flag_done;
#elif (ISIP_TURBO_THREAD_NUM == 13)
isip_turbo_complete_status = eNB->isip_turbo_thread[0].flag_done | eNB->isip_turbo_thread[1].flag_done | eNB->isip_turbo_thread[2].flag_done | eNB->isip_turbo_thread[3].flag_done | eNB->isip_turbo_thread[4].flag_done | eNB->isip_turbo_thread[5].flag_done | eNB->isip_turbo_thread[6].flag_done | eNB->isip_turbo_thread[7].flag_done | eNB->isip_turbo_thread[8].flag_done | eNB->isip_turbo_thread[9].flag_done | eNB->isip_turbo_thread[10].flag_done | eNB->isip_turbo_thread[11].flag_done | eNB->isip_turbo_thread[12].flag_done;
#endif
} while (isip_turbo_complete_status != turbo_complete);
stop_meas(&eNB->isip_wait_loop);
#if (ISIP_TURBO_THREAD_NUM == 1)
ret = eNB->isip_turbo_thread[0].ret;
#elif (ISIP_TURBO_THREAD_NUM == 2)
ret = eNB->isip_turbo_thread[0].ret | eNB->isip_turbo_thread[1].ret;
#elif (ISIP_TURBO_THREAD_NUM == 3)
ret = eNB->isip_turbo_thread[0].ret | eNB->isip_turbo_thread[1].ret | eNB->isip_turbo_thread[2].ret;
#elif (ISIP_TURBO_THREAD_NUM == 4)
ret = eNB->isip_turbo_thread[0].ret | eNB->isip_turbo_thread[1].ret | eNB->isip_turbo_thread[2].ret | eNB->isip_turbo_thread[3].ret;
#elif (ISIP_TURBO_THREAD_NUM == 5)
ret = eNB->isip_turbo_thread[0].ret | eNB->isip_turbo_thread[1].ret | eNB->isip_turbo_thread[2].ret | eNB->isip_turbo_thread[3].ret | eNB->isip_turbo_thread[4].ret;
#elif (ISIP_TURBO_THREAD_NUM == 6)
ret = eNB->isip_turbo_thread[0].ret | eNB->isip_turbo_thread[1].ret | eNB->isip_turbo_thread[2].ret | eNB->isip_turbo_thread[3].ret | eNB->isip_turbo_thread[4].ret | eNB->isip_turbo_thread[5].ret;
#elif (ISIP_TURBO_THREAD_NUM == 7)
ret = eNB->isip_turbo_thread[0].ret | eNB->isip_turbo_thread[1].ret | eNB->isip_turbo_thread[2].ret | eNB->isip_turbo_thread[3].ret | eNB->isip_turbo_thread[4].ret | eNB->isip_turbo_thread[5].ret | eNB->isip_turbo_thread[6].ret;
#elif (ISIP_TURBO_THREAD_NUM == 8)
ret = eNB->isip_turbo_thread[0].ret | eNB->isip_turbo_thread[1].ret | eNB->isip_turbo_thread[2].ret | eNB->isip_turbo_thread[3].ret | eNB->isip_turbo_thread[4].ret | eNB->isip_turbo_thread[5].ret | eNB->isip_turbo_thread[6].ret | eNB->isip_turbo_thread[7].ret;
#elif (ISIP_TURBO_THREAD_NUM == 9)
ret = eNB->isip_turbo_thread[0].ret | eNB->isip_turbo_thread[1].ret | eNB->isip_turbo_thread[2].ret | eNB->isip_turbo_thread[3].ret | eNB->isip_turbo_thread[4].ret | eNB->isip_turbo_thread[5].ret | eNB->isip_turbo_thread[6].ret | eNB->isip_turbo_thread[7].ret | eNB->isip_turbo_thread[8].ret;
#elif (ISIP_TURBO_THREAD_NUM == 10)
ret = eNB->isip_turbo_thread[0].ret | eNB->isip_turbo_thread[1].ret | eNB->isip_turbo_thread[2].ret | eNB->isip_turbo_thread[3].ret | eNB->isip_turbo_thread[4].ret | eNB->isip_turbo_thread[5].ret | eNB->isip_turbo_thread[6].ret | eNB->isip_turbo_thread[7].ret | eNB->isip_turbo_thread[8].ret | eNB->isip_turbo_thread[9].ret;
#elif (ISIP_TURBO_THREAD_NUM == 11)
ret = eNB->isip_turbo_thread[0].ret | eNB->isip_turbo_thread[1].ret | eNB->isip_turbo_thread[2].ret | eNB->isip_turbo_thread[3].ret | eNB->isip_turbo_thread[4].ret | eNB->isip_turbo_thread[5].ret | eNB->isip_turbo_thread[6].ret | eNB->isip_turbo_thread[7].ret | eNB->isip_turbo_thread[8].ret | eNB->isip_turbo_thread[9].ret | eNB->isip_turbo_thread[10].ret;
#elif (ISIP_TURBO_THREAD_NUM == 12)
ret = eNB->isip_turbo_thread[0].ret | eNB->isip_turbo_thread[1].ret | eNB->isip_turbo_thread[2].ret | eNB->isip_turbo_thread[3].ret | eNB->isip_turbo_thread[4].ret | eNB->isip_turbo_thread[5].ret | eNB->isip_turbo_thread[6].ret | eNB->isip_turbo_thread[7].ret | eNB->isip_turbo_thread[8].ret | eNB->isip_turbo_thread[9].ret | eNB->isip_turbo_thread[10].ret | eNB->isip_turbo_thread[11].ret;
#elif (ISIP_TURBO_THREAD_NUM == 13)
ret = eNB->isip_turbo_thread[0].ret | eNB->isip_turbo_thread[1].ret | eNB->isip_turbo_thread[2].ret | eNB->isip_turbo_thread[3].ret | eNB->isip_turbo_thread[4].ret | eNB->isip_turbo_thread[5].ret | eNB->isip_turbo_thread[6].ret | eNB->isip_turbo_thread[7].ret | eNB->isip_turbo_thread[8].ret | eNB->isip_turbo_thread[9].ret | eNB->isip_turbo_thread[10].ret | eNB->isip_turbo_thread[11].ret | eNB->isip_turbo_thread[12].ret;
#endif
stop_meas(&eNB->isip_turbo_stats);
// Turbo Decoding Paralleling End
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0+harq_pid,0);
return(ret);
......
......@@ -29,6 +29,17 @@
\note
\warning
*/
/* \brief variable define for turbo decoder paralleling
* \author YT Liao (Yuan-Te), TY Hsu, TH Wang(Judy)
* \date 2019
* \version 0.1
* \company ISIP@NCTU and Eurecom
* \email: ytliao.cs97g@nctu.edu.tw, tyhsu@cs.nctu.edu.tw, Tsu-Han.Wang@eurecom.fr
* \note
* \warning
*/
#ifndef __PHY_DEFS__H__
#define __PHY_DEFS__H__
......@@ -76,6 +87,7 @@
#define RX_NB_TH_MAX 2
#define RX_NB_TH 2
#define ISIP_TURBO_THREAD_NUM 13
//#ifdef SHRLIBDEV
//extern int rxrescale;
......@@ -457,6 +469,24 @@ typedef struct {
UE_rxtx_proc_t proc_rxtx[RX_NB_TH];
} UE_proc_t;
// ISIP TURBO THREAD
typedef struct
{
struct PHY_VARS_eNB_s *eNB;
int thread_id;
volatile int flag_wait;
volatile int flag_done;
pthread_t pthread_rx;
pthread_cond_t cond_rx;
pthread_mutex_t mutex_rx;
pthread_attr_t attr_turbo;
int UE_id;
int harq_pid;
int llr8_flag;
int ret;
//int current_cnt;
} isip_turbo;
/// Top-level PHY Data Structure for eNB
typedef struct PHY_VARS_eNB_s {
/// Module ID indicator for this instance
......@@ -653,13 +683,23 @@ typedef struct PHY_VARS_eNB_s {
time_stats_t ulsch_deinterleaving_stats;
time_stats_t ulsch_demultiplexing_stats;
time_stats_t ulsch_llr_stats;
time_stats_t ulsch_tc_init_stats;
time_stats_t ulsch_tc_alpha_stats;
time_stats_t ulsch_tc_beta_stats;
time_stats_t ulsch_tc_gamma_stats;
time_stats_t ulsch_tc_ext_stats;
time_stats_t ulsch_tc_intl1_stats;
time_stats_t ulsch_tc_intl2_stats;
// time_stats_t ulsch_tc_init_stats;
// time_stats_t ulsch_tc_alpha_stats;
// time_stats_t ulsch_tc_beta_stats;
// time_stats_t ulsch_tc_gamma_stats;
// time_stats_t ulsch_tc_ext_stats;
// time_stats_t ulsch_tc_intl1_stats;
// time_stats_t ulsch_tc_intl2_stats;
time_stats_t ulsch_tc_init_stats[ISIP_TURBO_THREAD_NUM];
time_stats_t ulsch_tc_alpha_stats[ISIP_TURBO_THREAD_NUM];
time_stats_t ulsch_tc_beta_stats[ISIP_TURBO_THREAD_NUM];
time_stats_t ulsch_tc_gamma_stats[ISIP_TURBO_THREAD_NUM];
time_stats_t ulsch_tc_ext_stats[ISIP_TURBO_THREAD_NUM];
time_stats_t ulsch_tc_intl1_stats[ISIP_TURBO_THREAD_NUM];
time_stats_t ulsch_tc_intl2_stats[ISIP_TURBO_THREAD_NUM];
time_stats_t isip_turbo_stats;
time_stats_t isip_ulsch_turbo_decoding_stats[ISIP_TURBO_THREAD_NUM];
time_stats_t isip_wait_loop;
#ifdef LOCALIZATION
/// time state for localization
......@@ -683,6 +723,9 @@ typedef struct PHY_VARS_eNB_s {
/// Pointer for ifdevice buffer struct
if_buffer_t ifbuffer;
//isip turbo thread
isip_turbo isip_turbo_thread[ISIP_TURBO_THREAD_NUM];
} PHY_VARS_eNB;
#define debug_msg if (((mac_xface->frame%100) == 0) || (mac_xface->frame < 50)) msg
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -187,202 +187,229 @@ const char* eurecomVariablesNames[] = {
"ue0_trx_write_ns_missing",
};
const char* eurecomFunctionsNames[] = {
/* softmodem signals */
"rt_sleep",
"trx_read",
"trx_write",
"trx_read_if",
"trx_write_if",
"eNB_thread_rxtx0",
"eNB_thread_rxtx1",
"ue_thread_synch",
"ue_thread_rxtx0",
"ue_thread_rxtx1",
"trx_read_sf9",
"trx_write_sf9",
"ue_signal_cond_rxtx0",
"ue_signal_cond_rxtx1",
"ue_wait_cond_rxtx0",
"ue_wait_cond_rxtx1",
"ue_lock_mutex_rxtx_for_cond_wait0",
"ue_lock_mutex_rxtx_for_cond_wait1",
"ue_lock_mutex_rxtx_for_cnt_decrement0",
"ue_lock_mutex_rxtx_for_cnt_decrement1",
"ue_lock_mutex_rxtx_for_cnt_increment0",
"ue_lock_mutex_rxtx_for_cnt_increment1",
/* RRH signals */
"eNB_tx",
"eNB_rx",
"eNB_trx",
"eNB_tm",
"eNB_rx_sleep",
"eNB_tx_sleep",
"eNB_proc_sleep",
"trx_read_rf",
"trx_write_rf",
/* PHY signals */
"ue_synch",
"ue_slot_fep",
"ue_rrc_measurements",
"ue_gain_control",
"ue_adjust_synch",
"lte_ue_measurement_procedures",
"lte_ue_pdcch_procedures",
"lte_ue_pbch_procedures",
"phy_procedures_eNb_tx0",
"phy_procedures_eNb_tx1",
"phy_procedures_eNb_rx_common0",
"phy_procedures_eNb_rx_common1",
"phy_procedures_eNb_rx_uespec0",
"phy_procedures_eNb_rx_uespec1",
"phy_eNB_slot_fep",
"phy_procedures_ue_tx",
"phy_procedures_ue_rx",
"phy_procedures_ue_tx_ulsch_uespec",
"phy_procedures_ue_tx_pucch",
"phy_procedures_ue_tx_ulsch_common",
"phy_procedures_ue_tx_prach",
"phy_procedures_ue_tx_ulsch_rar",
"phy_procedures_eNB_lte",
"phy_procedures_UE_lte",
"pdsch_thread",
"dlsch_thread0",
"dlsch_thread1",
"dlsch_thread2",
"dlsch_thread3",
"dlsch_thread4",
"dlsch_thread5",
"dlsch_thread6",
"dlsch_thread7",
"dlsch_decoding0",
"dlsch_decoding1",
"dlsch_decoding2",
"dlsch_decoding3",
"dlsch_decoding4",
"dlsch_decoding5",
"dlsch_decoding6",
"dlsch_decoding7",
"rx_pdcch",
"dci_decoding",
"rx_phich",
"pdsch_procedures",
"pdsch_procedures_si",
"pdsch_procedures_p",
"pdsch_procedures_ra",
"phy_ue_config_sib2",
"macxface_phy_config_sib1_eNB",
"macxface_phy_config_sib2_eNB",
"macxface_phy_config_dedicated_eNB",
"phy_ue_compute_prach",
"phy_enb_ulsch_msg3",
"phy_enb_ulsch_decoding0",
"phy_enb_ulsch_decoding1",
"phy_enb_ulsch_decoding2",
"phy_enb_ulsch_decoding3",
"phy_enb_ulsch_decoding4",
"phy_enb_ulsch_decoding5",
"phy_enb_ulsch_decoding6",
"phy_enb_ulsch_decoding7",
"phy_enb_sfgen",
"phy_enb_prach_rx",
"phy_enb_pdcch_tx",
"phy_enb_rs_tx",
"phy_ue_generate_prach",
"phy_ue_ulsch_modulation",
"phy_ue_ulsch_encoding",
const char *eurecomFunctionsNames[] = {
/* softmodem signals */
"rt_sleep",
"trx_read",
"trx_write",
"trx_read_if",
"trx_write_if",
"eNB_thread_rxtx0",
"eNB_thread_rxtx1",
"ue_thread_synch",
"ue_thread_rxtx0",
"ue_thread_rxtx1",
"trx_read_sf9",
"trx_write_sf9",
"ue_signal_cond_rxtx0",
"ue_signal_cond_rxtx1",
"ue_wait_cond_rxtx0",
"ue_wait_cond_rxtx1",
"ue_lock_mutex_rxtx_for_cond_wait0",
"ue_lock_mutex_rxtx_for_cond_wait1",
"ue_lock_mutex_rxtx_for_cnt_decrement0",
"ue_lock_mutex_rxtx_for_cnt_decrement1",
"ue_lock_mutex_rxtx_for_cnt_increment0",
"ue_lock_mutex_rxtx_for_cnt_increment1",
/* RRH signals */
"eNB_tx",
"eNB_rx",
"eNB_trx",
"eNB_tm",
"eNB_rx_sleep",
"eNB_tx_sleep",
"eNB_proc_sleep",
"trx_read_rf",
"trx_write_rf",
/* PHY signals */
"ue_synch",
"ue_slot_fep",
"ue_rrc_measurements",
"ue_gain_control",
"ue_adjust_synch",
"lte_ue_measurement_procedures",
"lte_ue_pdcch_procedures",
"lte_ue_pbch_procedures",
"phy_procedures_eNb_tx0",
"phy_procedures_eNb_tx1",
"phy_procedures_eNb_rx_common0",
"phy_procedures_eNb_rx_common1",
"phy_procedures_eNb_rx_uespec0",
"phy_procedures_eNb_rx_uespec1",
"phy_eNB_slot_fep",
"phy_procedures_ue_tx",
"phy_procedures_ue_rx",
"phy_procedures_ue_tx_ulsch_uespec",
"phy_procedures_ue_tx_pucch",
"phy_procedures_ue_tx_ulsch_common",
"phy_procedures_ue_tx_prach",
"phy_procedures_ue_tx_ulsch_rar",
"phy_procedures_eNB_lte",
"phy_procedures_UE_lte",
"pdsch_thread",
"dlsch_thread0",
"dlsch_thread1",
"dlsch_thread2",
"dlsch_thread3",
"dlsch_thread4",
"dlsch_thread5",
"dlsch_thread6",
"dlsch_thread7",
"dlsch_decoding0",
"dlsch_decoding1",
"dlsch_decoding2",
"dlsch_decoding3",
"dlsch_decoding4",
"dlsch_decoding5",
"dlsch_decoding6",
"dlsch_decoding7",
"rx_pdcch",
"dci_decoding",
"rx_phich",
"pdsch_procedures",
"pdsch_procedures_si",
"pdsch_procedures_p",
"pdsch_procedures_ra",
"phy_ue_config_sib2",
"macxface_phy_config_sib1_eNB",
"macxface_phy_config_sib2_eNB",
"macxface_phy_config_dedicated_eNB",
"phy_ue_compute_prach",
"phy_enb_ulsch_msg3",
"phy_enb_ulsch_decoding0",
"phy_enb_ulsch_decoding1",
"phy_enb_ulsch_decoding2",
"phy_enb_ulsch_decoding3",
"phy_enb_ulsch_decoding4",
"phy_enb_ulsch_decoding5",
"phy_enb_ulsch_decoding6",
"phy_enb_ulsch_decoding7",
"phy_enb_sfgen",
"phy_enb_prach_rx",
"phy_enb_pdcch_tx",
"phy_enb_rs_tx",
"phy_ue_generate_prach",
"phy_ue_ulsch_modulation",
"phy_ue_ulsch_encoding",
"isip_thread0",
"isip_thread1",
"isip_thread2",
"isip_thread3",
"isip_thread4",
"isip_thread5",
"isip_thread6",
"isip_thread7",
"isip_thread8",
"isip_thread9",
"isip_thread10",
"isip_thread11",
"isip_thread12",
"isip_thread_test0",
"isip_thread_test1",
"isip_thread_test2",
"isip_thread_test3",
"isip_thread_test4",
"isip_thread_test5",
"isip_thread_test6",
"isip_thread_test7",
"isip_thread_test8",
"isip_thread_test9",
"isip_thread_test10",
"isip_thread_test11",
"isip_thread_test12",
#if 1 // add for debugging losing PDSCH immediately before and after reporting CQI
"phy_ue_ulsch_encoding_fill_cqi",
"phy_ue_ulsch_encoding_fill_cqi",
#endif
"phy_ue_ulsch_scrambling",
"phy_eNB_dlsch_modulation",
"phy_eNB_dlsch_encoding",
"phy_eNB_dlsch_encoding_w",
"phy_eNB_dlsch_scrambling",
"phy_eNB_beam_precoding",
"phy_eNB_ofdm_mod_l",
/* MAC signals */
"macxface_macphy_init",
"macxface_macphy_exit",
"macxface_eNB_dlsch_ulsch_scheduler",
"macxface_fill_rar",
"macxface_terminate_ra_proc",
"macxface_initiate_ra_proc",
"macxface_cancel_ra_proc",
"macxface_get_dci_sdu",
"macxface_get_dlsch_sdu",
"macxface_rx_sdu",
"macxface_mrbch_phy_sync_failure",
"macxface_SR_indication",
"mac_dlsch_preprocessor",
"mac_schedule_dlsch",
"mac_fill_dlsch_dci",
"macxface_out_of_sync_ind",
"macxface_ue_decode_si",
"macxface_ue_decode_pcch",
"macxface_ue_decode_ccch",
"macxface_ue_decode_bcch",
"macxface_ue_send_sdu",
"macxface_ue_get_sdu",
"macxface_ue_get_rach",
"macxface_ue_process_rar",
"macxface_ue_scheduler",
"macxface_ue_get_sr",
"ue_send_mch_sdu",
/*RLC signals */
"rlc_data_req",
// "rlc_data_ind", // this calls "pdcp_data_ind",
"mac_rlc_status_ind",
"mac_rlc_data_req",
"mac_rlc_data_ind",
"rlc_um_try_reassembly",
"rlc_um_check_timer_dar_time_out",
"rlc_um_receive_process_dar",
/* PDCP signals */
"pdcp_run",
"pdcp_data_req",
"pdcp_data_ind",
"pdcp_apply_security",
"pdcp_validate_security",
"pdcp_fifo_read",
"pdcp_fifo_read_buffer",
"pdcp_fifo_flush",
"pdcp_fifo_flush_buffer",
/* RRC signals */
"rrc_rx_tx",
"rrc_mac_config_req",
"rrc_ue_decode_sib1",
"rrc_ue_decode_si",
/* GTPV1U signals */
"gtpv1u_enb_task",
"gtpv1u_process_udp_req",
"gtpv1u_process_tunnel_data_req",
/* UDP signals */
"udp_enb_task",
/* MISC signals */
"emu_transport",
"log_record",
"itti_enqueue_message",
"itti_dump_enqueue_message",
"itti_dump_enqueue_message_malloc",
"itti_relay_thread",
"test",
/* IF4/IF5 signals */
"send_if4",
"recv_if4",
"send_if5",
"recv_if5",
"compress_if",
"decompress_if",
"phy_ue_ulsch_scrambling",
"phy_eNB_dlsch_modulation",
"phy_eNB_dlsch_encoding",
"phy_eNB_dlsch_encoding_w",
"phy_eNB_dlsch_scrambling",
"phy_eNB_beam_precoding",
"phy_eNB_ofdm_mod_l",
/* MAC signals */
"macxface_macphy_init",
"macxface_macphy_exit",
"macxface_eNB_dlsch_ulsch_scheduler",
"macxface_fill_rar",
"macxface_terminate_ra_proc",
"macxface_initiate_ra_proc",
"macxface_cancel_ra_proc",
"macxface_get_dci_sdu",
"macxface_get_dlsch_sdu",
"macxface_rx_sdu",
"macxface_mrbch_phy_sync_failure",
"macxface_SR_indication",
"mac_dlsch_preprocessor",
"mac_schedule_dlsch",
"mac_fill_dlsch_dci",
"macxface_out_of_sync_ind",
"macxface_ue_decode_si",
"macxface_ue_decode_pcch",
"macxface_ue_decode_ccch",
"macxface_ue_decode_bcch",
"macxface_ue_send_sdu",
"macxface_ue_get_sdu",
"macxface_ue_get_rach",
"macxface_ue_process_rar",
"macxface_ue_scheduler",
"macxface_ue_get_sr",
"ue_send_mch_sdu",
/*RLC signals */
"rlc_data_req",
// "rlc_data_ind", // this calls "pdcp_data_ind",
"mac_rlc_status_ind",
"mac_rlc_data_req",
"mac_rlc_data_ind",
"rlc_um_try_reassembly",
"rlc_um_check_timer_dar_time_out",
"rlc_um_receive_process_dar",
/* PDCP signals */
"pdcp_run",
"pdcp_data_req",
"pdcp_data_ind",
"pdcp_apply_security",
"pdcp_validate_security",
"pdcp_fifo_read",
"pdcp_fifo_read_buffer",
"pdcp_fifo_flush",
"pdcp_fifo_flush_buffer",
/* RRC signals */
"rrc_rx_tx",
"rrc_mac_config_req",
"rrc_ue_decode_sib1",
"rrc_ue_decode_si",
/* GTPV1U signals */
"gtpv1u_enb_task",
"gtpv1u_process_udp_req",
"gtpv1u_process_tunnel_data_req",
/* UDP signals */
"udp_enb_task",
/* MISC signals */
"emu_transport",
"log_record",
"itti_enqueue_message",
"itti_dump_enqueue_message",
"itti_dump_enqueue_message_malloc",
"itti_relay_thread",
"test",
/* IF4/IF5 signals */
"send_if4",
"recv_if4",
"send_if5",
"recv_if5",
"compress_if",
"decompress_if",
};
struct vcd_module_s vcd_modules[] = {
......
......@@ -160,9 +160,10 @@ typedef enum {
VCD_SIGNAL_DUMPER_VARIABLES_END
} vcd_signal_dump_variables;
typedef enum {
typedef enum
{
/* softmodem signals */
VCD_SIGNAL_DUMPER_FUNCTIONS_RT_SLEEP=0,
VCD_SIGNAL_DUMPER_FUNCTIONS_RT_SLEEP = 0,
VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ,
VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE,
VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF,
......@@ -185,7 +186,7 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_INCREMENT0,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_INCREMENT1,
/* RRH signals */
/* RRH signals */
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_TX,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_RX,
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_TRX,
......@@ -266,6 +267,32 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_MODULATION,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ISIP_THREAD0,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ISIP_THREAD1,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ISIP_THREAD2,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ISIP_THREAD3,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ISIP_THREAD4,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ISIP_THREAD5,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ISIP_THREAD6,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ISIP_THREAD7,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ISIP_THREAD8,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ISIP_THREAD9,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ISIP_THREAD10,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ISIP_THREAD11,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ISIP_THREAD12,
VCD_SIGNAL_DUMPER_FUNCTIONS_ISIP_THREAD_TEST0,
VCD_SIGNAL_DUMPER_FUNCTIONS_ISIP_THREAD_TEST1,
VCD_SIGNAL_DUMPER_FUNCTIONS_ISIP_THREAD_TEST2,
VCD_SIGNAL_DUMPER_FUNCTIONS_ISIP_THREAD_TEST3,
VCD_SIGNAL_DUMPER_FUNCTIONS_ISIP_THREAD_TEST4,
VCD_SIGNAL_DUMPER_FUNCTIONS_ISIP_THREAD_TEST5,
VCD_SIGNAL_DUMPER_FUNCTIONS_ISIP_THREAD_TEST6,
VCD_SIGNAL_DUMPER_FUNCTIONS_ISIP_THREAD_TEST7,
VCD_SIGNAL_DUMPER_FUNCTIONS_ISIP_THREAD_TEST8,
VCD_SIGNAL_DUMPER_FUNCTIONS_ISIP_THREAD_TEST9,
VCD_SIGNAL_DUMPER_FUNCTIONS_ISIP_THREAD_TEST10,
VCD_SIGNAL_DUMPER_FUNCTIONS_ISIP_THREAD_TEST11,
VCD_SIGNAL_DUMPER_FUNCTIONS_ISIP_THREAD_TEST12,
#if 1 // add for debugging losing PDSCH immediately before and after reporting CQI
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING_FILL_CQI,
#endif
......@@ -350,7 +377,7 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC,
VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_RELAY_THREAD,
VCD_SIGNAL_DUMPER_FUNCTIONS_TEST,
/* IF4/IF5 signals */
VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4,
VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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