Commit e6804be9 authored by Sakthivel Velumani's avatar Sakthivel Velumani

created worker threads

parent 6042df1a
...@@ -252,6 +252,8 @@ typedef struct { ...@@ -252,6 +252,8 @@ typedef struct {
int16_t e[MAX_NUM_NR_DLSCH_SEGMENTS][3*8448]; int16_t e[MAX_NUM_NR_DLSCH_SEGMENTS][3*8448];
/// Number of bits in each code block after rate matching for LDPC code (38.212 V15.4.0 section 5.4.2.1) /// Number of bits in each code block after rate matching for LDPC code (38.212 V15.4.0 section 5.4.2.1)
uint32_t E; uint32_t E;
/// Number of segments processed so far
uint32_t processedSegments;
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
...@@ -463,6 +465,36 @@ typedef struct { ...@@ -463,6 +465,36 @@ typedef struct {
uint8_t cl_done; uint8_t cl_done;
} NR_gNB_PUSCH; } NR_gNB_PUSCH;
typedef struct LDPCDecode_s {
PHY_BARS_gNB *gNB;
NR_UL_gNB_HARQ_t *ulsch_harq;
t_nrLDPC_dec_params *p_decoderParms;
short* ulsch_llr;
int harq_pid;
int rv_index;
int A;
int E;
int Kc;
int Qm;
int nbSegments;
int segment_r;
int r_offset;
int Tbslbrm;
int decodeIterations;
} ldpcDecode_t
struct ldpcReqId {
uint16_t rnti;
uint16_t frame;
uint8_t subframe;
uint8_t codeblock;
uint16_t spare;
} __attribute__((packed));
union ldpcReqUnion {
struct ldpcReqId s;
uint64_t p;
};
/// Context data structure for RX/TX portion of slot processing /// Context data structure for RX/TX portion of slot processing
typedef struct { typedef struct {
...@@ -802,6 +834,9 @@ typedef struct PHY_VARS_gNB_s { ...@@ -802,6 +834,9 @@ typedef struct PHY_VARS_gNB_s {
time_stats_t rx_dft_stats; time_stats_t rx_dft_stats;
time_stats_t ulsch_freq_offset_estimation_stats; time_stats_t ulsch_freq_offset_estimation_stats;
*/ */
notifiedFIFO_t *respDecode;
tpool_t *threadPool;
int nbDecode;
} PHY_VARS_gNB; } PHY_VARS_gNB;
......
...@@ -225,6 +225,17 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, ...@@ -225,6 +225,17 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
*/ */
void nr_postDecode(PHY_VARS_gNB gNB, notifiedFIFO_elt_t *req) {
ldpcDecode_t *rdata = (ldpcDeocde_t*) NotifiedFifoData(req);
NR_UL_gNB_HARQ_t ulsch_harq = rdata->ulsch_harq;
bool decodeSuccess = (rdata->deocdeIterations <= rdata->p_decoderParms->numMaxIter);
ulsch_harq->processedSegments++;
LOG_D(PHY, "processing result of segment: %d, processed %d/%d\n",
rdata->segment_r, ulsch_harq->processedSegments, rdata->nbSegments);
proc->nbDecode--;
LOG_D(PHY,"remain to decoded in subframe: %d\n", proc->nbDecode);
void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH_id, uint8_t harq_pid) void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH_id, uint8_t harq_pid)
{ {
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms; NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
...@@ -282,17 +293,22 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH ...@@ -282,17 +293,22 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
//---------------------------------------------------------- //----------------------------------------------------------
start_meas(&gNB->ulsch_decoding_stats); start_meas(&gNB->ulsch_decoding_stats);
ret = nr_ulsch_decoding(gNB, nr_ulsch_decoding(gNB,
ULSCH_id, ULSCH_id,
gNB->pusch_vars[ULSCH_id]->llr, gNB->pusch_vars[ULSCH_id]->llr,
frame_parms, frame_parms,
pusch_pdu, pusch_pdu,
frame_rx, frame_rx,
slot_rx, slot_rx,
harq_pid, harq_pid,
G); G);
stop_meas(&gNB->ulsch_decoding_stats); stop_meas(&gNB->ulsch_decoding_stats);
while (gNB->nbDecode > 0) {
notifiedFIFO_elt_t *req=pullTpool(gNB->respDecode, gNB->threadPool);
nr_postDecode(gNB, req);
delNotifiedFIFO_elt(req);
}
if (ret > gNB->ulsch[ULSCH_id][0]->max_ldpc_iterations){ if (ret > gNB->ulsch[ULSCH_id][0]->max_ldpc_iterations){
LOG_D(PHY, "ULSCH %d in error\n",ULSCH_id); LOG_D(PHY, "ULSCH %d in error\n",ULSCH_id);
......
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