add TTI field to MAC dl/ul grants and fix PCAP to include TTI

This commit is contained in:
Andre Puschmann 2019-10-02 15:34:05 +02:00
parent d73965e887
commit c7f0caa24a
7 changed files with 14 additions and 9 deletions

View File

@ -338,6 +338,7 @@ public:
uint32_t pid; uint32_t pid;
uint16_t rnti; uint16_t rnti;
bool is_sps_release; bool is_sps_release;
uint32_t tti;
} mac_grant_dl_t; } mac_grant_dl_t;
typedef struct { typedef struct {
@ -346,6 +347,7 @@ public:
uint16_t rnti; uint16_t rnti;
bool phich_available; bool phich_available;
bool hi_value; bool hi_value;
uint32_t tti_tx;
} mac_grant_ul_t; } mac_grant_ul_t;
typedef struct { typedef struct {

View File

@ -93,7 +93,7 @@ public:
void pdcch_to_crnti(bool is_new_uplink_transmission); void pdcch_to_crnti(bool is_new_uplink_transmission);
void timer_expired(uint32_t timer_id); void timer_expired(uint32_t timer_id);
void new_grant_dl(mac_interface_phy_lte::mac_grant_dl_t grant, mac_interface_phy_lte::tb_action_dl_t* action); void new_grant_dl(mac_interface_phy_lte::mac_grant_dl_t grant, mac_interface_phy_lte::tb_action_dl_t* action);
void tb_decoded_ok(); void tb_decoded_ok(const uint32_t tti);
void start_noncont(uint32_t preamble_index, uint32_t prach_mask); void start_noncont(uint32_t preamble_index, uint32_t prach_mask);
bool contention_resolution_id_received(uint64_t uecri); bool contention_resolution_id_received(uint64_t uecri);

View File

@ -342,6 +342,7 @@ void cc_worker::dl_phy_to_mac_grant(srslte_pdsch_grant_t*
/* Fill MAC dci structure */ /* Fill MAC dci structure */
mac_grant->pid = dl_dci->pid; mac_grant->pid = dl_dci->pid;
mac_grant->rnti = dl_dci->rnti; mac_grant->rnti = dl_dci->rnti;
mac_grant->tti = CURRENT_TTI;
for (int i = 0; i < SRSLTE_MAX_CODEWORDS; i++) { for (int i = 0; i < SRSLTE_MAX_CODEWORDS; i++) {
mac_grant->tb[i].ndi = dl_dci->tb[i].ndi; mac_grant->tb[i].ndi = dl_dci->tb[i].ndi;
@ -711,6 +712,7 @@ void cc_worker::ul_phy_to_mac_grant(srslte_pusch_grant_t*
mac_grant->tb.tbs = phy_grant->tb.tbs / (uint32_t)8; mac_grant->tb.tbs = phy_grant->tb.tbs / (uint32_t)8;
mac_grant->tb.rv = phy_grant->tb.rv; mac_grant->tb.rv = phy_grant->tb.rv;
mac_grant->pid = pid; mac_grant->pid = pid;
mac_grant->tti_tx = CURRENT_TTI_TX;
} }
int cc_worker::decode_pdcch_ul() int cc_worker::decode_pdcch_ul()

View File

@ -345,13 +345,14 @@ void dl_harq_entity::dl_harq_process::dl_tb_process::tb_decoded(mac_interface_ph
if (ack) { if (ack) {
if (is_bcch) { if (is_bcch) {
if (harq_entity->pcap) { if (harq_entity->pcap) {
harq_entity->pcap->write_dl_sirnti(payload_buffer_ptr, cur_grant.tb[tid].tbs, ack, 0); harq_entity->pcap->write_dl_sirnti(payload_buffer_ptr, cur_grant.tb[tid].tbs, ack, cur_grant.tti);
} }
Debug("Delivering PDU=%d bytes to Dissassemble and Demux unit (BCCH)\n", cur_grant.tb[tid].tbs); Debug("Delivering PDU=%d bytes to Dissassemble and Demux unit (BCCH)\n", cur_grant.tb[tid].tbs);
harq_entity->demux_unit->push_pdu_bcch(payload_buffer_ptr, cur_grant.tb[tid].tbs); harq_entity->demux_unit->push_pdu_bcch(payload_buffer_ptr, cur_grant.tb[tid].tbs);
} else { } else {
if (harq_entity->pcap) { if (harq_entity->pcap) {
harq_entity->pcap->write_dl_crnti(payload_buffer_ptr, cur_grant.tb[tid].tbs, cur_grant.rnti, ack, 0); harq_entity->pcap->write_dl_crnti(
payload_buffer_ptr, cur_grant.tb[tid].tbs, cur_grant.rnti, ack, cur_grant.tti);
} }
if (cur_grant.rnti == harq_entity->rntis->temp_rnti) { if (cur_grant.rnti == harq_entity->rntis->temp_rnti) {
Debug("Delivering PDU=%d bytes to Dissassemble and Demux unit (Temporal C-RNTI)\n", cur_grant.tb[tid].tbs); Debug("Delivering PDU=%d bytes to Dissassemble and Demux unit (Temporal C-RNTI)\n", cur_grant.tb[tid].tbs);

View File

@ -407,14 +407,14 @@ void mac::tb_decoded(uint32_t cc_idx, mac_grant_dl_t grant, bool ack[SRSLTE_MAX_
{ {
if (SRSLTE_RNTI_ISRAR(grant.rnti)) { if (SRSLTE_RNTI_ISRAR(grant.rnti)) {
if (ack[0]) { if (ack[0]) {
ra_procedure.tb_decoded_ok(); ra_procedure.tb_decoded_ok(grant.tti);
} }
} else if (grant.rnti == SRSLTE_PRNTI) { } else if (grant.rnti == SRSLTE_PRNTI) {
// Send PCH payload to RLC // Send PCH payload to RLC
rlc_h->write_pdu_pcch(pch_payload_buffer, grant.tb[0].tbs); rlc_h->write_pdu_pcch(pch_payload_buffer, grant.tb[0].tbs);
if (pcap) { if (pcap) {
pcap->write_dl_pch(pch_payload_buffer, grant.tb[0].tbs, true, phy_h->get_current_tti()); pcap->write_dl_pch(pch_payload_buffer, grant.tb[0].tbs, true, grant.tti);
} }
} else { } else {

View File

@ -164,7 +164,6 @@ void ra_proc::step(uint32_t tti_)
*/ */
void ra_proc::state_pdcch_setup() void ra_proc::state_pdcch_setup()
{ {
phy_interface_mac_lte::prach_info_t info = phy_h->prach_get_info(); phy_interface_mac_lte::prach_info_t info = phy_h->prach_get_info();
if (info.is_transmitted) { if (info.is_transmitted) {
ra_tti = info.tti_ra; ra_tti = info.tti_ra;
@ -393,9 +392,10 @@ void ra_proc::new_grant_dl(mac_interface_phy_lte::mac_grant_dl_t grant, mac_inte
/* Called upon the successful decoding of a TB addressed to RA-RNTI. /* Called upon the successful decoding of a TB addressed to RA-RNTI.
* Processes the reception of a RAR as defined in 5.1.4 * Processes the reception of a RAR as defined in 5.1.4
*/ */
void ra_proc::tb_decoded_ok() { void ra_proc::tb_decoded_ok(const uint32_t tti)
{
if (pcap) { if (pcap) {
pcap->write_dl_ranti(rar_pdu_buffer, rar_grant_nbytes, ra_rnti, true, 0); pcap->write_dl_ranti(rar_pdu_buffer, rar_grant_nbytes, ra_rnti, true, tti);
} }
rDebug("RAR decoded successfully TBS=%d\n", rar_grant_nbytes); rDebug("RAR decoded successfully TBS=%d\n", rar_grant_nbytes);

View File

@ -286,7 +286,7 @@ void ul_harq_entity::ul_harq_process::new_grant_ul(mac_interface_phy_lte::mac_gr
} else { } else {
rnti = harq_entity->rntis->crnti; rnti = harq_entity->rntis->crnti;
} }
harq_entity->pcap->write_ul_crnti(pdu_ptr, grant.tb.tbs, rnti, get_nof_retx(), 0); harq_entity->pcap->write_ul_crnti(pdu_ptr, grant.tb.tbs, rnti, get_nof_retx(), grant.tti_tx);
} }
} else if (has_grant()) { } else if (has_grant()) {
// Non-Adaptive Re-Tx // Non-Adaptive Re-Tx