Simplify DLSCH: only one codeword supported
This commit is contained in:
@@ -408,14 +408,10 @@ void init_DLSCH_struct(PHY_VARS_gNB *gNB, processingData_L1tx_t *msg)
|
|||||||
uint16_t grid_size = cfg->carrier_config.dl_grid_size[fp->numerology_index].value;
|
uint16_t grid_size = cfg->carrier_config.dl_grid_size[fp->numerology_index].value;
|
||||||
msg->num_pdsch_slot = 0;
|
msg->num_pdsch_slot = 0;
|
||||||
|
|
||||||
msg->dlsch = malloc16(gNB->max_nb_pdsch * sizeof(NR_gNB_DLSCH_t *));
|
msg->dlsch = calloc(gNB->max_nb_pdsch, sizeof(*msg->dlsch));
|
||||||
int num_cw = NR_MAX_NB_LAYERS > 4? 2:1;
|
|
||||||
for (int i = 0; i < gNB->max_nb_pdsch; i++) {
|
for (int i = 0; i < gNB->max_nb_pdsch; i++) {
|
||||||
LOG_D(PHY, "Allocating Transport Channel Buffers for DLSCH %d/%d\n", i, gNB->max_nb_pdsch);
|
LOG_D(PHY, "Allocating Transport Channel Buffers for DLSCH %d/%d\n", i, gNB->max_nb_pdsch);
|
||||||
msg->dlsch[i] = (NR_gNB_DLSCH_t *)malloc16(num_cw * sizeof(NR_gNB_DLSCH_t));
|
msg->dlsch[i] = new_gNB_dlsch(fp, grid_size);
|
||||||
for (int j = 0; j < num_cw; j++) {
|
|
||||||
msg->dlsch[i][j] = new_gNB_dlsch(fp, grid_size);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -424,12 +420,8 @@ void reset_DLSCH_struct(const PHY_VARS_gNB *gNB, processingData_L1tx_t *msg)
|
|||||||
const NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
|
const NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
|
||||||
const nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config;
|
const nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config;
|
||||||
const uint16_t grid_size = cfg->carrier_config.dl_grid_size[fp->numerology_index].value;
|
const uint16_t grid_size = cfg->carrier_config.dl_grid_size[fp->numerology_index].value;
|
||||||
int num_cw = NR_MAX_NB_LAYERS > 4? 2:1;
|
|
||||||
for (int i = 0; i < gNB->max_nb_pdsch; i++) {
|
for (int i = 0; i < gNB->max_nb_pdsch; i++) {
|
||||||
for (int j = 0; j < num_cw; j++) {
|
free_gNB_dlsch(&msg->dlsch[i], grid_size, fp);
|
||||||
free_gNB_dlsch(&msg->dlsch[i][j], grid_size, fp);
|
|
||||||
}
|
|
||||||
free(msg->dlsch[i]);
|
|
||||||
}
|
}
|
||||||
free(msg->dlsch);
|
free(msg->dlsch);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -789,7 +789,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot)
|
|||||||
size_t size_output = 0;
|
size_t size_output = 0;
|
||||||
|
|
||||||
for (int dlsch_id = 0; dlsch_id < msgTx->num_pdsch_slot; dlsch_id++) {
|
for (int dlsch_id = 0; dlsch_id < msgTx->num_pdsch_slot; dlsch_id++) {
|
||||||
NR_gNB_DLSCH_t *dlsch = msgTx->dlsch[dlsch_id];
|
NR_gNB_DLSCH_t *dlsch = &msgTx->dlsch[dlsch_id];
|
||||||
const nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->pdsch_pdu.pdsch_pdu_rel15;
|
const nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->pdsch_pdu.pdsch_pdu_rel15;
|
||||||
|
|
||||||
LOG_D(PHY,
|
LOG_D(PHY,
|
||||||
@@ -850,7 +850,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, int frame, int slot)
|
|||||||
|
|
||||||
unsigned char *output_ptr = output;
|
unsigned char *output_ptr = output;
|
||||||
for (int dlsch_id = 0; dlsch_id < msgTx->num_pdsch_slot; dlsch_id++) {
|
for (int dlsch_id = 0; dlsch_id < msgTx->num_pdsch_slot; dlsch_id++) {
|
||||||
output_ptr += do_one_dlsch(output_ptr, gNB, msgTx->dlsch[dlsch_id], slot);
|
output_ptr += do_one_dlsch(output_ptr, gNB, &msgTx->dlsch[dlsch_id], slot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
|||||||
int num_segments = 0;
|
int num_segments = 0;
|
||||||
|
|
||||||
for (int dlsch_id = 0; dlsch_id < msgTx->num_pdsch_slot; dlsch_id++) {
|
for (int dlsch_id = 0; dlsch_id < msgTx->num_pdsch_slot; dlsch_id++) {
|
||||||
NR_gNB_DLSCH_t *dlsch = msgTx->dlsch[dlsch_id];
|
NR_gNB_DLSCH_t *dlsch = &msgTx->dlsch[dlsch_id];
|
||||||
|
|
||||||
unsigned int crc = 1;
|
unsigned int crc = 1;
|
||||||
const nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->pdsch_pdu.pdsch_pdu_rel15;
|
const nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->pdsch_pdu.pdsch_pdu_rel15;
|
||||||
@@ -222,7 +222,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
|||||||
size_t dlsch_offset = 0;
|
size_t dlsch_offset = 0;
|
||||||
|
|
||||||
for (int dlsch_id = 0; dlsch_id < msgTx->num_pdsch_slot; dlsch_id++) {
|
for (int dlsch_id = 0; dlsch_id < msgTx->num_pdsch_slot; dlsch_id++) {
|
||||||
NR_gNB_DLSCH_t *dlsch = msgTx->dlsch[dlsch_id];
|
NR_gNB_DLSCH_t *dlsch = &msgTx->dlsch[dlsch_id];
|
||||||
const nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->pdsch_pdu.pdsch_pdu_rel15;
|
const nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->pdsch_pdu.pdsch_pdu_rel15;
|
||||||
|
|
||||||
nrLDPC_TB_encoding_parameters_t *TB_parameters = &TBs[dlsch_id];
|
nrLDPC_TB_encoding_parameters_t *TB_parameters = &TBs[dlsch_id];
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
void nr_fill_dlsch_dl_tti_req(processingData_L1tx_t *msgTx, nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu)
|
void nr_fill_dlsch_dl_tti_req(processingData_L1tx_t *msgTx, nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu)
|
||||||
{
|
{
|
||||||
NR_gNB_DLSCH_t *dlsch = &msgTx->dlsch[msgTx->num_pdsch_slot][0];
|
NR_gNB_DLSCH_t *dlsch = &msgTx->dlsch[msgTx->num_pdsch_slot];
|
||||||
/// DLSCH struct
|
/// DLSCH struct
|
||||||
memcpy((void*)&dlsch->pdsch_pdu, (void*)pdsch_pdu, sizeof(nfapi_nr_dl_tti_pdsch_pdu));
|
memcpy((void*)&dlsch->pdsch_pdu, (void*)pdsch_pdu, sizeof(nfapi_nr_dl_tti_pdsch_pdu));
|
||||||
AssertFatal(msgTx->num_pdsch_slot == pdsch_pdu->pdsch_pdu_rel15.pduIndex,
|
AssertFatal(msgTx->num_pdsch_slot == pdsch_pdu->pdsch_pdu_rel15.pduIndex,
|
||||||
@@ -53,7 +53,7 @@ void nr_fill_dlsch_tx_req(processingData_L1tx_t *msgTx, int idx, uint8_t *sdu)
|
|||||||
|
|
||||||
/* not sure if FAPI could transmit DL_TTI_req and TX_req in different orders.
|
/* not sure if FAPI could transmit DL_TTI_req and TX_req in different orders.
|
||||||
* for the moment, assume they are in the same order (and check!) */
|
* for the moment, assume they are in the same order (and check!) */
|
||||||
NR_gNB_DLSCH_t *dlsch = &msgTx->dlsch[idx][0];
|
NR_gNB_DLSCH_t *dlsch = &msgTx->dlsch[idx];
|
||||||
nfapi_nr_dl_tti_pdsch_pdu *pdsch = &dlsch->pdsch_pdu;
|
nfapi_nr_dl_tti_pdsch_pdu *pdsch = &dlsch->pdsch_pdu;
|
||||||
AssertFatal(pdsch->pdsch_pdu_rel15.pduIndex == idx, "PDSCH PDU index %d does not match %d\n", pdsch->pdsch_pdu_rel15.pduIndex, idx);
|
AssertFatal(pdsch->pdsch_pdu_rel15.pduIndex == idx, "PDSCH PDU index %d does not match %d\n", pdsch->pdsch_pdu_rel15.pduIndex, idx);
|
||||||
dlsch->pdu = sdu;
|
dlsch->pdu = sdu;
|
||||||
|
|||||||
@@ -580,7 +580,7 @@ typedef struct processingData_L1tx {
|
|||||||
/// corresponds to UL_dci_req->ul_dci_pdu_list
|
/// corresponds to UL_dci_req->ul_dci_pdu_list
|
||||||
nfapi_nr_dl_tti_pdcch_pdu ul_pdcch_pdu[NFAPI_NR_MAX_NB_CORESETS];
|
nfapi_nr_dl_tti_pdcch_pdu ul_pdcch_pdu[NFAPI_NR_MAX_NB_CORESETS];
|
||||||
nfapi_nr_dl_tti_csi_rs_pdu csirs_pdu[NFAPI_NR_MAX_NB_CORESETS];
|
nfapi_nr_dl_tti_csi_rs_pdu csirs_pdu[NFAPI_NR_MAX_NB_CORESETS];
|
||||||
NR_gNB_DLSCH_t **dlsch;
|
NR_gNB_DLSCH_t *dlsch;
|
||||||
nfapi_nr_dl_tti_ssb_pdu ssb_pdu[64];
|
nfapi_nr_dl_tti_ssb_pdu ssb_pdu[64];
|
||||||
int n_ssb_pdu;
|
int n_ssb_pdu;
|
||||||
int n_csirs_pdu;
|
int n_csirs_pdu;
|
||||||
|
|||||||
@@ -441,7 +441,7 @@ int main(int argc, char **argv)
|
|||||||
unsigned char harq_pid = 0; //dlsch->harq_ids[subframe];
|
unsigned char harq_pid = 0; //dlsch->harq_ids[subframe];
|
||||||
processingData_L1tx_t msgDataTx;
|
processingData_L1tx_t msgDataTx;
|
||||||
init_DLSCH_struct(gNB, &msgDataTx);
|
init_DLSCH_struct(gNB, &msgDataTx);
|
||||||
NR_gNB_DLSCH_t *dlsch = &msgDataTx.dlsch[0][0];
|
NR_gNB_DLSCH_t *dlsch = &msgDataTx.dlsch[0];
|
||||||
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->pdsch_pdu.pdsch_pdu_rel15;
|
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->pdsch_pdu.pdsch_pdu_rel15;
|
||||||
//time_stats_t *rm_stats, *te_stats, *i_stats;
|
//time_stats_t *rm_stats, *te_stats, *i_stats;
|
||||||
unsigned int TBS = 8424;
|
unsigned int TBS = 8424;
|
||||||
|
|||||||
@@ -1058,7 +1058,7 @@ int main(int argc, char **argv)
|
|||||||
n_false_positive = 0;
|
n_false_positive = 0;
|
||||||
if (n_trials== 1) num_rounds = 1;
|
if (n_trials== 1) num_rounds = 1;
|
||||||
|
|
||||||
NR_gNB_DLSCH_t *gNB_dlsch = &msgDataTx->dlsch[0][0];
|
NR_gNB_DLSCH_t *gNB_dlsch = &msgDataTx->dlsch[0];
|
||||||
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &gNB_dlsch->pdsch_pdu.pdsch_pdu_rel15;
|
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &gNB_dlsch->pdsch_pdu.pdsch_pdu_rel15;
|
||||||
|
|
||||||
for (trial = 0; trial < n_trials && !stop; trial++) {
|
for (trial = 0; trial < n_trials && !stop; trial++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user