Two Case Studies from Public Documents
Every block of a real chip has a lesson of this module behind it. This page reads two real chips from their public manuals: an FPGA SoC and a RISC-V platform. It also notes what the manuals do not say.
You Will Be Able To
- Read a public SoC manual in a fixed order: the memory map, then seven questions.
- Map each block of two real chips to the lesson that explains it, and compare them with ap_soc and ap_phone.
- Say what a reference manual leaves out, and where to look for it.
- Lesson
- S10.18
- Time
- 30 min
- Runs on
- Your browser
- Check
- 5 questions
Address 8000_0000 is SRAM on ap_soc, DRAM on one real chip, and the door into the fabric on another.
How do you read a chip that somebody else designed?
Before You Start
You need From Microcontroller to Application Processor: ap_phone and the eight kinds of block.
You need FPGA SoCs and Configuration, Boot Order and Partial Reconfiguration.
You need The Memory Map, and it helps to have read Reading an SoC Specification.
Every other lesson of module S10 is a box on this page. The links are in the tables.
| Question | |
|---|---|
| 1 | In what order should you read the manual of a chip you did not design? |
| 2 | Which lessons of this module explain the blocks of an FPGA SoC? |
| 3 | Why do the interrupt blocks of a RISC-V platform sit at the same addresses as in ap_soc? |
| 4 | What does a reference manual not tell you? |
| 5 | With 0C20_0000 added to the list, what does the lab print last? |
The Idea: Reading Somebody Else's Chip
This module built one map of a large chip, block by block. Real chips are drawn from the same blocks. A public manual is where you meet them.
Such a manual runs to hundreds of pages, so read it in a fixed order. Start with the memory map. An address means nothing until you know whose map it is in. Then ask seven questions: processors, interconnect, memory, I/O, power, boot and security.
For every box you find, name the lesson that explains it. A box you cannot name is the next thing to learn. Last, list what the manual does not say. That list is often the most useful page of your notes.
Case 1 is an FPGA SoC: the AMD Zynq UltraScale+ MPSoC. Case 2 is a RISC-V platform, a chip named FU740-C000. It comes from SiFive (a company that designs RISC-V cores). Both manuals are public, but neither is in our reference library. So every fact of the two chips here is labelled "not checked". Check the section in the current issue before you rely on it.
New Words
| Word | Meaning |
|---|---|
| Technical reference manual | The long public document of a chip: its blocks, its memory map, its registers and how they work together. |
| Data sheet of a chip | The shorter document with the numbers of one part: speeds, voltages, temperatures and timing. |
| Erratum | A published mistake of a chip or its manual, with a way around it. The plural is errata. |
| Issue of a document | One version of it. A section number can move from one issue to the next. |
| Real-time core | A core built for short, predictable reaction times, for control loops, rather than for an operating system. |
| Monitor core | A small extra core that starts the chip and watches over it while the application cores work. |
| TileLink | The on-chip bus that SiFive uses, in the role that AHB and AXI play elsewhere. |
| CLINT | Core-local interruptor: the block that holds the machine timer and one software-interrupt word for each hart. In ap_soc it is ap_clint. |
One Picture: Case 1, Box by Box
- Processor
- Power
- Control / FSM
- Bus
- Memory
- Pads
- Peripheral
- 1. Processors
Three kinds: application cores for the operating system, real-time cores for control loops, and a graphics engine in some parts.
- 2. Interconnect
A coherent interconnect joins the application cores to memory. A translation unit stands in front of the devices.
- 3. Memory
One DRAM controller for several kinds of DRAM, and a small on-chip memory where the first loader runs.
- 4. I/O
Fast controllers share four serial lanes. Slow ones share a set of multiplexed pins.
- 5. Power
Four power domains: one on a battery, a low-power one, a full-power one, and the fabric. A small processor manages them.
- 6. Boot and 7. security
A boot ROM in the configuration and security unit loads the first loader, checks it, and can load the bitstream.
- And the fabric
Several ports each way and interrupt lines join the fabric to the rest, as in S10.14.
Read the diagram as text
- Application cores: four Arm cores, a shared cache: S10.2, S10.13
- Real-time cores: two smaller Arm cores: S10.13
- Platform management: a small processor for power: S10.16
- Configuration and security: the boot ROM and the keys: S10.15
- Coherent interconnect: with an I/O translation unit: S9.4, S10.7
- DRAM controller: and a small on-chip memory: S10.4
- Fast and slow I/O: shared serial lanes, many controllers: S10.5
- Fabric: ports each way and interrupt lines: S10.14, S10.19
- Application cores → Coherent interconnect: coherent
- Real-time cores → Coherent interconnect: requests
- Coherent interconnect → DRAM controller: memory
- Fast and slow I/O → Coherent interconnect: DMA
- Fabric → Coherent interconnect: fabric ports
- Platform management → Application cores: power
- Configuration and security → Fabric: bitstream
AMD Zynq UltraScale+ MPSoC, drawn by us from the overview of its technical reference manual (UG1085). Not checked against the library. Some boxes differ between members of the family.
The Smallest Example, Worked by Hand
No simulator yet. Take one address, 8000_0000, and look it up in three maps.
| Map | Region that holds 8000_0000 | Block |
|---|---|---|
| ap_soc v1.0 (map.json) | 8000_0000 to 8000_FFFF | On-chip SRAM, 64 KiB |
| Case 2, the RISC-V platform (not checked) | From 8000_0000 upward | DRAM, outside the chip |
| Case 1, the FPGA SoC (not checked) | 8000_0000 to 9FFF_FFFF | A window into the fabric |
Three chips, three blocks. Now take one box and find its lesson. Case 1 has a translation unit in front of its devices. A device asks for an address of its own, and the unit turns it into a real one. That is the IOMMU of I/O Memory Management.
One more look at the map shows something friendly. Case 2 puts its PLIC at 0C00_0000 and its CLINT at 0200_0000. ap_soc uses the same two addresses. Many RISC-V platforms share this layout, so code and tools carry over.
The Rules
Rule 1: Read the memory map first.
An address means nothing until you know whose map it is in. 8000_0000 is three different blocks on three chips.
Rule 2: Ask the same seven questions of every chip.
Processors, interconnect, memory, I/O, power, boot and security. Every box answers one of them.
Rule 3: Name the lesson behind every box.
A box with no lesson behind it is the next thing to learn.
Rule 4: A manual says what a chip has, rarely why, and never how it was verified.
The reasons and the tests stay with the team that built it.
Rule 5: The numbers of one part are in its data sheet.
Speeds, voltages and timing change with the part and its grade. The reference manual describes the family.
Rule 6: Cite the section and the issue.
Manuals are revised. Errata come as separate documents.
Sources for These Rules
Rules 1 to 6 are common practice for reading chip documents. Reading an SoC Specification covers the structure of a specification.
Case 1: AMD, Zynq UltraScale+ Device Technical Reference Manual (UG1085), overview and memory map chapters. Case 2: SiFive, FU740-C000 Manual, overview and memory map chapters. Neither is in our reference library. Every fact of them on this page is labelled "not checked".
The map of ap_soc is content/modules/v3/soc/ap_soc/map.json. The numbers of ap_phone are in docs/soc/ap_soc-facts.md, section 15.
Case 1: The Zynq UltraScale+ MPSoC, Question by Question
This is the chip that module S10 most resembles. It has a cluster of cores, a coherent interconnect, a DRAM controller, power domains and a boot chain. Beside them sits a fabric. The table answers the seven questions at the level of a block.
| Question | What the manual describes | Lesson |
|---|---|---|
| Processors | Up to four Arm Cortex-A53 application cores, with a shared second-level cache. Two Arm Cortex-R5F real-time cores. A graphics engine in some parts | S10.2, S10.6 |
| Interconnect | An AXI interconnect with a cache-coherent part for the application cores, and a translation unit for devices | S9.3, S10.7 |
| Memory | One DRAM controller for several kinds of DDR DRAM. An on-chip memory of 256 KiB | S10.4 |
| I/O | PCIe, USB, Ethernet, storage and display controllers sharing four serial lanes; slow peripherals on multiplexed pins | S10.5, S7.4 |
| Power | Four power domains: battery, low-power, full-power and the fabric; a small management processor | S10.16, S10.9 |
| Boot | A boot ROM loads a first-stage loader into the on-chip memory; the loader can then load the bitstream | S10.15, S10.19 |
| Security | Signed and encrypted boot images, with keys in one-time memory | S9.6, S10.8 |
| The fabric | Several ports each way, some coherent, and interrupt lines from the fabric | S10.14 |
| Addresses | Block |
|---|---|
| 0000_0000 to 7FFF_FFFF | DRAM, the first 2 GiB |
| 8000_0000 to 9FFF_FFFF | Fabric window 1, through a port of the low-power domain |
| A000_0000 to BFFF_FFFF | Fabric window 2, through two ports of the full-power domain |
| FFFC_0000 to FFFF_FFFF | The on-chip memory |
Set it beside ap_phone. Both have one cluster, one DRAM controller, power domains in a tree and a boot chain. Case 1 adds two things that ap_phone lacks: real-time cores and a fabric. Its 4 power domains are large, where the 12 of ap_phone are small.
Case 2: The FU740-C000, Question by Question
- Processor
- Memory
- Bus
- Pads
- Control / FSM
- Peripheral
- Processors
Four application cores and one smaller monitor core: two kinds of core, as S10.13 weighs them.
- Memory
All five share one cache, then DRAM. The DRAM starts at 8000_0000, where ap_soc keeps its SRAM.
- I/O
Fast ports for PCIe and Ethernet move data by DMA. Slow peripherals sit on a bus of their own.
- Interrupts and timers
A PLIC and a CLINT, at the same addresses as in ap_soc. The slow peripherals raise their interrupts there.
Read the diagram as text
- Application cores: four 64-bit RISC-V cores: S10.2
- Monitor core: one smaller RISC-V core: S10.13
- Shared cache: one cache for all five: S10.2
- On-chip bus: TileLink, the bus of the vendor: S4.10
- DRAM controller: DRAM from 8000_0000: S10.4
- PCIe and Ethernet: fast ports: S10.5
- PLIC and CLINT: at 0C00_0000 and 0200_0000: S6.3, S6.10
- Slow peripherals: UART, SPI, I2C, GPIO: S7.1
- Application cores → Shared cache: misses
- Monitor core → Shared cache: misses
- Shared cache → On-chip bus: memory
- On-chip bus → DRAM controller: memory
- PCIe and Ethernet → On-chip bus: DMA
- Slow peripherals → PLIC and CLINT: interrupts
SiFive FU740-C000, drawn by us from its manual. Not checked against the library.
| Question | What the manual describes | Lesson |
|---|---|---|
| Processors | Four 64-bit RISC-V application cores and one smaller monitor core: five harts | S10.2 |
| Interconnect | TileLink, the on-chip bus of the vendor | S4.10 |
| Memory | A shared second-level cache, then a DDR4 controller; DRAM from 8000_0000 | S10.2, S10.4 |
| I/O | PCIe and Gigabit Ethernet; UART, SPI, I2C, PWM and GPIO | S10.5, S7.1 |
| Interrupts and timers | A PLIC at 0C00_0000 and a CLINT at 0200_0000 | S6.3, S6.10 |
| Boot | A ROM chosen by mode pins, then loaders from flash or a memory card | S6.6, S10.15 |
| Power and security | Little in the overview, as far as this page read it | Rule 4: list it as a gap |
Set it beside ap_soc. The interrupt controller, the timer and the start of memory sit at the same addresses. The lab shows it: 3 of 7 addresses name the same block. The difference is scale: five 64-bit harts, a shared cache, DRAM and fast ports, as in ap_phone.
What the Documents Leave Out
Rule 4 deserves a list of its own. Each item is something an architect or a verifier wants, and a reference manual does not give.
| Missing | Why it matters | Where it lives |
|---|---|---|
| Why each choice was made | The trade-off behind a block is what you would reuse | Talks and papers by the team, when they exist |
| Speed under load | A port can be wide and still be slow when every manager is busy | Your own measurement, as in S8.7 and S10.3 |
| How it was verified | Tests, coverage and the bugs found stay inside the company | Nowhere public |
| The numbers of one part | Speeds and voltages depend on the part and its grade | The data sheet of that part |
| Known faults | A block may not work as the manual says | The errata documents of the family |
| The circuit itself | No RTL and no layout are published for these chips | Nowhere public |
Now Run It
The lab at the end of this page decodes seven addresses through three maps. The ap_soc map is map.json. The other two are the tables of this page.
00000000 ap_soc=boot ROM riscv=not in table fpga=DRAM
02000000 ap_soc=CLINT riscv=CLINT fpga=DRAM
0c000000 ap_soc=PLIC riscv=PLIC fpga=DRAM
10000000 ap_soc=peripherals riscv=peripherals fpga=DRAM
80000000 ap_soc=on-chip SRAM riscv=DRAM fpga=fabric window 1
a0000000 ap_soc=nothing riscv=DRAM fpga=fabric window 2
fffc0000 ap_soc=nothing riscv=DRAM fpga=on-chip memory
same block as ap_soc: riscv 3 of 7, fpga 0 of 7Rule 1 in every row. Only three addresses name the same block on two chips: the CLINT, the PLIC and the peripherals of the RISC-V platform. They are a shared habit, not a law.
Row five is the hand example: SRAM, DRAM and a fabric window. The last row counts: 3 of 7 against case 2, and 0 of 7 against case 1.
This lab leaves things out. Each case column knows only the regions that this page names. A real map has dozens more, and they are not checked here.
Why It Is Built This Way
| Choice of the two chips | The alternative | What it buys, and costs |
|---|---|---|
| Case 1: DRAM at address 0 | A boot ROM at address 0, as in ap_soc | The operating system sees one large block of memory from 0. The boot ROM and small memories go to the top of the map. |
| Case 2: PLIC and CLINT at the common RISC-V addresses | Addresses of its own | Software and tools for other RISC-V chips work with few changes. The map is less free. |
| Case 1: real-time cores beside application cores | One kind of core | Control loops get short, steady reaction times. Two kinds of software, and two kinds of debug. |
These reasons are common practice, not quotes from the manuals. The manuals say what was chosen; rule 4 says they rarely say why.
The Trap: The Section That Moved
A team cited a section of a reference manual in its design notes. A year later, a new issue came out. Its sections were renumbered, and one table had grown a row. The notes still pointed at the old number.
Rule 6 avoids this. Write down the issue, the section and the title of the section. Then look for errata of that family.
The second trap is reading a data-sheet number into a reference manual. The manual says a port can run fast. The data sheet of the part you bought says how fast. Rule 5 keeps them apart.
The third trap is this page itself. Its two case tables are not checked against the manuals. Use them to learn the method, not as a source.
At Scale
This is the last page of module S10. It looks ahead to what to read next.
An open chip with its source
OpenTitan publishes its documents and its RTL. There you can check a manual against the circuit itself. Not checked here.
Your own reading sheet
Keep one table per chip: the map, the seven questions, a lesson for each box, and the gaps. Two chips read this way teach more than ten skimmed.
From reading to verifying
Every gap of rule 4 is a test plan in waiting. The SoC Verification track starts from such a list.
Back to the capstone
Module S11 reads ap_soc the same way, end to end, from its own documents.
Try It
Run the lab. For each address, compare the three columns.
Raise N by one and add the address 0200_4000 at the end. Do all three chips agree with the row for 0200_0000?
Do the same with 1001_0000. On which chips is it a peripheral, and on which is it something else?
Names Printed by the Lab
| Name | Meaning |
|---|---|
| ap_soc | The block at that address in the map of ap_soc v1.0 (map.json). |
| riscv | The block in the table of case 2 on this page. |
| fpga | The block in the table of case 1 on this page. |
| not in table, nothing | The table of the page names no block there, or ap_soc decodes nothing there. |
| same block as ap_soc | How many addresses name the same block as on ap_soc. |
00000000 ap_soc=boot ROM riscv=not in table fpga=DRAM 02000000 ap_soc=CLINT riscv=CLINT fpga=DRAM 0c000000 ap_soc=PLIC riscv=PLIC fpga=DRAM 10000000 ap_soc=peripherals riscv=peripherals fpga=DRAM 80000000 ap_soc=on-chip SRAM riscv=DRAM fpga=fabric window 1 a0000000 ap_soc=nothing riscv=DRAM fpga=fabric window 2 fffc0000 ap_soc=nothing riscv=DRAM fpga=on-chip memory same block as ap_soc: riscv 3 of 7, fpga 0 of 7Check Yourself
Common Mistakes
Wrong Assume an address means the same block on every chip.
8000_0000 is SRAM, DRAM or a fabric window, by chip.
Fix Read the memory map first.
Wrong Take a speed from the reference manual as a promise.
The numbers of one part and grade are in its data sheet.
Fix Read the data sheet and the errata of the part you use.
Wrong Cite a section number alone.
Sections move between issues.
Fix Cite the issue, the section number and its title.
Remember
- Read a chip in a fixed order: the memory map, then seven questions.
- Every block of a real chip has a lesson of this module behind it.
- A manual says what a chip has, rarely why, and never how it was verified.
- Cite the issue and the section, and read the data sheet and the errata of your part.