Skip to content

add coverage mapping, fix internal signal access, improve line covera…#193

Open
Gui-Yue wants to merge 1 commit intoXS-MLVP:mainfrom
Gui-Yue:fix_iprefetchpipe
Open

add coverage mapping, fix internal signal access, improve line covera…#193
Gui-Yue wants to merge 1 commit intoXS-MLVP:mainfrom
Gui-Yue:fix_iprefetchpipe

Conversation

@Gui-Yue
Copy link
Contributor

@Gui-Yue Gui-Yue commented Feb 28, 2026

Description

本 PR 主要针对 IPrefetchPipe 验证的稳定性与覆盖率可追踪性进行修复和优化。

变更摘要

  • 在 watch_point.py 中补充覆盖反标(mark_function),将覆盖 bin 与对应测试函数建立映射。
  • 修复 iprefetchpipe_test.py 内部信号读取稳定性问题:
    • 增加安全读取逻辑(缓存可用信号名)。
    • 增加 wrapper/top-level IO 路径兜底。
  • 在不新增测试用例的前提下优化现有用例刺激时序,提高行覆盖:
    • 调整 test_mshr_interaction_apis 中类别5的刺激顺序,使 MSHR/waymask 相关分支可稳定命中。
  • 修复部分原先不稳定/失败的验证检查,提升回归稳定性。

覆盖说明(未覆盖行的合理性)

  • 当前仍未覆盖的主要是 IPrefetchPipe.v 中 initial begin 下 if (reset) 初始化分支(如 697-741 行)。
  • 该分支属于仿真 time0 初始化路径,判断时机早于测试激励进入;在现有 DUT 封装与测试框架下,运行期通过测试激励无法可靠触发该路径。
  • 因此该未覆盖属于“启动阶段结构性不可达”,不影响运行期功能验证结论。
    本 PR 已优先补齐运行期功能相关分支覆盖并保证回归稳定通过。

背景与动机

此前 IPrefetchPipe 验证存在:

  • 内部信号读取失败;
  • 分支覆盖依赖时序窗口,命中不稳定;
  • 部分检查偶发失败,影响回归一致性。

本 PR 通过增强可观测性和优化刺激时序,提升验证稳定性与覆盖质量。

依赖

  • 无新增外部依赖。

Fixes # N/A

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

使用代理环境执行:
export http_proxy=http://127.0.0.1:7897 https_proxy=http://127.0.0.1:7897

复现命令:
make test target=ut_frontend/icache/iprefetchpipe/

测试结果:

  • 全量回归通过:22 passed。
  • 全量回归:ut_frontend/icache/iprefetchpipe/

Test Configuration:

  • Firmware version: N/A
  • Hardware: x86_64 Linux 主机
  • Toolchain: Python 3.10.12 + pytest 8.3.5 + toffee-test 相关插件
  • SDK: N/A

Checklist:

  • My code follows the style guidelines of this project
  • I have added the appropriate labels
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant