Added Periodic CQI to PUSCH. Fixed PUSCH not shortened when SRS RB are contiguous to PUSCH RB

master
ismagom 10 years ago
parent e693e454d2
commit 0c398130c9

@ -259,6 +259,11 @@ void mac::main_radio_loop() {
ul_buffer->generate_sr(); ul_buffer->generate_sr();
} }
if (phy_h->cqi_is_ready_to_send(tti+4)) {
ul_buffer->generate_cqi_report();
}
// The UL buffer is released when successfully transmitted. // The UL buffer is released when successfully transmitted.
if (ul_buffer->is_released()) { if (ul_buffer->is_released()) {
ul_buffer->ready(); ul_buffer->ready();

@ -124,9 +124,11 @@ public:
void start_trace(); void start_trace();
void write_trace(std::string filename); void write_trace(std::string filename);
void main_radio_loop(); bool sr_is_ready_to_send(uint32_t tti);
bool sr_is_ready_to_send(uint32_t tti); bool cqi_is_ready_to_send(uint32_t tti);
void main_radio_loop();
private: private:
enum { enum {
IDLE, RXTX IDLE, RXTX

@ -93,6 +93,12 @@ namespace ue {
SRS_CS_ACKNACKSIMUL, SRS_CS_ACKNACKSIMUL,
SRS_IS_CONFIGURED, SRS_IS_CONFIGURED,
CQI_PERIODIC_PMI_IDX,
CQI_PERIODIC_SIMULT_ACK,
CQI_PERIODIC_FORMAT_SUBBAND,
CQI_PERIODIC_FORMAT_SUBBAND_K,
CQI_PERIODIC_CONFIGURED,
UCI_I_OFFSET_ACK, UCI_I_OFFSET_ACK,
UCI_I_OFFSET_RI, UCI_I_OFFSET_RI,
UCI_I_OFFSET_CQI, UCI_I_OFFSET_CQI,

@ -195,6 +195,19 @@ int phy::sr_last_tx_tti() {
} }
} }
bool phy::cqi_is_ready_to_send(uint32_t tti)
{
/*
if (params_db.get_param(phy_params::CQI_PERIODIC_CONFIGURED)) {
if (srslte_cqi_send(params_db.get_param(phy_params::CQI_PERIODIC_PMI_IDX), tti)) {
Warning("Sending PUCCH CQI\n");
return true;
}
}
*/
return false;
}
bool phy::sr_is_ready_to_send(uint32_t tti_) { bool phy::sr_is_ready_to_send(uint32_t tti_) {
if (sr_enabled) { if (sr_enabled) {
// Get I_sr parameter // Get I_sr parameter

@ -98,7 +98,10 @@ void ul_buffer::set_current_tx_nb(uint32_t current_tx_nb_)
bool ul_buffer::generate_cqi_report() bool ul_buffer::generate_cqi_report()
{ {
return false; uci_data.uci_cqi_len = 4;
uint8_t cqi[4] = {1, 1, 1, 1};
uci_data.uci_cqi = cqi;
return true;
} }
bool ul_buffer::generate_sr() { bool ul_buffer::generate_sr() {
@ -216,6 +219,13 @@ bool ul_buffer::generate_data(ul_sched_grant *grant, srslte_softbuffer_tx_t *sof
int n = 0; int n = 0;
// Transmit on PUSCH if UL grant available, otherwise in PUCCH // Transmit on PUSCH if UL grant available, otherwise in PUCCH
if (grant) { if (grant) {
if (params_db->get_param(phy_params::CQI_PERIODIC_CONFIGURED)) {
if (srslte_cqi_send(params_db->get_param(phy_params::CQI_PERIODIC_PMI_IDX), tti)) {
generate_cqi_report();
}
}
srslte_pusch_hopping_cfg_t pusch_hopping_cfg; srslte_pusch_hopping_cfg_t pusch_hopping_cfg;
bzero(&pusch_hopping_cfg, sizeof(srslte_pusch_hopping_cfg_t)); bzero(&pusch_hopping_cfg, sizeof(srslte_pusch_hopping_cfg_t));

@ -94,4 +94,7 @@ SRSLTE_API int srslte_cqi_format2_subband_pack(srslte_cqi_format2_subband_t *msg
uint8_t *buff, uint8_t *buff,
uint32_t buff_len); uint32_t buff_len);
SRSLTE_API bool srslte_cqi_send(uint32_t I_cqi_pmi,
uint32_t tti);
#endif // CQI_ #endif // CQI_

@ -75,3 +75,51 @@ int srslte_cqi_format2_subband_pack(srslte_cqi_format2_subband_t *msg, uint8_t *
return 4+1; return 4+1;
} }
bool srslte_cqi_send(uint32_t I_cqi_pmi, uint32_t tti) {
uint32_t N_p = 0;
uint32_t N_offset = 0;
if (I_cqi_pmi <= 1) {
N_p = 2;
N_offset = I_cqi_pmi;
} else if (I_cqi_pmi <= 6) {
N_p = 5;
N_offset = I_cqi_pmi - 2;
} else if (I_cqi_pmi <= 16) {
N_p = 10;
N_offset = I_cqi_pmi - 7;
} else if (I_cqi_pmi <= 36) {
N_p = 20;
N_offset = I_cqi_pmi - 17;
} else if (I_cqi_pmi <= 76) {
N_p = 40;
N_offset = I_cqi_pmi - 37;
} else if (I_cqi_pmi <= 156) {
N_p = 80;
N_offset = I_cqi_pmi - 77;
} else if (I_cqi_pmi <= 316) {
N_p = 160;
N_offset = I_cqi_pmi - 157;
} else if (I_cqi_pmi == 317) {
return false;
} else if (I_cqi_pmi <= 349) {
N_p = 32;
N_offset = I_cqi_pmi - 318;
} else if (I_cqi_pmi <= 413) {
N_p = 64;
N_offset = I_cqi_pmi - 350;
} else if (I_cqi_pmi <= 541) {
N_p = 128;
N_offset = I_cqi_pmi - 414;
} else if (I_cqi_pmi <= 1023) {
return false;
}
if ((tti-N_offset)%N_p == 0) {
return true;
} else {
return false;
}
}

@ -335,10 +335,18 @@ int srslte_pusch_cfg(srslte_pusch_t *q, srslte_pusch_cfg_t *cfg, srslte_dci_msg_
if (srslte_refsignal_srs_send_cs(srs_cfg->subframe_config, tti%10) == 1 && if (srslte_refsignal_srs_send_cs(srs_cfg->subframe_config, tti%10) == 1 &&
srslte_refsignal_srs_send_ue(srs_cfg->I_srs, tti) == 1) srslte_refsignal_srs_send_ue(srs_cfg->I_srs, tti) == 1)
{ {
printf("PUSCH shorteneed for SRS UE transmission\n");
q->shortened = true; q->shortened = true;
/* If RBs are contiguous, PUSCH is not shortened */
uint32_t k0_srs = srslte_refsignal_srs_rb_start_cs(srs_cfg->bw_cfg, q->cell.nof_prb);
uint32_t nrb_srs = srslte_refsignal_srs_rb_L_cs(srs_cfg->bw_cfg, q->cell.nof_prb);
for (uint32_t ns=0;ns<2 && q->shortened;ns++) {
if (cfg->grant.n_prb_tilde[ns] != k0_srs + nrb_srs) {
q->shortened = false;
}
}
} }
// If not coincides with UE transmission. PUSCH shall be shortened if cell-specific SRS transmission RB coincides with PUSCH allocated RB // If not coincides with UE transmission. PUSCH shall be shortened if cell-specific SRS transmission RB
//coincides with PUSCH allocated RB
if (!q->shortened) { if (!q->shortened) {
uint32_t k0_srs = srslte_refsignal_srs_rb_start_cs(srs_cfg->bw_cfg, q->cell.nof_prb); uint32_t k0_srs = srslte_refsignal_srs_rb_start_cs(srs_cfg->bw_cfg, q->cell.nof_prb);
uint32_t nrb_srs = srslte_refsignal_srs_rb_L_cs(srs_cfg->bw_cfg, q->cell.nof_prb); uint32_t nrb_srs = srslte_refsignal_srs_rb_L_cs(srs_cfg->bw_cfg, q->cell.nof_prb);
@ -348,15 +356,10 @@ int srslte_pusch_cfg(srslte_pusch_t *q, srslte_pusch_cfg_t *cfg, srslte_dci_msg_
cfg->grant.n_prb_tilde[ns] + cfg->grant.L_prb < k0_srs + nrb_srs)) cfg->grant.n_prb_tilde[ns] + cfg->grant.L_prb < k0_srs + nrb_srs))
{ {
q->shortened = true; q->shortened = true;
printf("CS n_prb=%d, L=%d, k0=%d, nrb=%d\n", cfg->grant.n_prb_tilde[ns], cfg->grant.L_prb, k0_srs, nrb_srs);
} }
} }
} }
} }
if (q->shortened) {
printf("PUSCH is shortened TTI=%d\n", tti);
}
} }
/* Compute final number of bits and RE */ /* Compute final number of bits and RE */

Loading…
Cancel
Save