Search Knowledge

© 2026 LIBREUNI PROJECT

Computer Architecture/Synthesis and capstone
Page 19 of 20

Architecture Review

Review a design by invariants, bottlenecks, and failure modes.

Lesson briefSynthesis and capstone · 10 h · 3 outcomes

Required knowledge

  • Programming in a systems language
  • Binary arithmetic and basic digital logic

Learning outcomes

  • Audit a processor proposal by explicit ISA, timing, memory, ownership, performance, and security invariants.
  • Separate proof, simulation, benchmark, and assumption evidence in a design review.
  • Write a prioritized review decision with a counterexample and a falsifiable remediation experiment.

Assessment target

Given an incomplete architecture proposal, produce a risk-ranked review, demonstrate one failure trace, and specify acceptance evidence for the repair.

Scope boundary

  • RTL implementation and electrical device physics are reduced to the abstractions needed to reason about a modern processor.

Architecture review is a structured argument that a proposed machine satisfies its software contract under its intended workload and failure model. A block diagram can show components without proving that instruction state, memory visibility, exceptions, device ownership, and performance budgets compose. This review uses a hypothetical 4-core image-processing SoC to demonstrate the evidence a reviewer should request.

Review packet

The proposal contains an ISA summary, pipeline diagram, cache hierarchy, page-table model, DMA rings, and benchmark results. The cores are four-wide out of order, have private 32 KiB L1 caches and shared 2 MiB L2, use write-back coherence, and share DRAM. A camera writes frames through DMA; software applies a filter and sends output to a display engine. The design claims 30 frames per second and “strong consistency” without defining memory-ordering operations or the p99 latency boundary.

The first review question is scope: which claims are architectural and which are implementation assumptions? If software binaries depend on an instruction’s exact overflow or alignment behavior, that behavior belongs to the ISA. If the claim is that a loop usually hits in L1, it is a workload-dependent performance hypothesis. If a driver assumes a DMA buffer is not reused until completion, that is an ownership protocol. Each claim needs a different proof or measurement.

Review the boundary

0 / 4 answered

Why must an architecture review test both the functional contract and the performance model?

