Design Reviews: "Design This SoC"
An open design question has many right answers, but every right answer has numbers. Eight columns, filled from left to right, turn a vague product into a design you can defend.
You Will Be Able To
- Fill the eight columns of a design review in order, and say what each column takes from the columns before it.
- Turn every requirement into a number before drawing a block, and size from the peak, not the average.
- Tell a flaw, which fails a number, from a risk, which passes with a thin margin.
- Lesson
- S11.4
- Time
- 28 min
- Runs on
- Your browser
- Check
- 5 questions
The interviewer says: "Design a small logger chip." You draw a processor, a bus and a UART. Ten minutes later she asks how big the SRAM is.
You have no number. Where should your answer have started?
Before You Start
You need Reading an SoC Specification: the tables a chip document holds.
You need The Memory Map, Power Modes and the Energy of a Sleep and Drivers: Polling, Interrupts or DMA.
It helps to have done The Integration Bug Hunt. Its ten faults are the kind a review should catch early.
| Question | |
|---|---|
| 1 | What are the eight columns of a design review, in order? |
| 2 | Why does every requirement become a number before any block is drawn? |
| 3 | Why do you size from the peak and not from the average? |
| 4 | What is the difference between a flaw and a risk? |
| 5 | The logger must keep two minutes of data. What does the board print last? |
The Idea: Eight Questions, Always in the Same Order
A design question in a review or an interview is open. Many answers are right. An answer with no numbers is not one of them.
So use the same eight questions every time, in the same order. Write the answers on a board of eight columns. Each column uses what the columns to its left decided.
The first idea is numbers before boxes. Requirements become rates, sizes, times and limits. Only then do blocks appear, and only then do they get addresses.
The second idea is that time and events are sized from rates. Clocks, interrupts and sleep modes follow from how often things happen. The rate that counts is the one in the busiest second, which this page calls the peak.
The third idea is planning for failure. The last two columns ask how you will see the chip fail, and what could still sink it.
The design under review is called the proposal. It can fail a column. That is a design flaw, and it is fixed now. It can also pass with almost nothing to spare. That is a design risk, and it goes on a list.
New Words
| Word | Meaning |
|---|---|
| Design review | A meeting where other engineers check a proposed design against its requirements before work goes on. |
| Proposal | The design under review: its blocks, its map, its clocks, its interrupt numbers, its modes and its debug access. |
| Review board | This page's name for eight columns, one for each question of a review, filled from left to right. |
| Sizing sheet | A worked set of sums that turns requirements into clock rates, buffer depths, interrupt counts and memory sizes. |
| Design flaw | A place where the proposal fails a requirement or a rule. It is fixed before work goes on. |
| Design risk | A part that passes with a thin margin, or rests on a number nobody has measured. It is listed with a test that retires it. |
| Resource margin | The share of a resource left over after the need. Spare SRAM is a resource margin. |
| ppm | Parts per million. An error of 64 ppm is 64 millionths, or 0.0064 percent. |
| UART divider | The number the clock is divided by to give the baud rate. |
| Walk-through | An interview question answered in stages: requirements, blocks, interfaces, the hard corner, trade-offs and follow-ups. |
One Picture: The Review Board
- File
- Processor
- Memory
- Clock / reset
- Control / FSM
- Power
- Debug
- Report
- 1. Requirements
Write every requirement as a rate, a size, a time or a limit. Bytes each second, seconds kept, a deadline.
- 2. Block diagram
One block for each job the numbers name. A block with no number behind it has no reason to be there.
- 3. Memory map
Give every block an aligned window. The SRAM must hold the buffers that column 1 sized, plus the stack.
- 4. Clocks and resets
Pick the clocks that meet the rates, and check every divider. Say which resets reach which blocks, and in what order.
- 5. Interrupts
One source number for each requester, all different. Count the requests in a second, on average and at the peak.
- 6. Power modes
List the modes and what each one keeps powered. Data that must survive a sleep must stay in a powered block.
- 7. Debug
A debugger that can stop the core from reset, a console, and counters for every buffer that can overflow.
- 8. Risks
Every thin margin and every unmeasured number goes on a list, each with a test that retires it. Then change a requirement and run the board again.
Read the diagram as text
- Requirements: What must it do, in numbers?
- Block diagram: Which block does each job?
- Memory map: Where does each block live?
- Clocks and resets: How fast, and how does it start?
- Interrupts: Who asks for service, and how often?
- Power modes: When does it sleep, and what survives?
- Debug: How will you see it fail?
- Risks: What could still sink it?
- Requirements → Block diagram: what to build
- Block diagram → Memory map: what to place
- Memory map → Clocks and resets: what to time
- Clocks and resets → Interrupts: what to count
- Interrupts → Power modes: when to wake
- Power modes → Debug: what to see
- Debug → Risks: what is thin
- Risks → Requirements: change and run again
Four pairs: what to build, where and how fast, when it acts, and how it fails. Every worked system on the next pages fills this same board.
The Smallest Example, Worked by Hand
No simulator yet. A logger reads one temperature sensor over SPI, 10 times a second, 2 bytes each time. It keeps the last minute and reports it on UART0 at 115,200 baud.
| Column | Sum | Entry |
|---|---|---|
| 1 Requirements | 2 bytes × 10 a second; × 60 seconds | 20 bytes a second; a buffer of 1200 bytes |
| 2 Block diagram | one block for each job | timer, SPI, UART0, SRAM and boot ROM |
| 3 Memory map | 1200 + 512 of stack + 64 of variables | 1776 bytes: an SRAM of 2 KiB at 8000_0000 |
| 4 Clocks and resets | 50 MHz ÷ 115,200 = 434.03, so a divider of 434 | 115,207 baud, 64 ppm fast; one reset for everything |
| 5 Interrupts | 10 timer + 10 SPI + 1200 UART bytes a minute | 40 a second on average |
| 5, at the peak | while a report goes out: 115,200 ÷ 10 bits a byte | 11,540 in that second |
| 6 Power modes | asleep between samples | the SRAM must stay powered |
| 7 Debug | stop the core from reset; see the output | JTAG from reset; console on UART0 |
| 8 Risks | 272 bytes spare of 2048 | 13 percent spare: on the list |
Read row 5 twice. On average the logger asks for service 40 times a second. While a report is sent, UART0 asks once for every byte, over 11,000 times. The core and the handler must keep up with that second.
A report of 1200 bytes, at 10 bits a byte, takes 104.2 ms on the wire. The lab rounds that up to 105 ms.
The Rules
Rule 1: Numbers before boxes.
Write every requirement as a rate, a size, a time or a limit. A block exists because a number needs it.
Rule 2: Fill the columns in order.
Each column uses what the columns to its left decided. A change on the left reruns every column to its right.
Rule 3: Size from the peak.
Buffers, clocks and handlers must survive the busiest second, not the average one.
Rule 4: A flaw fails a number; a risk passes thinly.
Fix a flaw now. Put a risk on a list with the test that will retire it.
Rule 5: Plan for the day it fails.
Debug access works from the first instruction. Every buffer that can overflow has a counter that says so.
Rule 6: Say what you assumed.
Every number on the board names its source, or says "exercise value" or "not checked".
Sources for These Rules
Review as a team activity, with design and verification reviewing each other's work: Mehta, ASIC/SoC Functional Design Verification, section 6.4.4.
A written verification plan as the first step of a chip project: the same book, sections 2.2 and 16.2.
The eight columns, the split between flaw and risk, and the 20 percent line are common practice. They are choices of this page; no book in our library gives them.
The 2 percent budget for both baud-rate errors together is a common habit, not checked. The 30,000 ppm of the RC oscillator and the 50 ppm of the crystal are exercise values. The 50 MHz crystal is that of ap_soc (docs/soc/ap_soc-facts.md, section 10).
Now Run It: A Proposal with Three Flaws
The lab at the end of this page is the board as a sizing sheet. A colleague has proposed a logger, and the lab reviews it column by column.
Each column ends in ok or in FLAW. FLAW stands for a design flaw in that column.
1 requirements data=20 B/s buffer=1200 B report=105 ms
2 blocks sensors=1 on one SPI jobs=5 blocks=5 missing=0 ok
3 map sram=1024 B need=1776 B aligned=5/5 overlaps=0 FLAW
4 clocks core=25000000 Hz div=217 baud=115207 error=64 ppm source=30000 ppm FLAW
5 interrupts average=40/s peak=11540/s numbers_ok=0 FLAW
6 power sleep_keeps_sram=1 wake=timer ok
7 debug jtag_from_reset=1 console=UART0 ok
8 risks sram_spare=0% clock_budget_used=150% open_risks=2
flaws=3Rule 1, in the first row. The requirements become 20 bytes a second and 1200 bytes kept.
Rule 2, in row 3. The proposal has an SRAM of 1 KiB. Column 1 asked for 1776 bytes, so the map fails.
Row 4. The divider is right for a 25 MHz clock, and only 64 ppm off. But the clock comes from the RC oscillator, at 30,000 ppm. Together they break the 20,000 ppm budget.
Row 5. SPI and UART0 share source number 1. One handler would answer for two blocks, as in trial 3 of the bug hunt.
Rule 4, in row 8. The risk line counts thin margins. It is not a flaw count; the last row is.
Now fix the three flaws, as the first steps under the lab say. The board passes, and one risk stays open.
3 map sram=2048 B need=1776 B aligned=5/5 overlaps=0 ok
4 clocks core=50000000 Hz div=434 baud=115207 error=64 ppm source=50 ppm ok
8 risks sram_spare=13% clock_budget_used=0% open_risks=1
flaws=0Spare SRAM is 13 percent. That passes, so it is not a flaw. It is below 20 percent, so it is a risk. One way to retire it: measure the stack on the real program, or take 4 KiB.
This lab leaves things out. It is a sheet of sums, not a chip. It checks only the rules it was given, and a passing board is not a working chip.
Why It Is Built This Way
| Choice | The alternative | What it buys, and what it costs |
|---|---|---|
| Eight fixed columns | A free discussion of the design | Nothing is forgotten, and two reviews can be compared. A column can feel empty on a small chip; write "none" and say why. |
| Left to right | Start with the block you know best | Every entry has a reason to its left. The interesting block waits until the numbers ask for it. |
| Flaws and risks kept apart | One list of concerns | Flaws stop the work; risks only schedule tests. A single list lets a flaw hide among fifty worries. |
| Each worked system on its own page | Three systems as rows of one table | A table row has no room for a timeline or a trade-off. Each system gets the whole board. |
The Trap: Starting with the Processor
The commonest wrong start draws the processor first. It is the block everyone knows. The SRAM, the clock and the interrupt count then get guessed to fit it.
The second trap is the average. The logger asks for service 40 times a second on average. Its handler was timed for that, and the report lost bytes at 11,540 a second.
The third trap calls a risk a flaw, or a flaw a risk. Spare SRAM of 13 percent is not a reason to stop the project. An SRAM that is too small is.
Revision: Every Walk-Through on One Board
The track asks you to design sixteen blocks and systems, each as an interview walk-through. Every one of them fits the board.
For a block, the requirements are its users and their rates; the risks are its hardest cases. Answer each one in the eight columns, then compare with its lesson.
Walk-through D14 is a whole system. A sensor hub is a small chip that collects sensor readings while a larger processor sleeps.
| # | Design this | Where the block is taught | Column that decides it |
|---|---|---|---|
| D1 | A memory map for a microcontroller | S4.1 The Memory Map | Memory map |
| D2 | A bus matrix for two managers and four subordinates | S4.4 Many Managers | Block diagram |
| D3 | An AXI crossbar | S4.4 Arbitration at Each Target | Block diagram |
| D4 | A clock and reset controller | SoC Design (not yet built). The chip view: S5.5 Reset Architecture | Clocks and resets |
| D5 | An interrupt controller for 32 sources | S6.3 The Interrupt Controller | Interrupts |
| D6 | A watchdog | S6.11 The Watchdog | Risks |
| D7 | A DMA controller | S6.12 DMA | Interrupts |
| D8 | A GPIO block with interrupts | S7.2 GPIO | Interrupts |
| D9 | A pin mux for 32 pads | S7.4 Pads and Pin Multiplexing | Block diagram |
| D10 | A cache for a given workload | S3.6 Cache Performance, S3.20 Choosing a Cache | Memory map |
| D11 | A branch predictor under a bit budget | S2.12 Better Predictors, S2.28 The Bit Budget | Requirements |
| D12 | The boot flow of a secure microcontroller | S9.6 Secure Boot | Debug |
| D13 | A performance monitor that finds a bottleneck | S8.8 Finding the Bottleneck | Debug |
| D14 | A sensor-hub SoC, end to end | This page and S11.10 Worked System: A Sensor Hub | All eight |
| D15 | A register-block generator | SoC Design (not yet built). The contract: S6.8 Registers | Memory map |
| D16 | A TLB with a page-table walker | S3.8 The TLB, S3.23 The Page-Table Walker | Memory map |
Each walk-through is an interview question with a staged answer, kept with the lesson that teaches its block. Answer each one on the board of this page.
The next three pages fill the whole board for three systems. The first is the sensor hub of D14.
A motor controller is a chip that switches the coils of an electric motor. A network node is a small chip that sends and receives on a network.
At Scale
This section looks ahead, from a logger to a chip with a hundred blocks.
A column becomes a document
The map, the clock plan, the power intent and the debug plan each become a document. Each has an owner, as in The SoC Design Flow.
Reviews repeat
The same board is reviewed at each milestone. A requirement that changes reruns every column to its right.
Risks get a date
Each risk has an owner and a test that retires it. The list should shrink as the chip nears tape-out.
Try It
Run the lab. Three columns print FLAW. Read each one before you change anything.
Fix the map: set SRAM_SIZE to 2048. Fix the clocks: CLOCK_HZ 50000000, SOURCE_PPM 50, UART_DIV 434. Fix the interrupts: IRQ_SPI 4. Run again.
Now set KEEP_S to 90. Which column fails first, and why does the next column not care?
Names Printed by the Lab
| Name | Meaning |
|---|---|
| data, buffer, report | Bytes stored each second, bytes kept, and the time to send them all at the baud rate, rounded up. |
| sram, need | The SRAM of the proposal, and the buffer plus 512 bytes of stack and 64 of variables. |
| aligned, overlaps | Windows whose base is a multiple of their size, out of five; pairs of windows that share an address. |
| div, baud, error | The UART divider, the baud rate it gives, and how far that is from the one required, in ppm. |
| source | The accuracy of the clock source, in ppm. Error and source together must stay under 20,000 ppm. |
| average, peak | Interrupts in a second: on average, and in a second when a report is being sent. |
| numbers_ok | 1 when the three source numbers are different and all lie from 1 to 16. |
| sram_spare, clock_budget_used | The share of the SRAM left over, and the share of the 20,000 ppm used. Spare below 20 percent is a risk. |
| flaws | The columns that print FLAW. |
1 requirements data=20 B/s buffer=1200 B report=105 ms 2 blocks sensors=1 on one SPI jobs=5 blocks=5 missing=0 ok 3 map sram=1024 B need=1776 B aligned=5/5 overlaps=0 FLAW 4 clocks core=25000000 Hz div=217 baud=115207 error=64 ppm source=30000 ppm FLAW 5 interrupts average=40/s peak=11540/s numbers_ok=0 FLAW 6 power sleep_keeps_sram=1 wake=timer ok 7 debug jtag_from_reset=1 console=UART0 ok 8 risks sram_spare=0% clock_budget_used=150% open_risks=2 flaws=3Check Yourself
Common Mistakes
Wrong Draw the processor first and size the rest to fit it.
The numbers that should choose the processor come later and get guessed.
Fix Write the requirements as numbers, then let them name the blocks.
Wrong Size the handler and buffers from the average rate.
The busiest second decides whether data is lost.
Fix Find the peak and size for it.
Wrong Put every concern in one list.
A flaw that must stop the work hides among worries.
Fix Fix flaws now. List risks with the test that retires each one.
Remember
- Eight columns, left to right: requirements, block diagram, memory map, clocks and resets, interrupts, power modes, debug, risks.
- Numbers before boxes: every block exists because a number needs it.
- Size from the peak, not the average.
- A flaw fails a number and is fixed now. A risk passes thinly and is listed with its test.