惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

小众软件
小众软件
IT之家
IT之家
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Security Archives - TechRepublic
Security Archives - TechRepublic
P
Proofpoint News Feed
C
CERT Recently Published Vulnerability Notes
阮一峰的网络日志
阮一峰的网络日志
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
P
Palo Alto Networks Blog
Know Your Adversary
Know Your Adversary
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Cisco Talos Blog
Cisco Talos Blog
L
Lohrmann on Cybersecurity
AWS News Blog
AWS News Blog
J
Java Code Geeks
博客园_首页
Scott Helme
Scott Helme
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
T
The Exploit Database - CXSecurity.com
Security Latest
Security Latest
V
Visual Studio Blog
Cloudbric
Cloudbric
Jina AI
Jina AI
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
A
Arctic Wolf
C
Cybersecurity and Infrastructure Security Agency CISA
S
SegmentFault 最新的问题
The Last Watchdog
The Last Watchdog
SecWiki News
SecWiki News
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
W
WeLiveSecurity
K
Kaspersky official blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Hacker News: Ask HN
Hacker News: Ask HN
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
宝玉的分享
宝玉的分享
Hugging Face - Blog
Hugging Face - Blog
量子位
Google Online Security Blog
Google Online Security Blog
博客园 - Franky
Simon Willison's Weblog
Simon Willison's Weblog
博客园 - 三生石上(FineUI控件)
Recent Commits to openclaw:main
Recent Commits to openclaw:main

博客园 - 普罗大众

debug的一个问题 phy_simulators之nr_dlsim之4层接收的优化 phy_simulators之nr_dlsim开始 phy_simulators之nr_pbchsim之PBCH解码 phy_simulators之nr_pbchsim之PBCH-DMRS检测 phy_simulators之nr_pbchsim之仿真的局限 phy_simulators之nr_pbchsim之一些结构 phy_simulators之nr_pbchsim之SSS检测 phy_simulators之nr_pbchsim之信道 phy_simulators之nr_pbchsim之初始同步 phy_simulators之nr_pbchsim之发送端 phy_simulators之nr_pbchsim之PSS检测 phy_simulators之dlsim.c debug方法三:printf debug方法二:用vs code debug方法一:直接用gdb命令 phy_simulators的编译生成方法三:CMakePresets.json phy_simulators的编译生成方法二:手动写cmake脚本 phy_simulators的编译生成方法一:build_oai --phy_simulators open air interface的phy_simultors编译过了 AI App的使用感觉 从“图像视频编码”到“通信物理层” MAC pc + Ubuntu + OAI 原来Fourier是法国的,怪不得法国小波分析这么牛 整理心情
phy_simulators之nr_dlsim之一个bug
普罗大众 · 2026-06-13 · via 博客园 - 普罗大众

跑4层接收的测试例时,发现怎么调SNR,最后都全错,而小于4层接收就没问题。百度了很多次,总算发现了一个bug,而且据说是OAI官方在2024年就发现此bug了,但为啥我用的2.4.0版本(2025年)没有纠正这个bug,奇怪。。。百度描述的bug如下

在 #if defined(__aarch64__) && defined(USE_NEON) 分支中,‌Layer 2 (tx2) 和 Layer 3 (tx3) 的数据源完全错了‌。它们重复读取了 Layer 0 和 Layer 1 的数据,导致第 3、4 层接收到的全是错误数据(实际上是第 1、2 层的副本或错位数据),这直接解释了为什么 ‌4 层接收会全部解错‌。

1. 错误分析
请看这段有问题的 NEON 代码:

c
#if defined(__aarch64__) && defined(USE_NEON)
// SIMDe doesn't handle this properly, gcc up to 14.2 neither
for (; i < (n_symbs & ~3); i += 4) {
uint32x4_t d4 = *(uint32x4_t *)(mod + i); // 加载 mod[i], mod[i+1], mod[i+2], mod[i+3]

*(uint32_t *)tx0 = vgetq_lane_u32(d4, 0); // tx0 取 mod[i] (正确: Layer 0)
tx0++;

*(uint32_t *)tx1 = vgetq_lane_u32(d4, 1); // tx1 取 mod[i+1] (正确: Layer 1)
tx1++;

// --- 错误开始 ---
*(uint32_t *)tx2 = vgetq_lane_u32(d4, 0); // tx2 取 mod[i] (错误! 应该是 mod[i+2])
tx2++;

*(uint32_t *)tx3 = vgetq_lane_u32(d4, 1); // tx3 取 mod[i+1] (错误! 应该是 mod[i+3])
tx3++;
// --- 错误结束 ---
}
#endif
预期行为‌:将交错存储的 mod 数组解映射到 4 个独立的层数组 tx0-tx3。
tx0 应获取索引 0, 4, 8...
tx1 应获取索引 1, 5, 9...
tx2 应获取索引 2, 6, 10...
tx3 应获取索引 3, 7, 11...
实际行为‌:
tx2 获取了 mod[i](即 tx0 的值)。
tx3 获取了 mod[i+1](即 tx1 的值)。
后果‌:Layer 2 和 Layer 3 的数据完全被污染。在 4 层 MIMO 解码时,接收机期望 Layer 2 和 3 携带独立的信息流,但实际收到的是 Layer 0 和 1 的重复/错位数据。这会导致信道估计和均衡完全失效,CRC 校验必然失败。
为什么 3 层没问题?‌
因为 3 层 MIMO 通常不会进入这个 case 4 分支,或者即使进入,如果代码逻辑是 case 3,它可能使用了不同的实现路径(或者标量路径),从而避开了这个特定的 NEON Bug。

2. 修复方案
你需要修改 vgetq_lane_u32 的索引,使其对应正确的数据位置。

修正后的代码:‌

c
#if defined(__aarch64__) && defined(USE_NEON)
// Fix: Correct lane indices for tx2 and tx3
for (; i < (n_symbs & ~3); i += 4) {
uint32x4_t d4 = *(uint32x4_t *)(mod + i);

*(uint32_t *)tx0 = vgetq_lane_u32(d4, 0); // mod[i]
tx0++;

*(uint32_t *)tx1 = vgetq_lane_u32(d4, 1); // mod[i+1]
tx1++;

*(uint32_t *)tx2 = vgetq_lane_u32(d4, 2); // mod[i+2] <-- 修正: 索引从 0 改为 2
tx2++;

*(uint32_t *)tx3 = vgetq_lane_u32(d4, 3); // mod[i+3] <-- 修正: 索引从 1 改为 3
tx3++;
}
#endif