Commit 65d03185 authored by francescomani's avatar francescomani

using tbslbrm at mac also for ulsch as in scf spec

parent 8fbe727b
......@@ -1200,6 +1200,10 @@ typedef struct
#define PUSCH_PDU_BITMAP_PUSCH_PTRS 0x4
#define PUSCH_PDU_BITMAP_DFTS_OFDM 0x8
typedef struct {
uint32_t tbSizeLbrmBytes;
}nfapi_v3_pusch_maintenance_parameters_t;
typedef struct
{
uint16_t pdu_bit_map;//Bitmap indicating presence of optional PDUs (see above)
......@@ -1245,7 +1249,7 @@ typedef struct
nfapi_nr_dfts_ofdm_t dfts_ofdm;
//beamforming
nfapi_nr_ul_beamforming_t beamforming;
nfapi_v3_pdsch_maintenance_parameters_t maintenance_parms_v3;
} nfapi_nr_pusch_pdu_t;
//for pucch_pdu:
......
......@@ -485,8 +485,7 @@ void nr_interleaving_ldpc(uint32_t E, uint8_t Qm, uint8_t *e,uint8_t *f);
void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f);
int nr_rate_matching_ldpc(uint8_t Ilbrm,
uint32_t Tbslbrm,
int nr_rate_matching_ldpc(uint32_t Tbslbrm,
uint8_t BG,
uint16_t Z,
uint8_t *w,
......@@ -497,8 +496,7 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm,
uint8_t rvidx,
uint32_t E);
int nr_rate_matching_ldpc_rx(uint8_t Ilbrm,
uint32_t Tbslbrm,
int nr_rate_matching_ldpc_rx(uint32_t Tbslbrm,
uint8_t BG,
uint16_t Z,
int16_t *w,
......
......@@ -373,8 +373,7 @@ void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f)
}
int nr_rate_matching_ldpc(uint8_t Ilbrm,
uint32_t Tbslbrm,
int nr_rate_matching_ldpc(uint32_t Tbslbrm,
uint8_t BG,
uint16_t Z,
uint8_t *w,
......@@ -395,7 +394,7 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm,
//Bit selection
N = (BG==1)?(66*Z):(50*Z);
if (Ilbrm == 0)
if (Tbslbrm == 0)
Ncb = N;
else {
Nref = 3*Tbslbrm/(2*C); //R_LBRM = 2/3
......@@ -457,8 +456,7 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm,
return 0;
}
int nr_rate_matching_ldpc_rx(uint8_t Ilbrm,
uint32_t Tbslbrm,
int nr_rate_matching_ldpc_rx(uint32_t Tbslbrm,
uint8_t BG,
uint16_t Z,
int16_t *w,
......@@ -484,7 +482,7 @@ int nr_rate_matching_ldpc_rx(uint8_t Ilbrm,
//Bit selection
N = (BG==1)?(66*Z):(50*Z);
if (Ilbrm == 0)
if (Tbslbrm == 0)
Ncb = N;
else {
Nref = (3*Tbslbrm/(2*C)); //R_LBRM = 2/3
......
......@@ -242,12 +242,10 @@ void ldpc8blocks( void *p) {
mod_order,nb_rb);
uint32_t Tbslbrm = rel15->maintenance_parms_v3.tbSizeLbrmBytes;
uint8_t Ilbrm = 1;
uint8_t e[E];
bzero (e, E);
nr_rate_matching_ldpc(Ilbrm,
Tbslbrm,
nr_rate_matching_ldpc(Tbslbrm,
impp->BG,
*impp->Zc,
impp->d[rr],
......
......@@ -247,8 +247,6 @@ void nr_processULSegment(void* arg) {
__m128i *pv = (__m128i*)&z;
__m128i *pl = (__m128i*)&l;
uint8_t Ilbrm = 0;
Kr = ulsch_harq->K;
Kr_bytes = Kr>>3;
K_bits_F = Kr-ulsch_harq->F;
......@@ -295,8 +293,7 @@ void nr_processULSegment(void* arg) {
//start_meas(&phy_vars_gNB->ulsch_rate_unmatching_stats);
if (nr_rate_matching_ldpc_rx(Ilbrm,
0,
if (nr_rate_matching_ldpc_rx(rdata->tbslbrm,
p_decoderParms->BG,
p_decoderParms->Z,
ulsch_harq->d[r],
......@@ -594,6 +591,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
rdata->offset = offset;
rdata->ulsch = ulsch;
rdata->ulsch_id = ULSCH_id;
rdata->tbslbrm = pusch_pdu->maintenance_parms_v3.tbSizeLbrmBytes;
pushTpool(phy_vars_gNB->threadPool,req);
phy_vars_gNB->nbDecode++;
LOG_D(PHY,"Added a block to decode, in pipe: %d\n",phy_vars_gNB->nbDecode);
......
......@@ -292,8 +292,6 @@ void nr_processDLSegment(void* arg) {
__m128i *pv = (__m128i*)&z;
__m128i *pl = (__m128i*)&l;
uint8_t Ilbrm = 1;
Kr = harq_process->K; // [hna] overwrites this line "Kr = p_decParams->Z*kb"
Kr_bytes = Kr>>3;
K_bits_F = Kr-harq_process->F;
......@@ -329,8 +327,7 @@ void nr_processDLSegment(void* arg) {
harq_process->round); */
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_IN);
if (nr_rate_matching_ldpc_rx(Ilbrm,
Tbslbrm,
if (nr_rate_matching_ldpc_rx(Tbslbrm,
p_decoderParms->BG,
p_decoderParms->Z,
harq_process->d[r],
......
......@@ -188,7 +188,6 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
uint16_t Kr=0;
uint32_t r_offset=0;
uint32_t F=0;
uint8_t Ilbrm = 0;
float Coderate = 0.0;
///////////
......@@ -378,8 +377,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC, VCD_FUNCTION_IN);
start_meas(&ue->ulsch_rate_matching_stats);
if (nr_rate_matching_ldpc(Ilbrm,
0,
if (nr_rate_matching_ldpc(0,
harq_process->BG,
*pz,
harq_process->d[r],
......
......@@ -927,6 +927,7 @@ typedef struct LDPCDecode_s {
int r_offset;
int offset;
int decodeIterations;
uint32_t tbslbrm;
} ldpcDecode_t;
struct ldpcReqId {
......
......@@ -1767,6 +1767,8 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
pusch_pdu->pusch_data.tb_size = sched_pusch->tb_size;
pusch_pdu->pusch_data.num_cb = 0; //CBG not supported
pusch_pdu->maintenance_parms_v3.tbSizeLbrmBytes = 0;
LOG_D(NR_MAC,"PUSCH PDU : data_scrambling_identity %x, dmrs_scrambling_id %x\n",pusch_pdu->data_scrambling_id,pusch_pdu->ul_dmrs_scrambling_id);
/* TRANSFORM PRECODING --------------------------------------------------------*/
......
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