PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
This commit is contained in:
@@ -64,7 +64,7 @@ int main (int argc, char *argv[])
|
||||
|
||||
Simulator::Stop (Seconds (0.005));
|
||||
|
||||
//Simulator::Run ();
|
||||
Simulator::Run ();
|
||||
|
||||
//GtkConfigStore config;
|
||||
//config.ConfigureAttributes ();
|
||||
|
||||
@@ -402,18 +402,18 @@ LteEnbMac::DoSubframeIndication (uint32_t frameNo, uint32_t subframeNo)
|
||||
|
||||
|
||||
// --- DOWNLINK ---
|
||||
// Send CQI info to the scheduler
|
||||
FfMacSchedSapProvider::SchedDlCqiInfoReqParameters cqiInfoReq;
|
||||
cqiInfoReq.m_sfnSf = ((0xFF & frameNo) << 4) | (0xF & subframeNo);
|
||||
// Send Dl-CQI info to the scheduler
|
||||
FfMacSchedSapProvider::SchedDlCqiInfoReqParameters dlcqiInfoReq;
|
||||
dlcqiInfoReq.m_sfnSf = ((0xFF & frameNo) << 4) | (0xF & subframeNo);
|
||||
|
||||
int cqiNum = m_dlCqiReceived.size ();
|
||||
if (cqiNum > MAX_CQI_LIST)
|
||||
{
|
||||
cqiNum = MAX_CQI_LIST;
|
||||
}
|
||||
cqiInfoReq.m_cqiList.insert (cqiInfoReq.m_cqiList.begin (), m_dlCqiReceived.begin (), m_dlCqiReceived.end ());
|
||||
dlcqiInfoReq.m_cqiList.insert (dlcqiInfoReq.m_cqiList.begin (), m_dlCqiReceived.begin (), m_dlCqiReceived.end ());
|
||||
m_dlCqiReceived.erase (m_dlCqiReceived.begin (), m_dlCqiReceived.end ());
|
||||
m_schedSapProvider->SchedDlCqiInfoReq (cqiInfoReq);
|
||||
m_schedSapProvider->SchedDlCqiInfoReq (dlcqiInfoReq);
|
||||
|
||||
|
||||
// Get downlink transmission opportunities
|
||||
@@ -422,6 +422,23 @@ LteEnbMac::DoSubframeIndication (uint32_t frameNo, uint32_t subframeNo)
|
||||
|
||||
|
||||
// --- UPLINK ---
|
||||
// Send UL-CQI info to the scheduler
|
||||
FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ulcqiInfoReq;
|
||||
ulcqiInfoReq.m_sfnSf = ((0xFF & frameNo) << 4) | (0xF & subframeNo);
|
||||
cqiNum = m_ulCqiReceived.size ();
|
||||
if (cqiNum >= 1)
|
||||
{
|
||||
ulcqiInfoReq.m_ulCqi = m_ulCqiReceived.at (cqiNum -1);
|
||||
if (cqiNum > 1)
|
||||
{
|
||||
// empty old ul cqi
|
||||
while (m_ulCqiReceived.size () > 0)
|
||||
{
|
||||
m_ulCqiReceived.pop_back ();
|
||||
}
|
||||
}
|
||||
m_schedSapProvider->SchedUlCqiInfoReq (ulcqiInfoReq);
|
||||
}
|
||||
|
||||
// Send BSR reports to the scheduler
|
||||
FfMacSchedSapProvider::SchedUlMacCtrlInfoReqParameters ulMacReq;
|
||||
@@ -481,8 +498,13 @@ LteEnbMac::DoReceiveIdealControlMessage (Ptr<IdealControlMessage> msg)
|
||||
|
||||
void
|
||||
LteEnbMac::DoUlCqiReport (UlCqi_s ulcqi)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << " eNB UL-CQI received");
|
||||
{
|
||||
if (ulcqi.m_type == UlCqi_s::PUSCH)
|
||||
{
|
||||
NS_LOG_DEBUG(this << " eNB rxed an PUSCH UL-CQI");
|
||||
}
|
||||
// TODO store UL-CQI to send them to scheduler
|
||||
m_ulCqiReceived.push_back (ulcqi);
|
||||
}
|
||||
|
||||
|
||||
@@ -499,21 +521,6 @@ LteEnbMac::ReceiveDlCqiIdealControlMessage (Ptr<DlCqiIdealControlMessage> msg)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LteEnbMac::ReceiveUlCqiIdealControlMessage (Ptr<UlCqiIdealControlMessage> msg)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << msg);
|
||||
|
||||
UlCqi_s ulcqi = msg->GetUlCqi ();
|
||||
if (ulcqi.m_type == UlCqi_s::PUSCH)
|
||||
{
|
||||
NS_LOG_DEBUG(this << " eNB rxed an PUSCH UL-CQI");
|
||||
}
|
||||
// TODO store UL-CQI to send them to scheduler
|
||||
//m_dlCqiReceived.push_back (dlcqi);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
LteEnbMac::ReceiveBsrMessage (MacCeListElement_s bsr)
|
||||
{
|
||||
|
||||
@@ -122,11 +122,7 @@ public:
|
||||
* \param msg the DL CQI message
|
||||
*/
|
||||
void ReceiveDlCqiIdealControlMessage (Ptr<DlCqiIdealControlMessage> msg);
|
||||
/**
|
||||
* \brief Receive a UL CQI ideal control message
|
||||
* \param msg the UL CQI message
|
||||
*/
|
||||
void ReceiveUlCqiIdealControlMessage (Ptr<UlCqiIdealControlMessage> msg);
|
||||
|
||||
void DoReceiveIdealControlMessage (Ptr<IdealControlMessage> msg);
|
||||
|
||||
/**
|
||||
@@ -187,7 +183,8 @@ private:
|
||||
// std::map <uint16_t, std::map <uint8_t,Ptr<LteMacSapUser> > > m_rlcAttached;
|
||||
std::map <lteFlowId_t, LteMacSapUser*> m_rlcAttached;
|
||||
|
||||
std::vector <CqiListElement_s> m_dlCqiReceived; // CQI received
|
||||
std::vector <CqiListElement_s> m_dlCqiReceived; // DL-CQI received
|
||||
std::vector <UlCqi_s> m_ulCqiReceived; // UL-CQI received
|
||||
std::vector <MacCeListElement_s> m_ulCeReceived; // CE received (BSR up to now)
|
||||
|
||||
|
||||
|
||||
@@ -398,7 +398,7 @@ LteEnbPhy::CreateUlCqiReport (const SpectrumValue& sinr)
|
||||
for (it = sinr.ConstValuesBegin (); it != sinr.ConstValuesEnd (); it++)
|
||||
{
|
||||
ulcqi.m_sinr.push_back ((*it));
|
||||
NS_LOG_DEBUG(this << " RB " << i << " SINR " << (*it));
|
||||
//NS_LOG_DEBUG(this << " RB " << i << " SINR " << (*it));
|
||||
i++;
|
||||
}
|
||||
return (ulcqi);
|
||||
|
||||
@@ -210,7 +210,8 @@ PfSchedulerMemberSchedSapProvider::SchedUlCqiInfoReq (const struct SchedUlCqiInf
|
||||
PfFfMacScheduler::PfFfMacScheduler ()
|
||||
: m_cschedSapUser (0),
|
||||
m_schedSapUser (0),
|
||||
m_timeWindow (0.5)
|
||||
m_timeWindow (0.5),
|
||||
m_schedTtiDelay (2) // WILD ACK: based on a m_macChTtiDelay = 1
|
||||
{
|
||||
m_cschedSapProvider = new PfSchedulerMemberCschedSapProvider (this);
|
||||
m_schedSapProvider = new PfSchedulerMemberSchedSapProvider (this);
|
||||
@@ -679,7 +680,7 @@ PfFfMacScheduler::DoSchedUlTriggerReq (const struct FfMacSchedSapProvider::Sched
|
||||
int rbAllocated = 0;
|
||||
|
||||
FfMacSchedSapUser::SchedUlConfigIndParameters ret;
|
||||
|
||||
std::vector <uint16_t> rbgAllocationMap;
|
||||
for (it = m_ceBsrRxed.begin (); it != m_ceBsrRxed.end (); it++)
|
||||
{
|
||||
if (rbAllocated + rbPerFlow > m_cschedCellConfig.m_ulBandwidth)
|
||||
@@ -687,6 +688,11 @@ PfFfMacScheduler::DoSchedUlTriggerReq (const struct FfMacSchedSapProvider::Sched
|
||||
// limit to physical resources last resource assignment
|
||||
rbPerFlow = m_cschedCellConfig.m_ulBandwidth - rbAllocated;
|
||||
}
|
||||
// store info on allocation for managing ul-cqi interpretation
|
||||
for (int i = 0; i < rbPerFlow; i++)
|
||||
{
|
||||
rbgAllocationMap.push_back ((*it).first);
|
||||
}
|
||||
UlDciListElement_s uldci;
|
||||
uldci.m_rnti = (*it).first;
|
||||
uldci.m_rbStart = rbAllocated;
|
||||
@@ -708,6 +714,7 @@ PfFfMacScheduler::DoSchedUlTriggerReq (const struct FfMacSchedSapProvider::Sched
|
||||
uldci.m_pdcchPowerOffset = 0; // not used
|
||||
ret.m_dciList.push_back (uldci);
|
||||
}
|
||||
m_allocationMaps.insert (std::pair <uint16_t, std::vector <uint16_t> > (params.m_sfnSf, rbgAllocationMap));
|
||||
m_schedSapUser->SchedUlConfigInd (ret);
|
||||
return;
|
||||
}
|
||||
@@ -763,7 +770,57 @@ void
|
||||
PfFfMacScheduler::DoSchedUlCqiInfoReq (const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters& params)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
// TODO: Implementation of the API
|
||||
//NS_LOG_DEBUG (this << " RX UL CQI at " << params.m_sfnSf);
|
||||
// correlate info on UL-CQIs with previous scheduling -> calculate m_sfnSf of transmission
|
||||
uint32_t frameNo = (0xFF & params.m_sfnSf) >> 4;
|
||||
uint32_t subframeNo = (0xF & params.m_sfnSf);
|
||||
//NS_LOG_DEBUG (this << " sfn " << frameNo << " sbfn " << subframeNo);
|
||||
if (subframeNo - m_schedTtiDelay < 0)
|
||||
{
|
||||
frameNo--;
|
||||
}
|
||||
subframeNo = (subframeNo - m_schedTtiDelay) % 10;
|
||||
//NS_LOG_DEBUG (this << " Actual sfn " << frameNo << " sbfn " << subframeNo);
|
||||
uint16_t sfnSf = ((0xFF & frameNo) << 4) | (0xF & subframeNo);
|
||||
// retrieve the allocation for this subframe
|
||||
std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
|
||||
std::map <uint16_t, std::vector <uint16_t> >::iterator itCqi;
|
||||
itMap = m_allocationMaps.find (sfnSf);
|
||||
if (itMap == m_allocationMaps.end())
|
||||
{
|
||||
NS_LOG_DEBUG (this << " Does not find info on allocation");
|
||||
return;
|
||||
}
|
||||
for (uint32_t i = 0; i < (*itMap).second.size (); i++)
|
||||
{
|
||||
//NS_LOG_DEBUG (this << " UE " << (*itMap).second.at (i) << " SINR " << params.m_ulCqi.m_sinr.at (i));
|
||||
// fixed point notation Sxxxxxxxxxxx.xxx
|
||||
itCqi = m_ueCqi.find ((*itMap).second.at (i));
|
||||
if (itCqi == m_ueCqi.end ())
|
||||
{
|
||||
// create a new entry
|
||||
std::vector <uint16_t> newCqi;
|
||||
for (uint32_t j = 0; j < m_cschedCellConfig.m_ulBandwidth; j++)
|
||||
{
|
||||
if (i==j)
|
||||
{
|
||||
newCqi.push_back (params.m_ulCqi.m_sinr.at (i));
|
||||
}
|
||||
else
|
||||
{
|
||||
newCqi.push_back (0); // TBD : put the lower possible value
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// update the value
|
||||
(*itCqi).second.at (i) = params.m_ulCqi.m_sinr.at (i);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -151,6 +151,16 @@ private:
|
||||
*/
|
||||
std::map <uint16_t,SbMeasResult_s> m_a30CqiRxed;
|
||||
|
||||
/*
|
||||
* Map of previous allocated UE per RBG
|
||||
* (used to retrieve info from UL-CQI)
|
||||
*/
|
||||
std::map <uint16_t, std::vector <uint16_t> > m_allocationMaps;
|
||||
|
||||
/*
|
||||
* Map of UEs' UL-CQI per RBG
|
||||
*/
|
||||
std::map <uint16_t, std::vector <uint16_t> > m_ueCqi;
|
||||
|
||||
/*
|
||||
* Map of UE's buffer status reports received
|
||||
@@ -169,6 +179,7 @@ private:
|
||||
|
||||
|
||||
double m_timeWindow;
|
||||
uint8_t m_schedTtiDelay; // delay between scheduling and reception (based on m_macChTtiDelay)
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user