Classify each option as correct or incorrect, or leave uncertain options unanswered (“I don't know”) and verify at any time.

1
Review should omit measurements because hardware timing varies between executions
2
Functional and performance models are equivalent whenever outputs are deterministic
3
Performance measurements replace functional tests when the service deadline is strict
4
A correct design can still violate latency or bandwidth constraints

Contract completeness

Review the architectural state: registers, PC, privilege modes, memory model, exception causes, atomic operations, vector state, and device address-space attributes. For every instruction class, ask what changes and what remains unchanged. An illegal instruction must not inherit a neighbor’s write enable. A faulting load must specify whether the PC points to the faulting instruction and whether retry is legal.

Check type boundaries: signed and unsigned arithmetic, extension rules, unaligned accesses, byte order, vector tails, and floating-point rounding. An ISA that says “integer add” without overflow semantics forces compilers and debuggers to guess. A device interface that permits arbitrary access widths can create incompatible implementations.

Worked audit finding. The proposed ISA says loads return a word but does not say whether a byte load sign-extends, zero-extends, or leaves upper bits unchanged. This is a blocking defect because software cannot write a portable decoder and a compiler cannot preserve source-level signedness. The reviewer must request a precise table of width and extension behavior.

Review the refinement boundary

A review claims a speculative core is correct because its final benchmark output matches once. No trace connects speculative state to in-order architectural retirement.

Which evidence addresses the missing correctness argument?

Datapath and pipeline audit

Trace one instruction of each class through every stage. For each stage, identify its inputs, outputs, valid bit, control bundle, and side effects. Confirm that destination identifiers travel with their results and that bubbles disable all architectural writes. Check the critical path and the clock constraint using worst-case rather than average delay.

Audit hazards with adversarial sequences: dependent ALU chains, load-use pairs, branch-after-compare, back-to-back writes to one register, memory stalls, and exceptions after speculation. Ask which forwarding paths exist, which dependencies stall, and how the controller prevents deadlock. A review finding must include a trace that demonstrates the failure or a proof that the path is safe.

For out-of-order execution, inspect rename-map checkpoints, physical-register reclamation, load/store disambiguation, reorder-buffer retirement, and store visibility. The statement “execution is out of order but results are correct” is not evidence. The design needs a refinement argument to the ISA and a precise exception story.

Memory-system audit

Compute cache tag/index/offset fields from capacity, line size, and associativity. Identify conflict traces and estimate AMAT from local miss rates. Examine write-back eviction ordering, dirty state, coherence transitions, and fence semantics. A write-back cache without a coherence policy is not a complete shared-memory design: two cores may read different copies after one writes.

Review virtual-memory interaction: TLB tags or ASIDs, page-table levels, permission checks, page faults, cache aliases, invalidation, and frame reuse. A stale TLB entry after context switch is a security defect, not merely a performance problem. A page-table update without interprocessor shootdown can expose a frame to the wrong process.

Review the memory model with a message-passing test. A producer writes data then a flag; a consumer observes the flag then reads data. State which release/acquire or fence operations make the intended order visible. Coherence of each location is not enough to prove cross-location ordering.

I/O and ownership audit

The camera DMA path must specify buffer allocation, IOMMU mapping, cache synchronization, descriptor publication, completion ordering, interrupt behavior, timeout, reset, and buffer reuse. Draw the ownership states and mark which agent may write each field. A completion carrying an invalid length must be rejected before it becomes an array bound.

Audit DimensionVerification StandardFailure Mode ObservedAudit Remediation Action
MMIO AttributesStrongly-ordered, non-cacheableCache hit returns stale device status registerConfigure page table entry with Device-nGnRE / PMA I/O attributes
Side-Effect FIFO ReadNon-speculative load dispatchSpeculative load silently drains hardware FIFO entryEnforce load fence (fence r, r / lfence) before FIFO read
DMA Descriptor PublicationStrict release barrierDevice reads partially initialized descriptorInsert fence w, o (write-to-output fence) before ringing doorbell
Buffer Ownership HandshakeSingle-writer / single-readerCPU processes buffer while camera DMA writesRequire explicit generation match and ownership bit check

Review device-memory attributes. Caching a status register can return stale state; speculative reads can acknowledge a side-effect register unexpectedly. A barrier used for ordinary memory may not order a device doorbell. The driver and hardware specification must name the required primitive.

Performance and measurement audit

The proposal’s 30-frame-per-second claim should be decomposed into input, processing, output, scheduling, and queueing. Count arithmetic operations, estimate bytes moved, compute a roofline ceiling, and identify whether the design is compute- or bandwidth-bound. Then examine p50 and p99, not only average frame time. If input bursts or DMA interrupts create queueing, mean throughput can hide missed latency targets.

Benchmark methodology must state input dimensions, pixel distribution, alignment, compiler flags, warm-up, core placement, frequency, cache state, repetitions, and timing boundaries. Counters should test mechanisms: cache misses, branch misses, bandwidth, queue occupancy, and stall reasons. A review should reject “2× faster” when the baseline uses different correctness settings or excludes setup that the product must pay.

Safety and security audit

Enumerate assets and adversaries: user frames, page tables, device buffers, privileged code, and inter-core messages. Check memory-safety arithmetic, privilege boundaries, IOMMU mappings, speculative side channels, cache timing, and stale ownership. Identify the blast radius of a compromised device or driver. A security control must map to a threat and have a test or operational signal.

Hardware Security DimensionAttack Surface EvaluatedConcrete Vulnerability MechanismVerified Defense Invariant
DMA Access AuthorityPCIe bus-mastering endpointsCompromised peripheral overwrites OS page tablesHardware IOMMU enforces page-table isolation per device domain
Transient Execution LeakageBranch predictor & out-of-order executionSpectre v1 bounds-check bypass reads host memorySpeculative execution barrier (sb / lfence) on untrusted indexing
Rowhammer DRAM DisturbanceRepeated activation of adjacent DRAM rowsBit-flips induced in adjacent physical memory pagesTarget Row Refresh (TRR) enabled in DRAM controller
Fault Recovery & Privilege ContainmentBus error / ECC double-bit parity trapKernel panic or uncontained privilege escalationSynchronous Machine Check Exception (MCE) kills only faulting task

Check fault containment: illegal instruction, page fault, ECC error, DMA overrun, device timeout, thermal throttling, and power loss. For each, state whether the processor retries, kills a process, resets a device, degrades service, or enters a machine-check path. An architecture that only describes the happy path is incomplete.

Review decision and evidence levels

Classify findings as blocking correctness defects, unverified assumptions, performance risks, or maintainability concerns. A design decision is strong when it has a precise invariant, a worked trace or proof, an experiment plan, and a rollback or recovery story. “The simulator passed” is evidence only for the tested traces and simulator model. “The benchmark improved” is evidence only for the stated workload and measurement boundary.

Worked decision. The proposal uses write-back private L1 caches but gives no coherence protocol. Reject as incomplete because a two-core program can write a shared location and observe stale values, violating the memory model. A revision must specify a protocol, fence interaction, invalidation/ownership transitions, and tests for write-write, read-after-write, false sharing, and eviction. The reviewer should not approve the design merely because single-core benchmarks pass.

Required review report

Construct a one-page architecture claim table, a block and sequence diagram, three adversarial traces, two quantitative models, a threat model, and a list of open assumptions. For every claim, label evidence as theorem/proof, simulation, benchmark, specification, or expert judgment. Include one finding you expect the design team to disagree with and the measurement that would settle it.

Before signing off, perform a boundary review. Ask what happens at zero and maximum lengths, the first and last cache line, a branch taken at a page boundary, an exception after a younger DMA request, a context switch while a TLB entry is cached, a device reset while a descriptor is in flight, and a power failure after a storage acknowledgement. These cases expose whether the design has a real state model or only a collection of nominal diagrams. Record the expected architectural observation and the internal mechanism that enforces it for each case.

The final review meeting should separate disagreement about a requirement from disagreement about an implementation. If two reviewers disagree about whether a frame may be dropped, first resolve the service contract; if they agree on the contract but disagree about a cache or DMA mechanism, compare evidence against the invariant. This prevents architecture review from becoming a preference contest and makes the decision reversible when a measured assumption changes.

Section Exercises

Deep Practice

Solve these problems to test and consolidate your understanding. Complete worked solutions and diagnostic hints are available for each problem.

Exercise 5.3.1: ISA Width, Extension, and Exception Contract Audit

Verificationapplication

A proposed 64-bit ISA manual defines LB rd, offset(rs1) as “loads one byte from effective address rs1 + offset into rd”, omits unaligned-access fault rules for LW/LD, and leaves EPC unspecified when a data TLB miss traps during a speculative load. Identify the three blocking contract defects and write the exact architectural state rules needed to close them.

HintExpand

Check upper-bit semantics in the 64-bit destination register, alignment fault behavior, and precise exception state.

Worked solutionExpand
  1. Upper-bit extension ambiguity: The manual must distinguish signed sign-extension (LB: bits 63..8 filled with bit 7) from unsigned zero-extension (LBU: bits 63..8 zeroed); leaving upper bits undefined or preserved prevents portable compilation of int8_t vs. uint8_t.
  2. Alignment contract omission: For multi-byte loads (LW, LD), specify whether unaligned addresses trap with an alignment fault or split atomically/non-atomically across cache lines, and define the trap vector and memory side-effect guarantee.
  3. Imprecise trap specification: On a data TLB miss, the ISA must enforce precise exceptions: EPC records the faulting load’s PC, rd remains unmodified, and younger speculative instructions are squashed before architectural commitment.

Exercise 5.3.2: Out-of-Order Speculative Store and Forwarding Audit

Verificationapplication

A four-wide out-of-order core verifies single-cycle branch prediction recovery in simulation, yet allows executed stores to write L1 cache lines before reaching the head of the reorder buffer (ROB) and forwards from the store buffer by matching only word-aligned addresses without byte-mask checking. Construct an adversarial instruction sequence demonstrating architectural failure for each flaw and state the hardware invariants that fix them.

HintExpand

Trace a store younger than a faulting load for early L1 writes, and a partial byte store followed by a wider load for forwarding.

Worked solutionExpand
  1. Premature store write trace: Suppose instruction I1I_1 (LD x1, 0(x2)) raises a page fault while younger I2I_2 (SW x3, 0(x4)) writes L1 early. When I1I_1 traps at ROB retirement, architectural memory already contains I2I_2‘s speculative store, violating precise exceptions and potentially corrupting shared data visible to other cores or DMA. Invariant: Stores remain buffered in a speculative store queue and commit to L1 only upon reaching the non-faulting head of the ROB.
  2. Width-blind forwarding trace: Suppose I1I_1 (SB x5, 0(x10)) writes byte 0 while I2I_2 (LW x6, 0(x10)) reads all four bytes [0..3]. Word-address-only matching either returns x5 with stale/zero upper bytes or fails to merge bytes [1..3] from L1. Invariant: Store-to-load forwarding requires full containment of the load’s byte mask within the matching store’s byte mask (or stalling/merging byte-by-byte from L1).

Exercise 5.3.3: Weakly Ordered Message-Passing Failure Trace and Fence Repair

Constructiontransfer

Given Core 0 executing M[data] = 42; M[flag] = 1; and Core 1 executing while (M[flag] == 0); r1 = M[data]; on a weakly ordered multicore processor with coherent caches (initially M[data] = 0, M[flag] = 0), construct a trace showing how r1 == 0 can occur and specify the architectural ordering repair.

HintExpand

Coherence guarantees single-address serialization, not cross-address store-to-store or load-to-load ordering across data and flag.

Worked solutionExpand
  1. Failure trace without barriers: Even with hardware cache coherence (MESI), Core 0’s store buffer or interconnect can make the write M[flag] = 1 visible to Core 1 before M[data] = 42 drains, or Core 1’s out-of-order load unit can speculatively read M[data] (observing 0) before the loop exits on M[flag] == 1.
  2. Architectural repair: Core 0 must issue a release store (stlr or fence w, w between the stores to data and flag), and Core 1 must issue an acquire load (ldar or fence r, r after observing M[flag] == 1 and before reading M[data]).

Exercise 5.3.4: Camera DMA Ownership Invariant and MMIO Attribute Audit

Formalisationtransfer

In the camera SoC proposal, the driver maps MMIO device status and read-to-clear FIFO registers as normal write-back cacheable memory and updates the DMA ring tail doorbell immediately after writing descriptor fields in cached DRAM. Identify two correctness/hardware corruption failures this causes and formulate the memory-attribute, ordering, and IOMMU isolation invariants required for a sound I/O interface.

HintExpand

Examine stale/speculative MMIO reads, descriptor publication order across memory/I/O domains, and device physical address bounds.

Worked solutionExpand
  1. MMIO cacheable failure: Caching status registers returns stale values from L1 instead of live device state, while speculative loads into a read-to-clear FIFO register silently drain queued hardware words on mispredicted paths. Invariant: Map all MMIO register ranges with strongly ordered, non-cacheable, non-speculative attributes (Device-nGnRE / I/O PMA) and guard side-effect reads with load barriers (fence r, r / lfence).
  2. Doorbell race & DMA isolation: Without a write-to-output barrier and cache flush (on non-coherent DMA), the device can fetch uninitialized descriptor bytes after seeing the doorbell write; without an IOMMU, a corrupted descriptor can target kernel page tables. Invariant: Flush/clean descriptor lines if non-coherent, issue fence w, o before ringing the MMIO doorbell, verify buffer generation/ownership tags on completion, and confine device bus mastering through an IOMMU page-table domain covering only active frame buffers.

Exercise 5.3.5: Separating Throughput Averages from p99 Latency and Roofline Evidence

Generalisationsynthesis

The review packet claims the 30 fps / 25 ms p99 latency SLO is met because mean frame latency is 21.5 ms21.5\text{ ms} 46.5 fps46.5\text{ fps} and cites a 2.1×2.1\times speedup over a scalar baseline compiled at -O0. Explain why neither metric establishes the SLO or microarchitectural claim, and design a falsifiable measurement protocol using latency distributions, hardware counters, and roofline arithmetic intensity.

HintExpand

Compare mean vs. tail percentiles under jitter, critique unoptimized baselines, and bind DRAM traffic to frame latency ceilings.

Worked solutionExpand
  1. Why mean and -O0 evidence fail: A 21.5 ms21.5\text{ ms} mean easily violates a 25 ms25\text{ ms} p99 bound whenever DMA interrupts, TLB shootdowns, or DRAM refresh/queueing create a heavy tail (e.g., 5% of frames taking 35 ms35\text{ ms} Comparing against -O0 attributes basic register allocation and dead-code removal to the proposed hardware.
  2. Falsifiable measurement protocol:
    • Benchmark against an -O3/vectorized reference implementation with pinned frequencies, warm-up policy, and fixed input resolution 1920×10801920 \times 1080 RGBA).
    • Record full per-frame latency percentiles p50,p95,p99,p99.9p_{50}, p_{95}, p_{99}, p_{99.9} across ≥1,000\ge 1{,}000 contiguous frames with concurrent camera DMA load.
    • Collect hardware counters (retired ops, DRAM CAS read/write bytes, L1/L2 miss stalls, TLB misses) to compute measured operational intensity ops/byte\text{ops}/\text{byte} on the roofline model and verify which stage bounds p99p_{99}

References & Further Reading