Interviews
Protocols Interview Questions
Practise the question, then the follow-ups an interviewer asks next.
Start with a Question TreeAI Mock Interview
- 50
- Question trees
- 357
- Follow-ups
- 216
- Wrong answers explained
- 42
- Runnable on a simulator
Browse by Track
Flagship Questions · With follow-ups
Question Trees
Each question opens into the follow-ups an interviewer asks next, the wrong answers people give, and what a fresher's and a senior's answer sound like.
-
AHB Address and Data Phases
What does it mean that AHB is pipelined? Draw three back-to-back zero-wait writes. 20 follow-ups · 12 pitfalls · 3 runnable- Asked at NVIDIA
- Likely at Broadcom
- Likely at Micron
-
AHB Wait States, HREADY and HREADYOUT
A subordinate inserts two wait states on a read. What happens on the bus during those cycles? And what is the difference between HREADY and HREADYOUT? 8 follow-ups · 4 pitfalls · 1 runnable -
The Write That Happened on IDLE
A register reads back correctly right after a write, but two cycles later the same read returns 0. Between the reads the manager drove IDLE and left the last address and control on the bus. What is the bug? 6 follow-ups · 3 pitfalls · 1 runnable -
The Two-Cycle AHB ERROR
Why does an AHB ERROR response take two cycles when OKAY takes one? 5 follow-ups · 5 pitfalls · 1 runnable -
AHB Decoder, Multiplexor and Default Subordinate
Build the interconnect for one AHB manager and three subordinates. What does the decoder do, what drives the read multiplexor's select, and why do you need a default subordinate? 11 follow-ups · 7 pitfalls · 2 runnable- Likely at Infineon
-
AHB Bursts and the 1 KB Rule
List the AHB burst types. Where does a WRAP4 of words starting at 0x34 go, and what rule must an incrementing burst respect? 6 follow-ups · 4 pitfalls · 1 runnable -
The APB Setup and Access Phases
Draw an APB write with no wait states, then one with a wait state. What happens in each cycle, and what is the shortest an APB transfer can be? 18 follow-ups · 9 pitfalls · 1 runnable- Asked at NVIDIA
- Likely at Broadcom
- Likely at Intel
-
Stale APB Read Data
A register read-back test fails only on the peripheral that adds wait states. Every read returns zero or the previous value. The writes look right on the waveform. Where do you look first? 10 follow-ups · 4 pitfalls · 1 runnable -
PSLVERR and What It Promises
When is PSLVERR valid? And if a write gets PSLVERR, was the register written or not? 5 follow-ups · 4 pitfalls · 1 runnable -
Why Registers Live on APB
Your SoC already has an AXI interconnect. Why put the UART, timer and GPIO registers behind an APB bridge, instead of giving each one an AXI port? 10 follow-ups · 5 pitfalls -
Designing an AXI-to-APB Bridge
Design an AXI4-to-APB bridge. What must it do, which decisions are yours, and how would you verify it? 6 follow-ups · 3 pitfalls- Likely at Qualcomm
- Likely at Samsung
-
The Five AXI Channels
AXI has five channels. Name them, say who drives each, and tell me why reads and writes are kept apart. 9 follow-ups · 4 pitfalls- Likely at NVIDIA
- Likely at Microchip
- Likely at Broadcom
-
Write Data Before the Write Address
Can write data arrive at a subordinate before its write address? And when may the subordinate raise BVALID? 5 follow-ups · 2 pitfalls · 1 runnable -
Beat Addresses for FIXED, INCR and WRAP
Write the function that returns the address of beat n of an AXI burst, for all three burst types. Then give me the addresses of a 4-beat, 4-byte WRAP burst starting at 0x38. 6 follow-ups · 4 pitfalls · 2 runnable -
The 4 KB Boundary Check
Why may an AXI burst not cross a 4 KB boundary? Write the check for an INCR burst. 5 follow-ups · 4 pitfalls · 1 runnable -
Byte Lanes and WSTRB for Narrow Transfers
On a 32-bit bus a manager does an INCR burst of four 1-byte beats from 0x1001, and a 4-byte burst from 0x3002. Which lanes and which WSTRB does each beat use? 6 follow-ups · 3 pitfalls · 1 runnable -
AXI IDs and Response Order
What does the AXI ID guarantee about the order of responses? Can read data from two transactions be interleaved? 8 follow-ups · 4 pitfalls- Asked at Qualcomm
-
The Scoreboard That Fails Legal Traffic
Your AXI scoreboard pushes each read's expected data into one queue at AR time. It pops the queue on every R beat. It passes against a simple memory but fails on the new interconnect, with no protocol errors. What is wrong? 6 follow-ups · 3 pitfalls · 1 runnable -
Outstanding Transactions and Bandwidth
A memory answers every single-beat read 8 cycles after accepting it. How many reads must a manager keep outstanding to use the read data channel fully? 5 follow-ups · 3 pitfalls · 1 runnable- Asked at Qualcomm
-
AXI Response Codes
What responses can an AXI subordinate return? How many responses do a 4-beat write and a 4-beat read get? 5 follow-ups · 3 pitfalls -
Exclusive Accesses and the Monitor
Explain how an AXI exclusive read and exclusive write implement a lock, and what EXOKAY and OKAY mean on each. 5 follow-ups · 4 pitfalls -
AXI4-Lite Against Full AXI4
What is removed in AXI4-Lite compared with AXI4, and what stays? 5 follow-ups · 2 pitfalls -
IDs Through an AXI Interconnect
Four managers, each with 4-bit IDs, share three subordinates through your interconnect. How do IDs work across it, and where can it go wrong? 6 follow-ups · 3 pitfalls- Likely at Intel
- Likely at Infineon
-
The Valid/Ready Rules
On a valid/ready channel, when exactly does a transfer happen, and what rules must each side follow? 7 follow-ups · 6 pitfalls -
The Link That Never Moved
A DMA engine and a memory controller each pass their unit tests. Connected, nothing moves: the wave showsvalidandreadylow forever while both have work. What happened and whose bug is it? 9 follow-ups · 7 pitfalls · 1 runnable -
Is the Hold Rule Enough?
Our handshake checker is one property:valid && !ready |=> valid. It has never fired. Is the interface covered? 5 follow-ups · 2 pitfalls · 2 runnable -
The Monitor That Saw Too Many Beats
A monitor doesif (valid) beats++;on every rising edge. The scoreboard says the DUT sent extra data. Who is wrong? 5 follow-ups · 3 pitfalls · 2 runnable -
Registering Ready Without Losing Beats
Timing fails on thereadypath through a chain of pipeline stages. A colleague registersreadyin each stage. What breaks, and what do you build instead? 6 follow-ups · 4 pitfalls · 2 runnable -
Credits Versus Ready
When would you choose credit-based flow control instead of valid/ready, and what does it cost? 5 follow-ups · 3 pitfalls -
Why I2C Is Open Drain
I2C outputs are open drain with pull-up resistors. Why not ordinary push-pull outputs, and what does that choice cost? 5 follow-ups · 4 pitfalls- Likely at Google
-
The Ninth Clock: ACK and NACK
Draw one I2C byte with its acknowledge. Who drives SDA in the ninth clock on a write, and on a read? Why does the controller NACK the last byte it reads? 5 follow-ups · 6 pitfalls · 1 runnable- Likely at Analog Devices
-
Clock Stretching
What is clock stretching in I2C, and what must the controller do for it to work? 5 follow-ups · 4 pitfalls · 1 runnable -
I2C Multi-Controller Arbitration
Two controllers start a transfer at the same moment, one to 0x50 and one to 0x58. How does I2C decide who wins, and what happens to the loser's message? 5 follow-ups · 4 pitfalls · 2 runnable -
Reading a Register with Repeated START
Walk me through reading register 0x3C of an I2C target at address 0x50. Why is there a repeated START in the middle? 6 follow-ups · 3 pitfalls -
Recovering a Stuck I2C Bus
After a watchdog reset of the SoC, the I2C bus is dead: SDA reads low forever, SCL is high. What happened and how does the controller recover? 6 follow-ups · 4 pitfalls · 2 runnable -
I3C Versus I2C
What does I3C change compared with I2C, and what does it keep? 6 follow-ups · 6 pitfalls -
I3C Dynamic Address Assignment
Explain how ENTDAA gives every I3C target an address. What decides the order, and what does a target that loses a round do? 6 follow-ups · 4 pitfalls · 2 runnable -
I3C In-Band Interrupts
How does an I3C target raise an interrupt without an interrupt pin? Walk me through the request and the controller's choices. 6 follow-ups · 4 pitfalls -
SPI Modes, CPOL and CPHA
Explain SPI modes 0 to 3. In each mode, which clock edge launches data and which edge samples it? 15 follow-ups · 6 pitfalls · 1 runnable- Likely at Google
- Likely at Qualcomm
- Likely at Analog Devices
-
The Reply Shifted by One Bit
Your controller reads a peripheral's ID register as 52h, but the datasheet says A5h. Writes seem to work. What is your first suspect? 9 follow-ups · 4 pitfalls · 1 runnable -
Sharing MISO Between Peripherals
Three SPI peripherals share one MISO line. What must each do when its chip select is high, and what goes wrong if one does not? 7 follow-ups · 3 pitfalls -
Who Drives the Lanes in EBh
Walk me through a Fast Read Quad I/O (EBh) on a W25Q128JV, clock by clock. Who drives IO0 to IO3 at each point? 7 follow-ups · 4 pitfalls -
The 300-Byte Page Program
Firmware programs a 300-byte buffer into a W25Q128JV starting at a page boundary. Readback shows the first 44 bytes wrong and the next page still erased. Explain. 9 follow-ups · 4 pitfalls · 1 runnable -
Drawing a UART Frame
The line idles high and runs 8N1. Draw the frame for 0xA5 on the wire and tell me how many bit-times it takes. Then add even parity. 5 follow-ups · 4 pitfalls- Likely at Google
- Likely at Analog Devices
-
Why a UART Oversamples
Why does a UART receiver run at 16 times the baud rate? Walk me through how it finds and samples each bit. 10 follow-ups · 7 pitfalls · 2 runnable -
The Baud Mismatch Budget
Your UART and its peer run from different clocks. How much baud-rate mismatch can the link tolerate, and which bit fails first? 5 follow-ups · 4 pitfalls · 1 runnable -
Lost Bytes on a Clean Wire
A customer says bytes go missing from your UART under load. Yet a protocol analyser on the RX pin shows every frame clean. What is going on? Also, tell me how framing, parity, overrun and break differ. 8 follow-ups · 4 pitfalls · 1 runnable -
Verification Plan for a UART
You own verification of a UART IP: 16-byte FIFOs, programmable divisor, parity options and RTS/CTS. Walk me through your plan. 7 follow-ups · 4 pitfalls- Asked at Qualcomm
-
Verifying a Bus Interface IP
Walk me through your verification plan for a new AXI subordinate, such as a memory-controller front end. How do you decide you are done? 6 follow-ups · 5 pitfalls · 1 runnable- Asked at Infineon
- Likely at Microchip
- Likely at Cadence
-
Functional Coverage for a Bus
What functional coverage would you write for a bus interface like AXI, and what traps do you watch for? 6 follow-ups · 4 pitfalls- Likely at Microchip
- Likely at Micron
- Likely at Cadence
No question matches these filters.
Quick revision · One flat list
Question Bank
All 236 Protocols questions, main and follow-up. Open a track, then a topic. Answer out loud first, then open the short answer.
Jump to a Track
59 questions · 12 topicsAXI
The Five AXI Channels5
AXI has five channels. Name them, say who drives each, and tell me why reads and writes are kept apart. L0L1
AW, W and B carry writes; AR and R carry reads. The manager drives AW, W and AR, and the subordinate drives B and R. Each channel has its own valid/ready handshake. The split lets a read and a write be in flight at once. It also lets write data move independently of its address. And you can add a register slice (a pipeline stage) to any one channel alone.
QuestionPractise The Five AXI Channels →Why not just let the write finish when the last data beat is accepted? What does B give you? L0L1
Accepting a beat only means the next stage had room, not that the write reached its target or succeeded. B is the completion response, and it carries the error code. The subordinate sends it only after it has the address and the last beat. For a Non-bufferable write, B also guarantees the write is visible to any manager. A manager that needs ordering waits for B.
Follow-upPractise Why Writes Need a B Channel →A manager writes a word, and right after its last W beat it reads the same address with the same ID. Is it guaranteed to see the new value? L1L2
No. AXI never orders a read against a write, whatever the IDs, so the read may return the old value. The manager's tool is to wait for the write's B response before issuing the read. Lesson P2.12 measured exactly this, with a posted write and a six-cycle write latency. The read issued after the last data beat returned the old word.
Follow-upPractise A Read Issued Before the Write Response →A DMA writes a 4 KB buffer, then writes a "done" flag that the CPU polls. How do you make sure the CPU never sees the flag before the data? L2L3
Before writing the flag, wait for the B responses of every buffer write. Only a completion response makes an access observable. Same-ID writes stay in order only to the same location, so one ID does not order the buffer against the flag. A Bufferable B can come from a buffer partway along the path. It then guarantees observability only inside the write's Domain, so the CPU must sit in that Domain.
Follow-upPractise Ordering a Flag After a Buffer →APB moves one transfer at a time over one set of wires. What does AXI gain with its five channels, and what does it cost? L1
AXI gains concurrency: reads and writes overlap, and many transactions can be outstanding (issued but not yet finished). Each channel can also be pipelined on its own. APB is not pipelined, and every transfer takes at least two cycles. The cost is wires and logic: five handshakes, ID tracking, reorder buffers and a much harder verification job. That is why register blocks often sit on APB or AXI4-Lite.
Follow-upPractise Five Channels Against One Shared Bus →Write Data Before the Write Address5
Can write data arrive at a subordinate before its write address? And when may the subordinate raise BVALID? L1L2
Yes. The protocol sets no order between AW and W, so data may come before, with or after its address. The subordinate may wait for either or both VALIDs before raising either READY. But the manager must never wait for a READY before raising AWVALID or WVALID. BVALID may rise only after both the address and the last data beat (WLAST) have been accepted. It must not wait for BREADY.
QuestionPractise Write Data Before the Write Address →Why is it the sender that is forbidden to wait, and not the receiver? L1
Someone has to move first, or two polite blocks wait forever. The spec picks the sender: VALID may never wait for READY. READY may wait for VALID, or be high early. So every handshake makes progress as long as the sender has something to send. Receivers can also save power or logic by raising READY only on demand.
Follow-upPractise Why VALID Must Not Wait for READY →Your protocol checker binds every AXI rule as an assertion. Will it catch a manager whose WVALID waits for AWREADY? L2L3
Not by itself. On the wires, the illegal manager looks legal against a subordinate that raises AWREADY early. Against a subordinate that waits for WVALID, nothing moves, and no safety property fails on a bus where nothing moves. You need a watchdog or liveness check (a VALID is eventually accepted). You also need stimulus that includes a subordinate holding AWREADY until it sees WVALID.
Follow-upPractise Catching a VALID That Waits →Walk me through how you would verify an AXI interconnect. What checks, what coverage, and which bugs are you most worried about escaping? L3L4
Put a protocol checker on every manager and subordinate port. A fabric re-registers what it forwards, so it hides a subordinate's fault from the manager side. Add an end-to-end scoreboard keyed by manager and ID that checks routing, data, ID restore and same-ID order across subordinates. Test every region edge and hole for full-length DECERR. Stress with random back-pressure (READY held low), W before AW, maximum outstanding and racing exclusives, with watchdogs for deadlock.
Follow-upPractise Verifying an AXI Interconnect →Write data reaches an interconnect two cycles before its address. What must the interconnect do with it? L2
Hold it. The interconnect cannot know which subordinate the data belongs to until it decodes the address. So it must realign data with request, and present WVALID only to the destination. That means buffering W, or holding WREADY low, until the matching AW is decoded, in AW order. AXI4 write data carries no ID, so it follows the address order.
Follow-upPractise Early Write Data at an Interconnect →Beat Addresses for FIXED, INCR and WRAP5
Write the function that returns the address of beat n of an AXI burst, for all three burst types. Then give me the addresses of a 4-beat, 4-byte WRAP burst starting at 0x38. L0L1
Beat 0 is always the start address, and FIXED repeats it. INCR adds n times the size to the start aligned down to the size. WRAP does the same inside a window of size times length bytes, aligned to that total. It returns to the window's base when it reaches the top. So WRAP4 of 4 bytes at 0x38 has window 0x30 to 0x3F and visits 0x38, 0x3C, 0x30, 0x34.
QuestionPractise Beat Addresses for FIXED, INCR and WRAP →Who actually issues WRAP bursts, and why not just use INCR? L1
Caches issue them: on a miss, the CPU wants the word it stalled on first (critical word first). But the cache still needs the whole line. A WRAP burst starts at the missing word and wraps around the line-aligned window. So the line is filled in one transaction that never leaves it. INCR from the missing word would run past the end of the line.
Follow-upPractise Why WRAP Bursts Exist →A manager issues a WRAP burst of 3 beats, and another at 0x102 with 4-byte beats. What does your checker say? L1L2
Both are illegal. A WRAP burst must be 2, 4, 8 or 16 beats long, so length 3 fails. It must also start aligned to its transfer size, so 0x102 with 4-byte beats fails. A checker flags both at the request handshake, before any data moves. FIXED is limited to 16 beats, and INCR may run to 256.
Follow-upPractise Illegal WRAP Bursts →Why must a WRAP burst start aligned and have 2, 4, 8 or 16 beats? Where does it wrap? L1L2
The burst lives in a window of beats times bytes per beat, aligned to that size. The lowest address of the window is the wrap boundary. With a power-of-two length, hardware finds the window by masking low address bits. An aligned start keeps every beat a whole transfer inside it.
Follow-upPractise Where a WRAP Burst Wraps →Your beat-address model wraps with if (a >= boundary + window) a -= window. It passes every regression. Where does it break? L2L3
At the top of the address space. With 32-bit unsigned arithmetic, a window that ends at 2^32 makes boundary + window overflow to 0. So the test is always true, and beat 1 is pulled down a whole window. Comparing the offset, a - boundary >= window, never overflows. The twin runs both forms at 0x108 and at 0xFFFFFFF8: they agree in the middle and disagree at the top.
The 4 KB Boundary Check5
Why may an AXI burst not cross a 4 KB boundary? Write the check for an INCR burst. L1L2
The interconnect routes a burst using its first address only. So a burst that crossed the boundary could run into the next subordinate. The rule also limits how many address bits a subordinate must increment. The check compares the 4 KB page of the first byte with the page of the last byte, aligned_start + beats*size - 1. Using the address one past the end wrongly flags a burst that ends exactly on the edge.
Who would break if a burst crossed 4 KB: the manager, the interconnect or the subordinate? L1
Mainly the interconnect and the subordinate. The interconnect decodes the destination once, from the first address. So the tail of a crossing burst would land in whichever subordinate owns the next page. The subordinate computes later addresses itself, and the rule limits how far its address counter has to carry. The manager is the one that must obey the rule, by splitting its bursts.
Follow-upPractise Who the 4 KB Rule Protects →Break it: an INCR burst of sixteen 8-byte beats starts at 0xFC0. Which beat crosses, and when should the checker report it? L1L2
The burst covers 128 bytes, from 0xFC0 to 0x103F. Beat 9 starts at 0x1000, on the next 4 KB page. The checker should flag the request at the address handshake. The first and last byte addresses must share every bit from bit 12 up.
Follow-upPractise Finding the Beat That Crosses 4 KB →Does your boundary checker need to handle WRAP and FIXED bursts too? L2
No, because FIXED never changes address. A WRAP burst stays inside its window, at most 16 beats of 128 bytes (2 KB) and aligned to its own size. An aligned power-of-two window of 2 KB or less cannot cross a 4 KB edge. Only INCR, up to 256 beats, can cross. The checker still needs the WRAP length and alignment rules.
Follow-upPractise Can WRAP or FIXED Cross 4 KB? →A DMA must copy 10 KB starting at 0x0000_1F40 on a 64-bit AXI bus. How does it cut the transfer into bursts? L2L3
Cut at every 4 KB boundary first, then at the 256-beat limit. With 8-byte beats, a burst moves at most 2 KB. So here the bursts are 0x1F40 to 0x1FFF (24 beats), then 2 KB bursts of 256 beats, then the tail. Many DMAs also stop at a smaller Max_Transaction_Bytes that the system advertises, or at cache-line multiples. An unaligned start needs a strobed first beat.
Follow-upPractise Splitting a DMA Transfer into Bursts →Byte Lanes and WSTRB for Narrow Transfers6
On a 32-bit bus a manager does an INCR burst of four 1-byte beats from 0x1001, and a 4-byte burst from 0x3002. Which lanes and which WSTRB does each beat use? L1L2
The lanes come from the address: lane = address mod bus width. The 1-byte beats walk lanes 1, 2, 3, 0 with strobes 0010, 0100, 1000, 0001. The unaligned 4-byte burst uses lanes 2 to 3 on beat 0 (strobe 1100) and all four lanes after that. WSTRB may clear any lane inside the beat's lanes, but must be low outside them.
QuestionPractise Byte Lanes and WSTRB for Narrow Transfers →A big-endian core and a little-endian core share an AXI memory. Does AXI swap bytes for one of them? L2
No. AXI is byte invariant: the byte at address word+n always travels on lane n, whichever core sent it. Endianness only decides which byte of a multi-byte value goes to which address, inside each core. So the bus never swaps lanes. A core that wants the other's view of a 32-bit value reverses the bytes in software or in its own interface.
Follow-upPractise Byte Invariance and Endianness →What if a bridge designer swaps byte lanes on one path to fix endianness for the big-endian core? L2L3
Then byte invariance breaks on that path. A single byte written to word+1 now lands at word+2. Byte-wide software breaks, and the other core reads scrambled data. Endianness belongs inside each core, never on the bus.
Follow-upPractise A Bridge That Swaps Byte Lanes →A 1-byte write to 0x1001 arrives with WSTRB 0110. Legal? And a beat with WSTRB 0000? L1L2
WSTRB 0110 is illegal. The beat addresses only lane 1, so the lane 2 strobe lies outside the transfer and must be low. WSTRB 0000 is legal: inside the beat's lanes any pattern is allowed, including none, and that beat writes nothing. A manager uses all-zero strobes to finish a burst it no longer needs, because a burst cannot end early.
Follow-upPractise Strobes Outside the Transfer →A DMA streams 16-bit samples with perfect strobes, and every second sample is lost. The protocol checker is silent. What happened? L2L3
The data stayed in lanes 0 and 1, while the strobes moved to lanes 2 and 3 for the odd addresses. The strobes alone are legal, so no protocol rule fires. The subordinate writes whatever sits in the strobed lanes. Only a data check catches it: a scoreboard or read-back that compares bytes by address. Lesson P2.7 measured the result: 11 11 00 00 33 33 00 00.
Follow-upPractise Right Strobes, Wrong Lanes →You put a 32-to-64-bit upsizer and a 64-to-32-bit downsizer in a fabric. Which transactions are they allowed to reshape? L3
A Non-modifiable transaction (AxCACHE[1] low) must not be split or merged. It keeps its address, size, length and burst type. So an upsizer steers each narrow beat into the right half of the wide word and leaves size and length alone. It may pack beats only when the transaction is Modifiable. A downsizer must split anyway when Size exceeds the narrow bus, a case the spec admits cannot meet the rule.
Follow-upPractise Upsizers, Downsizers and Modifiable →AXI IDs and Response Order5
What does the AXI ID guarantee about the order of responses? Can read data from two transactions be interleaved? L1L2
Responses with the same ID come back in request order. Different IDs carry no ordering, so they may complete in any order. Read data of different IDs may be interleaved beat by beat. The beats of one ID are never interleaved with each other. AXI4 write data has no ID and must follow the address order. AXI3 had WID and allowed write interleaving.
QuestionPractise AXI IDs and Response Order →Why does AXI force same-ID responses into order at all? Why not let everything reorder? L1
A response carries only the ID. With two transactions open on one ID, the manager can pair each response with its request only by order. Ordering per ID also lets a simple manager use one ID and never build a reorder buffer. A capable manager uses several IDs as several in-order streams.
Follow-upPractise Why Same-ID Responses Stay in Order →Two 4-beat reads on IDs 1 and 2 come back as 1, 2, 1, 2, 2, 1, 2, 1. Legal? What must the monitor do? L2
Legal: different IDs may interleave beat by beat. Each transaction's beats must still stay in order and end with its own RLAST. The monitor must assemble beats per RID and file each beat under the oldest open read of that ID. It closes the transaction on RLAST. A monitor that assumes contiguous bursts glues beats of different reads together.
Follow-upPractise Interleaved Read Data →A manager team says their block cannot handle interleaved read data. Is that allowed, and what does the spec offer? L2L3
Not if the manager issues different IDs: such a manager must accept interleaved data. The Read_Interleaving_Disabled property only lets it switch interleaving off as an optimisation. That works only when the attached subordinate supports it. So the test plan must cover interleaved returns for every manager that uses several IDs.
Follow-upPractise A Manager That Cannot Take Interleaving →A manager uses one ID for everything. The latency of its short reads is terrible whenever a long read is in flight. Why, and what would you change? L2L3
Same-ID responses must return in order, so a short read queues behind a slow one (head-of-line blocking). Give independent streams their own IDs, so the subordinate or interconnect can answer the fast one first. Keep one ID only for accesses that must stay ordered. The cost is reorder storage in the manager and more tracking downstream. Lesson P2.10 measured a fast read waiting seven edges on a shared ID, and three on its own.
Follow-upPractise Choosing IDs for Throughput →The Scoreboard That Fails Legal Traffic3
Your AXI scoreboard pushes each read's expected data into one queue at AR time. It pops the queue on every R beat. It passes against a simple memory but fails on the new interconnect, with no protocol errors. What is wrong? L2L3
The scoreboard assumes responses return in issue order. The new fabric returns different IDs out of order, which is legal. So the expected and actual streams no longer line up. Key the expected queue by ID: one in-order queue per RID, popped when that ID's beat arrives. The twin shows the in-order version reporting two mismatches on legal traffic. The per-ID version still catches a real same-ID swap.
QuestionPractise The Scoreboard That Fails Legal Traffic →A subordinate swaps two same-ID reads. When does your protocol checker catch it, and when not? L2L3
Only when the two reads have different lengths, because the first response's RLAST then lands on the wrong beat count. If the lengths are equal, every beat is legal on the wires, and only the data shows the swap. You need a scoreboard keyed by ID that knows which address each read asked for. Lessons P2.10 and P2.18 measured exactly this split.
Follow-upPractise The Reorder No Checker Sees →What goes in the functional coverage of an AXI subordinate before you call it done? L3
Group it by channel handshakes, requests, data, responses and ordering, as in the table. The corners that matter most are bursts ending exactly at 4 KB and errors mid-burst. So do maximum outstanding depth, cross-ID reordering and W before AW. Cross only the pairs the design can actually produce, and close holes with directed tests.
Follow-upPractise Functional Coverage for an AXI Port →Outstanding Transactions and Bandwidth5
A memory answers every single-beat read 8 cycles after accepting it. How many reads must a manager keep outstanding to use the read data channel fully? L1L2
About latency times rate: 8 cycles times one read per cycle, so 8 in flight. Throughput is outstanding transactions (issued but not yet answered) divided by latency, which is Little's law. So one read at a time gives one beat every 8 cycles. The run shows 32 reads taking 257 cycles with a window of 1, 68 with 4 and 40 with 8. A window of 16 is no faster, because then the clock is the limit.
QuestionPractise Outstanding Transactions and Bandwidth →A subordinate raises ARREADY only after it sees ARVALID. Legal? What does it cost? L1L2
Legal: READY may wait for VALID. But with a registered READY (driven from a flip-flop), it costs a cycle on every request. The handshake cannot happen in the cycle VALID first appears. The spec recommends READY high by default on request channels; the subordinate must then be able to accept any request presented. Lesson P2.5 measured RREADY-after-RVALID stretching four read beats from edges 14-17 to 21, 23, 25, 27.
Follow-upPractise READY High in Advance →Timing fails on a long AXI path, so you add register slices. What do they cost in latency and in bandwidth? L2
Each stage adds a cycle of latency in its direction. It costs no bandwidth if the slice sustains one beat per cycle. The manager must then keep enough transactions outstanding to cover the longer round trip. VALID must go through as many stages as its payload, but different channels may get different numbers of stages. Lesson P2.5 measured two stages moving a write response from edge 10 to 14.
Follow-upPractise What a Register Slice Costs →Break it: a slice registers READY to cut the timing path, but it has only one data register. What happens at the first stall? L2L3
With READY from a flop, the sender sees the stall one edge late. So one extra beat is accepted on that edge. With only one register, that beat overwrites the held beat, and data is lost. A real slice adds a skid register, so it holds two beats and still passes one per cycle.
Follow-upPractise A Register Slice That Drops a Beat →A DMA on a 128-bit AXI port reads from DDR with a loaded latency around 200 cycles. How do you size its outstanding reads and its buffers? L3
Cover latency times rate: about 200 beats in flight at one beat per cycle. With 16-beat bursts, that is about 13 outstanding reads, rounded up for latency spread. The manager must be able to accept all data it requested. So it needs about 200 × 16 bytes of read buffering, or a sink that always accepts data. Then check what the interconnect and memory controller actually accept; their limits, not the DMA's, often set the ceiling.
Follow-upPractise Sizing a DMA's Outstanding Capability →AXI Response Codes5
What responses can an AXI subordinate return? How many responses do a 4-beat write and a 4-beat read get? L0L1
OKAY means normal success, and EXOKAY means a successful exclusive access only. SLVERR means the access reached a subordinate that failed it. DECERR means no subordinate was found at the address. A write gets one response on B after its last beat. A read gets one RRESP with every beat, so a 4-beat read has four, and they may differ. An error never shortens a burst.
QuestionPractise AXI Response Codes →A 4-beat write gets SLVERR. Which of its bytes were written? L1
You cannot tell from the response. SLVERR on B covers the whole write. The spec says the location might not be fully updated, so some beats may have landed and some not. Lesson P2.13 showed a write that returned SLVERR with bytes 0a and 0b already in memory. Software treats the whole buffer as suspect.
Follow-upPractise An Error in the Middle of a Burst →What if beat 2 of a 4-beat read gets SLVERR? Does the burst stop there? L1L2
No. The subordinate still sends all four beats, up to RLAST, and the manager takes them. Each read beat carries its own response, so beats 1, 3 and 4 may be OKAY. Only the data of beat 2 is suspect.
Follow-upPractise An Error on One Beat of a Read →A read returns DECERR. Who generated it, and how is that different from SLVERR? L1L2
DECERR normally comes from the interconnect. The address decoded to no subordinate, so the access never reached a target. SLVERR comes from a subordinate that received the access and could not complete it. Examples are a write to a read-only register, or an access to a powered-down block. For debug, DECERR points at the address map; SLVERR points at the target.
Follow-upPractise SLVERR Against DECERR →You own the interconnect. What does your default subordinate have to do with a 16-beat read to an unmapped address? L2L3
Complete the transaction like any subordinate. Accept the request, and return all 16 beats with DECERR on each and RLAST on the last. Echo the ID, and obey the same handshake and ordering rules. For writes, it must accept every beat up to WLAST before one DECERR on B. A default subordinate that answers with one beat hangs a manager waiting for RLAST.
Follow-upPractise Designing the Default Subordinate →Exclusive Accesses and the Monitor5
Explain how an AXI exclusive read and exclusive write implement a lock, and what EXOKAY and OKAY mean on each. L2L3
The manager does an exclusive read. A subordinate that supports exclusives records the address and ID in a monitor (a small tracker) and answers EXOKAY. Later the manager does an exclusive write with the same ID, address and attributes. If no one wrote the location meanwhile, the write happens and gets EXOKAY. Otherwise the write is dropped and gets OKAY, and software retries. The bus is never locked in between.
QuestionPractise Exclusive Accesses and the Monitor →A manager runs an exclusive sequence against a subordinate with no exclusive monitor. What happens on each step? L2
The exclusive read returns OKAY instead of EXOKAY: the data is valid, but nothing is monitored. If the manager writes anyway, the exclusive write also gets OKAY. The location is updated as a normal write, so a lock "fails" yet changes memory. The spec recommends treating OKAY on the read as "not supported" and skipping the write.
Follow-upPractise Exclusives to a Subordinate That Lacks Them →Break it: a spinlock routine treats any non-error response to its exclusive write as success. What can happen? L2L3
On a memory without an exclusive monitor, both steps return OKAY, so two cores can both believe they hold the lock. On a memory with a monitor, OKAY on the exclusive write means it failed and nothing was written. Either way, only EXOKAY means success. The routine must retry on OKAY, or report that exclusives are not supported.
Follow-upPractise A Spinlock That Trusts OKAY →You are verifying a memory controller's exclusive monitor. Which scenarios do you make sure you hit? L3
Races: two managers on one address must give exactly one EXOKAY, and a normal write in between must fail the sequence. ID handling: reusing the ID on a new address moves the monitor. A size or length mismatch between the read and the write may fail the write. Granule: the monitor may watch a wide block, so a write to a neighbouring byte may legally fail the sequence. Limits: test unaligned, non-power-of-two and over-16-beat exclusives too.
Follow-upPractise Testing an Exclusive Monitor →Why did AXI5 add atomic transactions when exclusives already existed? L3
An exclusive pair needs two round trips, and it can fail and retry under contention. The data also travels to the manager and back. An atomic transaction sends the operation to the data instead. The subordinate or a near-memory agent does the read-modify-write in one transaction, so the location is unavailable for less time. The cost is ALU logic at the target and a more complex protocol.
Follow-upPractise Exclusives Against AXI5 Atomics →AXI4-Lite Against Full AXI45
What is removed in AXI4-Lite compared with AXI4, and what stays? L0L1
Lite keeps the five channels, the handshakes, the addresses, write strobes, AxPROT and the responses. Every transaction is one transfer at the full data width, 32 or 64 bits. So the length, size, burst, WLAST and RLAST signals go. There are no IDs and no exclusive accesses, so no EXOKAY. Accesses are Non-modifiable and Non-bufferable. It may still have several transactions outstanding.
QuestionPractise AXI4-Lite Against Full AXI4 →Why would a designer pick AXI4-Lite for a block instead of full AXI? L0L1
Control and status registers never need bursts, IDs or reordering. Supporting those costs logic and verification effort. Lite keeps the subordinate very simple (one beat, in order) while staying on the AXI fabric with no protocol bridge. Full AXI is for data movers: memories, DMAs, caches.
Follow-upPractise Why AXI4-Lite Exists →You connect an AXI4-Lite register block straight to a full AXI4 manager. What has to be true for this to work? L1L2
The block must copy AWID onto BID and ARID onto RID (ID reflection), because the manager pairs responses by ID. Also, either the system guarantees that the manager issues only Lite-shaped transactions, or a bridge converts them. The bridge breaks bursts into single transfers and combines their responses. Lesson P2.15 shows what happens otherwise: a four-beat read into the Lite block breaks the RLAST rule on its first beat.
Follow-upPractise A Lite Subordinate on a Full AXI Manager →A Lite register block passed its own regression but corrupts registers in the SoC behind a full AXI port. Where do you look? L2
Look at what the bench never sent. Its driver issued only single, full-width, aligned transfers, so every Lite assumption held. In the SoC, the block may see bursts, narrow sizes or partial strobes. Check whether a bridge sits in front, and whether the block honours or errors on partial strobes. Then extend the bench to drive what the real manager can issue, or assert that it never does.
Follow-upPractise The Lite Block That Passed Every Test →For a block of control registers, would you put it on AXI4-Lite or on APB behind a bridge? L1L2
APB is cheaper per peripheral: one shared, non-pipelined transfer at a time, at least two cycles each. Many slow peripherals can share one bridge. AXI4-Lite costs more logic, but allows parallel reads and writes and several outstanding transactions, with no bridge hop. Pick APB for many slow, low-traffic peripherals. Pick Lite for a few registers on a fast path, or where a bridge's latency hurts.
Follow-upPractise AXI4-Lite or APB for Registers →IDs Through an AXI Interconnect5
Four managers, each with 4-bit IDs, share three subordinates through your interconnect. How do IDs work across it, and where can it go wrong? L3L4
The interconnect appends the manager port number, so subordinates see 6-bit IDs. The fabric routes BID and RID back by those bits, and strips them on the way. Across subordinates, it must keep same-ID order. If a manager sends ID 3 to subordinate A, then ID 3 to B, B's response must not overtake A's. Usually the fabric stalls the second request, or keeps a per-ID destination table. Every added bit widens subordinate tracking and exclusive monitors.
QuestionPractise IDs Through an AXI Interconnect →Why does the interconnect add bits to the ID instead of passing it through? L2L3
Two managers may both use ID 0. Without a port tag, their transactions would merge into one ordering stream at the subordinate. The responses also could not be routed back. Appending the port number makes every ID unique system-wide, without managers coordinating. It also gives the fabric its return address.
Follow-upPractise Why the Interconnect Extends IDs →A manager issues ID 5 to a slow DDR, then ID 5 to a fast SRAM. Walk me through what your interconnect does. L3
The SRAM would answer first, which would break same-ID order at the manager. The common design tracks the outstanding count and its destination, per manager and ID. A new request with the same ID to a different destination stalls until the earlier responses return. The alternative, a reorder buffer, costs area. Lesson P2.10 measured the stall: the second ID-5 request was held from edge 4 to edge 13.
Follow-upPractise Same ID to Two Subordinates →Compare stalling same-ID requests with a reorder buffer in the interconnect. L3L4
Stalling needs only a count and a destination per manager and ID. It costs speed when one manager reuses an ID across fast and slow targets. A reorder buffer lets both requests go and holds the early response until its turn. It must store every response that can arrive early, so it costs area and design risk.
Follow-upPractise Stalling Versus a Reorder Buffer →Your SoC has three levels of interconnect and 40 managers. The memory controller now sees 14-bit IDs. What problems does that create and what would you do? L4
Every level adds port bits. The memory controller's per-ID state, reorder logic and exclusive monitors grow with the IDs it must tell apart. One option is to remap IDs into a smaller set of in-flight tags, which is legal if the original ordering is kept. Others are capping outstanding transactions per manager, or using the unique-ID indicator so unordered requests need no tracking. Each trades area for stalls.
Follow-upPractise The Cost of ID Width in a Large Fabric →19 questions · 3 topicsAPB
The APB Setup and Access Phases14
Draw an APB write with no wait states, then one with a wait state. What happens in each cycle, and what is the shortest an APB transfer can be? L0L1
Every APB transfer starts with one SETUP cycle. In it PSEL is high, PENABLE is low, and the address, direction and write data are valid. One or more ACCESS cycles follow, with PENABLE high. The transfer completes at the edge where PSEL, PENABLE and PREADY are all high. So the minimum is two cycles, and each cycle of PREADY low adds one. Afterwards the bus returns to IDLE, or goes straight to SETUP for the next transfer, with PENABLE low again.
QuestionPractise The APB Setup and Access Phases →Why does APB spend a whole cycle on SETUP? Why not finish a register access in one cycle? L1
SETUP gives the completer a full cycle with a stable address and select. Then PENABLE marks the cycle that counts. The completer can decode in SETUP and act on a single edge with very little logic. APB trades speed for that simplicity. It is not pipelined and every transfer costs at least two cycles, which is fine for occasional register traffic.
Follow-upPractise Why APB Has a Setup Cycle →The completer holds PREADY low for three cycles. What is the requester allowed to change during those cycles? L1L2
Nothing it set in SETUP: PADDR, PWRITE, PSEL, PENABLE and PPROT stay unchanged. So do PWDATA and PSTRB for a write, and any user request signals. The hold lasts from the SETUP-to-ACCESS transition until PREADY is high. The only free signal in that window is the completer's own PREADY. Any number of wait states is legal, from zero upwards.
Follow-upPractise What Holds During APB Wait States →A completer holds PREADY low forever. Is that an APB protocol violation? How does your bench catch it? L2L3
It is not a protocol violation, because APB allows any number of wait states. "Too long" is a system property, so a protocol checker cannot call it wrong. The bench uses a watchdog instead, with a limit taken from the peripheral's documented maximum. The watchdog reports a hang when the wait reaches that limit. In formal, the same requirement is a bounded response property, or a liveness property with fairness assumptions on the completer's inputs.
Follow-upPractise A Completer That Never Answers →A completer hangs with PREADY low. Should the bridge time out? What does it return, and what is the risk? L3L4
A timeout is system policy, not protocol. After a programmed limit, the bridge returns SLVERR so the CPU is not stuck forever. The risk is on the APB side: the requester must hold the transfer until PREADY, so the bridge cannot legally abandon it. It either keeps that segment blocked and fails every later access, or resets the completer. Specify which, raise an interrupt, and verify that recovery path.
Follow-upPractise Timeouts in an APB Bridge →Your APB protocol checker passes on every test. Which completer bugs can still be in the design? L2L3
Every bug that keeps the wires legal can remain, because a wire checker only proves the protocol. A completer that acts in every selected cycle still obeys the handshake. So does one that returns read data one transfer late, ignores PSTRB, acts without its PSEL, or raises PSLVERR a cycle early. A register model or scoreboard that predicts data and responses catches the rest. But it needs traffic with wait states, back-to-back transfers, sparse strobes and errors.
Follow-upPractise What an APB Checker Cannot See →Your SoC already has an AXI interconnect. Why put the UART, timer and GPIO registers behind an APB bridge, instead of giving each one an AXI port? L0L1
Register traffic is rare, small and tolerant of latency, so APB's simplicity wins. It runs one transfer at a time, with no bursts and no IDs. Each peripheral needs only a tiny state machine, and there are few wires to route. One bridge pays the AXI cost once for many peripherals. The price is throughput: at least two cycles per transfer, and one slow completer stalls the whole APB segment. So blocks that move real data stay on AXI or AHB.
QuestionPractise Why Registers Live on APB →What did APB3, APB4 and APB5 each add? L1
APB3 added wait states and errors, through PREADY and PSLVERR. APB4 added protection and sparse writes, through PPROT and PSTRB. APB5 added wake-up signalling, user signals and parity protection. The current issue also adds Realm Management Extension support as an option. An APB2 completer has neither PREADY nor PSLVERR, so a bridge ties them off for it.
Follow-upPractise From APB2 to APB5 →One peripheral on your APB segment takes 50 wait states for some registers. What happens to the other peripherals, and what would you do about it? L2L3
Every access behind that bridge waits, because APB carries one transfer at a time and nothing starts until the waiting one completes. One fix is to give the slow peripheral its own APB segment or bridge. Another is to make it answer at once with a busy bit that software polls. A third is posted writes: the bridge answers before APB finishes, so it loses PSLVERR for those writes. Pick by the latency budget of the time-critical peripherals.
Follow-upPractise One Slow Peripheral on the APB Segment →Design an AXI4-to-APB bridge. What must it do, which decisions are yours, and how would you verify it? L3L4
The bridge is the AXI subordinate and the APB requester. It decodes PSELx and makes one APB transfer per AXI beat. Each transfer uses the aligned address, with WSTRB on PSTRB and AxPROT on PPROT. It maps PSLVERR to SLVERR: per beat in RRESP, and merged into the single BRESP. Your decisions are read/write arbitration, DECERR for unmapped addresses, a timeout policy and posted writes. Verify it with checkers on both sides and an end-to-end scoreboard.
QuestionPractise Designing an AXI-to-APB Bridge →What should the bridge answer for an address that no APB completer owns? Why not just start the APB transfer anyway? L2L3
Decode first, and answer DECERR without starting any APB transfer, because APB itself defines no decode error. With no PSELx asserted, nobody drives PREADY. So a transfer started to a hole never completes, unless a default responder answers it. DECERR also tells software that the address was wrong. SLVERR would instead suggest that a peripheral refused it.
Follow-upPractise Unmapped Addresses Behind an APB Bridge →How does PSLVERR reach an AXI manager through a bridge? A 4-beat AXI write becomes four APB transfers and the second gets PSLVERR. What does the manager see? L2L3
The bridge maps PSLVERR to SLVERR, in the RRESP of the failing beat for a read and in BRESP for a write. A write has one completion response for the whole transaction. So the bridge must merge four APB results into one BRESP. Reporting SLVERR if any beat failed is the usual choice. The remaining beats still run: AXI never shortens a burst, and every read beat is returned whatever its response.
Follow-upPractise PSLVERR Through an AXI Bridge →Walk me through your verification bench for an AXI-to-APB bridge, and tell me how you know you are done. L3L4
Protocol checkers on both ports catch rule breaks. An end-to-end scoreboard predicts the APB transfers (one per beat, with address, PSTRB and PPROT) and the AXI responses. Done means every check passes and the coverage model is closed. That model crosses burst type, length and size with unaligned and narrow beats and wait states. It also covers PSLVERR on the first, middle and last beat, unmapped addresses, and reads racing writes.
Follow-upPractise How You Know the Bridge Is Done →What would you check and cover before you sign off error handling on an APB peripheral? L2L3
Check that each refused access errors: a write to read-only, an unmapped offset, or a wrong size or protection. Check that PSLVERR is read only at completion, and that register state after a failed write matches the documented policy. Cover read and write, crossed with error or not, crossed with zero, one and many wait states. Also cover an error followed straight by a good transfer to the same completer. Then check the error reaches software through the bridge.
Follow-upPractise Signing off APB Error Handling →Stale APB Read Data2
A register read-back test fails only on the peripheral that adds wait states. Every read returns zero or the previous value. The writes look right on the waveform. Where do you look first? L1L2
At the edge where the read data is taken. PRDATA needs to be valid only at the completion edge, where PSEL, PENABLE and PREADY are all high. So a sampler at the first ACCESS edge reads data that is not ready yet. Zero-wait peripherals hide the bug, because their first ACCESS edge is the completion edge. Capture only when PREADY is high too, and run every regression with wait states.
QuestionPractise Stale APB Read Data →Design the monitor of an APB agent. When does it publish a transfer, and what goes in the item? L2L3
It publishes once per transfer, at the edge where PSEL, PENABLE and PREADY are all high. Only then are PRDATA and PSLVERR valid. The item carries the address, direction, PPROT, PWDATA and PSTRB, all stable since SETUP. It also carries PRDATA or the error at completion, and the wait count: the ACCESS cycles with PREADY low. Sampling through a clocking block keeps the monitor free of races with the DUT.
Follow-upPractise Designing the APB Monitor →PSLVERR and What It Promises3
When is PSLVERR valid? And if a write gets PSLVERR, was the register written or not? L1L2
PSLVERR counts only in the last cycle of the transfer, where PSEL, PENABLE and PREADY are all high. Elsewhere it is ignored, and driving it low there is only a recommendation. It says the transfer failed, not what happened inside. A failed write may or may not have changed the register. A failed read may return data that the requester still uses. PSLVERR is optional; without it the requester's input is tied low.
QuestionPractise PSLVERR and What It Promises →Why doesn't the APB specification guarantee that an errored write left the register alone? L2
Completers differ, and the specification keeps them cheap. Some decide the error only after part of the access has taken effect; others refuse cleanly. Forcing "no side effect on error" would add buffering to every peripheral. So the error reports failure only. The register's behaviour on error belongs in the peripheral's documentation and its register model.
Follow-upPractise Why an APB Error Promises so Little →What if your register model still predicts the write after PSLVERR comes back? L2
Then the mirror holds a value the register may not have. The next read check fails on a correct design, or passes on a wrong one. The adapter should return UVM_NOT_OK, so the model skips predicting that access. Then read the register back to learn what the peripheral really did.
26 questions · 3 topicsAHB
AHB Address and Data Phases14
What does it mean that AHB is pipelined? Draw three back-to-back zero-wait writes. L0L1
Every transfer has an address phase of one cycle and a data phase of one or more cycles. The next transfer's address phase happens during the current transfer's data phase. With no wait states, the bus finishes one transfer per cycle. Each transfer still takes two cycles from address to data. So write data trails its address by a cycle. At most two transfers are on the bus at once: one in address, one in data.
QuestionPractise AHB Address and Data Phases →Why pipeline the address at all? What does the subordinate gain? L1
It gains a full cycle between seeing the address and having to produce or take the data. That is time to decode and start a memory access. Meanwhile the bus still completes one transfer per cycle. Without the overlap, a bus must halve its throughput. Or it must force every subordinate to answer in the same cycle it sees the address.
Follow-upPractise What the AHB Pipeline Buys →Why does an AHB ERROR response take two cycles when OKAY takes one? L1L2
The bus is pipelined. When a subordinate starts an ERROR, the next transfer's address phase is already on the bus. The first cycle (HRESP high, HREADYOUT low) holds that address phase and warns the manager. In the second cycle (HRESP high, HREADYOUT high), the manager can drive IDLE. That cancels the next transfer before anyone takes it. Wait states before the error carry HRESP low.
QuestionPractise The Two-Cycle AHB ERROR →Beat 2 of an INCR4 write gets ERROR, and the manager drives IDLE in the second error cycle. What happens to beat 3, and must the manager redo the burst later? L2
Beat 3's address phase was on the bus during the first error cycle. The manager turns it into IDLE in the second cycle. So no subordinate ever takes it, because it is never accepted as NONSEQ or SEQ with HREADY high. The manager need not rebuild the remaining beats later. During that waited cycle, it may also change the address, which the normal hold rule forbids.
Follow-upPractise Cancelling After an ERROR →What if the manager does not cancel, and drives beats 3 and 4 after the ERROR? Is that legal, and what should your checker accept? L2
It is legal: cancelling the rest of the burst is allowed, not required. So the checker must accept both IDLE in the second error cycle and a burst that carries on. The subordinate answers the later beats normally. A checker that flags the continued burst reports a false failure on a legal manager.
Follow-upPractise A Manager That Continues After ERROR →A subordinate sometimes gives a one-cycle ERROR. Write assertions that catch it. L2
Check both directions. A first ERROR cycle (HRESP high, HREADYOUT low) must be followed by a second (HRESP high, HREADYOUT high). And a second cycle must be preceded by a first. The one-cycle error passes the first property vacuously: there is no first cycle to trigger it. It fails only the second, so a checker with just one of them misses it.
Follow-upPractise Asserting the Two-Cycle ERROR →Compare AHB ERROR with APB PSLVERR and AXI SLVERR and DECERR. Where does an AHB decode error come from? L2L3
AHB has one response bit, so a decode error is ERROR from the default subordinate for unmapped NONSEQ or SEQ transfers. APB's PSLVERR counts only in the single completion cycle, and needs no second cycle because APB is not pipelined. AXI separates SLVERR (the end point refused) from DECERR (no end point). It reports per read beat and once per write, and never shortens a burst. Bridges map PSLVERR to HRESP or to RRESP/BRESP.
Follow-upPractise Error Responses Across AMBA →A subordinate inserts two wait states on a read. What happens on the bus during those cycles? And what is the difference between HREADY and HREADYOUT? L1L2
The wait states stretch the data phase of the read. They also stretch the address phase of the next transfer, which stays on the wires until HREADY is high. Each subordinate drives HREADYOUT for its own data phase. The multiplexor picks the HREADYOUT of the subordinate whose data phase is active. It sends that as HREADY to the manager and to every subordinate. A subordinate takes an address phase only at an edge where its HSEL and HREADY are both high.
QuestionPractise AHB Wait States, HREADY and HREADYOUT →A subordinate drives HREADYOUT. Why does it also need the bus HREADY as an input? L1L2
The data phase in front may belong to another subordinate. HREADY says when that data phase ends. Only then does the address phase on the wires count as accepted. A subordinate that samples on HSEL alone may act too early. The address phase may still change, such as an IDLE becoming NONSEQ, or the manager may cancel it after an ERROR.
Follow-upPractise Why a Subordinate Takes HREADY In →Break it: a subordinate takes address and control whenever HSEL is high and ignores HREADY. Show the failure. L2
While the data phase in front is in a wait state, HSEL and the address can already point at this subordinate. It then takes a transfer the bus has not accepted yet. If the manager changes IDLE to NONSEQ, or cancels after an ERROR, the subordinate acts on the wrong transfer. Across a long wait it can even take one transfer twice.
Follow-upPractise A Subordinate That Samples on HSEL Alone →While HREADY is low, may the manager change HTRANS? Give the exceptions. L2
Normally no, with three exceptions. IDLE may become NONSEQ, and in a fixed-length burst BUSY may become SEQ. In an undefined-length INCR burst, BUSY may become anything, and IDLE or NONSEQ ends the burst. After any such change, HTRANS is held until HREADY is high. The address may change only for IDLE, or after an ERROR has started.
Follow-upPractise HTRANS During a Wait State →Why should every AHB subordinate have a known maximum number of wait states? How would you check that across an SoC? L3
Wait states stall the whole AHB interface. So the worst-case latency of every manager depends on the slowest subordinate it can reach. A known maximum per subordinate lets you compute that latency. Check it with a watchdog per subordinate, set to its documented bound. Add performance tests that hit the worst case and, for small blocks, a bounded-response property in formal.
Follow-upPractise Bounding AHB Wait States →Write down the rules your AHB monitor uses. When is an address phase taken, and when does its data phase end? What do monitors usually get wrong? L2L3
An address phase is taken at an edge where HREADY is high and HTRANS is NONSEQ or SEQ. On a subordinate port, HSEL must be high too. Its data phase ends at the next edge where HREADY is high, and HWDATA, HRDATA and HRESP belong to it there. Monitors often log at the address phase and pair the wrong data. Others ignore HREADY and log a waiting transfer several times, or read HRESP as final in the first ERROR cycle.
Follow-upPractise Rules for an AHB Monitor →Compare AHB's pipelining with AXI's outstanding transactions. When would you still pick AHB? L1L2
AHB has one address and control path, with at most one transfer in address and one in data. Transfers complete in order, and a wait state stalls whatever is behind it. AXI has independent channels and IDs, so a manager can issue many requests without waiting. Responses with different IDs may return out of order. AHB wins on area and simplicity for a single manager with modest latency, such as a microcontroller memory bus.
Follow-upPractise AHB Pipelining Against AXI Outstanding Transactions →The Write That Happened on IDLE5
A register reads back correctly right after a write, but two cycles later the same read returns 0. Between the reads the manager drove IDLE and left the last address and control on the bus. What is the bug? L1
The register block takes address phases without checking HTRANS. IDLE and BUSY must get a zero-wait OKAY and be ignored. But the manager may leave the last write's HADDR and HWRITE on the bus. A block that decodes only HSEL, HWRITE and HADDR treats each IDLE as another write. It stores whatever HWDATA holds. Take a write only when HSEL and HREADY are high and HTRANS is NONSEQ or SEQ.
QuestionPractise The Write That Happened on IDLE →IDLE and BUSY both move no data. What is the difference, and what must the subordinate do for each? L1
IDLE means the manager wants no transfer. BUSY means a burst is continuing, but its next beat is not ready yet. Its address and control already describe that next beat. The subordinate answers both the same way: a zero-wait OKAY and no action.
Follow-upPractise IDLE Against BUSY →Why does a BUSY cycle carry the address of the next beat, and which bursts may end with BUSY? L2
It keeps the burst continuous. When the manager is ready, it turns BUSY into SEQ with the same address. So the subordinate can keep prefetching. Only an undefined-length INCR may end after BUSY, followed by IDLE or NONSEQ. Fixed-length INCR4/8/16 and WRAP4/8/16 must end with a SEQ beat, and BUSY may never follow a SINGLE.
Follow-upPractise BUSY and the End of a Burst →Would an AHB protocol checker have caught the write-on-IDLE bug? What does, and how do you split the work between checker and scoreboard? L2L3
No. Every wire was legal, because the manager may leave the address on the bus during IDLE. Only the data shows the bug. A scoreboard or register model that reads back after idle gaps catches it. Assertions own the wire rules (holds, two-cycle ERROR, SEQ addresses, 1 KB crossings). The scoreboard owns subordinate behaviour (data taken in the wrong phase, lanes HSIZE did not select, actions on IDLE).
Follow-upPractise What the AHB Checker Misses →Every subordinate passes its own block-level tests, yet the SoC sometimes reads wrong data. Which interconnect bugs slip past block tests, and what traffic exposes them? L2L3
These bugs need two subordinates at once. A mux select on the wrong phase shows only on back-to-back accesses to different subordinates. A HREADY fan-in that forwards the wrong HREADYOUT shows only when one subordinate waits while another is addressed. A region off-by-one shows only at a 1 KB edge, and a one-cycle default-subordinate error only on unmapped accesses. Expose them with back-to-back cross-subordinate traffic, random waits and address sweeps at every region boundary.
Follow-upPractise Interconnect Bugs That Pass Block Tests →AHB Decoder, Multiplexor and Default Subordinate7
Build the interconnect for one AHB manager and three subordinates. What does the decoder do, what drives the read multiplexor's select, and why do you need a default subordinate? L2
The decoder turns HADDR into one HSELx during the address phase. The multiplexor returns HRDATA, HRESP and HREADYOUT from the subordinate whose data phase is in progress. So its select is the decoder output, registered at every edge where HREADY is high. The live decoder output already names the next transfer. A default subordinate fills the holes in the map, so nothing hangs. It gives a zero-wait OKAY for IDLE and BUSY, and a two-cycle ERROR for NONSEQ and SEQ.
QuestionPractise AHB Decoder, Multiplexor and Default Subordinate →List the AHB burst types. Where does a WRAP4 of words starting at 0x34 go, and what rule must an incrementing burst respect? L1L2
HBURST gives SINGLE, undefined-length INCR, and fixed INCR4/8/16 and WRAP4/8/16. The number counts beats, not bytes. A wrapping burst wraps inside a window of beats times size. So a WRAP4 of words from 0x34 visits 0x34, 0x38, 0x3C, 0x30. An incrementing burst must not cross a 1 KB boundary, because subordinate regions are at least 1 KB and 1 KB aligned. Every beat is aligned to its size.
QuestionPractise AHB Bursts and the 1 KB Rule →Why must an AHB incrementing burst not cross a 1 KB boundary? And how does that compare with AXI? L1L2
Subordinate regions are at least 1 KB, and they start and end on 1 KB boundaries. So a burst that stays inside one 1 KB block never changes subordinate mid-burst. Subordinates can then treat SEQ beats as a continuation without decoding again. AXI applies the same idea with a 4 KB boundary. A wrapping burst stays inside its own aligned window, which on usual bus widths is far smaller than 1 KB.
Follow-upPractise Why the 1 KB Boundary →Break it: an INCR4 burst of words starts at 0x3F8. What goes wrong at the boundary, and what should the manager do? L1L2
The beats are 0x3F8, 0x3FC, 0x400 and 0x404. The third beat starts the next 1 KB block, which may belong to another subordinate. That subordinate sees a SEQ beat with no NONSEQ before it. The manager must split the request: two beats, then a new NONSEQ at 0x400.
Follow-upPractise An INCR Burst Across a 1 KB Boundary →Write the next-address function for AHB bursts, wrapping and incrementing, and show it on the spec's examples. L1L2
The window is beats times size, aligned to its own size. Add the size to the address. For a wrapping burst, if that reaches the end of the window, go back to the window's base. The run reproduces the specification's WRAP4, INCR4, WRAP8 and halfword INCR8 examples. The classic bug is a window sized for the old burst length, which turns WRAP8 back at 16 bytes.
Follow-upPractise Next Address in a Wrapping Burst →Can an AHB burst end before its last beat? Who may end it, and what must a subordinate tolerate? L2L3
A manager may not end a fixed-length burst on its own, but two things can end it. After an ERROR, the manager may cancel the remaining beats. A multi-layer interconnect may also cut a burst to serve another manager. An INCR burst also ends whenever BUSY is followed by IDLE or NONSEQ. Subordinates must work correctly when a burst never completes, for example by dropping prefetched data.
Follow-upPractise Bursts That End Early →Now a DMA engine joins the CPU on the same subordinates. What changes in the AHB system, and what does the verification plan add? L3L4
An interconnect adds arbitration and routing, because the AHB interface itself stays single-manager. It stalls a waiting manager by holding its HREADY low. A multi-layer interconnect may cut a burst short to serve another manager, so subordinates must cope with unfinished bursts. Locked sequences need HMASTLOCK, and exclusives need HMASTER to tell managers apart. The plan adds per-port checkers, routing scoreboards, fairness coverage and terminated-burst coverage.
Follow-upPractise From One AHB Manager to Several →22 questions · 4 topicsUART
Drawing a UART Frame5
The line idles high and runs 8N1. Draw the frame for 0xA5 on the wire and tell me how many bit-times it takes. Then add even parity. L0L1
Idle is 1. The frame starts with a 0 start bit. Then come the eight data bits, least significant bit first, and a 1 stop bit. For A5h that is 0, then 1 0 1 0 0 1 0 1, then 1: ten bit-times. Even parity adds one bit before the stop bit, chosen so the count of 1s is even. A5h already has four 1s, so the parity bit is 0 and the frame takes eleven bit-times.
QuestionPractise Drawing a UART Frame →Why does a UART need a start bit and a stop bit at all? L0
There is no clock wire, so the receiver needs one moment it agrees on with the transmitter. That moment is the high-to-low edge of the start bit. The receiver times every bit from that edge. The stop bit returns the line high. So the next frame always begins with a fresh falling edge, even when the last data bit was 0.
Follow-upPractise Why Start and Stop Bits →Compare UART with SPI. What does UART give up by not sending a clock? L0L1
SPI sends the clock, so the receiver samples on an edge it is given, and the rate can change freely. A UART receiver must rebuild bit timing from the start edge and its own clock. So both ends must agree closely on the baud rate. Frames also carry start and stop overhead: 8N1 moves 8 data bits in 10 bit-times. The gain is fewer wires and no shared clock across a cable.
Follow-upPractise The Cost of No Clock Wire →Parity is on. Which corruptions does it catch, and which pass silently? L1
It catches any odd number of flipped bits in the data and parity bits. It passes any even number. So a burst that flips two adjacent bits passes. Parity also says nothing about a lost or extra frame. Systems that care add a checksum or CRC at the packet level, above the UART.
Follow-upPractise What Parity Misses →Why does parity miss exactly the corruptions that flip an even number of bits? L0L1
Parity stores one fact: whether the count of ones is even or odd. Flipping one bit changes that count by one, so the parity no longer matches. Flipping two bits changes the count by two or by zero, so it still matches. Any even number of flips cancels the same way.
Follow-upPractise Why Parity Misses Two Flipped Bits →Why a UART Oversamples8
Why does a UART receiver run at 16 times the baud rate? Walk me through how it finds and samples each bit. L0L1
There is no clock on the wire, so a fast local clock finds the start edge to within one tick. It then counts to the middle of every bit. A typical receiver rejects glitches in the middle of the start bit. There, 8 ticks after the edge, the line must still be low. After that it samples every 16 ticks, often with a 2-of-3 vote over ticks. At 16x a sample is off by at most a sixteenth of a bit; at 2x, by half a bit.
QuestionPractise Why a UART Oversamples →Why 16x? Would 4x or 64x be better? L1L2
The ratio sets the quantisation error of finding the start edge: up to one tick, or 1/N of a bit. At 2x that is half a bit, which already uses the whole budget; at 16x it is about 6 %. Beyond that, the rate mismatch between the two clocks dominates. So 64x buys little and costs a faster clock and wider counters. Sixteen also leaves room for a centred vote over several ticks.
Follow-upPractise Why 16 and Not 2 →Design the shortest glitch that corrupts a byte despite a 2-of-3 vote. How would your testbench inject it? L1L2
Two low ticks on two of the three vote ticks of one sample win the vote. One tick never does. The bench must time the glitch against the receiver's own sample ticks. A random glitch time rarely lands on two vote ticks, so the bench must know or sweep the sample position. The P6.5 bench did this and turned 55h into 45h with no flag.
Follow-upPractise Beating the Majority Vote →Your UART and its peer run from different clocks. How much baud-rate mismatch can the link tolerate, and which bit fails first? L1L2
Drift is zero at each start edge and grows with every bit. So the last sample, the stop bit, fails first. A receiver that samples exact bit centres has half a bit of slack over the nine bits before the stop. That is about ±5.6 %, shared by both ends. Real receivers do worse: the site's bench receiver first loses 8N1 frames at +4.5 % and −6 %. The 8E1 format fails earlier, because parity puts the stop bit one bit later.
QuestionPractise The Baud Mismatch Budget →Why is it the stop bit that fails, and not data bit 0? L1
The start edge is the only moment both ends agree on, and drift is zero there. Each later bit adds the same timing error. So the sample furthest from the start edge, the stop sample, has drifted most. This is also why the receiver restarts its count on every start edge. The error never carries from one frame to the next.
Follow-upPractise Why the Stop Bit Fails First →Would switching to two stop bits give you more tolerance? L2
It helps only on the fast side, and only when frames stream back to back. There, with a fast transmitter, the stop sample comes late and can land in the next start bit. It then reads 0. A second stop bit puts idle time there instead. With idle time between frames it buys nothing: the P6.4 sweep shows 8N1 and 8N2 failing at the same steps.
Follow-upPractise Does a Second Stop Bit Help →Your SoC talks to a module clocked by an RC oscillator. How do you sign off that the UART link works across temperature and parts? L2L3
Add up the error sources: this end's divisor rounding and clock tolerance, and the peer's oscillator tolerance over temperature and voltage. Compare the sum, in both directions, with the receiver's measured budget for the frame format in use, not a quoted 5 %. In simulation, sweep the peer rate in fine steps, both ways, in every supported format. Run frames back to back and with gaps. Record the first failing step as the sign-off number.
Follow-upPractise Signing off a UART Link Budget →Why is the measured 8N1 budget +4.5 % on one side and −6 % on the other, not ±5 %? L2L3
A rate error moves each sample further from its bit centre, and the stop bit moves most. The total room is about half a bit over the frame. A receiver that samples a little before the centre has less room on one side and more on the other. So quote the budget with its receiver, format and pacing.
Follow-upPractise Why the Baud Budget Is Lopsided →Lost Bytes on a Clean Wire5
A customer says bytes go missing from your UART under load. Yet a protocol analyser on the RX pin shows every frame clean. What is going on? Also, tell me how framing, parity, overrun and break differ. L1L2
A clean wire with lost bytes points inside the receiver, to an overrun. A frame completes before software read the previous byte, and the new byte overwrites it. Framing errors (the stop sample reads 0) and parity errors are visible on the wire; an overrun is not. A break is the line held low for longer than a whole frame. A correct receiver reports it once and delivers no byte. It hunts for a start only after the line is high again.
QuestionPractise Lost Bytes on a Clean Wire →After a break, why must the receiver wait for the line to go high before it hunts for a start bit? L1L2
During a break the line is a continuous 0. A receiver that re-arms at once takes the low level as a new start every frame time. It delivers a stream of 00h framing errors. Waiting for the high level means the next frame begins on a real falling edge. A common bug that tests miss is a lost first frame after recovery: the receiver re-armed too late or too early.
Follow-upPractise Recovering from a Break →Break it: after a break, the receiver waits for a whole frame of idle high before it hunts again. What goes wrong? L1L2
The transmitter may send the next start bit soon after the line goes high. A receiver that waits a whole frame misses that falling edge. It loses the first byte, or starts in the middle of it and reads garbage. Re-arm on the first high level, then hunt for the next falling edge.
Follow-upPractise A Receiver That Re-Arms Too Late →Software cannot always keep up. How do RTS and CTS prevent overrun, and why is the RTS trigger set below the FIFO size? L1L2
Each side drives RTS from its own receive FIFO level. The peer sees it as CTS and starts no new frame while CTS is deasserted. But frames already started, or already loaded in the transmitter, still arrive after RTS changes. So the trigger sits below full, and the room above it absorbs those frames. The P6.6 bench uses 12 of 16; a trigger at 16 left no room.
Follow-upPractise RTS, CTS and the Trigger Level →Your scoreboard fires on every framing error, and the error-injection tests now fail. How should the checker decide whether a flag is a bug? L2
A flag is a bug only if it disagrees with what was sent. So the checker predicts flags from the stimulus. An injected short stop expects FE, a break expects one break and no byte, and a slow read expects overrun. It flags both a missing expected flag and an unexpected one. Banning all errors makes error tests impossible; ignoring flags misses a receiver that never sets them.
Follow-upPractise Error Checks Without False Alarms →Verification Plan for a UART4
You own verification of a UART IP: 16-byte FIFOs, programmable divisor, parity options and RTS/CTS. Walk me through your plan. L2L3
I use three independent parts. A wire monitor reports each frame after its stop sample. A reference model predicts bytes and flags from the stimulus and the read timing, and a scoreboard compares them. Stimulus sweeps the divisor and the peer rate error both ways, in every format, back to back and with gaps. It injects faults: parity, short stop, break, glitches, slow reads and CTS toggling. Before trusting the checker, I run it against a bank of known-faulty receivers.
QuestionPractise Verification Plan for a UART →When should a UART monitor publish a byte to the scoreboard, and why not earlier? L1L2
After the stop sample. Until then there is no frame. The stop bit decides between a byte, a framing error and a break, and a break never gives a byte. A monitor that publishes at data bit 7 hands the scoreboard bytes that later turn out to be breaks or errors.
Follow-upPractise When a Monitor Reports a Byte →Walk me through how you showed that your UART checker would catch a bug, beyond a green regression. L2L3
Run it against a bank of deliberately faulty receivers. Examples are a missing overrun flag, an off-centre sample, a one-tick start check and a broken break recovery. Add a legal variation, such as a rate error inside the budget. Every fault must make some check fire, and the legal case must stay silent. A fault that no test catches names the next test to write.
Follow-upPractise Proving Your Checker Works →Which UART bugs typically survive a decent regression, and what would have caught each? L3
Rate tolerance worse than claimed: only a sweep to the first failing step catches it. A missing overrun flag: caught only when software reads slowly. The first frame lost after a break: caught by sending a frame right after recovery. An RTS trigger off by one: caught by filling the FIFO to exactly the trigger. Each needs a deliberate scenario; random traffic at the nominal rate rarely hits them.
Follow-upPractise UART Bugs That Escape →21 questions · 4 topicsSPI
SPI Modes, CPOL and CPHA9
Explain SPI modes 0 to 3. In each mode, which clock edge launches data and which edge samples it? L0L1
CPOL is the clock's idle level. CPHA picks the sampling edge. CPHA 0 samples on the first edge after the clock leaves idle; CPHA 1 samples on the second. The other edge launches the next bit. So modes 0 (CPOL 0, CPHA 0) and 3 (1, 1) sample on rising edges, and modes 1 and 2 on falling edges. With CPHA 0, the first bit must already be on the line when CS falls.
QuestionPractise SPI Modes, CPOL and CPHA →In mode 0 the first edge after CS falls is a sampling edge. When was the first bit launched? L1
At the falling edge of CS. With CPHA 0 there is no launch edge before the first sample. So both sides put bit 7 out as soon as they are selected. They launch every later bit on the trailing edge. A peripheral that waits for a clock edge to drive bit 7 delivers the byte one bit late.
Follow-upPractise Where the First CPHA 0 Bit Comes From →A serial flash supports both mode 0 and mode 3. What actually differs, and does it matter which one you use? L1
Only the clock level while idle, at the CS edges: low in mode 0, high in mode 3. In both, the flash latches input on rising edges and drives output on falling edges. So data transfer is identical. It matters at the frame boundary: the controller must hold the idle clock level when it moves CS. The CS-to-clock setup and hold times still apply.
Follow-upPractise Mode 0 Against Mode 3 →Your controller reads a peripheral's ID register as 52h, but the datasheet says A5h. Writes seem to work. What is your first suspect? L1L2
A clean one-bit shift is the signature of an SPI mode mismatch, not noise. Both sides move one bit per clock but disagree on which edge carries it. The controller samples each bit just before the peripheral launches it, so it gets the previous bit. The lost bit turns up in the next byte. With a mode-0 controller and a mode-1 peripheral, writes can still pass. But their only hold time is the launch delay.
QuestionPractise The Reply Shifted by One Bit →Why is a mode mismatch a shift of exactly one bit, never two? L1
Both sides still move one bit per clock and agree on the number of clocks. They disagree only on which of the two edges in a clock period carries the bit. Those edges are half a period apart. Sampling on the launch edge reads the value from before the launch, which is the previous bit. So every bit lands exactly one place late.
Follow-upPractise Why Exactly One Bit →The mismatched direction passes in your zero-delay simulation. Why might it fail in silicon, and how do you compute the real margin? L2
On the shared edge, the only hold time is the launching side's clock-to-output delay. So a model with no delays always takes the old bit and looks correct. In silicon, hold must beat the receiver's requirement, such as tCHDX of 2 ns on the W25Q128JV. For same-cycle reads, start from half a clock period. Subtract the peripheral's clock-to-output time (tCLQV) and the controller's input setup; the rest is the setup margin.
Follow-upPractise Passing in Simulation, Failing on the Board →You write a passive SPI monitor. How does it know which edge to sample, and what can a checker on the wires assert? L1L2
From configuration, never by guessing: rising when CPOL equals CPHA, falling otherwise. A monitor that infers the mode can be fooled by the very mismatch it should catch. On the wires alone, a checker can assert the idle clock level at CS edges and MISO released while deselected. It can also check stable data on the sample edge, whole bytes on writes and CS-to-clock times. Whether the bytes are right needs a reference model.
Follow-upPractise How an SPI Monitor Picks Its Edge →You verify a QSPI flash controller that does reads, page programs and erases. What is in your bench, and which bugs would still escape? L2L3
Use a wire monitor for every supported mode and lane width. Add wire checks that need no data: idle level, MISO and IO release, CS timing and whole bytes on writes. A strict flash model refuses what the datasheet forbids: programs without WEL, quad reads with QE clear, commands while BUSY. A scoreboard compares readback with a reference memory. Bugs escape through a lenient model, page-wrap writes, off-by-one dummy counts and turnaround timing.
Follow-upPractise Verifying an SPI Flash Controller →Prove it: how do you show that your QSPI bench catches each class of fault, not just that the tests pass? L2L3
Plant one fault per class, such as a missing WEL, a late IO release or a page-wrap error. Run every test against every fault and record which check fires. A fault with no mark is a hole, so add a program for it. On the lesson bench the wire checker caught 1 fault of 11, and readbacks caught the rest.
Follow-upPractise Showing the Flash Bench Catches Each Fault →Sharing MISO Between Peripherals3
Three SPI peripherals share one MISO line. What must each do when its chip select is high, and what goes wrong if one does not? L1
A deselected peripheral must put MISO in high impedance, so only the selected one drives it. The W25Q128JV floats its outputs whenever /CS is high. If a deselected device keeps driving, two outputs fight. Simulation shows x on the bits where they disagree. A board shows mid-rail levels, wrong bits and extra current. Clock, MOSI and MISO are shared; each device has its own active-low select.
QuestionPractise Sharing MISO Between Peripherals →Compare one chip select per device with a daisy chain. L1L2
Separate selects cost one pin per device, but let you talk to any device alone, at its own mode and length. A daisy chain uses one select, and each device's output feeds the next device's input. So the chain is one long shift register, and every update shifts through every device. One broken device breaks the chain, and every device must support pass-through. It suits strings of identical parts, such as LED drivers or shift registers.
Follow-upPractise Separate Selects or a Daisy Chain →How soon after one select rises may the controller select another device and read it? L2
The first device needs its output-disable time to let go of MISO: 7 ns maximum (tSHQZ) on the W25Q128JV. The next device's first driven bit must come later than that. The same device also has its own minimum deselect time before it accepts a new command. On that flash it is 10 ns after a read and 50 ns after a program, erase or write.
Follow-upPractise Switching from One Device to the Next →Who Drives the Lanes in EBh5
Walk me through a Fast Read Quad I/O (EBh) on a W25Q128JV, clock by clock. Who drives IO0 to IO3 at each point? L2
The controller sends EBh on IO0 alone for 8 clocks. Then it sends the 24-bit address on all four lanes in 6 clocks, and the mode byte in 2 more. Then come 4 dummy clocks, in which the controller must release the lanes. From clock 20 the flash drives one byte every 2 clocks, high nibble first, with the top bit on IO3. QE in status register 2 must be set, because IO2 and IO3 replace the /WP and /HOLD pins.
QuestionPractise Who Drives the Lanes in EBh →Read Data (03h) has no dummy clocks. Why do the fast reads add them? L1L2
The flash needs time to fetch the first byte after the last address bit. Read Data (03h) gets that time by running slowly: on the W25Q128JV it is limited to 50 MHz. Fast Read (0Bh) adds eight dummy clocks so the whole frame can run at the full rated clock. That is 133 MHz in the 3.0 to 3.6 V range. The quad I/O read sends the mode byte and then only four dummy clocks.
Follow-upPractise Why Dummy Clocks Exist →What if the controller sends six dummy clocks instead of eight for Fast Read (0Bh)? L1L2
The flash drives data only after its eighth dummy clock. The controller starts sampling two clocks early, so it reads two junk bits first. Every byte it returns is then shifted by two bits. Check the dummy count per command, because the quad reads use different counts.
Follow-upPractise Too Few Dummy Clocks on a Fast Read →The controller releases IO0 to IO3 one clock late, after the first data clock. What do you see, and how would your bench catch it? L2
Both drivers are on during the first data clock. Simulation shows x on lanes where they disagree; the board shows mid-rail levels and wrong bits. A bench catches it with a wire rule: no lane has two drivers. Or it checks that the controller's output enables are off before the first data clock. Waiting for a data mismatch is not enough, because matching bits hide the fight.
Follow-upPractise Releasing the Quad Lanes Late →A CPU executes in place from this flash with a 32-byte cache line. What does one miss cost, and does burst wrap make it cheaper? L2L3
One EBh read of the line: 8 instruction, 6 address, 2 mode, 4 dummy and 64 data clocks, 84 in all. Burst wrap, set with 77h, does not reduce that. It starts at the byte that missed and wraps within the aligned section. So the CPU can resume while the rest of the line streams in.
Follow-upPractise The Cost of an XIP Cache Miss →The 300-Byte Page Program4
Firmware programs a 300-byte buffer into a W25Q128JV starting at a page boundary. Readback shows the first 44 bytes wrong and the next page still erased. Explain. L2L3
Page Program writes within one 256-byte page. The low address byte wraps inside the page, so bytes 256 to 299 overwrite bytes 0 to 43. The next page is never touched. The driver must split writes at page boundaries. It must send Write Enable (06h) before every program, because WEL clears when a program finishes. It must also raise CS only after a whole byte, and poll BUSY before the next command.
QuestionPractise The 300-Byte Page Program →Why does every program or erase need its own Write Enable, and how does firmware know the operation has finished? L1L2
Write Enable (06h) sets WEL, a guard against stray writes. The flash clears it after every program, erase or status write, so each one needs a fresh 06h. After CS rises, the operation runs on its own for milliseconds. Firmware polls status register 1 with 05h until BUSY, bit 0, reads 0. While BUSY, the flash ignores everything except status reads and suspend.
Follow-upPractise WEL and BUSY →Walk me through how the page-wrap bug escaped your flash-model tests and what you would change. L2L3
The model shared the driver's wrong belief, a linear address. So the two agreed, and the test checked nothing the datasheet says. Fix the model first: feed it stimulus the datasheet forbids or defines unusually, and expect the datasheet's result. Examples are a program past a page, a program without 06h and a quad read with QE clear. Then cover page offset × length, including lengths that cross the boundary.
Follow-upPractise How the Page Bug Escaped →What if firmware programs a location that already holds data, without erasing first? L1L2
The datasheet defines Page Program only on erased locations, which read FFh. So the result is not something to rely on. In practice, programming can only clear bits, never set them. To get 1s back you must erase, and the smallest erase on this flash is a 4 KB sector. So updating one byte means a read, a sector erase and a reprogram.
Follow-upPractise Programming over Old Data →32 questions · 6 topicsI2C
Why I2C Is Open Drain5
I2C outputs are open drain with pull-up resistors. Why not ordinary push-pull outputs, and what does that choice cost? L0L1
Each device can only pull a line low or let go. A pull-up resistor raises the line when every device lets go. So the line is the wired-AND of all devices, and two drivers never fight. That makes clock stretching, clock synchronisation and multi-controller arbitration possible. It also lets parts on different supplies share a bus. The cost is the rising edge: a resistor charges the bus capacitance, which limits speed and bus size.
QuestionPractise Why I2C Is Open Drain →A new target drives SDA high actively whenever it is not pulling low. What happens on the bus? L0L1
The first time another device pulls SDA low while this one drives high, two outputs fight. In simulation the line resolves to x. On a board, the two transistors set a voltage, often between VIL and VIH, so receivers disagree. ACKs, arbitration and the controller's own bits all break. The fight can also damage drivers.
Follow-upPractise A Push-Pull Device on SDA →You have a Fast-mode bus at 3.3 V with about 100 pF. How do you choose the pull-up resistor? L1L2
Two bounds. Rp(max) comes from the rise-time limit: tr = 0.8473 Rp Cb. With 300 ns and 100 pF, Rp is at most about 3.5 kΩ. Rp(min) comes from the sink current: (VDD − 0.4 V) / 3 mA, about 967 Ω. Pick inside that window, toward the high end if supply current matters. At 400 pF in Fast-mode the window is empty, so a resistor alone cannot work.
Follow-upPractise Sizing the I2C Pull-Up →The sensor cable makes your bus 800 pF, twice the Fast-mode limit. What are your options, and what does each cost? L2L3
UM10204 lists four options. Run a slower SCL so the rise fits, or use higher-drive parts, such as Fm+ devices, with a stronger pull-up. Split the bus with buffers, multiplexers or switches so each segment stays under the limit, or add a switched pull-up. Buffers add delay to every edge and may bring their own VIL/VOL rules. Fm+ still stops at 550 pF and 1 MHz.
Follow-upPractise An 800 pF I2C Bus →Your I2C timing checker in simulation is clean. Does that prove the bus meets UM10204 timing? L2
No. A digital checker measures edge-to-edge times such as tLOW, tHIGH, tSU;DAT and tBUF on 0/1 pins. Rise time, fall time, spike width and bus capacitance are analog. In RTL the pins switch instantly, so a pull-up that is far too weak still passes. Those rows need SPICE or a board measurement, plus the pull-up arithmetic.
Follow-upPractise What a Digital I2C Checker Cannot See →The Ninth Clock: ACK and NACK5
Draw one I2C byte with its acknowledge. Who drives SDA in the ninth clock on a write, and on a read? Why does the controller NACK the last byte it reads? L0L1
The controller makes all nine clocks. In the ninth, the transmitter releases SDA. The receiver pulls it low (ACK) and holds it through the high phase; SDA left high is a NACK. On a write the target ACKs, and on a read the controller does. The controller NACKs the last read byte so the target stops driving. An ACK would tell the target to send the next byte, which may hold SDA low and block the STOP.
QuestionPractise The Ninth Clock: ACK and NACK →Your driver gets a NACK after the address byte. What could it mean, and what should the controller do? L1
After an address, most likely no device answers at that address, or the target is busy with a real-time task. Later in a transfer, a NACK can mean the target did not understand the byte or cannot take more. A controller-receiver also NACKs on purpose to end a read. Whatever the reason, the controller ends with STOP or tries again with a repeated START. Software decides whether to retry.
Follow-upPractise What a NACK Means →A target keeps pulling SDA low after its ACK slot, into the next bit. What does a correct controller report, and how do you find the culprit? L2
A correct controller that sends a 1 and reads a 0 decides it lost arbitration. So the log says "arbitration lost", even on a single-controller bus. The wires alone cannot say who pulled. You need the driver view, meaning each device's pull-low enable. It shows the target's lane still active after the ninth clock.
Follow-upPractise An ACK That Overstays →In I2C the ninth bit of a data byte is the receiver's ACK. What is it in I3C SDR? L1L2
The transmitter drives it. On a write, it is odd parity from the controller: the XOR of the eight data bits with 1. Parity lets the target detect a corrupted byte. On a read, it is end-of-data from the target: 0 ends the message, and 1 offers more. So the target decides how much it returns, though the controller may abort after a 1 with a repeated START.
Follow-upPractise The I3C T-Bit Versus the I2C ACK →What if the target sees a parity error on a byte the controller wrote? What does it do, and how does the controller find out? L2
It cannot NACK the byte, because the ninth bit belongs to the controller. Error type S2 says the target ignores the rest and waits for a STOP or a repeated START. The controller sees nothing on the wire. It learns of the error later, from the Protocol Error bit that GETSTATUS returns.
Follow-upPractise A Parity Error on a Written Byte →Clock Stretching5
What is clock stretching in I2C, and what must the controller do for it to work? L1L2
A target that needs time holds SCL low. SCL is a wired-AND, so the line stays low after the controller lets go. The controller must read SCL back, and start timing its HIGH only once SCL really is high. A controller that times HIGH from its own release samples SDA too early. The target still holds the clock, so the controller reads a wrong byte. Stretching is optional for targets and has no time limit in I2C.
QuestionPractise Clock Stretching →The same "read SCL back" rule makes clock synchronisation between two controllers work. Explain how. L2
On a wired-AND SCL, every controller starts counting LOW when the line falls. But the line rises only when the last one lets go. Each waits for SCL high before counting HIGH, and the first to finish HIGH pulls it low again. So the bus clock gets the longest LOW and the shortest HIGH of all controllers. A stretching target is just another device with a long LOW.
Follow-upPractise One Rule, Two Features →A target holds SCL low and never releases it. I2C has no time-out. What should your controller do, and how would you verify it? L2L3
I2C sets no limit, so the controller IP should carry its own configurable time-out. It should give up and report, not hang. With SCL stuck low, clocking out is impossible, so UM10204 points to a hardware reset input or a power cycle. To verify, use a target model that never releases. Check that the controller times out, flags the error and leaves SCL released.
Follow-upPractise A Target That Never Lets Go →Break it: you set the controller's stretch time-out to 1 ms. Which legal target does that break? L2
Any target whose datasheet allows a longer stretch. I2C sets no limit on stretching, so a 1 ms limit turns legal behaviour into a reported error. Set the limit from the slowest target's datasheet. Use SMBus's 35 ms only when the system really uses SMBus devices.
Follow-upPractise A Clock-Stretch Time-Out That Is Too Short →Can a target stretch the clock on I3C? What replaces it? L1L2
No. In I3C only the controller drives SCL, and legacy I2C targets on an I3C bus may not stretch. The controller may stall instead, holding SCL low in only four places. They are the ACK/NACK slot, a write's parity bit, a read's T-bit and the first bit of an assigned address in DAA. The absolute maximum stall is 15 ms.
Follow-upPractise Stretching on I3C →I2C Multi-Controller Arbitration5
Two controllers start a transfer at the same moment, one to 0x50 and one to 0x58. How does I2C decide who wins, and what happens to the loser's message? L1L2
Both drive SDA bit by bit, and compare the wired-AND line with what they sent while SCL is high. The first controller to send a 1 and read a 0 has lost, and it releases SDA at once. Until then both sent identical bits, so nothing is lost and the winner's message is intact. Address 0x58 loses on the fourth address bit. The loser may clock to the end of that byte, and retries when the bus is free.
QuestionPractise I2C Multi-Controller Arbitration →Your controller also has a target address. It loses arbitration during the address byte. What must it do next, and why? L2
It must switch to target mode at once and keep decoding the address. The winner may be addressing this very device. If it waits as an idle controller until the bus is free, it misses its own address. The winner then sees a NACK. Separately, it must not drive any more bits of its own message.
Follow-upPractise The Loser May Be the Target →What if the losing controller starts its own transfer again right after it loses? L2
It must wait until the bus is free. The bus counts as busy from the START until a set time after the STOP, and a repeated START keeps it busy. So the loser waits for the winner's STOP and the bus-free time. A START any earlier breaks the winner's message.
Follow-upPractise When the Losing Controller May Retry →Is there any collision I2C arbitration cannot resolve? L2L3
Yes. UM10204 leaves three collisions undefined while arbitration is still running. In two of them, one controller sends a repeated START or a STOP while the other sends a data bit. In the third, one sends a repeated START against a STOP. Arbitration works only when both still send bits in the same position of the same format.
Follow-upPractise Where Arbitration Is Undefined →You own a multi-controller I2C controller IP. How do you verify arbitration and clock synchronisation to sign-off? L3L4
Build a two-controller bench with a reference controller and the DUT on wired-AND lines. Cover a loss at every address and data bit position and identical messages that complete together. Add a loss while addressed as a target, the clock-to-end-of-byte rule, and unequal LOW/HIGH periods for synchronisation. Check from the driver view that the loser never drives after losing. Back it with a formal proof on an abstraction.
Follow-upPractise Verifying a Multi-Controller I2C IP →Reading a Register with Repeated START6
Walk me through reading register 0x3C of an I2C target at address 0x50. Why is there a repeated START in the middle? L0L1
The frame is S, 0x50 with W, ACK, the pointer 0x3C, ACK. Then comes a repeated START, 0x50 with R, ACK, the data byte, NACK, STOP. The write sets the target's internal pointer, and the read returns data from it. The repeated START changes direction without releasing the bus. A STOP would free the bus. On a multi-controller bus, another controller could then take it and move the pointer before the read.
QuestionPractise Reading a Register with Repeated START →What concretely goes wrong if you send STOP then START between the pointer write and the read? L1
After the STOP and the bus-free time, another controller may win the bus. It may access the same target, move its pointer or change the register. Your read then returns data from the wrong place, with no error anywhere. STOP then START works on a single-controller bus, with a target that keeps its pointer. Sr makes it safe without relying on either assumption.
Follow-upPractise STOP Plus START Instead of Sr →Register writes work, but every combined-format read returns 0xFF. The target ACKs the pointer. What do you suspect? L1L2
The target does not detect the repeated START. It treats the Sr and the next address byte as more write data, and never answers the read address. So the controller reads the released line: 0xFF. UM10204 requires devices to reset their bus logic on any START or repeated START, and expect an address. A test that only writes, or reads with STOP plus START, never exercises it.
Follow-upPractise A Target That Ignores Sr →Prove it: which directed test exposes a target that misses the repeated START? L1L2
A combined-format read: write the register pointer, send Sr, send the read address, then read. Check that the target ACKs the read address and returns the register value, not 0xFF. Cover Sr in the monitor, so coverage shows that this format really ran.
Follow-upPractise A Test That Exposes a Missed Repeated START →How does a register read change with a 10-bit target address? L2
The address takes two bytes: 1111 0XX plus W, then the low eight bits. Here XX are the top two address bits. Several targets may ACK the first byte, but only one ACKs the second. After the pointer write, the controller sends Sr and repeats only the first byte, with R. The target that matched both bytes earlier stays addressed and answers.
Follow-upPractise A 10-Bit Address Read →You write an I2C monitor. When does it publish a transaction, and what goes wrong if you publish at START? L2L3
Sample data at SCL rises, and detect START and STOP as SDA edges while SCL is high. Close the current transaction at a repeated START or a STOP. A monitor that publishes at START publishes the previous transaction late. On the first START, it publishes a byte it shifted in before the address. Treat Sr as both the end of one transfer and the start of the next.
Follow-upPractise Where an I2C Monitor Closes a Transaction →Recovering a Stuck I2C Bus6
After a watchdog reset of the SoC, the I2C bus is dead: SDA reads low forever, SCL is high. What happened and how does the controller recover? L2L3
The controller reset in the middle of a read, while a target was sending a 0. The target waits for SCL edges to finish its byte. No STOP can form while it holds SDA low. To recover, clock SCL up to nine times, checking SDA before each pulse. Each falling edge moves the target to its next bit, and it lets go at a 1 or its ACK slot. Then send a STOP, and if SDA stays low, use a hardware reset or power cycle.
QuestionPractise Recovering a Stuck I2C Bus →Why does the bus clear use up to nine clocks, and why stop early? L2
Every falling SCL edge moves a stuck transmitter to its next bit. Within a byte's eight bits and its acknowledge slot, it must reach a 1 or the ACK slot. There it lets go of SDA, so nine pulses cover any position. Stop as soon as SDA reads high. Extra pulses after that just clock a target further into a transfer the controller no longer wants.
Follow-upPractise Why up to Nine Clocks →What if SDA is still low after the nine clock pulses? L2
Then the target is not just waiting for clocks; it may be hung. Stop pulsing and report the failure. UM10204 then points to the device's hardware reset input, or a power cycle to trigger its power-on reset.
Follow-upPractise SDA Still Low After Nine Clocks →Now SCL is stuck low instead of SDA. Does the nine-clock trick help? L2L3
No. The controller cannot make SCL pulses if something holds SCL low. UM10204 says to use the devices' hardware reset inputs. Or cycle their power to trigger the mandatory power-on reset. So the controller must detect the fault with a time-out and report it. The board also needs a reset path to the I2C devices, a system design decision made early.
Follow-upPractise When SCL Is the Stuck Line →Name the bugs you have seen, or would expect, in a bus-clear implementation. L2
One bug sends only eight pulses, one short for a target that needs nine. Another sends no STOP after SDA comes back, so devices still think a transfer is open. A third pulses without reading SDA, so it claims success while the line is still low. A fourth waits forever when SCL is held, instead of timing out. Each needs its own stuck-target scenario to show up.
Follow-upPractise Bugs in a Bus-Clear Routine →Walk me through your verification plan for an I2C controller and target pair. How do you know you are done? L3L4
I use four kinds of checking, starting with data checks against a model derived from the wire. The others are a timing checker for the Table 11 edge times, a driver-view checker and a two-controller bench. Directed programs target each fault: wrong addresses, pointer wraps, Sr, stretching, collisions and a stuck bus. Done means every seeded fault is caught, legal variations stay silent and coverage closes.
Follow-upPractise Signing off an I2C Controller →16 questions · 3 topicsI3C
I3C Versus I2C4
What does I3C change compared with I2C, and what does it keep? L0L1
I3C keeps the two wires, START, STOP and the 7-bit address header, and legacy I2C targets can share the bus. Data moves to push-pull, at up to 12.5 MHz. Open drain stays only where several devices may drive: arbitration, ACKs and address assignment. Only the controller drives SCL, so targets cannot stretch the clock. I3C adds dynamic addresses, common command codes, in-band interrupts and hot-join. The ninth bit of a data byte becomes parity or end-of-data.
QuestionPractise I3C Versus I2C →Why does I3C go push-pull for data, and why not everywhere? L1L2
A push-pull 1 does not wait for a pull-up resistor to charge the bus. So bits get much shorter: 80 ns push-pull against 240 ns open drain on the lesson bench. Where several devices may drive at once, a 0 must win and a 1 must lose quietly, as in a wired-AND. So these stay open drain: the header after START, where targets may raise interrupts, plus ACK slots and address assignment. The header after a repeated START, and data, are push-pull.
Follow-upPractise Where I3C Keeps Open Drain →You must keep an old I2C sensor on the new I3C bus. What conditions does it have to meet, and what happens if it lacks a spike filter? L1L2
It must be a target only, with a static address, Fast-mode support and no clock stretching. A true 50 ns spike filter on SCL hides the short I3C clock highs from it. Then the bus can run I3C at full speed, which is called a mixed fast bus. Without the filter, the device sees I3C traffic as clocks. The bus speed then drops to what the slowest unfiltered legacy device tolerates.
Follow-upPractise A Legacy I2C Target on an I3C Bus →Your I3C Basic target supports no HDR mode. Can it ignore HDR entirely? L2L3
No. I3C Basic v1.0 leaves out the HDR (high data rate) modes themselves. But a full I3C controller may still put the bus into HDR for other devices. Every target must detect the HDR entry command and the HDR Exit Pattern, even one with no HDR support. A target that misses the exit treats HDR traffic as SDR and misreads what follows. Feature lists differ between I3C editions, so name the edition you quote.
Follow-upPractise HDR Tolerance in I3C Basic →I3C Dynamic Address Assignment6
Explain how ENTDAA gives every I3C target an address. What decides the order, and what does a target that loses a round do? L2
The controller broadcasts ENTDAA, then runs rounds of Sr (repeated START) with 7E/R. Every target without an address ACKs and sends its 48-bit provisional ID, then BCR and DCR. These bits go out in open drain, with no ACKs in between. The lowest 64-bit value wins and gets a 7-bit address plus odd parity, which it ACKs. A loser stops driving and competes again in the next round. A round that nobody ACKs ends DAA.
QuestionPractise I3C Dynamic Address Assignment →Does it matter which dynamic address each target gets? L2
Yes. In I3C a lower address means higher priority. Several targets may raise an in-band interrupt after the same START. The lowest address then wins the header arbitration, because 0 bits win on the wire. So the controller should give low addresses to targets with urgent interrupts. It can reassign addresses later with SETNEWDA or RSTDAA.
Follow-upPractise Why the Address Order Matters →After DAA, reads from one address return x and the checker flags contention. How can two targets end up with the same address, and how should the controller catch it? L2L3
Either two targets sent identical ID, BCR and DCR, or one target kept driving after it lost. Both then ACK the same address. The controller knows how many devices need an address. It must compare that number with the count actually assigned, and fewer means a collision. It then resets the duplicate with RSTDAA (direct or broadcast) and runs DAA again.
Follow-upPractise Two Targets, One Dynamic Address →Why can two targets send the same provisional ID at all? L2L3
With a vendor-fixed ID, two copies of one part share the maker and part bits. Only the 4-bit instance ID tells them apart. The system designer sets it, for example with straps or fuses. If two boards strap the same value, the IDs tie, so the controller must check after DAA.
Follow-upPractise Why Two Provisional IDs Can Match →The winning target NACKs the address the controller assigns. What happens next? L2
The target NACKs when the parity bit is wrong. The controller moves on to the next round, and the same target wins again with the same ID. If it NACKs a second time, the controller must leave DAA. It then runs an error procedure that the system designer defines. So a target with a broken parity check blocks every target behind it.
Follow-upPractise A NACK During DAA →Is ENTDAA the only way a target gets a dynamic address? L2
No. With SETDASA, the controller gives one target at a time a dynamic address, using its known static address. SETAASA does it for all supporting targets at once, with no arbitration: each static address becomes the dynamic one. ENTDAA then handles targets that have only a provisional ID. In a mixed system, the controller sends SETAASA before ENTDAA.
Follow-upPractise SETDASA and SETAASA Versus ENTDAA →I3C In-Band Interrupts6
How does an I3C target raise an interrupt without an interrupt pin? Walk me through the request and the controller's choices. L2L3
The target puts its own address with R into the arbitrable header after a START. If the bus stays free for the Bus Available time, the target pulls SDA low itself. The controller then completes the START and drives the clock. The controller has three answers. It can ACK and read the mandatory byte, if BCR bit 2 promises one. Or it can NACK so the target retries later, or NACK and disable its events with DISEC.
QuestionPractise I3C In-Band Interrupts →Why would an architect choose in-band interrupts over one interrupt line per sensor? When would you keep the pin? L2L3
IBI saves a host pin and a board trace per device. The interrupt carries the source's address and often a data byte, so the host need not poll to find who asked. The price is latency that depends on the bus. A request waits for a START or the Bus Available time, controller stalls add delay, and a lower-address target wins collisions. Keep a pin where worst-case latency must stay tightly bounded.
Follow-upPractise IBI Versus an Interrupt Pin →Two targets raise an IBI after the same START while the controller wanted to address 7E. Who wins, and what do the others do? L2
The header is open drain, so the lowest address on the wire wins. Any assigned dynamic address (0x03 to 0x7B) is lower than 7E. So an interrupting target always beats the controller's broadcast header. Between targets, the lower address wins. The losers may try again, but only after the next Bus Available condition, not on a repeated START.
Follow-upPractise Two Interrupts at Once →What if the controller NACKs the winning IBI? What does the target do next? L2
A plain NACK refuses only this request, and the target tries again after the Bus Available condition. To stop the requests, the controller NACKs, sends a repeated START and then DISEC with DISINT set. A controller that NACKs forever without DISEC wastes the bus on retries.
Follow-upPractise When the Controller Refuses an IBI →A target's BCR says a mandatory byte follows each IBI, but the target sends none. What does the bus show? L2L3
After its ACK, the controller releases SDA and expects the target to drive the byte. Nobody drives, so the keeper or pull-up lets SDA rise while SCL is high. That is a STOP on the wire. A decoder closes the frame early, and a controller that carries on reads 0xFF. The fix is in the target, but only a checker that knows BCR[2] can flag it directly.
Follow-upPractise The Missing Mandatory Byte →What must an I3C target verification environment contain beyond private reads and writes? L3L4
It needs several devices, because most I3C faults involve more than one device. Use two targets with near-identical IDs for DAA ties, and two simultaneous IBIs for header contention. Add a legacy I2C neighbour for the coexistence and no-stretch rules, and HDR enter and exit followed by an SDR read. Check with a wire checker and a driver view that shows who drives a 1, for push-pull faults. Also self-check effects such as addresses assigned and bytes read.
Follow-upPractise Verifying an I3C Target →29 questions · 6 topicsHandshake
The Valid/Ready Rules6
On a valid/ready channel, when exactly does a transfer happen, and what rules must each side follow? L0L1
A beat moves at a rising clock edge where valid and ready are both high, and at no other edge. Once the source raises valid, it keeps it high until that edge, with the payload unchanged. The source must not wait for ready before raising valid. The sink may wait for valid, or raise ready early. valid is low during reset.
The sink raised ready, then dropped it two cycles later without any beat arriving. Is that a protocol violation? L1
No. ready may rise in advance and fall again before valid is asserted; it carries no hold obligation. The only rule on ready is indirect: if it is high at an edge where valid is high, a beat moved. A checker must report the musts and can warn on the shoulds. It stays silent on freedoms like this one.
Your SoC has two hundred valid/ready links. How do you get the handshake rules checked on all of them without editing each block? L2L3
Write one parameterised checker module over clk, rst_n, valid, ready and the payload. Attach it with bind, so every instance gets it without touching the RTL. Make it count antecedent matches (cycles where the rule's trigger held) per link, and report links whose stall rule never started. A silent checker on a link that never stalled checked nothing. The same properties run as assertions in formal.
Reset is released at edge 10. Can the source drive valid high so that the sink sees it at edge 10? L1L2
No. AXI requires valid to stay low at least until the rising edge after reset goes high. The earliest it may rise is at a rising edge after release. So a sink first sees it one edge later. Reset may be asserted asynchronously, but it is released synchronously. A source that raises valid too early can hand a beat to a sink that is still leaving reset.
How does a valid/ready handshake differ from a plain strobe, and from a four-phase req/ack handshake? L0L1
A strobe is a one-way pulse that assumes the receiver can always take the data. If it cannot, data is lost. A four-phase req/ack handshake needs no shared clock: req rises, ack rises, req falls, ack falls. So it suits clock crossings, but costs four transitions per item. Valid/ready uses the shared clock to do this in one edge per beat, with backpressure (the sink can stall the source).
Follow-upPractise Strobe, Four-Phase and Valid/Ready →APB and AHB have no valid/ready pair per channel. How do they apply backpressure? L1L2
The requester always moves first, and the completer can only stretch the current transfer. APB holds the access phase while PREADY is low. AHB extends the data phase while HREADY is low. There is one flow-control point per transfer, not one per channel. So reads and writes cannot overlap independently, the way AXI channels do.
The Link That Never Moved5
A DMA engine and a memory controller each pass their unit tests. Connected, nothing moves: the wave shows valid and ready low forever while both have work. What happened and whose bug is it? L0L1
It is a circular wait. The engine raises valid only after seeing ready, and the controller raises ready only after seeing valid. The controller is legal, because a sink may wait for valid. The engine broke the rule that valid must not wait for ready. Its unit test passed because that bench kept ready high in advance. The run shows the same source moving 18 beats with one legal sink and 0 with another.
Why is the sink allowed to wait for valid, but the source is not allowed to wait for ready? L1L2
Someone has to move first, and the source is the side that knows a beat exists. Letting the sink wait is useful. An interconnect can decode the address carried with valid before it decides which target grants it. A sink can also keep ready low to save power. If either side could wait, two compliant blocks could deadlock, so the spec fixes the order.
If the sink may wait for valid, may it compute ready combinationally from valid in the same cycle? L2L3
Inside one block, a same-cycle ready = f(valid) works logically. But on an AXI interface, the spec forbids combinational paths from inputs to outputs. So the wait goes through a register, and ready rises the cycle after valid is seen. The rule stops timing paths from chaining across blocks. A combinational ready path would grow with every stage.
Break it: one block makes valid from ready, and its neighbour makes ready from valid, both in the same cycle. What happens? L2L3
The two paths close a combinational loop through both blocks. Simulation can oscillate or hang in zero time, and timing tools cut the loop at a random point. AXI rules both halves out. A transmitter must not wait for READY before it asserts VALID, and no input may reach an output combinationally.
Follow-upPractise Two Blocks That Close a Combinational Loop →How would your methodology have caught that deadlock at block level, before the two blocks met? L3
Test each source against an adversarial sink, one that keeps ready low until it sees valid. Assert that pending work produces valid within a bound while ready stays low. In every agent, randomise ready per cycle, including long low stretches. In formal, assume ready stays low until valid and prove that valid rises. A cover that never hits points at the circular wait.
Is the Hold Rule Enough?5
Our handshake checker is one property: valid && !ready |=> valid. It has never fired. Is the interface covered? L1L2
No. It checks that valid stays high, but not that the payload stays stable during a stall. So a source that swaps data mid-stall passes. It has no reset rule. And "never fired" may mean "never started": if the tests never stall, the antecedent (the left side of |=>) never matches. Add $stable(payload) under the same antecedent, a reset property, and a count of stalled edges.
The sink has not taken the beat yet. Why can't the source update the data while it waits? L1
Because the sink may already have acted on it. For example, an interconnect may have decoded the address and started arbitration. A registered sink also samples whatever is on the wires at the handshake edge. If the payload can change, the beat the sink receives depends on exactly when ready rose. Neither side controls that.
How do you prove the checker actually checked something? L2
Measure its antecedents. Count the edges where valid && !ready held, per link and per test, or write cover property (valid && !ready). Zero means the rule was vacuous: it passed without checking anything. Then make sure the agents create stalls. Use random ready with long low runs, and stall on the first beat and on a burst's last beat.
What would you accept as evidence that the protocol checkers on a subsystem are complete? L3L4
A traceability table that maps each must-rule in the spec to a property. Each property is bound on every instance of the interface. Every antecedent is covered in regression on every instance, and nothing fires at sign-off except reviewed waivers. Where the risk justifies it, cross-check with a commercial VIP or formal on the same rules. A rule nobody wrote cannot fire.
Follow-upPractise Signing off Protocol Checks →You already have a scoreboard comparing what went in with what came out. Why do you also need wire-level rules? L2L3
They answer different questions. The scoreboard catches beats lost, duplicated or corrupted inside the block, which no rule on the wires can see. The rule checker catches illegal timing at the exact edge, even when the data ends up right. For example, a beat withdrawn and offered again later still matches the scoreboard. But it breaks the hold rule.
Follow-upPractise Rule Checker or Scoreboard →The Monitor That Saw Too Many Beats5
A monitor does if (valid) beats++; on every rising edge. The scoreboard says the DUT sent extra data. Who is wrong? L0L1
The monitor is wrong. A held offer keeps valid high on every stalled cycle, so counting valid adds one phantom beat per stall. A beat is an edge where valid and ready are both high. In the twin, the link carries three beats with three stalled cycles. Counting valid gives 6, counting rising edges of valid gives 2, and counting handshakes gives 3.
The link carries bursts of 1 to 16 beats. How does the monitor know where one transaction ends? L0L1
With a last flag on the final beat, or by counting against a length sent with the request. last lets the receiver and the monitor find where transactions end without knowing the length. A checker spots a short or long burst by comparing the count at last with the requested length. AXI does both: AxLEN in the request, and WLAST or RLAST on the data.
What if the sender forgets to raise last on the final beat? L1
The receiver and the monitor see one long transaction, and the next burst's beats join it. A checker that compares the beat count with the requested length catches it once the count passes the length. Without that check, the fault shows up later as a corrupted packet.
Follow-upPractise A Burst Without Its Last Flag →Why not let the driver tell the scoreboard what it sent, instead of building a separate monitor? L1L2
Because the driver reports what it meant to send, not what the wires carried. A driver bug, such as dropping valid during a stall, would be invisible. A passive monitor rebuilds transactions from the wires alone. So the same monitor also works at subsystem level, where the agent is passive and another block drives the link.
The architects want proof that the link sustains 90% throughput under realistic backpressure. How do you get it from your bench? L2L3
Have the monitor count handshakes, stalled cycles (valid && !ready) and idle cycles (!valid) over a window. Report beats per cycle for each link. Separate idles caused by the source from stalls caused by the sink, because they have different owners. Run it with the traffic profile the architects specify. Track it as a regression metric with a threshold.
Registering Ready Without Losing Beats3
Timing fails on the ready path through a chain of pipeline stages. A colleague registers ready in each stage. What breaks, and what do you build instead? L2L3
A registered ready tells the stage about a stall one edge late. So the stage accepts a beat it has nowhere to put, and overwrites one. A slice that accepts only when empty is safe but halves throughput. The fix is a skid buffer: a second register that catches the one beat in flight when the stall arrives. It gives registered ready at full rate, for roughly twice the flops.
Isn't a skid buffer just a two-entry FIFO? Why not drop in the FIFO from the library? L2
Functionally, it is a two-entry FIFO with registered ready. The library FIFO is a fine choice if two things hold. Its ready (not-full) must come from a flop. It must also pass data through without an extra cycle when empty. FIFO designs differ on both, so check them: a not-full computed from the pop brings back the combinational path.
You add four register slices on the request and response paths of a memory link. What else must change to keep bandwidth? L3
Each slice adds a cycle to the round trip, so the requester must keep more requests outstanding. Throughput is roughly outstanding requests divided by round-trip latency. Re-check the initiator's outstanding limit, ID or tag count, and response buffering. Otherwise the link that met timing now runs slower. Slices on one AXI channel need not match those on another.
Follow-upPractise Slices, Latency and Outstanding Requests →Credits Versus Ready5
When would you choose credit-based flow control instead of valid/ready, and what does it cost? L2L3
Choose credits when the answer takes cycles to travel: long wires, many register stages, chip-to-chip links or a network on chip. The receiver hands out one credit per free buffer entry in advance. The sender spends one credit per beat, so no per-cycle ready crosses the link. The cost is buffering. The receiver needs about as many entries as beats sent during a credit's round trip.
The credit return takes 4 cycles end to end. How many credits does the sender need to stream at one beat per cycle? L2
At least as many as the beats it can send during one credit's round trip. The round trip is the forward delay, the receiver's turnaround and the return delay. With fewer, the sender stops and waits while the receiver is empty. Measure the real round trip, including every register stage. Rounding it down is the usual mistake.
Follow-upPractise How Many Credits →The producer cannot be stalled. The consumer can pause for 20 cycles. How deep must the FIFO be? L1L2
It must fit the beats it already holds when the pause starts, plus every beat that arrives during it. Subtract any beats that leave. With one held and one arriving per cycle for 20 cycles, that is 21 entries. A 16-deep FIFO loses 5. If the producer is faster on average than the consumer, no depth is enough; only flow control fixes that.
Follow-upPractise Sizing a FIFO with No Backpressure →A credited link slows down after hours of traffic and finally hangs. What would you suspect, and what check finds it on the first lost credit? L3
A credit leak: a credit returned during reset, dropped on a flush, or a beat sent without spending one. Each loss quietly shrinks the window until it reaches zero. Check conservation every cycle: sender credits plus beats in flight plus receiver free entries equals the configured total. Also check that the full count is back whenever the link is idle.
Follow-upPractise The Credit That Went Missing →What if the receiver resets while the sender keeps running? L3
The receiver comes back with all its entries free, but the sender still holds its old credits. Those credits are now counted twice, so the sender can overrun the receiver. The spec gives the transmitter no credits and the receiver all of them in reset. So both sides must reset together, or re-start the link from that state.
Follow-upPractise A Credited Link Reset on One Side →12 questions · 2 topicsVerification
Verifying a Bus Interface IP6
Walk me through your verification plan for a new AXI subordinate, such as a memory-controller front end. How do you decide you are done? L3L4
I build four layers. A bound protocol checker catches illegal timing at the interface. Monitors feed a reference model and an ID-aware scoreboard, which catch wrong data, lost beats and illegal reordering. Constrained-random and directed stimulus add adversarial backpressure (stall patterns chosen to stress the design) on every channel. Functional coverage tracks attributes, concurrency and stalls. I call it done when no checker fires, coverage is closed with reviewed waivers, and the bug-find rate has flattened.
QuestionPractise Verifying a Bus Interface IP →Management bought a commercial AXI VIP. Which parts of your plan does it replace, and which does it not? L3
It replaces the protocol checker and much of the stimulus and protocol coverage. That holds only once it is configured to match the interface: widths, ID bits, outstanding limits and optional signals. It does not replace the reference model, the scoreboard, or the design-specific legal subset. It also does not replace a review of its own configuration. A misconfigured VIP silently checks a different interface from the one you built.
Follow-upPractise What a Purchased VIP Does Not Do →Prove it: how do you show that the VIP's protocol checker actually fires on your configuration? L3
Break each rule once, on purpose, with a small fault in a test agent. Check that the VIP reports it, at the right edge. A checker whose antecedents never fired has checked nothing. Keep these fault tests in regression, so an upgrade or a config change that silences a rule shows up.
Follow-upPractise Proving the Bought Checker Fires →Your random AXI traffic ran a million transactions clean. Name corners it probably never hit, and how you would make sure it does. L2L3
Random traffic misses corners that need one exact value, such as a burst ending exactly at a 4 KB edge. Others are a WRAP in the top address window and the longest burst at the largest size. So are every ID in flight at once, a stall on the last beat, and reset during a burst. Uniform randomness gives each of these about zero probability. Add weighted constraints toward edges, directed tests for the extremes, and coverage bins that name each corner.
Follow-upPractise Corners Random Traffic Never Hits →Now scale it: an interconnect with eight managers and twelve subordinates. What changes in the verification architecture? L4
Bind a checker on every port, and replace the per-port scoreboards with one end-to-end scoreboard. It models the address decode and the ordering per manager and ID. It also models the ID bits the interconnect adds on the way in and removes on the way out. Add system checks: no response to the wrong manager, decode errors for address holes, and bounds on fairness and starvation. Formal suits the decoder and ID logic, while simulation covers data integrity and performance.
Follow-upPractise From One Port to an Interconnect →Walk me through the evidence you would show when your manager asks: is this IP ready for tape-out, yes or no? L3L4
I bring a plan-to-evidence table. It maps every spec rule to a property or scoreboard check, each passing in regression with its antecedent (trigger side) covered. Beside it go closed functional coverage with designer-signed waivers, and explained code coverage holes. I add open bugs at zero or deferred in writing, plus the recent bug-find rate. Then comes the honest part: what was not verified, and why the risk is accepted.
Follow-upPractise How You Know You Are Done →Functional Coverage for a Bus6
What functional coverage would you write for a bus interface like AXI, and what traps do you watch for? L2L3
Sample from the passive monitor when a transaction completes, not from the driver when it is issued. Cover the attributes: burst, length, size, alignment, and distance to a 4 KB or wrap boundary. Cover concurrency: outstanding depth, ID reuse and interleaving. Add backpressure (stall length per channel, including the last beat), every response type, and reset mid-transaction. Cross only the fields that interact. A cross of every field gives thousands of bins that nobody closes.
QuestionPractise Functional Coverage for a Bus →Why sample coverage in the monitor at completion rather than in the sequence or the driver? L2
Coverage should record what the design actually did. The monitor sees only accepted transactions, with their real response and timing. It also works the same when the agent is passive (only watching) in a larger environment. Sampling at completion lets a bin record the response and the stall pattern. The driver cannot know these when it sends the item.
Follow-upPractise Where Coverage Is Sampled →What if coverage is sampled in the driver instead? Show a bin it fills falsely. L2
Say a write is driven, but reset aborts it before the handshake. The driver has already counted a write of that kind. The bin closes, yet the design never completed it. Driver coverage measures what the stimulus asked for, not what the design did.
Follow-upPractise Coverage Sampled in the Driver →For a bus subordinate, what does code coverage tell you that functional coverage does not, and the other way round? L1L2
Code coverage finds RTL that no test reached, such as an error path or an unused state. Nobody has to think of these in advance. Functional coverage checks that the scenarios the spec and plan care about happened. That includes combinations and sequences that no single line of code represents. Code coverage cannot see a missing feature and functional coverage cannot see dead code, so you need both.
Follow-upPractise Code Coverage Versus Functional Coverage on a Bus →How many bins does a burst x length x size cross have on a 32-bit AXI interface? How would you cut it down? L3
Start from the legal set, not the raw one. On a 32-bit bus Size is 1, 2 or 4 bytes, and INCR allows 256 lengths, FIXED 16 and WRAP 4. That gives 3 x (256 + 16 + 4) = 828 legal combinations, against 6,144 raw. Then bucket the lengths where behaviour does not change: 1, 2 to 15, 16, 17 to 255, and 256. That leaves a few dozen bins, and each one means something.
Follow-upPractise Sizing a Cross Before Writing It →All coverage is green, yet a customer hits a hang when the response channel is stalled. How did that escape? L2L3
Most likely the bench kept BREADY and RREADY high, so the subordinate's response-side stall path never ran. Every stall rule then passed vacuously, because no stall ever happened. The coverage model also had no stall-length bins on B or R. Randomise ready with long low runs on every channel the testbench drives, and cover stall length per channel. Also count how often each checker antecedent matched.
Quick Questions
330 short questions drawn from the lessons. Say your answer out loud first, then open the model answer and follow the link to the lesson for the full reasoning.
Jump to a Module
Module P1 · 60 questions
Protocol Fundamentals
What is a bus protocol?
The rules both ends of a bus share: the signals, when each is sampled and held, what may follow what, and what the values mean. The wires are the interface; the protocol is how you may use them.
Lesson P1.1Why a Bus Needs Rules →What does an interconnect do?
It decodes each request's address to pick the target, arbitrates when requests compete for a path, and routes every response back to the initiator that asked.
Lesson P1.1Why a Bus Needs Rules →Shared bus or network-on-chip, when?
A shared bus when few blocks talk and one transfer at a time is enough. A network when dozens of blocks need many transfers in flight and can afford a few cycles per hop.
Lesson P1.1Why a Bus Needs Rules →What happens on a request to an unmapped address?
The interconnect finds no window and answers with a decode error. The request never reaches a target, and the initiator learns that its address was wrong.
Lesson P1.1Why a Bus Needs Rules →Why does the initiator never name the target?
It names an address, and the map decides the target. Blocks can then move or be replaced without changing a line of the initiator.
Lesson P1.1Why a Bus Needs Rules →Why are buses synchronous?
One clock gives every block the same moment to read, so a value only has to be stable at the edge. Without it each signal would need its own handshake just to be read safely.
Lesson P1.2Clocks, Edges and Sampling →What happens to a signal that changes at the sampling edge?
The reader gets the old value or the new one, and the standard does not say which. Change signals after the edge, and sample them at it.
Lesson P1.2Clocks, Edges and Sampling →What does asserted mean for an active-low signal?
It is at its active level, which is 0. "rst_n is asserted" means reset is in progress; "deasserted" means the block runs.
Lesson P1.2Clocks, Edges and Sampling →Why is reset asserted asynchronously but released synchronously?
Asserting without a clock forces a block quiet even when its clock has stopped. Releasing at an edge lets every block start in the same cycle.
Lesson P1.2Clocks, Edges and Sampling →At which edge should a monitor sample?
At the edge the design samples, normally the rising edge. Any other edge only matches while every source happens to behave.
Lesson P1.2Clocks, Edges and Sampling →Why must valid not depend on ready?
Because a sink is allowed to wait for valid before it raises ready. If the source also waits, neither signal ever rises and the link deadlocks on the first beat.
Lesson P1.3Handshakes: Request and Acknowledge, Valid and Ready →When exactly does a transfer happen?
At a rising clock edge where valid and ready are both 1. Both sides, and any monitor, count the same edges, so nobody is ever off by one.
Lesson P1.3Handshakes: Request and Acknowledge, Valid and Ready →Can a source drop valid if it changes its mind?
No. Once valid is 1 and ready is 0, valid and the data must stay until the transfer. A sink may have committed to that beat already.
Lesson P1.3Handshakes: Request and Acknowledge, Valid and Ready →What is the difference between a strobe and a handshake?
A strobe is a one-way pulse that assumes the receiver is ready. A handshake adds a signal back, so the receiver can stall the sender instead of losing data.
Lesson P1.3Handshakes: Request and Acknowledge, Valid and Ready →May ready be high before valid?
Yes. Ready in advance is allowed and gives the best throughput; ready may also wait for valid. Only valid is forbidden from waiting.
Lesson P1.3Handshakes: Request and Acknowledge, Valid and Ready →What is a burst and why bother?
A burst is the beats of one request, sent back to back after one address. It spends one request, one arbitration and one response on many words instead of one each.
Lesson P1.4Transactions: Beats, Bursts, Split and Posted →What is a split transaction?
A transaction whose response may come later than its request, with the wires free in between. It lets the bus carry other requests while a slow target works.
Lesson P1.4Transactions: Beats, Bursts, Split and Posted →Posted or non-posted writes, what is the difference?
A posted write is complete once its data is accepted and gets no response. A non-posted write waits for a response that confirms it and may carry an error.
Lesson P1.4Transactions: Beats, Bursts, Split and Posted →What is the difference between a beat and a transaction?
A beat is one handshake moving one word. A transaction is the request, all its beats and the response that closes it.
Lesson P1.4Transactions: Beats, Bursts, Split and Posted →What does last do?
It marks the final beat of a burst, so a receiver can find the end without counting and a checker can tell a short burst from a complete one.
Lesson P1.4Transactions: Beats, Bursts, Split and Posted →What is the difference between latency and throughput?
Latency is the time one transaction takes from request to response. Throughput is how many transactions complete per unit time; with several in flight it can be high while the latency stays the same.
Lesson P1.5Pipelining, Outstanding Transactions, Latency and Throughput →What is a pipelined bus?
One where the initiator issues the next request before the previous response has returned, so request N+1 overlaps response N. The latency of each transaction is unchanged; the idle cycles between them disappear.
Lesson P1.5Pipelining, Outstanding Transactions, Latency and Throughput →What does "outstanding" mean?
A transaction whose request has been taken but whose response has not yet returned. The number of outstanding transactions an initiator allows is its window.
Lesson P1.5Pipelining, Outstanding Transactions, Latency and Throughput →How many transactions must be in flight to saturate a link?
Enough to cover the latency plus the turnaround: a target with latency L that takes one request per cycle needs about L+1 in flight. Beyond that the clock sets the rate.
Lesson P1.5Pipelining, Outstanding Transactions, Latency and Throughput →Why does a response carry an ID?
With more than one request in flight, the response must name the request it answers. In-order targets can imply it by counting; out-of-order ones cannot.
Lesson P1.5Pipelining, Outstanding Transactions, Latency and Throughput →How do you size a FIFO between two clocked blocks?
From the longest stall the consumer can make: the beats held when it starts, plus the beats arriving during it, minus the beats leaving. A rate mismatch cannot be sized away; only backpressure or a faster consumer fixes it.
Lesson P1.6Flow Control: Backpressure, FIFO Depth and Credits →What is backpressure?
The sink lowering ready so the source holds its beat. The stall moves upstream one stage at a time until it reaches something that can wait, and no data is lost.
Lesson P1.6Flow Control: Backpressure, FIFO Depth and Credits →What happens without flow control?
The FIFO depth is the only margin. Any stall longer than the depth drops beats, usually silently, and the symptom appears far downstream.
Lesson P1.6Flow Control: Backpressure, FIFO Depth and Credits →What are credits and when are they better than ready?
Permission granted in advance: one credit per free entry, spent per beat and returned per freed entry. They win when the answer takes cycles to travel, across long wires, chip boundaries or a NoC.
Lesson P1.6Flow Control: Backpressure, FIFO Depth and Credits →How many credits does a link need?
Enough to cover the round trip: about the beats the source can send while a credit travels back. Fewer credits throttle the link even when the sink is empty.
Lesson P1.6Flow Control: Backpressure, FIFO Depth and Credits →When is out-of-order completion allowed?
Between responses with different tags. It lets a fast target answer without waiting behind a slow one.
Lesson P1.7Ordering, Tags and Out-of-Order Completion →What must stay in order?
Responses with the same tag, in request order. The interconnect holds a request whose tag is still outstanding at another target.
Lesson P1.7Ordering, Tags and Out-of-Order Completion →What is a tag for?
To match a response with its request when arrival order no longer says so. It names a stream, and reusing it promises in-order answers within that stream.
Lesson P1.7Ordering, Tags and Out-of-Order Completion →What does a scoreboard key on?
On the tag, with one queue per tag in request order. One queue for everything reports legal reorders as errors.
Lesson P1.7Ordering, Tags and Out-of-Order Completion →How do you keep a read after a write safe?
Wait for the write's response before issuing the read, or send both on one tag through one target. A read through another path may overtake the write.
Lesson P1.7Ordering, Tags and Out-of-Order Completion →What is a byte enable?
One bit per byte lane of the data bus that says whether this beat writes that lane. A lane with its enable at 0 keeps its byte in the target.
Lesson P1.8Addresses, Widths, Byte Lanes and Alignment →How does a 16-bit transfer travel on a 64-bit bus?
In the two lanes named by the low three address bits, with only those two enables set. The other six lanes carry nothing.
Lesson P1.8Addresses, Widths, Byte Lanes and Alignment →What does alignment mean and why does it matter?
A transfer is aligned when its address is a multiple of its size, so it fits in one word and one beat. An unaligned transfer may cross a word and need two beats, or be forbidden.
Lesson P1.8Addresses, Widths, Byte Lanes and Alignment →Which lane carries the byte at address 4n+1?
Lane 1, bits 8 to 15 of the data signal, on a little-endian 32-bit bus. The lane number is the low two address bits.
Lesson P1.8Addresses, Widths, Byte Lanes and Alignment →What goes wrong with a word write used as a byte write?
The byte lands in lane 0, so at the wrong address unless the address was aligned, and every other byte of the word is overwritten.
Lesson P1.8Addresses, Widths, Byte Lanes and Alignment →Priority or round robin, when?
Fixed priority when one requester must never wait and the others can tolerate gaps. Round robin when every requester has a deadline, because it bounds everyone's wait.
Lesson P1.9Arbitration, Fairness and Atomic Access →What is starvation?
A requester that keeps asking and is never granted. Fixed priority starves the lowest requester whenever the higher ones ask often enough.
Lesson P1.9Arbitration, Fairness and Atomic Access →What is the difference between a locked and an exclusive access?
A lock holds the bus from the read to the write, so nobody else is served. An exclusive pair leaves the bus free and lets the write fail if the location changed, so the initiator retries.
Lesson P1.9Arbitration, Fairness and Atomic Access →Where does arbitration happen on AXI?
Inside the interconnect, at every subordinate that several managers can reach. There is no central arbiter and no shared bus.
Lesson P1.9Arbitration, Fairness and Atomic Access →How do you verify fairness?
Count grants per requester under a request pattern where all keep asking, and measure the longest wait while asking. A bounded wait is fairness; an unbounded one is starvation.
Lesson P1.9Arbitration, Fairness and Atomic Access →How do you verify a bus protocol?
Turn each must sentence of the spec into a property, bind the properties to every instance of the bus, and add a scoreboard for the data. Then make sure tests stall, so the properties are exercised.
Lesson P1.10From the Spec to a Check →What is a vacuous pass?
An attempt whose antecedent was false, so the property checked nothing and reported no failure. A rule that only passes vacuously has never been tested.
Lesson P1.10From the Spec to a Check →What does "may" in a spec mean for your checker?
It is a freedom, so the checker must stay silent about it. A checker that flags a permitted event is wrong, however reasonable the flag looks.
Lesson P1.10From the Spec to a Check →Why bind a checker instead of adding assertions to the design?
The design stays untouched and the checker follows every instance into every environment. One file holds every rule, and it can be removed for synthesis in one line.
Lesson P1.10From the Spec to a Check →How do you know a protocol checker was exercised?
Count antecedent matches, or cover them. Each rule needs at least one test where its antecedent happened and the rule held.
Lesson P1.10From the Spec to a Check →What is a bus protocol, and what does an interconnect do?
A protocol is the set of rules that let an initiator and a target move data without losing or duplicating it. An interconnect decodes addresses and routes requests and responses between many of each.
Lesson P1.11Capstone: The Generic Link Bug Hunt →Why are on-chip buses synchronous, and what does "sampled at the edge" mean?
One clock gives both sides the same moment to agree on, so a signal driven after one edge is seen by everyone at the next. A value that changes exactly at the edge is the race every rule is written to avoid.
Lesson P1.11Capstone: The Generic Link Bug Hunt →When does a transfer happen on a valid/ready link, and why must valid never wait for ready?
At a rising edge where both are 1, and at no other edge. If the sink may wait for valid, a source that waits for ready deadlocks the link on its first beat.
Lesson P1.11Capstone: The Generic Link Bug Hunt →What is the difference between a beat, a burst and a transaction?
A beat is one handshake, a burst is a sequence of beats under one request, and a transaction is the request plus its data and its response. A monitor counts beats; a scoreboard expects transactions.
Lesson P1.11Capstone: The Generic Link Bug Hunt →Latency or throughput: which does pipelining improve?
Throughput: overlapping the request of one transaction with the data of another moves more beats per cycle. Each transaction still waits its full latency.
Lesson P1.11Capstone: The Generic Link Bug Hunt →How do you size a FIFO between two blocks?
From the longest stall the sink can cause and the rate at which beats arrive during it. A 16-deep FIFO behind a sink that can stall for 20 cycles at one beat per cycle overflows.
Lesson P1.11Capstone: The Generic Link Bug Hunt →When may responses complete out of order, and what must a scoreboard key on?
When the requests carry different tags, so the initiator can match each response. Responses with the same tag stay in order, and the scoreboard keys on the tag.
Lesson P1.11Capstone: The Generic Link Bug Hunt →What is a byte enable and why does alignment matter?
A byte enable says which lanes of a wide bus carry real bytes for this beat. An unaligned start lands bytes in lanes the receiver did not expect and can clobber its neighbours.
Lesson P1.11Capstone: The Generic Link Bug Hunt →Priority or round-robin, and what is starvation?
Priority serves the most urgent initiator first; round-robin gives every initiator a turn. Starvation is a low-priority initiator that never gets served while a chatty one keeps requesting.
Lesson P1.11Capstone: The Generic Link Bug Hunt →How do you verify a protocol, and what is a vacuous pass?
One property per must sentence of the spec, bound to every instance, plus a scoreboard for the data and a test that stalls. A vacuous pass is an attempt whose condition never came true, so it checked nothing.
Lesson P1.11Capstone: The Generic Link Bug Hunt →Module P2 · 94 questions
AXI
What are the five channels of AXI?
Write address (AW), write data (W), write response (B), read address (AR) and read data (R). The manager drives AW, W and AR; the subordinate drives B and R. Each is a valid/ready handshake with its own payload.
Lesson P2.1AXI in One Picture →Why does AXI separate the address from the data?
So they can be pipelined. A manager can issue the next address while data for the previous one is still moving, and the two can even arrive at a subordinate in either order. One combined channel would serialise every transaction.
Lesson P2.1AXI in One Picture →What is the difference between a transfer and a transaction?
A transfer is one handshake on one channel. A transaction is a whole burst: one address transfer, its data transfers, and for a write its single response transfer.
Lesson P2.1AXI in One Picture →Can a read overtake a write?
Yes. AXI gives no ordering between the read and write channels, even with the same ID. A manager that needs a read to see its own write waits for the write response before issuing the read (lesson P2.12).
Lesson P2.1AXI in One Picture →What do manager and subordinate mean?
The two ends of an interface: the manager issues transactions, the subordinate answers them. Older documents call them master and slave; the signals and the rules are identical.
Lesson P2.1AXI in One Picture →Why must VALID not depend on READY?
Because the specification lets the receiving side wait for VALID before asserting READY. If the sender also waited, neither signal would ever rise: a deadlock on the first transfer. The rule gives the sender the first move.
Lesson P2.2The Handshake, the Clock and Reset, AXI Style →May a subordinate drop AWREADY without accepting anything?
Yes. READY may be asserted and deasserted freely while no transfer happens. Only VALID is committed: once high it stays high, with the same payload, until the handshake.
Lesson P2.2The Handshake, the Clock and Reset, AXI Style →What are the reset rules?
ARESETn is active low, asserted asynchronously, released synchronously. In reset the manager holds AWVALID, WVALID and ARVALID low and the subordinate holds BVALID and RVALID low. A VALID may first rise after the first rising clock edge at which ARESETn is high.
Lesson P2.2The Handshake, the Clock and Reset, AXI Style →How does a stall look on the wires?
VALID is 1 and READY is 0 at a rising edge. The payload is unchanged at the next edge. A checker counts those edges; a monitor must not count them as transfers.
Lesson P2.2The Handshake, the Clock and Reset, AXI Style →Can write data arrive before the write address?
Yes. AW and W are independent handshakes; the data may be accepted before, after or in the same cycle as the address. A subordinate may wait for one before accepting the other, or for both before accepting either. No manager may make one VALID wait for the other channel's READY.
Lesson P2.3The Write Transaction: AW, W and B →When may a subordinate send the write response?
In AXI4, only after it has accepted the last data beat (WLAST) and the address. AXI3 required only the data. BVALID must never wait for BREADY.
Lesson P2.3The Write Transaction: AW, W and B →How does a subordinate know which data belongs to which address?
By order. AXI4 write data carries no ID and cannot be interleaved, so the n-th burst of beats belongs to the n-th address accepted.
Lesson P2.3The Write Transaction: AW, W and B →What happens if WLAST is on the wrong beat?
The protocol is broken: WLAST must be on beat AWLEN exactly. A subordinate typically ends the burst at WLAST, so data is lost or misattributed, and the response still says OKAY because the subordinate cannot tell.
Lesson P2.3The Write Transaction: AW, W and B →When may a subordinate raise RVALID?
Only after the AR handshake for that transaction, and never because RREADY is high. Data for a request that has not been accepted does not exist.
Lesson P2.4The Read Transaction: AR and R →Can RVALID wait for RREADY?
No. A manager is allowed to wait for RVALID before raising RREADY, so a subordinate that waited for RREADY would deadlock against it. RREADY may wait for RVALID or be high in advance.
Lesson P2.4The Read Transaction: AR and R →Is RRESP per beat or per transaction?
Per beat. Every read data transfer carries its own response and they may differ. A write has one BRESP for the whole transaction.
Lesson P2.4The Read Transaction: AR and R →What happens to a burst when one beat has an error?
Nothing changes in its length. The subordinate sends every beat the request asked for and marks the bad ones SLVERR or DECERR; RLAST still ends the burst. No AXI transaction ends early.
Lesson P2.4The Read Transaction: AR and R →May the subordinate change RDATA while RREADY is low?
No. Once RVALID is high the beat is frozen: RDATA, RRESP, RID and RLAST stay until the handshake. A pipeline that advances on RVALID alone breaks this rule.
Lesson P2.4The Read Transaction: AR and R →When is a read complete?
At the handshake of the beat with RLAST. That is the read completion the ordering model counts from (P2.12).
Lesson P2.4The Read Transaction: AR and R →What is an outstanding transaction?
One whose request has been accepted and whose response has not yet returned. AXI lets a manager have several in flight; the number it allows itself is its window.
Lesson P2.5Outstanding Transactions and Throughput →May the write data be sent before the write address?
Yes. The channels are independent, so W beats may arrive before, with or after the AW. The manager must never make WVALID wait for AWREADY, or hold back data because another transaction is incomplete.
Lesson P2.5Outstanding Transactions and Throughput →Why does the spec recommend READY high by default on request channels?
Because a READY that waits for VALID costs a cycle on every transfer. High by default lets a request move in its first cycle; it is only allowed if the receiver can then take whatever is offered.
Lesson P2.5Outstanding Transactions and Throughput →What does a register slice change?
Latency: one cycle per stage, in that direction, on that channel. The handshake rules hold on both sides of it and the throughput is unchanged once the pipeline is full.
Lesson P2.5Outstanding Transactions and Throughput →How many transactions must be in flight to saturate the bus?
Enough to cover the latency: a subordinate that answers L cycles after a request needs about L requests outstanding to keep a beat on every cycle.
Lesson P2.5Outstanding Transactions and Throughput →How does the ID affect throughput?
Same-ID responses come back in request order, so a transaction behind a slow one waits even if its own data is ready. Separate IDs let independent streams overtake each other.
Lesson P2.5Outstanding Transactions and Throughput →How many beats does AWLEN = 3 give?
Four. AxLEN is the beat count minus one; the 8-bit field reaches 256 beats for INCR in AXI4. AXI3 stops at 16 for every type, as WRAP and FIXED still do.
Lesson P2.6Bursts and the Address of Every Beat →Where does a WRAP burst wrap?
At the end of a window of size times length bytes that starts at the start address rounded down to that window; the address then returns to the window's start. The start must be aligned to the beat size and the length must be 2, 4, 8 or 16.
Lesson P2.6Bursts and the Address of Every Beat →Why must a burst not cross 4 KB?
The interconnect decodes a burst once, from its first address, and routes all of it to one subordinate. A burst across a 4 KB boundary could need two subordinates, and nothing downstream may split it.
Lesson P2.6Bursts and the Address of Every Beat →Can a transaction be terminated early?
No, by any party. A manager that wants to write less sends the remaining beats with all strobes low; one that wants to read less discards data; both complete every beat.
Lesson P2.6Bursts and the Address of Every Beat →What is a FIXED burst for?
Repeated access to one address, typically a FIFO port: every beat is a new entry. The address and the byte lanes are the same for every beat.
Lesson P2.6Bursts and the Address of Every Beat →What happens with an unaligned start address?
Beat 0 uses the lanes from the address to the end of its aligned beat; every later beat is at the aligned address plus its number times the size. P2.8 maps every byte.
Lesson P2.6Bursts and the Address of Every Beat →What is a narrow transfer?
A beat whose AxSIZE is smaller than the data bus. It uses only the lanes its address names, and the strobes mark those lanes.
Lesson P2.7Narrow Transfers, Byte Lanes and Width Conversion →May AxSIZE be larger than the data bus?
No. The size must not exceed the data width; the checker names it size. A converter may lower the size on the way down, never raise it.
Lesson P2.7Narrow Transfers, Byte Lanes and Width Conversion →Which lanes does beat n of a narrow INCR burst use?
The lanes of its own address: lower lane equals address modulo bus bytes, and the beat spans AxSIZE bytes from there. The address moves every beat, so the lanes walk across the bus and wrap at each word.
Lesson P2.7Narrow Transfers, Byte Lanes and Width Conversion →What does a FIXED burst do with the lanes?
Every beat has the same address, so every beat uses the same lanes. That is the FIFO case: one register, many beats.
Lesson P2.7Narrow Transfers, Byte Lanes and Width Conversion →How does a 32-bit manager talk to a 64-bit subordinate?
Through an upsizer that places each 4-byte beat in the half of the wide word its address names and shifts the strobes with it. Size and length are unchanged; the subordinate sees narrow beats.
Lesson P2.7Narrow Transfers, Byte Lanes and Width Conversion →Can an upsizer merge two beats into one wide beat?
Only if the transaction is Modifiable, AxCACHE[1] set. Merging changes AxSIZE and AxLEN, which a Non-modifiable transaction forbids.
Lesson P2.7Narrow Transfers, Byte Lanes and Width Conversion →May an AXI burst start at an unaligned address?
Yes, for INCR and FIXED bursts. A WRAP burst must start aligned to its transfer size. The first beat covers the bytes from the start address to the end of its aligned transfer.
Lesson P2.8Unaligned Transfers: Mapping Any Transfer onto Memory →How many bytes does the first beat carry?
aligned + number_bytes − start. At 0x1003 with 4-byte transfers that is one byte; with 8-byte transfers on a 64-bit bus it is five.
Lesson P2.8Unaligned Transfers: Mapping Any Transfer onto Memory →Are the later beats unaligned too?
No. Every beat after the first starts at an aligned address and is full. Only beat 0 is partial.
Lesson P2.8Unaligned Transfers: Mapping Any Transfer onto Memory →Does a burst from 0x1003 with three 4-byte beats move twelve bytes?
No, nine: one, four and four. The burst ends at the end of its window, 0x100b. Twelve bytes from 0x1003 need four beats.
Lesson P2.8Unaligned Transfers: Mapping Any Transfer onto Memory →On an unaligned read, what is in the other lanes of beat 0?
Whatever the subordinate drives; zeros are recommended, neighbours are common. They are not part of the transfer and a manager must discard them.
Lesson P2.8Unaligned Transfers: Mapping Any Transfer onto Memory →Can the manager give an aligned address instead?
Yes: an aligned address with strobes that mark the real first byte is the same transfer. The low address bits and the strobes must agree, and the subordinate follows the strobes.
Lesson P2.8Unaligned Transfers: Mapping Any Transfer onto Memory →What does WSTRB[2] mean?
That WDATA[23:16], lane 2, holds a byte to be written to byte address word + 2. A lane with its strobe low must be left alone by the subordinate.
Lesson P2.9Write Strobes, Byte Invariance and Read-Modify-Write →Is a strobe pattern like 0101 legal?
Yes, inside the lanes the beat addresses any pattern is legal, including all zeros. Outside them every strobe must be low.
Lesson P2.9Write Strobes, Byte Invariance and Read-Modify-Write →What happens if a subordinate ignores strobes?
Every partial write becomes a full write and the neighbouring bytes are corrupted. No protocol rule fires, because the strobes on the wire were right; only a data check catches it.
Lesson P2.9Write Strobes, Byte Invariance and Read-Modify-Write →What is byte-invariant endianness?
Lane n always carries byte address word + n. Endianness decides which byte of a value sits at the lowest address, not which lane a byte uses, so mixed-endian data can share a memory.
Lesson P2.9Write Strobes, Byte Invariance and Read-Modify-Write →How does a subordinate with ECC words handle a byte write?
By read-modify-write: read the word, merge the strobed bytes, recompute the check bits, write it back. It must keep a read that arrives in between from seeing the stale word.
Lesson P2.9Write Strobes, Byte Invariance and Read-Modify-Write →May an AXI4-Lite register block ignore strobes?
A Lite subordinate may use them, ignore them and treat writes as full width, or reject unsupported patterns with an error, but one that provides memory must support them fully.
Lesson P2.9Write Strobes, Byte Invariance and Read-Modify-Write →Why must responses with the same ID return in order?
Because a response carries only the ID. A manager with two open transactions on one ID can pair the answers with the requests only by their order, so the system promises that order.
Lesson P2.10IDs and Same-ID Order: Why Responses Come Back in Order →Who enforces it?
The subordinate for transactions it holds itself, the interconnect for transactions that went to different subordinates, usually by holding the later request until the earlier responses are back.
Lesson P2.10IDs and Same-ID Order: Why Responses Come Back in Order →What is the ID for, then?
To let a manager issue several transactions without waiting. Different IDs may complete in any order, so fast targets are not stuck behind slow ones.
Lesson P2.10IDs and Same-ID Order: Why Responses Come Back in Order →How does an interconnect keep IDs unique?
It appends bits that name the manager port to AWID and ARID, so the subordinate sees a wider ID, and strips them from BID and RID on the way back.
Lesson P2.10IDs and Same-ID Order: Why Responses Come Back in Order →Can a protocol checker catch same-ID reordering?
Only when the reordered transactions differ in length, through RLAST on the wrong beat. Otherwise the wires are legal and only a data check by ID sees it.
Lesson P2.10IDs and Same-ID Order: Why Responses Come Back in Order →When may responses come back out of order?
Whenever they carry different IDs. A subordinate with several paths or an interconnect with several subordinates answers each as soon as it can.
Lesson P2.11Different IDs: Out of Order and Interleaving →What is read data interleaving?
A subordinate sending a beat of one read between the beats of another. AXI4 allows it between different IDs; the beats of one transaction stay in order.
Lesson P2.11Different IDs: Out of Order and Interleaving →Can write data interleave?
Not in AXI4: write data follows the address order and a burst's beats stay together. AXI3 allowed it with WID.
Lesson P2.11Different IDs: Out of Order and Interleaving →What is the read data reordering depth?
The number of accepted requests a subordinate may answer out of order; one means in order. It is fixed at design time and not discoverable on the bus.
Lesson P2.11Different IDs: Out of Order and Interleaving →What does a scoreboard key on?
The ID, with one expected queue per ID in request order, counting beats per transaction and closing it on RLAST. One global queue reports legal reorders as errors.
Lesson P2.11Different IDs: Out of Order and Interleaving →Does the same ID order a read after a write?
No. The same ID orders writes among writes and reads among reads. A read may be answered before a write that was issued earlier on the same ID.
Lesson P2.12The Ordering Model: Reads Versus Writes →When is a write guaranteed visible?
After its B handshake. From then on any manager's later read or write observes it. A bufferable write may be answered early by an intermediate point that then owns the ordering.
Lesson P2.12The Ordering Model: Reads Versus Writes →How does a manager make a read see its own write?
It waits for B before issuing the read. Nothing on the address channels, and not the last data beat, provides that guarantee.
Lesson P2.12The Ordering Model: Reads Versus Writes →May a manager stream writes on one ID without waiting?
Yes, to one location: the second write is observed after the first. Across locations only an interface with Ordered Write Observation promises that.
Lesson P2.12The Ordering Model: Reads Versus Writes →What is the difference between a memory location and a peripheral region?
A memory location returns the last value written and has no side effects; a peripheral region may do neither, and its guarantees are per region, using Device transactions.
Lesson P2.12The Ordering Model: Reads Versus Writes →Is BRESP sent per beat or per transaction?
Per transaction, after the last data beat and the address. RRESP is per transfer and may differ from beat to beat.
Lesson P2.13Responses and Exclusive Access →Beat 2 of an 8-beat read returns SLVERR. What about beats 3 to 7?
The subordinate drives them all up to RLAST and the manager accepts them all; only the data of the error beats is invalid.
Lesson P2.13Responses and Exclusive Access →SLVERR or DECERR, what is the difference?
SLVERR: the subordinate that owns the address could not complete the request. DECERR: no subordinate owns the address, so the default subordinate answers.
Lesson P2.13Responses and Exclusive Access →My exclusive write returned OKAY. Did it happen?
After an EXOKAY read, no: the monitor was cleared or moved. After an OKAY read, the subordinate has no exclusive support and the write happened as a normal write.
Lesson P2.13Responses and Exclusive Access →How does a subordinate know whose exclusive write it is?
By the ID, made unique per manager port by the interconnect; one monitor per ID, and the write repeats the ID, address and size of the read.
Lesson P2.13Responses and Exclusive Access →What does Modifiable mean?
AxCACHE bit 1: the transaction may be split, merged or re-sized inside its 4 KB space, keeping AxLOCK and the protection attributes. Non-modifiable: as issued, except Bufferable to Non-bufferable and splitting bursts over 16 beats.
Lesson P2.14Memory Attributes, Protection and QoS: The Signals You Get Asked About →Device versus Normal memory?
Device: no reshaping, no prefetch, data from the endpoint, because side effects matter. Normal behaves like memory, so the system may buffer, merge and cache.
Lesson P2.14Memory Attributes, Protection and QoS: The Signals You Get Asked About →When is a Bufferable write really done?
Its own response cannot say. Follow it with a Non-bufferable write on the same ID to the same subordinate; that one is answered after the earlier writes drained.
Lesson P2.14Memory Attributes, Protection and QoS: The Signals You Get Asked About →What are the three AxPROT bits?
Bit 0 privileged, bit 1 Non-secure, bit 2 instruction. Bit 1 selects the address space and is the one a decoder compares; bit 2 is a hint.
Lesson P2.14Memory Attributes, Protection and QoS: The Signals You Get Asked About →Can QoS reorder two requests with the same ID?
No. QoS applies only where no ordering rule does; same-ID requests to one destination stay in order.
Lesson P2.14Memory Attributes, Protection and QoS: The Signals You Get Asked About →What does AXI4-Lite remove?
Bursts, IDs, exclusives and the attributes: no AxLEN, AxSIZE, AxBURST, AxLOCK, AxCACHE, WLAST, RLAST or EXOKAY. It keeps the handshakes, the strobes, AxPROT and the responses.
Lesson P2.15AXI4-Lite, AXI3 and AXI5: The Family →Can a full AXI manager drive a Lite subordinate directly?
Only if the system guarantees Lite-shaped transactions and the subordinate reflects IDs. Otherwise a bridge converts, or refuses with a compliant error.
Lesson P2.15AXI4-Lite, AXI3 and AXI5: The Family →How are the responses of a converted burst combined?
Into one response for the original transaction. Any error is sticky; with both SLVERR and DECERR present, the first received is used.
Lesson P2.15AXI4-Lite, AXI3 and AXI5: The Family →What is WID?
The write data ID of AXI3, which allowed write beats of different transactions to interleave. AXI4 removed it: write data follows the order of the addresses.
Lesson P2.15AXI4-Lite, AXI3 and AXI5: The Family →What is credited transport?
The AXI5 option where the receiver gives credits and the sender asserts VALID only while it holds one; there is no READY. A credit cannot be used in the cycle it is given.
Lesson P2.15AXI4-Lite, AXI3 and AXI5: The Family →Which AXI rules does a protocol checker enforce?
Per channel: VALID held until the handshake, the payload stable while it waits, VALIDs low in reset. Per request: burst length by type, WRAP alignment, the 4 KB boundary, the size against the bus, strobes on addressed lanes only, exclusive sizes. Per response: B only after the last beat and the AW, IDs that match an outstanding request, WLAST and RLAST on the right beat, EXOKAY only for exclusive requests.
Lesson P2.16The AXI Protocol Checker →How does a property know which beat is the last one?
From bookkeeping it keeps beside the assertions: the AWLEN of each write in order, a beat counter, and per-ID queues of read lengths. The property samples those variables with the wires, so it sees the bus as it was before the edge.
Lesson P2.16The AXI Protocol Checker →Why did your property fire when the procedural checker did not?
Sampling time. A property evaluates on values sampled before the edge. A procedural checker that updates its counts at the edge before it checks can miss a response offered in the same cycle as the last beat. Neither is wrong; they answer at different instants.
Lesson P2.16The AXI Protocol Checker →What can a checker on the wires never see?
A VALID that waits for READY, which only a deadlock or a watchdog reveals, and same-ID responses swapped between transactions of equal length, which only the data reveals.
Lesson P2.16The AXI Protocol Checker →Where do you bind the checker?
Wherever the fault can happen: at the manager port to check the interconnect, at each subordinate port to check the subordinates. One bind line per target module, in the bench and in the system, with no change to any of them.
Lesson P2.16The AXI Protocol Checker →How do you structure an AXI driver?
One process per channel, with queues between them. A dispatcher takes items; the request processes drive AW, W and AR from their queues; the response processes match B and R to the outstanding items by ID. The driver uses get() and put() instead of get_next_item() and item_done(), so the sequence can keep several items in flight.
Lesson P2.17An AXI Agent, Monitor and Scoreboard →How does the monitor know which transaction a beat belongs to?
A W beat belongs to the oldest write whose AW has arrived and whose data is unfinished, because write data follows address order. A read beat belongs to the oldest open read with its RID, because same-ID data is in order and different IDs may interleave.
Lesson P2.17An AXI Agent, Monitor and Scoreboard →What does an AXI scoreboard key on?
On the address, with its own model of the memory, once the monitor has paired beats with requests by ID. A scoreboard that keys on arrival order breaks the first time two IDs reorder.
Lesson P2.17An AXI Agent, Monitor and Scoreboard →Why did your scoreboard report mismatches on a correct DUT?
Usually because a read was issued before the write it depends on completed. The protocol orders neither reads against writes nor different IDs, so the sequence must wait for B before a dependent read, or the scoreboard must model that freedom.
Lesson P2.17An AXI Agent, Monitor and Scoreboard →Where do IDs come from in the sequence?
From the item: an ID is a stream, so a sequence that wants parallelism uses several IDs and keeps same-ID requests that must stay ordered on one ID. The driver and the monitor never invent IDs; they only match on them.
Lesson P2.17An AXI Agent, Monitor and Scoreboard →May write data arrive before its address, and when may B be sent?
Yes: AW and W are independent and a subordinate may wait for either. B may be sent only after the last W beat and, in AXI4, after the AW handshake, and there is one B per transaction.
Lesson P2.18Capstone: AXI Bug Hunts →Why must a burst not cross a 4 KB boundary, and where does a WRAP burst wrap?
Because the interconnect decodes by the start address and routes the whole burst to one subordinate, so a burst must never need two. A WRAP burst wraps at the boundary aligned to its total size, which is why it must start aligned and have 2, 4, 8 or 16 beats.
Lesson P2.18Capstone: AXI Bug Hunts →Why do responses with the same ID come back in order?
Because the manager has nothing else to match a response to its request; the ID is the only tag. Different IDs may return in any order, and read data of different IDs may even interleave.
Lesson P2.18Capstone: AXI Bug Hunts →Does the same ID on a read and a write order them?
No. There is no ordering between the read and write channels at all. A manager that needs its read to see its write waits for the write's B first.
Lesson P2.18Capstone: AXI Bug Hunts →What does a protocol checker catch that a scoreboard cannot, and the other way round?
The checker names a broken rule at its edge: a withdrawn offer, a changed payload, a wrong WLAST, an illegal burst. The scoreboard catches data that is legal on the wires and wrong in value: ignored strobes, a same-ID reorder of equal lengths, a beat corrupted behind a register. A deadlock needs a watchdog.
Lesson P2.18Capstone: AXI Bug Hunts →Module P3 · 48 questions
APB
What is APB for?
Low-bandwidth access to the control and status registers of peripherals. It is a simple, unpipelined, low-power interface behind a bridge from AXI or AHB.
Lesson P3.1APB in One Picture →How many cycles does an APB transfer take?
At least two: one setup cycle and one access cycle. Each wait state the completer inserts with PREADY = 0 adds one access cycle.
Lesson P3.1APB in One Picture →Can two APB transfers overlap?
No. APB is not pipelined and has no IDs; a transfer starts its setup only after the previous one has completed. Back-to-back transfers go straight from access to the next setup.
Lesson P3.1APB in One Picture →What did APB3 and APB4 add?
APB3 added PREADY (wait states) and PSLVERR (errors). APB4 added PPROT (protection) and PSTRB (write strobes). APB5 added wake-up, user and parity signals.
Lesson P3.1APB in One Picture →Describe the APB state machine.
IDLE (PSEL low), SETUP (PSEL high, PENABLE low) for exactly one cycle, then ACCESS (PENABLE high) until PREADY is high. From ACCESS the bus returns to IDLE, or goes straight to SETUP when another transfer follows.
Lesson P3.2The Transfer: Setup, Access and the State Machine →When does a completer perform a write?
At the edge where PSEL, PENABLE and PREADY are all high. It may decode earlier, but side effects happen once, at that edge.
Lesson P3.2The Transfer: Setup, Access and the State Machine →Can PSEL stay high between two transfers?
Yes, for two transfers to the same completer. PENABLE must still drop for one cycle, so the second transfer has its own setup cycle.
Lesson P3.2The Transfer: Setup, Access and the State Machine →What breaks if a completer acts whenever PSEL is high?
Every side effect repeats once per cycle of the transfer: a FIFO read pops two entries, or more with wait states. The wires look correct, so only the data shows it.
Lesson P3.2The Transfer: Setup, Access and the State Machine →How does an APB completer insert wait states?
It drives PREADY low in the access phase. The transfer completes at the first access edge where PREADY is high; each low cycle adds one wait state, with no upper limit in the protocol.
Lesson P3.3Wait States and PREADY →What must the requester keep stable during wait states?
PADDR, PWRITE, PSELx, PENABLE and PPROT, plus PWDATA and PSTRB for a write, and any user request signals. They also must not change between SETUP and the first access cycle.
Lesson P3.3Wait States and PREADY →Must PREADY be low in the setup phase?
No. PREADY is a don't-care whenever PENABLE is low, so a completer with no wait states can tie it high.
Lesson P3.3Wait States and PREADY →When must PRDATA be valid?
Only in the cycle the read completes, when PSEL, PENABLE and PREADY are all high. The requester samples it at that edge and ignores it at any other.
Lesson P3.3Wait States and PREADY →When is PSLVERR valid?
Only in the last cycle of a transfer, where PSEL, PENABLE and PREADY are all 1. In every other cycle it is ignored; driving it low there is recommended.
Lesson P3.4Errors: PSLVERR →A write got PSLVERR. Was the register written?
Unknown. The specification allows either, per peripheral. Read it back or consult the peripheral documentation.
Lesson P3.4Errors: PSLVERR →Is the data of a failed read zero?
Not necessarily. It may be invalid, the requester may still use it, and a completer cannot count on the error to keep a value secret.
Lesson P3.4Errors: PSLVERR →Must every completer support PSLVERR?
No. It is optional since APB3; when absent, the requester input is tied low.
Lesson P3.4Errors: PSLVERR →How does PSLVERR reach an AXI manager?
The bridge maps it to SLVERR: in BRESP for a write, in RRESP for each read beat. An AHB bridge maps it to HRESP ERROR.
Lesson P3.4Errors: PSLVERR →What is PSTRB during a read?
All bits low. The requester must drive them low for every read transfer.
Lesson P3.5Strobes, Protection and APB5 →Is a write with PSTRB 0000 legal?
Yes. It completes like any write and changes no byte.
Lesson P3.5Strobes, Protection and APB5 →What happens with an unaligned PADDR?
The specification calls the result unpredictable: the completer may use it, align it or answer PSLVERR. Use the aligned address and PSTRB instead.
Lesson P3.5Strobes, Protection and APB5 →The completer has PSTRB but the requester does not. How do you connect them?
Tie the completer's PSTRB inputs to PWRITE, so writes have every lane valid and reads have none.
Lesson P3.5Strobes, Protection and APB5 →What does PPROT[1] = 1 mean?
A Non-secure access. PPROT[0] = 1 is privileged and PPROT[2] = 1 is an instruction access.
Lesson P3.5Strobes, Protection and APB5 →Who generates PSELx?
The requester, normally the bridge: one select per completer, decoded from the address. Every other signal is shared by all completers.
Lesson P3.6Many Completers: Decoder and Read Mux →How does the requester get the right PRDATA?
A multiplexor in the bridge selects PRDATA, PREADY and PSLVERR of the completer whose PSELx is 1 in the current transfer.
Lesson P3.6Many Completers: Decoder and Read Mux →May a completer act without its PSEL?
No. PADDR and PENABLE are broadcast to every completer, so a completer that ignores PSEL acts on transfers meant for others.
Lesson P3.6Many Completers: Decoder and Read Mux →What happens on an access to an unmapped address?
APB does not define it. The bridge must end the transfer: a default responder with PSLVERR, or, in an AXI bridge, DECERR without an APB transfer.
Lesson P3.6Many Completers: Decoder and Read Mux →Why does one slow peripheral slow the others?
APB carries one transfer at a time. Nothing can start until the waiting transfer completes.
Lesson P3.6Many Completers: Decoder and Read Mux →What does a 4-beat AXI burst become on APB?
Four APB transfers, one per beat, each with setup and access. APB has no bursts.
Lesson P3.7The AXI-to-APB Bridge →How is a byte write carried across?
PADDR is the aligned word address and PSTRB is the beat's WSTRB, so only the addressed byte changes.
Lesson P3.7The AXI-to-APB Bridge →How is PSLVERR reported to AXI?
As SLVERR: in the RRESP of the failing read beat, or in the single BRESP of the write.
Lesson P3.7The AXI-to-APB Bridge →What does the bridge answer for an address with no APB completer?
DECERR, decided before any APB transfer starts.
Lesson P3.7The AXI-to-APB Bridge →Why is the bridge slow?
APB takes at least two cycles per transfer and one transfer at a time; a simple bridge also spends a cycle per beat on the AXI side.
Lesson P3.7The AXI-to-APB Bridge →Which properties would you write for APB?
An access follows a setup or a waited access, and setup lasts one cycle. PSEL, PADDR, PWRITE, PPROT, PSTRB and the write data hold from setup until PREADY, and PENABLE stays high. PENABLE drops after the completion edge. PSTRB is zero on reads, one PSELx is high at a time, and nothing is selected in reset. Add a watchdog on PREADY with the system's own limit.
Lesson P3.8The APB Checker →Is PREADY low in the setup cycle a rule?
No. PREADY may take any value while PENABLE is low, so a completer with no wait states can tie it high. A checker that demands PREADY low in setup rejects legal designs.
Lesson P3.8The APB Checker →Is PSLVERR outside the last cycle an error?
No. It is only meaningful in the cycle where PSEL, PENABLE and PREADY are all high; driving it low elsewhere is a recommendation. Report it as a note if you report it at all.
Lesson P3.8The APB Checker →Why is a timeout not part of the protocol checker proper?
Because APB allows any number of wait states. How long is too long is a property of the system, so the watchdog's limit comes from the peripheral's documentation, not from the specification.
Lesson P3.8The APB Checker →What can an APB checker never catch?
Faults that keep the handshake legal: a completer that acts more than once per transfer, read data that arrives a cycle late, a register that ignores strobes. Those show only in the data, which needs a register model or scoreboard.
Lesson P3.8The APB Checker →When does an APB monitor publish a transfer?
At the edge where PSEL, PENABLE and PREADY are all high. Only there are PRDATA and PSLVERR valid; at setup the data and the response are not known yet.
Lesson P3.9An APB Agent and the Register Adapter →How does an APB driver do back-to-back transfers?
After the completion edge it asks for the next item without waiting. If one is ready it drives the next setup at once with PSEL still high; if not, it drops PSEL and goes idle.
Lesson P3.9An APB Agent and the Register Adapter →What does the register adapter do with PSLVERR?
bus2reg sets the status to UVM_NOT_OK, so the test sees the error as the status of write or read. With explicit prediction the model then skips predicting that register.
Why use explicit prediction with a monitor?
The mirror then follows what the bus did, not what the model asked for. Accesses from other masters, a firmware model or a second sequence update it too.
Lesson P3.9An APB Agent and the Register Adapter →Does get_next_item or get suit an APB driver?
get_next_item with item_done, because APB carries one transfer at a time and the response goes back in the same item. get with put is for buses that keep several items in flight.
How many cycles does an APB transfer take, and why?
At least two: one setup cycle and one access cycle, plus one cycle per wait state. APB is not pipelined, and PENABLE marks the second cycle so a simple completer can act on one edge.
Lesson P3.10Capstone: APB Bug Hunts →When does a completer act on a write, and why only then?
At the edge where PSEL, PENABLE and PREADY are all high. Acting at every selected edge repeats side effects: a FIFO pops, a counter counts, a clear-on-read register clears, once per wait state.
Lesson P3.10Capstone: APB Bug Hunts →May PSEL stay high between two transfers?
Yes, when the next transfer goes to the same completer: ACCESS goes straight to SETUP, PENABLE drops for one cycle and PSEL stays high.
Lesson P3.10Capstone: APB Bug Hunts →What does PSLVERR mean for the register?
Only that the transfer failed. A write with an error may or may not have changed the register, and a read with an error may return data the requester still uses. PSLVERR counts only in the completion cycle.
Lesson P3.10Capstone: APB Bug Hunts →How does an AXI write burst reach an APB register block?
Through a bridge that makes one APB transfer per beat, puts the beat's strobes on PSTRB, and returns SLVERR in BRESP if any beat got PSLVERR. An address that decodes to no completer gets DECERR without an APB transfer.
Lesson P3.10Capstone: APB Bug Hunts →What would you put in an APB bench?
A rule checker bound to the bus, a register model with the access policy of every register, traffic with wait states, back-to-back transfers and errors, and a watchdog on PREADY.
Lesson P3.10Capstone: APB Bug Hunts →Module P4 · 58 questions
AHB
What makes AHB pipelined?
The address phase of the next transfer happens in the same cycle as the data phase of the current one. With zero wait states the bus completes one transfer per cycle, although each transfer takes two cycles from address to data.
Lesson P4.1AHB in One Picture →What is the difference between AHB and AHB-Lite?
AMBA 2 AHB supports several masters with an arbiter and the RETRY and SPLIT responses. AHB-Lite has one manager, no arbitration and a one-bit HRESP (OKAY or ERROR). The current AHB specification describes AHB-Lite and its AHB5 extensions; several managers need an interconnect in front.
Lesson P4.1AHB in One Picture →Who drives HREADY?
Each subordinate drives HREADYOUT. The multiplexor forwards the HREADYOUT of the subordinate whose data phase is in progress as HREADY, to the manager and to every subordinate.
Lesson P4.1AHB in One Picture →How many transfers can be in flight on AHB?
Two at most: one in its address phase and one in its data phase. AXI can have many outstanding transactions; AHB cannot.
Lesson P4.1AHB in One Picture →When is HWDATA valid relative to HADDR?
One cycle later: in the data phase of the transfer, which starts at the edge where its address phase is accepted. The manager holds HWDATA stable through every wait state.
Lesson P4.2Address Phase, Data Phase →When must HRDATA be valid?
Only in the last cycle of the data phase, at the edge where HREADY is high. During wait states its value is meaningless.
Lesson P4.2Address Phase, Data Phase →Why does a subordinate need HREADY as an input?
Because another subordinate may be stretching its data phase. The address on the wires is accepted only at an edge where HREADY is high, so a subordinate samples HSELx, the address and the control only then.
Lesson P4.2Address Phase, Data Phase →Can a subordinate extend the address phase?
No. It can only stretch its own data phase with HREADYOUT low. The next address phase waits on the wires as a side effect.
Lesson P4.2Address Phase, Data Phase →What happens on the bus during reset?
HTRANS is IDLE and every subordinate drives HREADYOUT high. Reset is asserted asynchronously and released synchronously.
Lesson P4.2Address Phase, Data Phase →What is the difference between IDLE and BUSY?
IDLE means no transfer is wanted. BUSY means a burst continues but its next beat is not ready; its address and control already show that next beat. Both get a zero-wait OKAY and are ignored by the subordinate.
Lesson P4.3HTRANS: IDLE, BUSY, NONSEQ, SEQ →How is a single transfer signalled?
HTRANS = NONSEQ, with burst type SINGLE or an undefined-length INCR of one beat. A single transfer is a burst of length one.
Lesson P4.3HTRANS: IDLE, BUSY, NONSEQ, SEQ →What does SEQ guarantee?
That the transfer continues the burst: the address is the previous one plus the transfer size (wrapped at the boundary for WRAP bursts) and the control is identical.
Lesson P4.3HTRANS: IDLE, BUSY, NONSEQ, SEQ →Can a burst end with BUSY?
Only an undefined-length INCR burst, followed by IDLE or NONSEQ. Fixed-length bursts end with their last beat as SEQ, and BUSY never follows a SINGLE transfer.
Lesson P4.3HTRANS: IDLE, BUSY, NONSEQ, SEQ →What is the difference between HREADY and HREADYOUT?
HREADYOUT is a subordinate's output for its own data phase. HREADY is the bus signal the multiplexor makes from the HREADYOUT of the subordinate whose data phase is in progress; the manager and every subordinate take it as an input.
Lesson P4.4Wait States and What May Change →What does a wait state extend?
The data phase of the current transfer and the address phase of the next one, which is already on the bus. Nothing is accepted until HREADY is high.
Lesson P4.4Wait States and What May Change →May the manager change the address during a wait state?
Only while the address phase shows IDLE, and after an ERROR has started. A NONSEQ or SEQ, once shown, keeps its address until HREADY is high.
Lesson P4.4Wait States and What May Change →May HTRANS change during a wait state?
IDLE to NONSEQ; BUSY to SEQ in a fixed-length burst; BUSY to anything in an undefined-length INCR burst. After such a change HTRANS is held until HREADY is high.
Lesson P4.4Wait States and What May Change →Why does a subordinate sample the address only when HREADY is high?
Because only then is the address phase accepted. While HREADY is low the manager may still change an IDLE into a different transfer, and the transfer it shows may target another subordinate.
Lesson P4.4Wait States and What May Change →Why is the AHB ERROR response two cycles?
Because the bus is pipelined: when the error starts, the next transfer's address is already on the bus. The first cycle, with HREADY low, lets the manager replace it with IDLE before the second cycle ends the transfer.
Lesson P4.5The Two-Cycle ERROR →What do HREADYOUT and HRESP look like during an ERROR?
First cycle HREADYOUT low and HRESP high; second cycle HREADYOUT high and HRESP high. Any wait states before it have HRESP low.
Lesson P4.5The Two-Cycle ERROR →Must the manager cancel the rest of a burst after an ERROR?
No. It may cancel the remaining beats, driving IDLE during the ERROR, or continue them. If it cancels, it need not rebuild the burst later.
Lesson P4.5The Two-Cycle ERROR →Is read data with an ERROR safe to ignore?
The manager may still use it, so a subordinate cannot rely on ERROR to hide data. Driving HRDATA to zero on a read error is recommended.
Lesson P4.5The Two-Cycle ERROR →What usually causes ERROR?
A protection error, such as a write to a read-only location, or an access to an address no subordinate owns, answered by the default subordinate.
Lesson P4.5The Two-Cycle ERROR →What does INCR4 mean, and how many bytes does it move?
Four beats, each at the previous address plus the size. The bytes are four times HSIZE: 16 for words, 8 for halfwords.
Lesson P4.6Bursts: The Address of Every Beat →Where does a WRAP8 of words starting at 0x34 wrap?
Inside the 32-byte window 0x20 to 0x3f: 0x34, 0x38, 0x3c, then 0x20, 0x24, 0x28, 0x2c, 0x30.
Lesson P4.6Bursts: The Address of Every Beat →Why must an AHB burst not cross 1 KB?
Subordinate regions are at least 1 KB and start on 1 KB boundaries, so a burst within 1 KB never needs two subordinates. The rule binds incrementing bursts; a wrapping burst stays in its window.
Lesson P4.6Bursts: The Address of Every Beat →Can an AHB transfer be unaligned?
No. Every transfer is aligned to its size. AXI allows an unaligned start; AHB uses HSIZE, HADDR and HWSTRB for narrow and sparse writes instead.
Lesson P4.6Bursts: The Address of Every Beat →What is BUSY for, and where is it not allowed?
A pause inside a burst, showing the next beat's address. Not as the last cycle of a fixed-length burst and not after a SINGLE; an undefined-length INCR may end with it.
Lesson P4.6Bursts: The Address of Every Beat →Which lanes carry a halfword at 0x1006 on a 32-bit bus?
Lanes 2 and 3, HWDATA bits 31:16. The lane is the address modulo the bus width in bytes.
Lesson P4.7Transfer Size, Byte Lanes, Strobes and Width →Can an AHB burst start at an unaligned address?
No. Every transfer, in every beat, is aligned to HSIZE. Unaligned data becomes several smaller aligned transfers.
Lesson P4.7Transfer Size, Byte Lanes, Strobes and Width →What does HWSTRB add?
Sparse writes in AHB5: a low strobe keeps an active lane from being written. It cannot widen a transfer; HSIZE and HADDR still choose the lanes.
Lesson P4.7Transfer Size, Byte Lanes, Strobes and Width →Must a manager drive the unused lanes of HWDATA?
No. Only the active lanes carry data. The subordinate must take its bytes from those lanes and leave the rest of the word alone.
Lesson P4.7Transfer Size, Byte Lanes, Strobes and Width →What is byte invariance?
A byte at a given address uses the same data wires in little-endian and byte-invariant big-endian systems; only multi-byte values change byte order.
Lesson P4.7Transfer Size, Byte Lanes, Strobes and Width →Which select drives the read data multiplexor?
The select of the data phase: the decoder output registered at every edge where HREADY is 1. The decoder's own output already names the next transfer's subordinate.
Lesson P4.8Decoder, Multiplexor and the Default Subordinate →Why does a subordinate need HREADY as an input?
HREADY says the transfer in front has finished. A subordinate takes an address phase only when HSEL and HREADY are both 1; before that the address may still change or be cancelled.
Lesson P4.8Decoder, Multiplexor and the Default Subordinate →What does the default subordinate do?
It covers the holes in the map: a zero-wait OKAY to IDLE and BUSY, the two-cycle ERROR to NONSEQ and SEQ.
Lesson P4.8Decoder, Multiplexor and the Default Subordinate →What is the smallest AHB region?
1 KB, starting and ending on a 1 KB line, which is why an incrementing burst may not cross one: it would change subordinates mid-burst.
Lesson P4.8Decoder, Multiplexor and the Default Subordinate →How does an APB peripheral answer an AHB manager?
Through a bridge that is an AHB subordinate. It stretches its data phase over the APB setup and access cycles and maps PSLVERR to ERROR.
Lesson P4.8Decoder, Multiplexor and the Default Subordinate →What does HEXOKAY low mean on an exclusive write?
The exclusive write failed: someone wrote the location since the exclusive read, or the location has no exclusive support. The manager repeats the whole read-modify-write.
Lesson P4.9Locked Transfers, Protection and Exclusive Access →What does HMASTER do?
It names the manager, or the thread inside it, so the monitor can keep one reservation per manager. The interconnect extends it to make every manager unique.
Lesson P4.9Locked Transfers, Protection and Exclusive Access →Why is an IDLE recommended after a locked sequence?
It gives the interconnect a clean point to re-arbitrate; the bus unlocks after a cycle with HMASTLOCK low and HREADY high.
Lesson P4.9Locked Transfers, Protection and Exclusive Access →What HPROT should a manager send if it does not know better?
0b0011: a data access, privileged, non-bufferable and non-cacheable.
Lesson P4.9Locked Transfers, Protection and Exclusive Access →Can an exclusive transfer be a burst?
No. It is a single beat, SINGLE or INCR, with no BUSY, aligned to its size.
Lesson P4.9Locked Transfers, Protection and Exclusive Access →What may change while HREADY is low?
A waiting NONSEQ or SEQ keeps its address and transfer type. An IDLE may move or become NONSEQ, and a BUSY may become SEQ (or anything in an INCR burst). After the first ERROR cycle the manager may drop the waiting transfer to IDLE.
Lesson P4.10The AHB Checker →Why is the ERROR response two cycles?
Because the next address phase is already on the bus. The first cycle holds it and warns the manager, which can then drive IDLE in the second.
Lesson P4.10The AHB Checker →How does a property check the address of a SEQ?
With bookkeeping beside the assertions: an always block keeps the last accepted beat, the size and the burst type. The property compares HADDR with the next address computed from them.
Lesson P4.10The AHB Checker →Which AHB faults does a protocol checker miss?
Faults inside a subordinate that leave the wires legal, such as write data taken in the wrong phase or lanes written that HSIZE did not select. A scoreboard that reads back what was written catches them.
Lesson P4.10The AHB Checker →What must IDLE and BUSY get?
A zero-wait OKAY, and no action at all.
Lesson P4.10The AHB Checker →How does an AHB driver pipeline?
It holds two items: one in the address phase and one in the data phase. At every edge where HREADY is high the data phase ends, the address-phase item moves into the data phase, and the next item takes the address phase. While HREADY is low it changes nothing.
Lesson P4.11An AHB Agent: The Pipelined Driver and Monitor →When does the monitor publish a write, and where does it get the data?
At the edge where the write's data phase ends, HREADY high, the edge after its address phase was taken or later with wait states. The data is HWDATA at that edge, because write data belongs to the data phase.
Lesson P4.11An AHB Agent: The Pipelined Driver and Monitor →What breaks a monitor that logs at the address phase?
Wait states: a transfer waiting on the wires shows NONSEQ at several edges and is logged several times, and the data it records belongs to another transfer. An address phase counts only at an edge with HREADY high.
Lesson P4.11An AHB Agent: The Pipelined Driver and Monitor →What does the driver do in the first cycle of an ERROR?
If a transfer waits in the address phase it may cancel it by driving IDLE in the second cycle; this driver does, and issues the transfer again afterwards. It may also continue; the specification allows both.
Lesson P4.11An AHB Agent: The Pipelined Driver and Monitor →Why use get() and put() in the driver?
Because two items are in flight at once. get() returns the sequence immediately, and put() returns each response when its data phase ends.
Lesson P4.11An AHB Agent: The Pipelined Driver and Monitor →What does pipelined mean on AHB?
The address phase of one transfer overlaps the data phase of the one before. Write data follows its address by at least one cycle, and a wait state in one data phase holds the next address phase on the wires.
Lesson P4.12Capstone: AHB Bug Hunts →Why does a subordinate need HREADY as an input when it drives HREADYOUT?
Because the bus HREADY says when the data phase in progress ends, possibly another subordinate's. A subordinate may sample an address phase only when HREADY is high; otherwise it takes a transfer that has not been accepted and may be cancelled.
Lesson P4.12Capstone: AHB Bug Hunts →Why is the ERROR response two cycles?
Because the next address phase is already on the wires. The first cycle holds it and warns the manager; in the second the manager may drive IDLE, so a transfer it no longer wants is never taken.
Lesson P4.12Capstone: AHB Bug Hunts →Why must the read multiplexor be keyed by the data phase?
Because the data and the response belong to the transfer in its data phase, while the decoder's select already points at the next address. The select is registered on HREADY high so it changes exactly when the data phase does.
Lesson P4.12Capstone: AHB Bug Hunts →What does a protocol checker catch that a scoreboard cannot, and the other way round?
The checker names a broken rule at its edge: a moved address, a one-cycle ERROR, a wrong SEQ address, a 1 KB crossing. The scoreboard catches the faults that keep every wire legal: data taken in the wrong phase, lanes HSIZE did not select, a multiplexor listening to the wrong subordinate.
Lesson P4.12Capstone: AHB Bug Hunts →Module P5 · 9 questions
Serial Communication Fundamentals
Why two flops and not one?
The second flop gives the first a whole clock to settle before any logic reads it. Failures fall exponentially with that time.
Lesson P5.9Crossing into the Receiver's Clock →Does a synchronizer remove metastability?
No. It makes a late settle rare enough. A faster clock or a slower flop brings failures back.
Lesson P5.9Crossing into the Receiver's Clock →Can you synchronize a multi-bit bus with two flops per bit?
No. Bits settle on different clocks and the word tears. Synchronize one bit, such as a valid or a Gray-coded pointer.
Lesson P5.9Crossing into the Receiver's Clock →When must you treat a trace as a transmission line?
When its round trip is not much shorter than the edge. A rule of thumb: one-way delay above about a sixth of the rise time.
Lesson P5.10When a Wire Becomes a Transmission Line →Series or parallel termination?
Series for one receiver at the end of a point-to-point line, at no DC cost. Parallel when several receivers sit along the line, at the cost of current.
Lesson P5.10When a Wire Becomes a Transmission Line →Why do differential pairs tolerate noise?
Noise couples into both wires alike and the receiver subtracts them, so it cancels.
Lesson P5.10When a Wire Becomes a Transmission Line →Why is a debug console almost always a UART?
Two pins, no clock, and any terminal can talk to it once the rates agree.
Lesson P5.11Choosing a Serial Protocol →Why not put everything on I2C?
It is slow, half duplex and needs a pin per interrupt; good for configuration, poor for bulk data or many fast sensors.
Lesson P5.11Choosing a Serial Protocol →What does I3C keep from I2C?
The two wires and legacy I2C targets on the same bus; it adds push-pull speed, dynamic addresses and in-band interrupts.
Lesson P5.11Choosing a Serial Protocol →Module P6 · 21 questions
UART
Which serial link has no clock wire, and what does that cost?
UART. The receiver must find the bit times from the start edge and its own clock, so both ends must agree on the rate closely.
Lesson P6.1Serial Links in One Picture →Why is I2C slower than SPI?
A 1 on I2C is a released line pulled up by a resistor, so the rise is slow. SPI drives both levels and runs far faster.
Lesson P6.1Serial Links in One Picture →Is QSPI four SPI links?
No. One controller sends one command and uses four data lanes together; a byte takes two clocks.
Lesson P6.1Serial Links in One Picture →Draw an 8N1 frame for 0x41.
Idle 1, start 0, then 1 0 0 0 0 0 1 0 (bit 0 first), stop 1: 10 bit-times.
Lesson P6.2The Frame: Start, Data, Parity, Stop →What does parity catch?
Any odd number of flipped bits. Two flipped bits leave the count of 1s unchanged and pass.
Lesson P6.2The Frame: Start, Data, Parity, Stop →Does the receiver check two stop bits?
A receiver checks the first; the second is idle time the transmitter promises.
Lesson P6.2The Frame: Start, Data, Parity, Stop →Why does a UART receiver oversample?
There is no clock on the wire. A fast local clock lets it find the start edge within one tick and count to the middle of every bit.
Lesson P6.3The Receiver: Oversampling and the Sample Point →Why wait for eight low ticks?
A short glitch must not start a frame, and eight ticks is also the middle of the start bit, so one counter both confirms the start and centres the samples.
Lesson P6.3The Receiver: Oversampling and the Sample Point →Why 16 and not 2?
The sample can be off by one tick of the fast clock: half a bit at 2 times, a sixteenth at 16 times. Beyond that, rate mismatch dominates.
Lesson P6.3The Receiver: Oversampling and the Sample Point →Which bit fails first under a rate mismatch, and why?
The stop bit, or the last data bit before it: the drift grows with every bit after the start edge, which is the only point both ends agree on.
Lesson P6.4Baud Mismatch: The Measured Budget →Why does parity reduce the tolerance?
It adds a bit before the stop, so the stop sample is one bit further from the start and drifts further.
Lesson P6.4Baud Mismatch: The Measured Budget →Does a second stop bit help?
Only when the transmitter is fast and frames come back to back: the late stop sample then lands in idle instead of the next start bit.
Lesson P6.4Baud Mismatch: The Measured Budget →What is the difference between a framing error and an overrun?
A framing error is on the wire: the stop sample read 0. An overrun is in the receiver: a byte arrived before the last one was read.
Lesson P6.5Errors, Break and Recovery →How should a receiver handle a break?
Report it once, deliver no bytes for it, and look for the next start only after the line has gone high again.
Lesson P6.5Errors, Break and Recovery →Does a majority vote make a receiver noise-proof?
No. A vote of three outvotes a one-tick glitch; a two-tick glitch on the right ticks still wins.
Lesson P6.5Errors, Break and Recovery →What do RTS and CTS mean?
Both are "ready to receive" signals. A side drives RTS from its own FIFO level; the other side sees it as CTS and starts no new frame while it is deasserted.
Lesson P6.6Flow Control, FIFOs and Baud Divisors →Why is the RTS trigger below the FIFO size?
Bytes already started or loaded still arrive after RTS changes; the room above the trigger holds them.
Lesson P6.6Flow Control, FIFOs and Baud Divisors →Why can XON/XOFF not carry binary data as is?
The stop and go signals are the bytes 0x13 and 0x11, so binary data containing them must be escaped.
Lesson P6.6Flow Control, FIFOs and Baud Divisors →When should a UART monitor report a byte?
After the stop sample. Before that there is no frame, and on a break there never will be one.
Lesson P6.7Capstone: The UART Monitor, Checker and Bug Hunt →What can assertions on the receiver's clock check?
Spacing, levels at sample points, flag consistency and counts. Not the peer's bit period: that needs a sweep.
Lesson P6.7Capstone: The UART Monitor, Checker and Bug Hunt →How do you know your checker works?
Run it against a bank of known faults and a legal variation: every fault must fire something, and the legal one nothing.
Lesson P6.7Capstone: The UART Monitor, Checker and Bug Hunt →Module P7 · 40 questions
SPI and QSPI
What are the four SPI signals?
SCLK from the controller, MOSI from the controller, MISO from the selected peripheral, and one active-low chip select per peripheral.
Lesson P7.1SPI in One Picture →Why is SPI called full duplex?
Every clock shifts one bit out on MOSI and one bit in on MISO at the same time. A byte sent is always a byte received.
Lesson P7.1SPI in One Picture →What does chip select do besides selecting?
It frames the transaction. The peripheral starts decoding when CS falls and acts when CS rises.
Lesson P7.1SPI in One Picture →Is SPI MSB first?
Most devices, and every flash instruction, shift the most significant bit first, but it is a device convention, not part of a standard.
Lesson P7.1SPI in One Picture →What do CPOL and CPHA mean?
CPOL is the idle level of the clock. CPHA selects whether data is sampled on the first (leading) or second (trailing) edge after the clock leaves idle; the other edge launches the next bit.
Lesson P7.2The Four Modes: CPOL and CPHA →Which modes are compatible?
The model transfers intact bytes between 0 and 3 (rising), and between 1 and 2 (falling), including the first byte. The selected device must also accept the clock level at CS. Mixed pairs race on the shared edge.
Lesson P7.2The Four Modes: CPOL and CPHA →What does a mode mismatch look like?
Bytes shifted by exactly one bit, often only in one direction, and hold times of a launch delay. It is never random garbage.
Lesson P7.2The Four Modes: CPOL and CPHA →Which mode does a typical serial flash use?
Mode 0 or mode 3: it samples on rising edges and changes its output on falling edges.
Lesson P7.2The Four Modes: CPOL and CPHA →How do you compute the read margin of an SPI interface?
Half the clock period minus the peripheral's clock-to-output time (tCLQV) minus the controller's input setup time, for same-cycle sampling.
Lesson P7.3Timing: Setup, Hold and the Half-Cycle Budget →Why can a 133 MHz flash fail at 100 MHz?
With tCLQV of 6 ns, half a period is shorter than the output delay above about 83 MHz, so same-cycle sampling takes the previous bit.
Lesson P7.3Timing: Setup, Hold and the Half-Cycle Budget →What do tCLQV and tCLQX bound?
tCLQV is the latest the new bit may appear; tCLQX is the earliest the old bit may vanish. The valid window lies between them.
Lesson P7.3Timing: Setup, Hold and the Half-Cycle Budget →What happens if CS rises in the middle of a write byte?
The flash does not execute the write. CS must rise only after the eighth bit of the last byte.
Lesson P7.3Timing: Setup, Hold and the Half-Cycle Budget →How do you connect several SPI peripherals?
Share CLK, MOSI and MISO; give each peripheral its own active-low select. Every deselected peripheral must release MISO.
Lesson P7.4Many Peripherals: CS, Daisy Chain and Tri-State →What happens if a deselected peripheral drives MISO?
Contention: x in simulation wherever the two drivers disagree, a mid-rail level and heat on a board.
Lesson P7.4Many Peripherals: CS, Daisy Chain and Tri-State →Can devices with different SPI modes share a bus?
Yes. The controller changes CPOL and CPHA between frames, per device.
Lesson P7.4Many Peripherals: CS, Daisy Chain and Tri-State →What is a daisy chain?
One select for all devices, each MISO wired to the next MOSI, forming one long shift register updated by one long frame.
Lesson P7.4Many Peripherals: CS, Daisy Chain and Tri-State →How does an SPI monitor know which edge to sample?
From the configured mode: rising when CPOL equals CPHA, falling otherwise. It cannot infer the mode from the wires.
Lesson P7.5The SPI Monitor and Checker →What can an SVA checker on SPI wires assert?
Rules that need no data: CLK idle level at the CS edges, MISO released while deselected, no change on the sample edge, whole bytes on writes, CS-to-clock times.
Lesson P7.5The SPI Monitor and Checker →What can it not assert?
Whether the bytes are right. That needs a reference model or a scoreboard.
Lesson P7.5The SPI Monitor and Checker →Why bind the checker to the wires and not the DUT's internals?
The wires are what both sides agreed to. A checker on internals cannot be reused on another peripheral and misses a DUT that shifts correctly but drives the wrong edge.
Lesson P7.5The SPI Monitor and Checker →What are the phases of a quad flash read?
Command, address, mode byte, dummy clocks and data, all inside one CS frame. The command decides the lane count of each phase and whether the mode and dummy phases exist.
Lesson P7.6From SPI to QSPI: The Flash Command Model →What does 1-4-4 mean?
One lane for the command, four for the address (and mode byte), four for the data. EBh is 1-4-4; 6Bh is 1-1-4, with the address on one lane.
Lesson P7.6From SPI to QSPI: The Flash Command Model →Why does Fast Read have dummy clocks?
They give the flash time to fetch the first byte after the last address bit. The clock stays at full speed for the rest of the frame; 03h has none and is limited to 50 MHz instead.
Lesson P7.6From SPI to QSPI: The Flash Command Model →What does an off-by-one in the dummy count do?
The controller samples one clock early or late. With one dummy too few, the first sampled bit is undriven and every bit lands one place late; on four lanes, every nibble does.
Lesson P7.6From SPI to QSPI: The Flash Command Model →Who drives IO0 to IO3 during a quad I/O read?
The controller during the command, address and mode byte; nobody during the dummy clocks; the flash during the data. The pins must be released before the falling edge of the first data clock.
Lesson P7.7Quad I/O on the Wire: Four Bidirectional Pins →What happens if the controller releases late?
Both drivers are on during the first data clocks. Simulation shows x where they disagree; silicon shows a mid-rail level, wrong bits and heat.
Lesson P7.7Quad I/O on the Wire: Four Bidirectional Pins →Why does /HOLD stop working in quad mode?
With QE set the /HOLD pin is IO3, a data lane. One pin cannot be a control input and a data lane at once.
Lesson P7.7Quad I/O on the Wire: Four Bidirectional Pins →Which way round are the nibble lanes?
High nibble first, and the top bit of each nibble on IO3, for the address, the mode byte and the data alike.
Lesson P7.7Quad I/O on the Wire: Four Bidirectional Pins →What must precede every program or erase?
A Write Enable (06h), which sets WEL. The flash clears WEL when the operation ends, so every write needs a fresh 06h.
Lesson P7.8Program, Erase and the Status Register →How does firmware know a program has finished?
It reads status register 1 with 05h until BUSY (bit 0) is 0. While BUSY is 1 the flash ignores all but the status reads.
Lesson P7.8Program, Erase and the Status Register →What happens if you program 300 bytes from the start of a page?
The address wraps inside the page: bytes 256 to 299 overwrite bytes 0 to 43, and the next page is untouched.
Lesson P7.8Program, Erase and the Status Register →Can you program a 1 over a 0?
No. Programming can only clear bits; only an erase returns them to 1, and it works on whole sectors or blocks.
Lesson P7.8Program, Erase and the Status Register →What does a cache miss cost in an XIP system?
One flash read of the whole line: the instruction, address, mode and dummy clocks plus two clocks per byte on four lanes. For a 32-byte line with EBh, 84 clocks.
Lesson P7.9XIP, Continuous Read and Burst with Wrap →Why use burst wrap?
The flash returns the byte that missed first, then wraps inside the aligned section, so the CPU resumes early and the whole line still arrives in one command.
Lesson P7.9XIP, Continuous Read and Burst with Wrap →Does wrap save clocks?
No. It changes the order of the bytes, not their number.
Lesson P7.9XIP, Continuous Read and Burst with Wrap →What is the difference between 1-4-4 and QPI?
In 1-4-4 the instruction byte still goes on one lane; in QPI (4-4-4) it goes on four lanes too.
Lesson P7.9XIP, Continuous Read and Burst with Wrap →Why is a clean wire not enough?
A flash that programs without WEL, erases to zero or never reports BUSY keeps every frame legal. Only a readback against the datasheet's rule shows what it did.
Lesson P7.10Capstone: A QSPI Controller and Flash Bug Hunt →How do you test a lenient flash model?
Send stimulus the datasheet forbids, such as a program without 06h or a quad read with QE clear, and expect the flash to refuse it.
Lesson P7.10Capstone: A QSPI Controller and Flash Bug Hunt →Why keep a record that gives no verdict?
The flash trace line is the evidence a human or a scoreboard reads. A record that also gave verdicts would hide the data whenever its rule was wrong.
Lesson P7.10Capstone: A QSPI Controller and Flash Bug Hunt →How do you choose stimulus for a fault list?
Build the fault-against-program matrix, then pick programs until every fault has a mark. Faults no program sees are the next stimulus to write.
Lesson P7.10Capstone: A QSPI Controller and Flash Bug Hunt →Your Review Queue
Saved review reminders are coming soon.