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.

Five questions this page answers
Question
1In what order should you read the manual of a chip you did not design?
2Which lessons of this module explain the blocks of an FPGA SoC?
3Why do the interrupt blocks of a RISC-V platform sit at the same addresses as in ap_soc?
4What does a reference manual not tell you?
5With 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

New words on this page
WordMeaning
Technical reference manualThe long public document of a chip: its blocks, its memory map, its registers and how they work together.
Data sheet of a chipThe shorter document with the numbers of one part: speeds, voltages, temperatures and timing.
ErratumA published mistake of a chip or its manual, with a way around it. The plural is errata.
Issue of a documentOne version of it. A section number can move from one issue to the next.
Real-time coreA core built for short, predictable reaction times, for control loops, rather than for an operating system.
Monitor coreA small extra core that starts the chip and watches over it while the application cores work.
TileLinkThe on-chip bus that SiFive uses, in the role that AHB and AXI play elsewhere.
CLINTCore-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

Case 1: An FPGA SoC, Box by BoxStep through the seven questions. Each box names the lesson of this course that explains it. The blocks come from the public manual and are not checked.
  • Processor
  • Power
  • Control / FSM
  • Bus
  • Memory
  • Pads
  • Peripheral
Case 1: An FPGA SoC, Box by BoxStep through the seven questions. Each box names the lesson of this course that explains it. The blocks come from the public manual and are not checked. component Application cores four Arm cores, ashared cache: S10.2,S10.13 component Real-time cores two smaller Arm cores:S10.13 component Platformmanagement a small processor forpower: S10.16 component Configuration andsecurity the boot ROM and thekeys: S10.15 component Coherentinterconnect with an I/Otranslation unit:S9.4, S10.7 component DRAM controller and a small on-chipmemory: S10.4 component Fast and slow I/O shared serial lanes,many controllers:S10.5 component Fabric ports each way andinterrupt lines:S10.14, S10.19 coherentrequestsmemoryDMAfabric portspowerbitstream
  1. component Application coresfour Arm cores, a shared cache: S10.2, S10.13
    • coherent → Coherent interconnect
  2. component Real-time corestwo smaller Arm cores: S10.13
    • requests → Coherent interconnect
  3. component Coherent interconnectwith an I/O translation unit: S9.4, S10.7
    • memory → DRAM controller
  4. component DRAM controllerand a small on-chip memory: S10.4
  5. component Fast and slow I/Oshared serial lanes, many controllers: S10.5
    • DMA → Coherent interconnect
  6. component Platform managementa small processor for power: S10.16
    • power → Application cores
  7. component Configuration and securitythe boot ROM and the keys: S10.15
    • bitstream → Fabric
  8. component Fabricports each way and interrupt lines: S10.14, S10.19
    • fabric ports → Coherent interconnect
  1. 1. Processors

    Three kinds: application cores for the operating system, real-time cores for control loops, and a graphics engine in some parts.

  2. 2. Interconnect

    A coherent interconnect joins the application cores to memory. A translation unit stands in front of the devices.

  3. 3. Memory

    One DRAM controller for several kinds of DRAM, and a small on-chip memory where the first loader runs.

  4. 4. I/O

    Fast controllers share four serial lanes. Slow ones share a set of multiplexed pins.

  5. 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. 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.

  7. 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.

One address, three maps
MapRegion that holds 8000_0000Block
ap_soc v1.0 (map.json)8000_0000 to 8000_FFFFOn-chip SRAM, 64 KiB
Case 2, the RISC-V platform (not checked)From 8000_0000 upwardDRAM, outside the chip
Case 1, the FPGA SoC (not checked)8000_0000 to 9FFF_FFFFA 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

  1. 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.

  2. 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.

  3. Rule 3: Name the lesson behind every box.

    A box with no lesson behind it is the next thing to learn.

  4. 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.

  5. 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.

  6. 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.

