NRRG tool update to R17(2022-12)
直接上代码,算法参见38.213 vh40 10.1节描述。
10.1 UE procedure for determining physical downlink control channel assignment
// detCcesPerPdcchCand determines the CCE indexes for aggregation level L corresponding to PDCCH candidate m of the search space set in slot n for an active DL BWP of a serving cell corresponding to carrier indicator field value n_CI For a search space set s associated with CORESET p
// p: CORESET index
// L: aggregation level
// m: PDCCH candidate index
// n: slot index
// sst: search space type, which can be type0, type0a, type1, type2, type3 or uss
// nRNTI: the n_RNTI
// NCCE: the N_CCE
// nCI: the n_CI
// Mmax: the M_max
func detCcesPerPdcchCand(p int, L int, m int, n int, sst string, nRNTI int, NCCE int, nCI int, Mmax int) ([]int, error) {
if sst == "uss" && nRNTI == 0 {
return nil, errors.New(fmt.Sprintf("For a USS, the nRNTI must not be 0!"))
}
var Y int
if sst != "uss" {
Y = 0
} else {
var Ap int
if p%3 == 0 {
Ap = 39827
} else if p%3 == 1 {
Ap = 39829
} else {
Ap = 39839
}
D := 65537
for k := -1; k <= n; k++ {
if k == -1 {
Y = nRNTI
} else {
Y = (Ap * Y) % D
}
}
}
v1 := Y + utils.FloorInt(float64(m*NCCE)/float64(L*Mmax)) + nCI
v2 := utils.FloorInt(float64(NCCE) / float64(L))
v3 := v1 % v2
var cces []int
for i := 0; i < L; i++ {
cces = append(cces, L*v3+i)
}
return cces, nil
}
用于计算CSS0 per PDCCH candidate TD/FD位置:
M, _ := strconv.Atoi(flags.gridsetting._css0NumCandidates[1:])
for m := 0; m < M; m++ {
cces, err := detCcesPerPdcchCand(0, flags.gridsetting._css0AggLevel, m, nc, "type0", 0, rgd.coreset0NumCces, 0, M)
if err != nil {
return err
}
rgd.css0PdcchCandidates[key] = append(rgd.css0PdcchCandidates[key], nrgrid.Css0PdcchCandidate{sfnc, nc, firstSymb, m, cces})
fmt.Printf("SSB/SIB1 PDCCH candidate: issb=%v, sfnc=%v, nc=%v, firstSymb=%v, m=%v, cces=%v\n", issb, sfnc, nc, firstSymb, m, cces)
}
打印如下:
issb=0, ssbLastSymbsMinus1=[1]
SSB/SIB1 PDCCH candidate: issb=0, sfnc=0, nc=5, firstSymb=0, m=0, cces=[0 1 2 3]
SSB/SIB1 PDCCH candidate: issb=0, sfnc=0, nc=5, firstSymb=0, m=1, cces=[4 5 6 7]
SSB/SIB1 PDCCH candidate: issb=0, sfnc=0, nc=6, firstSymb=0, m=0, cces=[0 1 2 3]
SSB/SIB1 PDCCH candidate: issb=0, sfnc=0, nc=6, firstSymb=0, m=1, cces=[4 5 6 7]
issb=1, ssbLastSymbsMinus1=[7]
SSB/SIB1 PDCCH candidate: issb=1, sfnc=0, nc=6, firstSymb=0, m=0, cces=[0 1 2 3]
SSB/SIB1 PDCCH candidate: issb=1, sfnc=0, nc=6, firstSymb=0, m=1, cces=[4 5 6 7]
SSB/SIB1 PDCCH candidate: issb=1, sfnc=0, nc=7, firstSymb=0, m=0, cces=[0 1 2 3]
SSB/SIB1 PDCCH candidate: issb=1, sfnc=0, nc=7, firstSymb=0, m=1, cces=[4 5 6 7]
issb=2, ssbLastSymbsMinus1=[15]
SSB/SIB1 PDCCH candidate: issb=2, sfnc=0, nc=7, firstSymb=0, m=0, cces=[0 1 2 3]
SSB/SIB1 PDCCH candidate: issb=2, sfnc=0, nc=7, firstSymb=0, m=1, cces=[4 5 6 7]
SSB/SIB1 PDCCH candidate: issb=2, sfnc=0, nc=8, firstSymb=0, m=0, cces=[0 1 2 3]
SSB/SIB1 PDCCH candidate: issb=2, sfnc=0, nc=8, firstSymb=0, m=1, cces=[4 5 6 7]
issb=3, ssbLastSymbsMinus1=[21]
SSB/SIB1 PDCCH candidate: issb=3, sfnc=0, nc=8, firstSymb=0, m=0, cces=[0 1 2 3]
SSB/SIB1 PDCCH candidate: issb=3, sfnc=0, nc=8, firstSymb=0, m=1, cces=[4 5 6 7]
SSB/SIB1 PDCCH candidate: issb=3, sfnc=0, nc=9, firstSymb=0, m=0, cces=[0 1 2 3]
SSB/SIB1 PDCCH candidate: issb=3, sfnc=0, nc=9, firstSymb=0, m=1, cces=[4 5 6 7]
版权声明:本文为jeffyko原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。