changed dci sizes computation from lut to function

master
Ismael Gomez 8 years ago
parent 603639399c
commit 4e22667539

@ -242,7 +242,7 @@ uint32_t dci_format0_sizeof_(uint32_t nof_prb) {
uint32_t dci_format1A_sizeof(uint32_t nof_prb) {
uint32_t n;
n = 1 + 1 + riv_nbits(nof_prb) + 5 + 3 + 1 + 2 + 2;
n = 1 + 1 + riv_nbits(nof_prb) + 5 + harq_pid_len + 1 + 2 + 2;
while (n < dci_format0_sizeof_(nof_prb)) {
n++;
}
@ -262,7 +262,7 @@ uint32_t dci_format0_sizeof(uint32_t nof_prb) {
uint32_t dci_format1_sizeof(uint32_t nof_prb) {
uint32_t n = (uint32_t) ceilf((float) nof_prb / srslte_ra_type0_P(nof_prb)) + 5 + 3 + 1 + 2
uint32_t n = (uint32_t) ceilf((float) nof_prb / srslte_ra_type0_P(nof_prb)) + 5 + harq_pid_len + 1 + 2
+ 2;
if (nof_prb > 10) {
n++;
@ -318,7 +318,7 @@ uint32_t precoding_bits_f2(uint32_t nof_ports) {
}
uint32_t dci_format2_sizeof(uint32_t nof_prb, uint32_t nof_ports) {
uint32_t n = (uint32_t) ceilf((float) nof_prb / srslte_ra_type0_P(nof_prb))+2+3+1+2*(5+1+2)+precoding_bits_f2(nof_ports);
uint32_t n = (uint32_t) ceilf((float) nof_prb / srslte_ra_type0_P(nof_prb))+2+harq_pid_len+1+2*(5+1+2)+precoding_bits_f2(nof_ports);
if (nof_prb > 10) {
n++;
}
@ -338,7 +338,7 @@ uint32_t precoding_bits_f2a(uint32_t nof_ports) {
}
uint32_t dci_format2A_sizeof(uint32_t nof_prb, uint32_t nof_ports) {
uint32_t n = (uint32_t) ceilf((float) nof_prb / srslte_ra_type0_P(nof_prb))+2+3+1+2*(5+1+2)+precoding_bits_f2a(nof_ports);
uint32_t n = (uint32_t) ceilf((float) nof_prb / srslte_ra_type0_P(nof_prb))+2+harq_pid_len+1+2*(5+1+2)+precoding_bits_f2a(nof_ports);
if (nof_prb > 10) {
n++;
}
@ -350,7 +350,7 @@ uint32_t dci_format2A_sizeof(uint32_t nof_prb, uint32_t nof_ports) {
}
uint32_t dci_format2B_sizeof(uint32_t nof_prb, uint32_t nof_ports) {
uint32_t n = (uint32_t) ceilf((float) nof_prb / srslte_ra_type0_P(nof_prb))+2+3+1+2*(5+1+2);
uint32_t n = (uint32_t) ceilf((float) nof_prb / srslte_ra_type0_P(nof_prb))+2+harq_pid_len+1+2*(5+1+2);
if (nof_prb > 10) {
n++;
}
@ -457,7 +457,7 @@ int dci_format0_pack(srslte_ra_ul_dci_t *data, srslte_dci_msg_t *msg, uint32_t n
*y++ = data->cqi_request;
// Padding with zeros
uint32_t n = srslte_dci_format_sizeof_lut(SRSLTE_DCI_FORMAT0, nof_prb);
uint32_t n = srslte_dci_format_sizeof(SRSLTE_DCI_FORMAT0, nof_prb, 1);
while (y - msg->data < n) {
*y++ = 0;
}
@ -476,7 +476,7 @@ int dci_format0_unpack(srslte_dci_msg_t *msg, srslte_ra_ul_dci_t *data, uint32_t
uint32_t n_ul_hop;
/* Make sure it's a SRSLTE_DCI_FORMAT0 message */
if (msg->nof_bits != srslte_dci_format_sizeof_lut(SRSLTE_DCI_FORMAT0, nof_prb)) {
if (msg->nof_bits != srslte_dci_format_sizeof(SRSLTE_DCI_FORMAT0, nof_prb, 1)) {
fprintf(stderr, "Invalid message length for format 0\n");
return SRSLTE_ERROR;
}
@ -569,7 +569,7 @@ int dci_format1_pack(srslte_ra_dl_dci_t *data, srslte_dci_msg_t *msg, uint32_t n
srslte_bit_unpack(data->tpc_pucch, &y, 2);
// Padding with zeros
uint32_t n = srslte_dci_format_sizeof_lut(SRSLTE_DCI_FORMAT1, nof_prb);
uint32_t n = srslte_dci_format_sizeof(SRSLTE_DCI_FORMAT1, nof_prb, 1);
while (y - msg->data < n) {
*y++ = 0;
}
@ -584,7 +584,7 @@ int dci_format1_unpack(srslte_dci_msg_t *msg, srslte_ra_dl_dci_t *data, uint32_t
uint8_t *y = msg->data;
/* Make sure it's a SRSLTE_DCI_FORMAT1 message */
if (msg->nof_bits != srslte_dci_format_sizeof_lut(SRSLTE_DCI_FORMAT1, nof_prb)) {
if (msg->nof_bits != srslte_dci_format_sizeof(SRSLTE_DCI_FORMAT1, nof_prb, 1)) {
fprintf(stderr, "Invalid message length for format 1\n");
return SRSLTE_ERROR;
}
@ -714,7 +714,7 @@ int dci_format1As_pack(srslte_ra_dl_dci_t *data, srslte_dci_msg_t *msg, uint32_t
}
// Padding with zeros
uint32_t n = srslte_dci_format_sizeof_lut(SRSLTE_DCI_FORMAT1A, nof_prb);
uint32_t n = srslte_dci_format_sizeof(SRSLTE_DCI_FORMAT1A, nof_prb, 1);
while (y - msg->data < n) {
*y++ = 0;
}
@ -733,7 +733,7 @@ int dci_format1As_unpack(srslte_dci_msg_t *msg, srslte_ra_dl_dci_t *data, uint32
uint8_t *y = msg->data;
/* Make sure it's a SRSLTE_DCI_FORMAT0 message */
if (msg->nof_bits != srslte_dci_format_sizeof_lut(SRSLTE_DCI_FORMAT1A, nof_prb)) {
if (msg->nof_bits != srslte_dci_format_sizeof(SRSLTE_DCI_FORMAT1A, nof_prb, 1)) {
fprintf(stderr, "Invalid message length for format 1A\n");
return SRSLTE_ERROR;
}
@ -926,7 +926,7 @@ int dci_format1Cs_unpack(srslte_dci_msg_t *msg, srslte_ra_dl_dci_t *data, uint32
/* pack bits */
uint8_t *y = msg->data;
if (msg->nof_bits != srslte_dci_format_sizeof_lut(SRSLTE_DCI_FORMAT1C, nof_prb)) {
if (msg->nof_bits != srslte_dci_format_sizeof(SRSLTE_DCI_FORMAT1C, nof_prb, 1)) {
fprintf(stderr, "Invalid message length for format 1C\n");
return SRSLTE_ERROR;
}
@ -1204,16 +1204,16 @@ int srslte_dci_msg_get_type(srslte_dci_msg_t *msg, srslte_dci_msg_type_t *type,
uint16_t msg_rnti)
{
DEBUG("Get message type: nof_bits=%d, msg_rnti=0x%x\n", msg->nof_bits, msg_rnti);
if (msg->nof_bits == srslte_dci_format_sizeof_lut(SRSLTE_DCI_FORMAT0, nof_prb)
if (msg->nof_bits == srslte_dci_format_sizeof(SRSLTE_DCI_FORMAT0, nof_prb, 1)
&& !msg->data[0]) {
type->type = SRSLTE_DCI_MSG_TYPE_PUSCH_SCHED;
type->format = SRSLTE_DCI_FORMAT0;
return SRSLTE_SUCCESS;
} else if (msg->nof_bits == srslte_dci_format_sizeof_lut(SRSLTE_DCI_FORMAT1, nof_prb)) {
} else if (msg->nof_bits == srslte_dci_format_sizeof(SRSLTE_DCI_FORMAT1, nof_prb, 1)) {
type->type = SRSLTE_DCI_MSG_TYPE_PDSCH_SCHED; // only these 2 types supported
type->format = SRSLTE_DCI_FORMAT1;
return SRSLTE_SUCCESS;
} else if (msg->nof_bits == srslte_dci_format_sizeof_lut(SRSLTE_DCI_FORMAT1A, nof_prb)) {
} else if (msg->nof_bits == srslte_dci_format_sizeof(SRSLTE_DCI_FORMAT1A, nof_prb, 1)) {
/* The RNTI is not the only condition. Also some fields in the packet.
* if (msg_rnti >= SRSLTE_CRNTI_START && msg_rnti <= SRSLTE_CRNTI_END) {
type->type = SRSLTE_DCI_MSG_TYPE_RA_PROC_PDCCH;
@ -1224,7 +1224,7 @@ int srslte_dci_msg_get_type(srslte_dci_msg_t *msg, srslte_dci_msg_type_t *type,
type->format = SRSLTE_DCI_FORMAT1A;
//}
return SRSLTE_SUCCESS;
} else if (msg->nof_bits == srslte_dci_format_sizeof_lut(SRSLTE_DCI_FORMAT1C, nof_prb)) {
} else if (msg->nof_bits == srslte_dci_format_sizeof(SRSLTE_DCI_FORMAT1C, nof_prb, 1)) {
if (msg_rnti == SRSLTE_MRNTI) {
type->type = SRSLTE_DCI_MSG_TYPE_MCCH_CHANGE;
type->format = SRSLTE_DCI_FORMAT1C;

@ -340,7 +340,7 @@ int srslte_pdcch_decode_msg(srslte_pdcch_t *q,
} else {
ret = SRSLTE_SUCCESS;
uint32_t nof_bits = srslte_dci_format_sizeof_lut(format, q->cell.nof_prb);
uint32_t nof_bits = srslte_dci_format_sizeof(format, q->cell.nof_prb, q->cell.nof_ports);
uint32_t e_bits = PDCCH_FORMAT_NOF_BITS(location->L);
double mean = 0;

Loading…
Cancel
Save