NG Toolset开发笔记--NB-IoT Resource Grid(5)

100 篇文章 0 订阅
42 篇文章 1 订阅

2/9号完成fillSib2和fillSib3的coding。

2018-2-12:参照36.211和36.213规范,更新fillNbSib2和fillNbSib3。

举例说明NB-SIB2的mapping:

def fillNbSib2(self, hsfn, sfn):
        dn = str(hsfn) + '_' + str(sfn)
        if not dn in self.gridNbDl:
            self.ngwin.logEdit.append('Call NgNbiotGrid.fillHostCrs at first to initialize NgNbiotGrid.gridNbDl!')
            return
        
        #from 36.331 5.2.1.2a
        #The SI messages are transmitted within periodically occurring time domain windows (referred to as SI-windows) using scheduling information provided in SystemInformationBlockType1-NB. Each SI message is associated with a SI-window and the SI-windows of different SI messages do not overlap. That is, within one SI-window only the corresponding SI is transmitted. The length of the SI-window is common for all SI messages, and is configurable.
        #
        #Within the SI-window, the corresponding SI message can be transmitted a number of times over 2 or 8 consecutive NB-IoT downlink subframes depending on TBS. The UE acquires the detailed time/frequency domain scheduling information and other information, e.g. used transport format for the SI messages from schedulingInfoList field in SystemInformationBlockType1-NB. The UE is not required to accumulate several SI messages in parallel but may need to accumulate a SI message across multiple SI windows, depending on coverage condition.
        #
        #SI starting frame: (hsfn*1024+sfn) mod si_period = (n-1)*si_winLen/10 + si_offset
        n = 1   #ascending order in NB-SIB1 schedulingInfoList
        if (hsfn*1024+sfn)%self.args['nbSib2Period'] == (n-1)*self.args['nbSiWinLen']//10+self.args['nbSiRfOff']:
            self.resetSib2Mapping(hsfn, sfn)
        
        key = str(hsfn)+'_'+str(sfn)
        if not key in self.sib2Map:
            return
        
        slots = []
        for subf in self.sib2Map[key]:
            slots.extend([2*subf, 2*subf+1])
            
        for iap in range(self.args['nbDlAp']):
            for islot in slots:
                #2018-2-12 update
                #from 36.211 10.2.3.4
                #the index l in the first slot in a subframe fulfills l >= l_Data_Start where l_Data_Start is given by clause 16.4.1.4 of 3GPP TS 36.213 [4].
                #from 36.213 16.4.1.4
                #- if subframe k is a subframe used for receiving SIB1-NB
                #   - l_Data_Start = 3 the value of the higher layer parameter operationModeInfo is set to ’00’ or ‘01’ 
                #   - l_Data_Start = 0 otherwise
                #- else
                #   - l_Data_Start is given by the higher layer parameter eutraControlRegionSize if the value of the higher layer parameter eutraControlRegionSize is present
                #   - l_Data_Start = 0 otherwise
                for isymb in range(self.args['hostLteCfi'] if islot % 2 == 0 else 0, self.symbPerSlotNb):
                #for isymb in range(self.symbPerSlotNb):
                    for isc in range(self.scNbDl):
                        if self.gridNbDl[dn][iap][isc][islot*self.symbPerSlotNb+isymb] == NbiotResType.NBIOT_RES_BLANK.value:
                            self.gridNbDl[dn][iap][isc][islot*self.symbPerSlotNb+isymb] = NbiotResType.NBIOT_RES_SIB2.value


其中resetSib2Mapping用于构造SIB2 mapping字典

#data structure for SIB2/SIB3 mapping
        self.sib2Map = OrderedDict()   #key='hsfn_sfn', value=[list of subframes]
        self.sib3Map = OrderedDict()   #key='hsfn_sfn', value=[list of subframes]


resetSib2Mapping中会用到validateDlSubf,用于校验当前子帧是否为DL subframe:

def validateDlSubf(self, sfn, subf):
        #from 36.213 16.4
        #A NB-IoT UE shall assume a subframe as a NB-IoT DL subframe if
        #-	the UE determines that the subframe does not contain NPSS/NSSS/NPBCH/NB-SIB1 transmission, and
        #-	the subframe is configured as NB-IoT DL subframe after the UE has obtained SystemInformationBlockType1-NB.
        valid = True
        if subf == 5:   #NPSS
            valid = False
        if sfn % 2 == 0 and subf == 9:  #NSSS
            valid = False
        if subf == 0:   #NPBCH
            valid = False
        if sfn in self.sib1MapRf and subf == 4: #NB-SIB1
            valid = False
        if self.args['nbDlBitmap'][(sfn*self.subfPerRfNbDl+subf)%len(self.args['nbDlBitmap'])] == 0:    #DL bitmap
            valid = False
            
        return valid

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值