enb: refactor ue_max_rate() and move helper function back to sub classes

It turned out that the Amarisoft and SRS eNB scheduler produces
slightly different maximum data rates for both UL and DL.

Change-Id: I30fa7006906d101c53ba586fb06bced3945aa960
This commit is contained in:
Andre Puschmann 2020-05-27 10:37:46 +02:00
parent 487d1ef142
commit 61d150b115
3 changed files with 50 additions and 25 deletions

View File

@ -220,29 +220,4 @@ class eNodeB(log.Origin, metaclass=ABCMeta):
def addr(self):
return self._run_node.run_addr()
def ue_max_rate(self, downlink=True):
# The max rate for a single UE per PRB configuration in TM1 with MCS 28 QAM64
max_phy_rate_tm1_dl = { 6 : 3.5e6,
15 : 11e6,
25 : 18e6,
50 : 36e6,
75 : 55e6,
100 : 75e6 }
max_phy_rate_tm1_ul = { 6 : 0.9e6,
15 : 4.7e6,
25 : 10e6,
50 : 23e6,
75 : 34e6,
100 : 51e6 }
if downlink:
max_rate = max_phy_rate_tm1_dl[self.num_prb()]
else:
max_rate = max_phy_rate_tm1_ul[self.num_prb()]
#TODO: calculate for non-standard prb numbers.
if downlink and self._txmode > 2:
max_rate *= 2
return max_rate
# vim: expandtab tabstop=4 shiftwidth=4

View File

@ -233,4 +233,29 @@ class AmarisoftENB(enb.eNodeB):
rfemu_obj = rfemu.get_instance_by_type(rfemu_cfg['type'], rfemu_cfg)
return rfemu_obj
def ue_max_rate(self, downlink=True):
# The max rate for a single UE per PRB configuration in TM1 with MCS 28 QAM64
max_phy_rate_tm1_dl = { 6 : 3.2e6,
15 : 9.2e6,
25 : 18e6,
50 : 36e6,
75 : 55e6,
100 : 75e6 }
max_phy_rate_tm1_ul = { 6 : 2.0e6,
15 : 5.1e6,
25 : 10e6,
50 : 21e6,
75 : 32e6,
100 : 51e6 }
if downlink:
max_rate = max_phy_rate_tm1_dl[self.num_prb()]
else:
max_rate = max_phy_rate_tm1_ul[self.num_prb()]
# MIMO only supported for Downlink
if downlink and self._txmode > 2:
max_rate *= 2
return max_rate
# vim: expandtab tabstop=4 shiftwidth=4

View File

@ -232,4 +232,29 @@ class srsENB(enb.eNodeB):
rfemu_obj = rfemu.get_instance_by_type(rfemu_cfg['type'], rfemu_cfg)
return rfemu_obj
def ue_max_rate(self, downlink=True):
# The max rate for a single UE per PRB configuration in TM1 with MCS 28 QAM64
max_phy_rate_tm1_dl = { 6 : 3.5e6,
15 : 11e6,
25 : 18e6,
50 : 36e6,
75 : 55e6,
100 : 75e6 }
max_phy_rate_tm1_ul = { 6 : 1.7e6,
15 : 4.7e6,
25 : 10e6,
50 : 23e6,
75 : 34e6,
100 : 51e6 }
if downlink:
max_rate = max_phy_rate_tm1_dl[self.num_prb()]
else:
max_rate = max_phy_rate_tm1_ul[self.num_prb()]
# MIMO only supported for Downlink
if downlink and self._txmode > 2:
max_rate *= 2
return max_rate
# vim: expandtab tabstop=4 shiftwidth=4