Skip to content

Add DTLB bundle and initial agent interfaces#159

Open
kennny6 wants to merge 1 commit intoXS-MLVP:mainfrom
kennny6:dtlb_env_init
Open

Add DTLB bundle and initial agent interfaces#159
kennny6 wants to merge 1 commit intoXS-MLVP:mainfrom
kennny6:dtlb_env_init

Conversation

@kennny6
Copy link

@kennny6 kennny6 commented Aug 17, 2025

Description

本 PR 为 DTLB 和 PTW 的测试环境添加了 Agent 初步实现,包括 DTLBAgent、CSRAgent、PTWAgent、ControlAgent 和 PMPAgent,以及对应的 Bundle 定义(ld_tlb_bundle.py)。这些 Agent 用于驱动和监测 DTLB 和 PTW 的功能,支持多端口并发非阻塞请求、TLB hit/miss、PTW 交互、权限异常、SFENCE 配置和 redirect 配置。主要修改包括:

  • DTLBAgent:实现 drive_request 发送 DTLB 请求,monitor_resp 和 monitor_multi_port 监测响应和请求内容。
  • CSRAgent:实现 drive_virt_config 配置虚拟化模式(SATP、VSATP、HGATP)。
  • PTWAgent:实现 drive_ptw_req 处理 PTW 请求,monitor_ptw_resp 和 monitor_requestor_resp 分离监测 PTW 和 DTLB 响应。
  • ControlAgent:实现 drive_sfence 配置 SFENCE 刷新范围,drive_redirect 配置重定向。
  • PMPAgent:实现 monitor_pmp_excp 监测 PMP 请求和 Access Fault。
  • ld_tlb_bundle.py:定义了 DTLB、PTW、CSR、PMP 和 Redirect 的 Bundle 结构,与 TLBNonBlock_top.v 接口一致。

动机:

  • 为 DTLB 和 PTW 提供全面的测试驱动和监测功能,支持多端口非阻塞、虚拟化、权限检查和 SFENCE 验证。
  • 分离 PTW 和 DTLB 响应监测,提高测试清晰度和覆盖率。
  • 支持 PMP 接口监测,验证 Access Fault 行为。

依赖:

  • Toffee 测试框架
  • TLBNonBlock_top.v 硬件模块

Type of change

Please delete options that are not relevant.

  • 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?

我已经通过脚本完成了对 DTLB Bundle 的检查,验证了新增内容的正确性:

  • 在 dut/TLBNonBlock/ 目录下运行了 bundle 检查脚本
  • 脚本能够成功解析并校验 Bundle 中定义的信号
  • 未发现错误或缺失字段

由此确认 Bundle 定义在语法和结构上均正确,可以顺利集成到测试环境中。

Test Configuration:

  • Firmware version: \
  • Hardware: 基于 TLBNonBlock_top.v 的 DTLB 模块
  • Toolchain: Toffee 测试框架
  • SDK: \

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