Commit 81398971 authored by cig's avatar cig

Set tb_size in bytes and A in bits @ UE

- now is consistent for both UE and gNB
parent 9ac6dfee
...@@ -248,7 +248,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch, ...@@ -248,7 +248,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
crc = 1; crc = 1;
harq_process = ulsch->harq_processes[harq_pid]; harq_process = ulsch->harq_processes[harq_pid];
nb_rb = harq_process->pusch_pdu.rb_size; nb_rb = harq_process->pusch_pdu.rb_size;
A = harq_process->pusch_pdu.pusch_data.tb_size; A = harq_process->pusch_pdu.pusch_data.tb_size*8;
pz = &Z; pz = &Z;
mod_order = nr_get_Qm_ul(harq_process->pusch_pdu.mcs_index, harq_process->pusch_pdu.mcs_table); mod_order = nr_get_Qm_ul(harq_process->pusch_pdu.mcs_index, harq_process->pusch_pdu.mcs_table);
R = nr_get_code_rate_ul(harq_process->pusch_pdu.mcs_index, harq_process->pusch_pdu.mcs_table); R = nr_get_code_rate_ul(harq_process->pusch_pdu.mcs_index, harq_process->pusch_pdu.mcs_table);
......
...@@ -405,7 +405,7 @@ int main(int argc, char **argv) ...@@ -405,7 +405,7 @@ int main(int argc, char **argv)
rel15_ul->pusch_data.rv_index = rvidx; rel15_ul->pusch_data.rv_index = rvidx;
rel15_ul->nrOfLayers = Nl; rel15_ul->nrOfLayers = Nl;
rel15_ul->target_code_rate = code_rate; rel15_ul->target_code_rate = code_rate;
rel15_ul->pusch_data.tb_size = TBS>>3; rel15_ul->pusch_data.tb_size = TBS/8;
/////////////////////////////////////////////////// ///////////////////////////////////////////////////
double *modulated_input = malloc16(sizeof(double) * 16 * 68 * 384); // [hna] 16 segments, 68*Zc double *modulated_input = malloc16(sizeof(double) * 16 * 68 * 384); // [hna] 16 segments, 68*Zc
...@@ -441,7 +441,7 @@ int main(int argc, char **argv) ...@@ -441,7 +441,7 @@ int main(int argc, char **argv)
harq_process_ul_ue->pusch_pdu.nr_of_symbols = nb_symb_sch; harq_process_ul_ue->pusch_pdu.nr_of_symbols = nb_symb_sch;
harq_process_ul_ue->num_of_mod_symbols = N_RE_prime*nb_rb*nb_codewords; harq_process_ul_ue->num_of_mod_symbols = N_RE_prime*nb_rb*nb_codewords;
harq_process_ul_ue->pusch_pdu.pusch_data.rv_index = rvidx; harq_process_ul_ue->pusch_pdu.pusch_data.rv_index = rvidx;
harq_process_ul_ue->pusch_pdu.pusch_data.tb_size = TBS; harq_process_ul_ue->pusch_pdu.pusch_data.tb_size = TBS/8;
harq_process_ul_ue->a = &test_input[0]; harq_process_ul_ue->a = &test_input[0];
} }
......
...@@ -710,14 +710,14 @@ int main(int argc, char **argv) ...@@ -710,14 +710,14 @@ int main(int argc, char **argv)
available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, number_dmrs_symbols, mod_order, 1); available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, number_dmrs_symbols, mod_order, 1);
TBS = nr_compute_tbs(mod_order, code_rate, nb_rb, nb_symb_sch, nb_re_dmrs * number_dmrs_symbols, 0, 0, precod_nbr_layers); TBS = nr_compute_tbs(mod_order, code_rate, nb_rb, nb_symb_sch, nb_re_dmrs * number_dmrs_symbols, 0, 0, precod_nbr_layers);
pusch_pdu->pusch_data.tb_size = TBS>>3; pusch_pdu->pusch_data.tb_size = TBS/8;
ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.tb_size = TBS; ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.tb_size = TBS/8;
nr_fill_ulsch(gNB,frame,slot,pusch_pdu); nr_fill_ulsch(gNB,frame,slot,pusch_pdu);
int slot_offset = frame_parms->get_samples_slot_timestamp(slot,frame_parms,0);// - (int)(800*factor); int slot_offset = frame_parms->get_samples_slot_timestamp(slot,frame_parms,0);// - (int)(800*factor);
int slot_length = slot_offset - frame_parms->get_samples_slot_timestamp(slot-1,frame_parms,0); int slot_length = slot_offset - frame_parms->get_samples_slot_timestamp(slot-1,frame_parms,0);
for (int i=0;i<(TBS>>3);i++) ulsch_ue[0]->harq_processes[harq_pid]->a[i]=i&0xff; for (int i=0;i<(TBS/8);i++) ulsch_ue[0]->harq_processes[harq_pid]->a[i]=i&0xff;
double scale = 1; double scale = 1;
if (input_fd == NULL) { if (input_fd == NULL) {
......
...@@ -189,7 +189,7 @@ void nr_config_Msg3_pdu(NR_UE_MAC_INST_t *mac, ...@@ -189,7 +189,7 @@ void nr_config_Msg3_pdu(NR_UE_MAC_INST_t *mac,
nb_dmrs_re_per_rb*number_dmrs_symbols, nb_dmrs_re_per_rb*number_dmrs_symbols,
N_PRB_oh, N_PRB_oh,
0, // TBR to verify tb scaling 0, // TBR to verify tb scaling
pusch_config_pdu->nrOfLayers); pusch_config_pdu->nrOfLayers)/8;
} }
......
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