Case 1, seven questions (Not checked: read from the public manual, which is not in our reference library.)
QuestionWhat the manual describesLesson
ProcessorsUp 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 partsS10.2, S10.6
InterconnectAn AXI interconnect with a cache-coherent part for the application cores, and a translation unit for devicesS9.3, S10.7
MemoryOne DRAM controller for several kinds of DDR DRAM. An on-chip memory of 256 KiBS10.4
I/OPCIe, USB, Ethernet, storage and display controllers sharing four serial lanes; slow peripherals on multiplexed pinsS10.5, S7.4
PowerFour power domains: battery, low-power, full-power and the fabric; a small management processorS10.16, S10.9
BootA boot ROM loads a first-stage loader into the on-chip memory; the loader can then load the bitstreamS10.15, S10.19
SecuritySigned and encrypted boot images, with keys in one-time memoryS9.6, S10.8
The fabricSeveral ports each way, some coherent, and interrupt lines from the fabricS10.14
Case 1, part of the memory map (Not checked: read from the public manual, which is not in our reference library.)
AddressesBlock
0000_0000 to 7FFF_FFFFDRAM, the first 2 GiB
8000_0000 to 9FFF_FFFFFabric window 1, through a port of the low-power domain
A000_0000 to BFFF_FFFFFabric window 2, through two ports of the full-power domain
FFFC_0000 to FFFF_FFFFThe 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

Case 2: A RISC-V Platform, Box by BoxThe same seven questions, on a chip with no fabric. Its interrupt and timer blocks sit at the same addresses as in ap_soc. The blocks come from the public manual and are not checked.
  • Processor
  • Memory
  • Bus
  • Pads
  • Control / FSM
  • Peripheral
Case 2: A RISC-V Platform, Box by BoxThe same seven questions, on a chip with no fabric. Its interrupt and timer blocks sit at the same addresses as in ap_soc. The blocks come from the public manual and are not checked. component Application cores four 64-bit RISC-Vcores: S10.2 component Monitor core one smaller RISC-Vcore: S10.13 component Shared cache one cache for all five:S10.2 component On-chip bus TileLink, the bus ofthe vendor: S4.10 component DRAM controller DRAM from8000_0000: S10.4 component PCIe andEthernet fast ports: S10.5 component PLIC and CLINT at 0C00_0000 and0200_0000: S6.3,S6.10 component Slow peripherals UART, SPI, I2C, GPIO:S7.1 missesmissesmemorymemoryDMAinterrupts
  1. component Application coresfour 64-bit RISC-V cores: S10.2
    • misses → Shared cache
  2. component Monitor coreone smaller RISC-V core: S10.13
    • misses → Shared cache
  3. component Shared cacheone cache for all five: S10.2
    • memory → On-chip bus
  4. component On-chip busTileLink, the bus of the vendor: S4.10
    • memory → DRAM controller
  5. component DRAM controllerDRAM from 8000_0000: S10.4
  6. component PCIe and Ethernetfast ports: S10.5
    • DMA → On-chip bus
  7. component Slow peripheralsUART, SPI, I2C, GPIO: S7.1
    • interrupts → PLIC and CLINT
  8. component PLIC and CLINTat 0C00_0000 and 0200_0000: S6.3, S6.10
  1. Processors

    Four application cores and one smaller monitor core: two kinds of core, as S10.13 weighs them.

  2. Memory

    All five share one cache, then DRAM. The DRAM starts at 8000_0000, where ap_soc keeps its SRAM.

  3. I/O

    Fast ports for PCIe and Ethernet move data by DMA. Slow peripherals sit on a bus of their own.

  4. 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.

Case 2, seven questions (Not checked: read from the public manual, which is not in our reference library.)
QuestionWhat the manual describesLesson
ProcessorsFour 64-bit RISC-V application cores and one smaller monitor core: five hartsS10.2
InterconnectTileLink, the on-chip bus of the vendorS4.10
MemoryA shared second-level cache, then a DDR4 controller; DRAM from 8000_0000S10.2, S10.4
I/OPCIe and Gigabit Ethernet; UART, SPI, I2C, PWM and GPIOS10.5, S7.1
Interrupts and timersA PLIC at 0C00_0000 and a CLINT at 0200_0000S6.3, S6.10
BootA ROM chosen by mode pins, then loaders from flash or a memory cardS6.6, S10.15
Power and securityLittle in the overview, as far as this page read itRule 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.

MissingWhy it mattersWhere it lives
Why each choice was madeThe trade-off behind a block is what you would reuseTalks and papers by the team, when they exist
Speed under loadA port can be wide and still be slow when every manager is busyYour own measurement, as in S8.7 and S10.3
How it was verifiedTests, coverage and the bugs found stay inside the companyNowhere public
The numbers of one partSpeeds and voltages depend on the part and its gradeThe data sheet of that part
Known faultsA block may not work as the manual saysThe errata documents of the family
The circuit itselfNo RTL and no layout are published for these chipsNowhere 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.

