NUCLEI PMA CONFIG GENERATOR

SETTINGS

(32-48)

REGIONS

#ATTRBASEMODEEND / SIZE
CONFIG OUTPUT

        

ADDRESS MAP

DEV CA NC CA (Default)
Priority: NC > CA > DEV

VALIDATION

IMPORT CONFIG

PARSE RESULT

--

1. 概述

本工具用于生成和编辑 Nuclei CPU IP 的 PMA(Physical Memory Attribute) 区域配置。

Generate and edit PMA (Physical Memory Attribute) region configuration for Nuclei platforms.

2. 生成模式

  • PA SIZE: 总线接口物理地址位宽,取值 32 – 48,决定地址位宽。
  • PREFIX: 配置宏前缀,如 N600,生成 CONFIG_<PREFIX>_CFG_...。
  • 区域表: 每行配置一个区域,包含区域编号、属性、基地址、结束地址或大小。
  • 区域属性: 区域的属性,可选 Cacheable、Non-Cacheable、Device 区域,对于未配置的区域,默认是 Cacheable 属性。
  • 基地址: 区域的起始地址, 地址位宽需要等于 PA SIZE。
  • 结束地址: 区域的结束地址, 默认 [BASE, END), 地址位宽需要等于 PA SIZE。
  • 区域大小: 区域的大小,支持十六进制表示 (0x1000) 或字节大小表示 (4KB)。
  • 每种属性最多 8 块,添加时自动轮换选择未满的属性。
  • 添加区域时,支持 `基地址+结束地址` 和 `基地址+区域大小` 两种模式。
  • 区域大小最小配置为 4KB。
  • 配置区域基地址和大小时需要满足 (Base & (Size - 1) == 0)

PA SIZE 32-48; PREFIX e.g. N600. Each row is a region: ATTR, BASE, and END (exclusive [BASE,END)) or SIZE (hex or 32KB/1MB). Max 8 blocks per attribute; add button rotates to the next free attribute.

3. Mask 规则

统一使用高位 MASK (0xFF000000)。

MASK 位宽需要符合 PA SIZE。

MASK 规则: (Addr & Mask) == Base。

对于导入的配置,自动将输出 MASK 格式转换为高位 MASK。

Always output 1s-leading mask (high bits 1), e.g. 'hF0000000 for 256MB. Low-mask input ('h0FFFFFFF) is auto-converted on import.

4. 地址映射

  • 正确配置的区域将显示在右侧的地址映射面板内。
  • 区域显示 区域编号、基地址、结束地址 [BASE,END]。
  • 未配置的区域默认属性为 Cacheable。
颜色含义
Device
Cacheable
Non-Cacheable
Cacheable (Default)

Vertical bar: 0x0 at bottom, address-space end at top. Block height proportional to size with a readable minimum. Light blue background = CACHEABLE (Default).

5. 修复方案

区域配置不满足对齐要求时,底部校验面板提供修复方案:

  • 包裹: 使用更大的区域包裹当前不满足对齐要求的配置。
  • 拆分: 拆分成多个满足对齐要求的小块。
  • 应用: 应用选择的方案,默认包裹方案。

WRAP (default): enclose in a larger power-of-two block. SPLIT: break into power-of-two blocks (red warning if >8). APPLY writes the fix into the region table.

6. 导入配置

导入区域配置文件,以便检查区域配置的正确性和修改区域配置。

导入区域配置之后,可以在生成页面修改区域配置。

导入配置页面支持两种导入方式:

  • 从代码导入: 从配置文件中复制对应的区域配置代码片段,粘贴到代码框中,工具将自动解析 PMA 相关配置,确认无误后,点击导入,导入至生成界面。
  • 从文件导入: 选择从文件导入,选择需要导入的 config 文件或者 verilog define 文件。工具将自动提取并解析文件中 PMA 相关的配置并显示在代码框中,确认无误后,点击导入,导入至生成界面。

工具将自动解析导入文件或代码的 PMA 相关配置,并显示在解析结果面板。使用者可以在该面板查看解析出的结果是否正确。

导入生成面板时,只会导入解析正确的区域配置,将舍弃错误的配置。

Import from a .config file or paste the PMA section. From code: paste the snippet and the tool parses the PMA-related lines; click IMPORT once verified. From file: pick a config file or a Verilog `define file; the tool extracts and parses the PMA-related lines into the code box; click IMPORT once verified. The PARSE RESULT panel shows every parsed block (ok/error/unused); only correct regions are imported, invalid ones are dropped.

7. 导出 CSV

通过地址映射面板右上角的 CSV 按钮,可以将区域配置导出为 CSV 文件。

regionattrbaseendsize_hexsize_human
CA_region0Cacheable0x100000000x200000000x10000000256 MB

EXPORT CSV (top-right of the address map) downloads regions sorted by base address: attr, base, end (exclusive), size_hex, size_human.