{% extends "base.html" %} {% set active = 'registers' %} {% block title %}{{ node.name }} · DocGraph{% endblock %} {% block content %}

{{ node.name }}

qualified {{ node.qualified_name }} · doc {{ node.doc_id | short_id }} · page {{ node.location.page or '—' }} · source {{ node.attrs.get('source','heuristic') }}

{% if node.summary %}
{{ node.summary }}
{% endif %}
address
{{ node.attrs.get('address') or '—' }}
offset
{{ node.attrs.get('offset') or '—' }}
width
{{ node.attrs.get('width') or 32 }} bits
access
{{ node.attrs.get('access') or '—' }}
reset
{{ node.attrs.get('reset_value') or '—' }}

位图({{ node.attrs.get('width', 32) }} bits)

{% set width = node.attrs.get('width', 32) %} {# 自顶向下渲染,从 MSB → LSB #} {% for bit in range(width - 1, -1, -1) %} {% set claimed = namespace(bf=None) %} {% for bf in bitfields %} {% if claimed.bf is none and bf.attrs.bit_high >= bit >= bf.attrs.bit_low %} {% set claimed.bf = bf %} {% endif %} {% endfor %} {% if claimed.bf %} {% set bf = claimed.bf %}
{{ bit }} {{ bf.name }}
{% else %}
{{ bit }}
{% endif %} {% endfor %}

位域 ({{ bitfields|length }})

{% if not bitfields %}

没有位域。可能是 LLM 抽取还没覆盖;试试 docgraph review 检查置信度。

{% else %} {% for bf in bitfields %} {% endfor %}
bitsnameaccessresetdescription
{{ bf.attrs.bit_high }}:{{ bf.attrs.bit_low }} {{ bf.name }} {{ bf.attrs.access or '—' }} {{ bf.attrs.reset or '—' }} {{ bf.attrs.description | short(200) }}
{% endif %}
原始 JSON
{{ node.model_dump_json(indent=2) }}
{% endblock %}