qemu-register-extraction
Skill57 starsChanged 4 months agoMITView on GitHub
Use to extract a source-cited QEMU register and behavior contract from drivers, datasheets, firmware, device trees, runtime traces, and SVD, IP-XACT, SystemRDL, or vendor regfiles before modeling a hardware block.
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- qemu-agent-feedbackSkill
- qemu-board-modelingSkill
- qemu-boot-runSkill
- qemu-buildSkill
- qemu-debugSkill
- qemu-imageSkill
- qemu-kernel-buildSkill
- qemu-linux-bootSkill
- qemu-model-verificationSkill
- qemu-peripheral-modelingSkill
- qemu-qtestSkill
- qemu-rst-documentationSkill
- qemu-tcg-backendSkill
- qemu-tcg-frontendSkill
- qemu-uboot-buildSkill
- qemu-workflowSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
Before changing source or mutable artifacts, record the workspace root, revision, git status --short, pre-existing changes, goal, scope, …
- Very specific: line 31
Keep QEMU builds under source-root builds/build-<target>/.
- Very specific: line 84
Produce the handoff: Write the contract to .oh-my-qemu/<task-slug>/output/register-contract.md, with source-cited qtest candidates and …
- Distinctive: line 94
Follow driver call paths around writes.
- Very specific: line 99
Do not include C implementation templates.
- Distinctive: line 103
Do not suggest placing register definitions, backing storage, or semantics in a header.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
QEMU Register Extraction
Audit workflow
For non-trivial workspace writes, use a stable
.oh-my-qemu/<task-slug>/ directory and create only needed entries:
.oh-my-qemu/<task-slug>/
├── audit.md # Baseline, scope, decisions, evidence, verification, and gaps
├── commands.md # Redacted commands, working directories, and results
├── logs/ # Decisive build, test, runtime, or diagnostic logs
├── scripts/ # Temporary scripts, probes, parsers, and harnesses
└── output/ # Generated deliverables, dependencies, and non-QEMU binariesBefore changing source or mutable artifacts, record the workspace root,
revision, git status --short, pre-existing changes, goal, scope, and
acceptance checks in audit.md. Log exact redacted commands and results in
commands.md; record revisions, configurations, tool versions, and hashes when
they affect reproducibility. Separate observations from inferences and edit
source only when requested.
Keep QEMU builds under source-root builds/build-<target>/; put third-party
dependencies and non-QEMU binaries in task output/. Before writing audit
artifacts or configuring QEMU in a Git worktree, add .agents/,
.oh-my-qemu/, and builds/ to the repository-local file from
git rev-parse --git-path info/exclude; preserve existing entries and avoid
duplicates. Never stage or commit those directories. At handoff, verify them
absent from git status --short. Report the task directory and unresolved gaps.
QEMU upstream and research boundary
QEMU's official GitLab and mailing lists are upstream project channels. A
patch becomes an upstream contribution when sent to the mailing-list recipients
selected through MAINTAINERS; do not prepare or send agent-generated patches
for that submission. Local branches, commits, patch files, pushes, and pull
requests are not by themselves QEMU upstream contributions. Perform those Git
actions only when requested and follow the workspace's Git policy.
Summarize proprietary or copyrighted sources and cite page, section, revision, or source location; do not copy long passages.
Before extracting, read the register contract reference in full. It defines the source inventory, required facts, confidence policy, detailed output schema, and completion checklist.
Extract the contract
- Bound the target. Record the IP name/version, SoC or board variants, compatibility strings, register windows, endianness, access widths, IRQs, clocks, resets, power domains, DMA endpoints, and intended workload.
- Inventory sources. Record the exact revision or document edition plus path, line, page, section, hash, or capture command for every driver, datasheet, firmware image, DTB, regfile, and runtime trace used.
- Cross-reference facts. Tie each register or behavior to specific source locations. Treat generated headers and names as evidence, not authority.
- Extract semantics. Capture offset, width, reset, access type, masks, reserved bits, valid access sizes, aliases, banking, read/write side effects, unsupported access behavior, and version differences.
- Extract feature flows. Record initialization order, polling, IRQ and W1C paths, FIFO/timer/DMA/descriptor behavior, unlock sequences, and every cross-register enable or completion dependency.
- Resolve evidence quality. Mark each fact
HIGH,MEDIUM,LOW, orCONFLICT. Never choose silently between disagreeing sources or invent a default for a gap; name the check that could resolve it. - Record the framework decision. For every guest-visible control/status
register bank, record policy present in the target QEMU workspace, explicit
user direction and whether it is compatible, and a clear maintained nearby
subsystem convention. Apply them in that order, treating only compatible
user direction as decisive, and stop at the first decisive input. Select
RegisterInfoor justified manual MMIO callbacks; useRegisterInfowhen none decides. Keep register offsets, field macros, backing storage, framework tables, and register-local hooks in the device.cfile, not a header. - Produce the handoff. Write the contract to
.oh-my-qemu/<task-slug>/output/register-contract.md, with source-cited qtest candidates and explicit unknowns. Keep extraction/conversion scripts inscripts/and copied or generated third-party artifacts inoutput/.
Evidence rules
- Separate observed facts from inference and modeling suggestions.
- Cite source revision plus line/page/section for every decisive field or sequence.
- Follow driver call paths around writes; a scalar register can still trigger reset, DMA, IRQ, FIFO, timer, or command behavior.
- Model cross-register dependencies as named feature flows with required order, partial-state behavior, and a verification candidate.
- Preserve conflicts and unavailable sources as gaps.
- Do not include C implementation templates. The consumer must inspect the
selected framework in the checked-out QEMU tree before any local-only model
experiment, including the current
RegisterInfoAPI when that framework is selected. - Do not suggest placing register definitions, backing storage, or semantics in a header. Headers may expose only non-register-layout declarations genuinely required outside the device translation unit, such as a public QOM type or a cross-unit helper prototype.
Handoff
Report the target and variants covered, source inventory, contract path, confidence/conflict summary, missing facts, qtest candidates, and unresolved gaps. The extraction is incomplete if software-touched registers lack access semantics, side effects, source citations, or explicit unknowns.
Upstream references
- QEMU code provenance policy:
docs/devel/code-provenance.rst. RegisterInfoAPI to inspect when selected:include/hw/core/register.h,include/hw/core/registerfields.h, andhw/core/register.c.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

