AMBA AHB · Module 3
HPROT
The AHB protection-and-attribute signal — the classic four HPROT bits (opcode/data, user/privileged, bufferable, cacheable), the AHB5 extensions, and why HPROT is an advisory hint scoped to its consumers.
This chapter covers HPROT, the protection-and-attribute signal — the last of the address-phase control signals. Unlike HADDR, HSIZE, or HTRANS, which every access must get right, HPROT is advisory: it carries hints about the nature of the access (is it an instruction fetch or data? privileged or user? cacheable? bufferable?) that some parts of the system act on and many ignore. Understanding HPROT means understanding which signals are mandatory for correctness versus hints for features — a distinction that matters for both design and debugging. We give the classic four-bit encoding, note the AHB5 extensions, and clarify exactly who consumes HPROT and who does not.
1. What Is It?
HPROT is an address-phase signal, driven by the manager, carrying protection and memory-attribute information about the access. The classic encoding is four bits, each a binary attribute:
- HPROT[0] — opcode/data: 0 = an instruction (opcode) fetch, 1 = a data access.
- HPROT[1] — user/privileged: 0 = a user-mode access, 1 = a privileged access.
- HPROT[2] — bufferable: 0 = non-bufferable, 1 = bufferable (a write buffer may hold it).
- HPROT[3] — cacheable: 0 = non-cacheable, 1 = cacheable (a cache may store it).
The defining property of HPROT is that it is a hint, not a command. A plain memory or peripheral can completely ignore HPROT and still function correctly — the access works regardless. HPROT exists for the parts of the system that care about the access's nature: protection units (which look at privilege), and caches/memory controllers (which look at cacheable/bufferable). The newer AHB5 revision extends HPROT with additional memory-attribute bits (modifiable, allocate hints, shareability), but the classic four are the foundation.
2. Why Does It Exist?
HPROT exists because some system features need to know the nature of an access — not just where it goes and how big it is, but what kind of access it is — and the manager is the only one who knows that.
Consider the features that need this:
- Protection. A memory-protection unit enforcing privilege separation needs to know whether an access is privileged or user to decide whether to allow it — a user-mode access to a privileged region should be blocked. Only the manager (the processor) knows the current privilege level, so it must communicate it. HPROT[1] carries it.
- Caching. A cache or memory system needs to know whether a region is cacheable to decide whether to cache the data, and whether it is bufferable to decide whether a write can be held in a write buffer rather than completing immediately. These attributes depend on what the region is (normal memory vs a device register), which the manager's memory system knows. HPROT[2] and [3] carry them.
- Instruction vs data. Some systems treat instruction fetches differently from data accesses (separate caches, different protection). HPROT[0] distinguishes them.
So HPROT exists to let the manager describe the access's character to the parts of the system that act on character. The reason it is a separate, advisory signal — rather than folded into mandatory control — is that most of the bus does not care: a simple SRAM does not care whether an access is cacheable, it just stores or returns the data. Making HPROT advisory lets simple subordinates ignore it entirely while letting sophisticated ones use it, without burdening every access with mandatory attribute handling. It is the signal that carries optional richness about an access for the features that want it.
3. Mental Model
Model HPROT as the handling instructions on a package, separate from the address.
A package has a mandatory address (HADDR) and contents (the data), but it may also carry handling stickers — "fragile," "this side up," "perishable," "authorized personnel only." These are HPROT: hints about how to treat the package. A basic warehouse (a simple subordinate) ignores the stickers and just stores the package. But a specialized handler (a protection unit, a cache) reads them: the "authorized personnel only" sticker (privilege) makes a security checkpoint allow or refuse the package; the "perishable" sticker (cacheable/bufferable) makes a smart depot decide whether to keep a fast-access copy. The package gets delivered either way; the stickers only change behaviour for handlers that read them.
Watch HPROT travel with an access:
HPROT alongside the access (opcode fetch, then data access)
3 cyclesThe model's lesson: HPROT is handling instructions that travel with each access; consumers that care read them, the rest ignore them. The access happens regardless; HPROT only shapes how privilege-aware and cache-aware logic treats it.
4. Real Hardware Perspective
In hardware, HPROT is a manager output that a few specialized blocks decode and most subordinates leave unconnected.
A protection unit (often sitting in the interconnect or in front of certain subordinates) decodes HPROT[1] (privilege) along with the address to decide whether the access is permitted; if a user-mode access targets a privileged-only region, the protection unit blocks it, typically returning an error response. A cache uses HPROT[3] (cacheable) to decide whether to allocate a line for the data, and a write buffer or memory controller uses HPROT[2] (bufferable) to decide whether a write may be acknowledged before it fully completes. These consumers wire up the HPROT bits they care about.
A simple subordinate — a basic SRAM, a straightforward peripheral — typically leaves HPROT unconnected. It does not need to know whether the access is cacheable or privileged; it just performs the read or write. This is the practical meaning of "advisory": the signal exists on the bus, but a subordinate is free to ignore it, and most do. The hardware cost of HPROT is therefore borne only by the consumers that use it; everyone else simply does not connect it.
A key hardware point: because HPROT is advisory, forgetting to drive it correctly does not break a plain access — but it can break a security or caching feature. A manager that drove the wrong privilege level on HPROT[1] might allow an access a protection unit should have blocked (a security hole) or get blocked when it should be allowed. A wrong cacheable bit might cause stale data (caching something that should not be cached) or lost performance. So while HPROT is advisory for correctness of the transfer, it is mandatory for correctness of the features that depend on it — a subtle but important distinction in hardware design and verification.
5. System Architecture Perspective
At the system level, HPROT is the bus-level carrier of two important system concerns: security/isolation and memory attributes — and it connects AHB to the processor's view of memory.
Security and isolation. Modern systems separate privileged (operating system, secure) software from user (application) software, and enforce that user code cannot access privileged resources. HPROT[1] is how that privilege level reaches the bus: the processor drives it according to the mode it is executing in, and a protection unit on the bus enforces the access rules. So HPROT is a building block of system security — a memory-protection or system-MPU scheme relies on managers driving HPROT[1] truthfully and protection units enforcing on it. In security-sensitive systems, HPROT (and its AHB5 extensions) become genuinely important, not optional.
Memory attributes. A processor's memory system classifies regions: normal cacheable memory, non-cacheable device regions, bufferable vs strongly-ordered, and so on. These classifications must reach the bus so that caches and memory controllers behave correctly — you must not cache a device register (its value changes outside the processor) and you may cache normal memory. HPROT[2] and [3] carry these attributes per access, derived from the region's classification in the processor's memory configuration. So HPROT is how the processor's memory-attribute map is communicated to the interconnect and memory system on every access — essential for correct caching and ordering behaviour.
The AHB5 extension. As systems grew more sophisticated (richer memory types, finer cache control, security states), the classic four HPROT bits were not enough, and AHB5 extended HPROT with additional attribute bits and added related signals. This reflects HPROT's growing system importance: what began as a small advisory field became, in modern secure and cache-coherent systems, a richer description of each access's memory and security properties. So at the system level, HPROT has trended from "optional hint" toward "important attribute channel," especially where security and caching matter.
The architectural takeaway: HPROT is where AHB connects to the system-level concerns of who is allowed to access what (security) and how data should be treated (memory attributes). In a simple microcontroller it may be largely ignored; in a secure, cache-coherent system it is central.
6. Engineering Tradeoffs
HPROT's design embodies a clear "optional richness" tradeoff.
- Advisory vs mandatory. Making HPROT advisory lets simple subordinates ignore it (saving logic and integration effort) while letting sophisticated ones use it. The cost is the subtlety that "advisory" is scoped — it is mandatory-for-correctness wherever a consumer exists, which can trip up designers who treat it as always-ignorable. The trade is simplicity for the common case versus a correctness nuance for the feature case.
- Carrying attributes on the bus vs configuring them centrally. HPROT carries attributes per access, which is flexible (each access can differ) but means the manager must drive them correctly every time. The alternative — a central region-attribute table consulted by the interconnect — would relieve the manager but be less flexible. AHB carries them on the access (driven from the processor's memory map), trading manager-side responsibility for per-access flexibility.
- Four bits vs extensibility. The classic four bits keep HPROT small and cheap, sufficient for simple systems, at the cost of not expressing richer memory types — which is exactly why AHB5 had to extend it. The trade is initial simplicity versus future richness, resolved by starting small and extending when systems demanded it.
- Security via HPROT vs separate mechanisms. Using HPROT[1] for privilege folds basic protection into the existing bus signalling (cheap, integrated) but ties security to the manager driving it truthfully and the protection unit enforcing it. More robust isolation (e.g. full secure/non-secure separation) needed additional mechanisms beyond the single privilege bit — which is part of why AHB5 and related security architectures extended the model. The trade is lightweight integrated protection versus stronger dedicated security.
The through-line: HPROT trades mandatory simplicity for optional richness. It lets the common case (a simple subordinate) ignore it while giving security and caching features the per-access information they need — and it grew (AHB5) as those features demanded more. The engineering subtlety is remembering that "advisory" does not mean "can be wrong" wherever a consumer exists.
7. Industry Example
Trace HPROT through a few accesses on a system that has both a protection unit and a cache.
- A privileged instruction fetch. The processor, running OS code, fetches an instruction. It drives HPROT[0]=0 (opcode), HPROT[1]=1 (privileged), and the cacheable/bufferable bits per the code region's attributes (code is typically cacheable). The protection unit sees privileged and allows the access to the privileged code region; the instruction cache, seeing cacheable, may allocate a line. The fetch's character is fully described to both consumers.
- A user data access to a privileged region (blocked). Now user-mode application code attempts to read a privileged-only peripheral. The processor drives HPROT[1]=0 (user). The protection unit, decoding HPROT[1] and the address, sees a user access to a privileged region and blocks it, returning an error response. HPROT[1] is exactly what let the protection unit catch this — a security enforcement that depends entirely on the privilege bit being driven truthfully.
- A data access to a device register (non-cacheable). The processor reads a hardware status register. The memory map classifies this region as a device, so the processor drives HPROT[3]=0 (non-cacheable). The cache, seeing non-cacheable, does not store the value — correctly, because the register's value can change outside the processor, and caching it would return stale data. HPROT[3] prevented a coherency bug.
- A simple SRAM access. The same accesses, when they reach a plain SRAM, are handled identically regardless of HPROT — the SRAM ignores it and just reads or writes. HPROT shaped the behaviour of the protection unit and cache, but the SRAM neither needs nor uses it.
Every access carries its HPROT character, and the consumers that care — protection unit, cache — act on it, while the simple memory ignores it. The blocked user access and the uncached device read are HPROT doing its real, important work in a system that consumes it.
8. Common Mistakes
9. Interview Insight
HPROT questions test whether you understand the advisory-but-scoped nature and the bit meanings.
The answer that lands gives the bits and nails the advisory nuance: "HPROT is an address-phase signal carrying attribute hints — classically four bits: opcode vs data, user vs privileged, bufferable, and cacheable, with AHB5 adding more. It's advisory: a simple subordinate can ignore it and still work. But it's only advisory for the plain transfer — wherever a protection unit consumes the privilege bit or a cache consumes the cacheable bit, HPROT is mandatory-correct, because getting it wrong is a security or coherency bug." That scoped understanding of "advisory" is the senior signal.
10. Practice Challenge
Reason from the bit meanings and the scoped-advisory nature.
- Decode the bits. Give the meaning of each classic HPROT bit (0–3) and both its values.
- Mandatory or hint? Classify HADDR, HWRITE, HSIZE, HTRANS, and HPROT as mandatory-for-correctness or advisory, and explain HPROT's special scoping.
- Trace a block. Describe how a protection unit uses HPROT to block a user-mode access to a privileged region.
- Caching decision. Explain why a device register region must be marked non-cacheable and what goes wrong if it is not.
- Spot the security bug. A protection unit fails to block a forbidden access. Name the two HPROT-related causes and the fix.
11. Key Takeaways
- HPROT is an address-phase signal carrying attribute hints, classically four bits: opcode/data [0], user/privileged [1], bufferable [2], cacheable [3]. AHB5 extends it.
- It is advisory for the plain transfer — a simple subordinate can ignore it and still work correctly; most do, leaving it unconnected.
- 'Advisory' is scoped: wherever a consumer exists, HPROT is mandatory-correct. HPROT[1] is security-critical with a protection unit; HPROT[3] affects coherency with a cache.
- Cacheable [3] (may a cache store it) and bufferable [2] (may a write buffer hold it) are different attributes controlling different mechanisms.
- HPROT connects AHB to system security and memory attributes — privilege enforcement and cache/buffer behaviour — derived from the processor's mode and memory map.
- Getting HPROT wrong where it is consumed causes security or coherency bugs, not harmless misbehaviour — the most important practical point about it.
12. What Comes Next
You have now covered every address-phase signal. The module turns to the data and handshake signals — beginning with the data buses themselves:
- 3.7 — HWDATA & HRDATA (coming next) — the separate write- and read-data buses, their width, validity timing, and byte-lane use.
- 3.8 — HREADY & HREADYOUT (coming soon) — the critical distinction between the shared HREADY input and each subordinate's HREADYOUT output.
To revisit the address phase HPROT belongs to, see The Address / Control Phase and the other address-phase signals HADDR & HWRITE, HTRANS, HSIZE, and HBURST. For the broader protocol map, see the AMBA family overview.