Printed by the lab on Icarus. The two case columns decode only the regions in 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 7

Rule 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 chipsThe alternativeWhat it buys, and costs
Case 1: DRAM at address 0A boot ROM at address 0, as in ap_socThe 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 addressesAddresses of its ownSoftware and tools for other RISC-V chips work with few changes. The map is less free.
Case 1: real-time cores beside application coresOne kind of coreControl 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

ap_soc~12 blocks, one page of map
Case 1hundreds of pages, dozens of regions

This is the last page of module S10. It looks ahead to what to read next.

  1. 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.

  2. 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.

  3. From reading to verifying

    Every gap of rule 4 is a test plan in waiting. The SoC Verification track starts from such a list.

  4. 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
NameMeaning
ap_socThe block at that address in the map of ap_soc v1.0 (map.json).
riscvThe block in the table of case 2 on this page.
fpgaThe block in the table of case 1 on this page.
not in table, nothingThe table of the page names no block there, or ap_soc decodes nothing there.
same block as ap_socHow many addresses name the same block as on ap_soc.
RUNIcarus Verilog · in your browser
Edit the code, then run it
Expected: 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 7

Check Yourself

Predict the outputIn this run the address 0C20_0000 is added to the end of the list. What is the last line? Its form is: same block as ap_soc: riscv . of 8, fpga . of 8
// One address means a different block on each chip. Test code: three decoders, no bus.
module tb;
  // ap_soc v1.0 (map.json): the regions of the fast bus and the window of the APB bridge.
  function automatic string ap_soc(input logic [31:0] a);
    if (a < 32'h0000_1000) return "boot ROM";
    if (a >= 32'h0200_0000 && a < 32'h0201_0000) return "CLINT";
    if (a >= 32'h0C00_0000 && a < 32'h0C40_0000) return "PLIC";
    if (a >= 32'h1000_0000 && a < 32'h1001_0000) return "peripherals";
    if (a >= 32'h8000_0000 && a < 32'h8001_0000) return "on-chip SRAM";
    return "nothing";
  endfunction
  // Case 2, the RISC-V platform: only the regions that the page's table names.
  function automatic string riscv_case(input logic [31:0] a);
    if (a >= 32'h0200_0000 && a < 32'h0201_0000) return "CLINT";
    if (a >= 32'h0C00_0000 && a < 32'h1000_0000) return "PLIC";
    if (a >= 32'h1000_0000 && a < 32'h2000_0000) return "peripherals";
    if (a >= 32'h8000_0000) return "DRAM";
    return "not in table";
  endfunction
  // Case 1, the FPGA SoC: only the regions that the page's table names.
  function automatic string fpga_case(input logic [31:0] a);
    if (a < 32'h8000_0000) return "DRAM";
    if (a < 32'hA000_0000) return "fabric window 1";
    if (a < 32'hC000_0000) return "fabric window 2";
    if (a >= 32'hFFFC_0000) return "on-chip memory";
    return "not in table";
  endfunction
  localparam int N = 8;
  logic [31:0] addrs [N];
  int same_riscv = 0, same_fpga = 0;
  initial begin
    addrs[0] = 32'h0000_0000;
    addrs[1] = 32'h0200_0000;
    addrs[2] = 32'h0C00_0000;
    addrs[3] = 32'h1000_0000;
    addrs[4] = 32'h8000_0000;
    addrs[5] = 32'hA000_0000;
    addrs[6] = 32'hFFFC_0000;
    addrs[7] = 32'h0C20_0000;
    foreach (addrs[i]) begin
      $display("%h  ap_soc=%-12s  riscv=%-12s  fpga=%s", addrs[i], ap_soc(addrs[i]), riscv_case(addrs[i]), fpga_case(addrs[i]));
      same_riscv += (ap_soc(addrs[i]) == riscv_case(addrs[i]));
      same_fpga += (ap_soc(addrs[i]) == fpga_case(addrs[i]));
    end
    $display("same block as ap_soc: riscv %0d of %0d, fpga %0d of %0d", same_riscv, N, same_fpga, N);
  end
endmodule
ConceptWhat should you read first in a manual of a chip you did not design?
ConceptWhich lesson explains the translation unit in front of the devices of case 1?
ConceptWhy do the PLIC and CLINT of case 2 sit at the same addresses as in ap_soc?
ConceptWhere do you find how fast one part you bought may run?

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.

Practice

Report a problem with this page