From IP to Chip to System

A chip is verified at several levels: block, subsystem, chip and system. Learn what each level may assume from the one below, and how a function bug differs from an integration bug. Then watch a real chip with two faults show the difference.

You Will Be Able To

  • Name the levels of verification on a chip project and what each one owns.
  • Say what each level may assume from the level below.
  • Tell a function bug from an integration bug, and place each at the level that finds it first.
  • Read a chip run that fails, and decide which level should have caught the bug.
Lesson
VF.2
Time
24 min
Runs on
Your browser
Check
5 questions

A chip test fails on a Tuesday night. The board sent the byte 0x5A into the chip, and the firmware read back 0xA5. Before anyone starts to debug, the team must agree on two things. Whose bug is it, and which bench should have caught it first?

One Block, Three LevelsStep through. First UART0 alone on its block bench, then UART0 wired into ap_soc, then the chip with firmware on it.
  • Test
  • Peripheral
  • Control / FSM
  • Pads
  • Processor
  • Data
  • Interrupt
One Block, Three LevelsStep through. First UART0 alone on its block bench, then UART0 wired into ap_soc, then the chip with firmware on it. test Block bench drives every pin ofUART0 peripheral UART0 the same block atevery level control ap_plic input 1 is UART0 pads Pads IO0 transmit, IO1receive test Chip bench owns only the pads processor Core withfirmware a handler reads thebyte all pinsrequestUART linepin muxinterrupt
  1. test Block benchdrives every pin of UART0
    • all pins → UART0
  2. peripheral UART0the same block at every level
    • request → ap_plic
  3. test Chip benchowns only the pads
    • UART line → Pads
  4. pads PadsIO0 transmit, IO1 receive
    • pin mux → UART0
  5. control ap_plicinput 1 is UART0
    • interrupt → Core with firmware
  6. processor Core with firmwarea handler reads the byte
  1. Block level

    The block bench owns every pin of UART0. It proves the block against the UART's own specification.

  2. Chip level

    The same UART0 now sits behind a pad and a pin mux, and its request runs to ap_plic. The chip bench reaches it only through the pads.

  3. System level

    Firmware runs on the core. A byte at the pad must end in a handler that reads it, as on a real board.

Read the diagram as text
  • Block bench: drives every pin of UART0
  • UART0: the same block at every level
  • ap_plic: input 1 is UART0
  • Pads: IO0 transmit, IO1 receive
  • Chip bench: owns only the pads
  • Core with firmware: a handler reads the byte
  • Block bench → UART0: all pins
  • UART0 → ap_plic: request
  • Chip bench → Pads: UART line
  • Pads → UART0: pin mux
  • ap_plic → Core with firmware: interrupt

One block seen at three levels. Each level adds joins the level below never had.

Before You Start

Read An SoC as a Verifier Sees It first: it names the parts of a chip and the six questions. The companion track explains the levels in general, in The Levels: Block, Subsystem, Chip, System. It explains verification against validation in Verification, Validation and Test.

What a block team hands over is taught in the SoC Architecture track, in IP Blocks: What Arrives With a Block.

Five questions this page answers
Question
1What are the levels of verification on a chip project?
2What may each level assume from the level below?
3What is the difference between a function bug and an integration bug?
4Where does the block team stop and the chip team start?
5How does a real chip run show which level should have caught a bug?

The Idea: Each Level Trusts the One Below

Nobody verifies a whole chip in one go. The design is built from blocks, the blocks are joined into a chip, and the chip runs software on a board. So verification climbs the same ladder. Each level proves what it can see, and trusts the level below for the rest.

Trust is the key word. A block level that passed lets the chip level skip the inside of the block. That saving only works if each level does its own job fully. A hole at one level becomes a bug that the next level may never look for.

The levels also find different kinds of bugs. Some bugs live inside one block. Others live in the joins between blocks, and appear only when the joins exist. Knowing which is which tells you who must fix a bug, and where its test belongs.

New Words

New words on this page
WordMeaning
IP blockA block designed to be reused, often bought from another company. UART0 is one.
Block levelVerification of one block alone, on a bench that drives all its pins.
SubsystemA group of blocks that work together, such as a core with its memories.
Chip levelVerification of the whole chip through its pads, with every block in place. Also called SoC level.
System levelThe chip running real software, as it will on a board.
FirmwareThe program that runs on the chip's own processor. Here it is a small C program.
Verification planThe written list of what must be verified at a level, how, and what each level assumes.
RegressionRunning every test again, often every night, so that a change cannot quietly break an old result.
Function bugA block that does the wrong thing by its own specification.
Integration bugBlocks that each work, joined the wrong way: a wire, an address, a clock or a pad.
HandlerThe function the processor runs when an interrupt arrives.
Seeded faultA bug put into a copy of the chip on purpose, to see which tests catch it. Each has an ID such as Q027.
Status wordThe last word a test writes for the bench: 0x900D for a pass, or 0xBAD0_0000 plus a fail code.
ValidationChecking the real chip, after manufacture, against what the product needs. Verification comes before it.

The Ladder of Levels

Levels of verification on a chip project
LevelIt ownsIt may assumeIt finds
Block (IP)Every pin of one blockNothing: it is the bottom rungFunction bugs: rare cases, every mode, every error
SubsystemA few blocks and their busEach block passed its benchBugs between close neighbours, such as a core and its memory
Chip (SoC)Only the padsBlocks and subsystems passedIntegration bugs: wires, map, clocks, resets, pads, power
SystemThe chip and its softwareThe chip passed its chip testsBugs between hardware and software, and in real use

After silicon comes back, validation on the real chip asks whether it suits the product. That is a different question, covered by the companion track.

Read the third column as a promise between levels. The chip level does not re-test the divider of UART0, because the block level promised it. In return, the chip level owns everything the block level could not see. Where the block team stops is exactly where its bench runs out of pins.

The Smallest Example: Two Bugs in One UART

Take two bugs that both stop a received byte from reaching the firmware. Ask, for each one, which bench could see it.

Two bugs, two levels
BugKindBlock bench sees it?Chip test sees it?
UART0 stores each received byte invertedFunctionYes: it compares every byte it sends inYes, but later and at a higher price
UART0's request is not wired to ap_plic input 1IntegrationNo: the wire is outside the blockYes: no interrupt ever arrives

A function bug can show at every level. An integration bug can only show where its join exists.

The first bug is cheap to find at block level and expensive later. The second bug cannot be found at block level at all, however good the bench. That asymmetry is the whole reason chip-level verification exists.

The Rules

  1. Rule 1: Each level proves what only it can see.

    Block benches prove functions. Chip tests prove joins. System tests prove the chip with its software.

  2. Rule 2: Each level assumes the one below passed, and says so.

    The assumption is written into the plan, so a gap below is visible.

  3. Rule 3: A function bug belongs to the lowest level that can see it.

    Fix it there, and add the missing test there.

  4. Rule 4: An integration bug exists only where its join exists.

    No block bench can find it, however thorough.

Sources for These Rules

Mehta, ASIC/SoC Functional Design Verification, sections 16.1 to 16.4: an SoC verified as subsystems that are themselves made of blocks.

Mehta, section 2.2: work done at block level is carried up into the subsystem plan.

The split between function and integration bugs is this track's point of view (docs/soc-verification-plan.md section 2.1).

Now Run It: Two Levels in a Slice

The lab at the end of this page holds a small transmitter, uart_tx, and a chip that puts it behind a pin mux. The parameter BUG seeds one bug. BUG = 2 is an integration bug: the chip routes the transmit line to pad 1 instead of pad 0.

Printed by the lab (Icarus 12) with BUG = 2.
BUG = 2
block bench: sent 4b, line read 4b: pass
chip bench:  sent 4b, pad 0 read ff: FAIL

Rule 4 at work. The block bench sends 0x4B and reads 0x4B back from the line: the block is right. The chip bench sends the same byte and reads 0xFF at pad 0, because nothing ever drives it. Change BUG to 1 and both benches fail, because a function bug travels with the block.

Now on the Real Chip: One Byte, Three Chips

The same idea runs on ap_soc v1.5. The program below sets pad IO1 to UART receive and enables the receive interrupt. Then it asks the board to send 0x5A. Its handler reads the byte, and main checks it.

The file uart_rx.c, built with this site's firmware kit. Its header hal.h names the registers. The headers irq.h and tb.h hold helpers for interrupts and the bench.
/* uart_rx.c: the board sends 0x5A; the UART interrupt handler must read it. */
#include "hal.h"
#include "irq.h"
#include "tb.h"

volatile unsigned got, rx;

static void on_uart(void)
{
    rx = reg_read32(UART0_RXDATA);                   /* reading the byte clears RX_READY */
    got = got + 1;
}

int main(void)
{
    reg_write32(SYSCTL_PINMUX, 2u << 2);             /* pad IO1 carries UART RX */
    reg_write32(UART0_IRQ_ENABLE, UART0_IRQ_ENABLE_RX_READY_MASK);
    irq_enable(UART0_IRQ, on_uart);                  /* ap_plic source 1 and the core's enable */
    tb_event(3);                                     /* the board sends 0x5A on pad IO1 */
    for (volatile unsigned t = 0; t < 400 && got == 0; t++) { }
    if (got == 0) {
        tb_puts("no interrupt; UART0 STATUS ");
        tb_put_hex(reg_read32(UART0_STATUS));
        tb_putc('\n');
        return 1;
    }
    tb_puts("handler read ");
    tb_put_hex(rx);
    tb_putc('\n');
    return rx == 0x5A ? 0 : 2;
}

It ran on three builds of the chip: as designed, and two copies with one seeded fault each. Q027 makes UART0 store each received byte inverted, a function bug. Q094 wires ap_plic input 1 to the timer's request, so UART0's request reaches nothing: an integration bug. The bench asked for the byte at cycle 267 in every run. Each run ends with a status word: 0x900D is a pass, and 0xBAD0_0000 plus a code is a fail with that code. The next lesson shows how the bench reads it.

One test, three chips
ChipConsoleInterrupts takenStatus word
As designedhandler read 0000005a10x0000900D
Q027: The receive FIFO complements each incoming bytehandler read 000000a510xBAD00002
Q094: PLIC input 1 follows request 3no interrupt; UART0 STATUS 0000000300xBAD00001

Read the rows with rules 3 and 4. On the good chip the handler reads 0x5A and the test passes. With Q027 the handler runs but reads 0xA5, the inverse, and the test fails with code 2. A UART block bench that sends bytes in and compares them would have caught this first.

Q094 is different. No interrupt arrives, and the test gives up at cycle 8735. Yet UART0's STATUS register reads 0x3. Bit 0, ROOM, says the transmitter is free; bit 1, RX_READY, says a received byte is waiting. So the byte sits safely inside UART0. The block did its job; the wire to ap_plic did not. No UART bench could ever see that.

The bench's lines for the Q094 copy (soc_tb on Icarus 12).
EVENT 267: 00000003
CONSOLE 8735: no interrupt; UART0 STATUS 00000003

Why It Is Built This Way

Why not test everything at chip level, where all the joins exist? Because every chip test pays for the whole chip. Every cycle simulates the core, the fabric and every block, not only UART0. The test must also boot and set up the pad and the interrupt first. In the good run above, 267 cycles pass before the board is even asked for the byte.

A block bench pays none of that. It can try every divider and every error case in the time a chip test spends booting. So each level does the work it is cheapest at, and the levels together cover the chip.

Traps

The first trap is "the block passed, so the chip is fine". The Q094 copy has a perfect UART0 and a broken chip. A passing block bench says nothing about the wires around the block.

The second trap is the opposite: testing the inside of every block again from the chip. It costs a boot per case and finds what the block bench already proved. The next lesson, on what the block bench already proved, draws that line exactly.

The third trap is fixing a function bug only at chip level. If the chip test finds Q027, the fix goes into UART0 and a test goes into its bench. Otherwise the next chip that reuses UART0 starts with the same hole.

At Scale

ap_soc~12 blocks
Phone-class SoChundreds of blocks

This section looks ahead. ap_soc has two levels you can run here: small slices and the whole chip.

  1. More rungs

    A large chip has subsystems inside subsystems: a core cluster, a memory system, a modem. Each rung has its own bench and its own team.

  2. System level grows

    Real products boot an operating system. That is too long for a simulator, so teams move to faster platforms, the subject of a later lesson.

  3. After silicon

    When the chip comes back, validation teams run it on boards. A bug found there is the most expensive kind to fix.

Where This Goes Next

The next lesson follows one chip test from reset to pass. The module after this one draws the line between the levels exactly.

Where to go from here
LessonWhat it adds
One Chip Test From Reset to PassOne real chip test, from power-good to the pass word.
What the Block Bench Already ProvedWhat the block bench already proved, and the rules of the hand-over to the chip level.
Twelve Things Only a Chip Gets WrongThe twelve kinds of bug only a chip gets wrong.
The Integration Bug HuntAn integration bug hunt on the chip of the SoC Architecture track.

Try It

Run the lab with BUG = 2 and read the two bench lines.

Set BUG to 1, the function bug, and predict both lines before you run it.

Set BUG to 0 and check that both benches pass.

RUNIcarus Verilog · in your browser
Edit the code, then run it
Expected: BUG = 2 block bench: sent 4b, line read 4b: pass chip bench: sent 4b, pad 0 read ff: FAIL

Check Yourself

Predict the outputThe lab runs with BUG = 1, the function bug: the transmitter sends the high bit first. What is the last line it prints?
// One transmitter, two benches. BUG selects a seeded bug:
//   0 none; 1 a function bug inside the block (it sends the byte high bit first);
//   2 an integration bug in the chip (the pin mux routes UART TX to pad 1, not pad 0).
module uart_tx #(parameter int BUG = 0) (input logic clk, rst_n, start, input logic [7:0] data, output logic tx, busy);
  logic [9:0] frame; int left;
  assign busy = left != 0;
  always_ff @(posedge clk or negedge rst_n)
    if (!rst_n) begin tx <= 1; left <= 0; end
    else if (start && !busy) begin
      frame <= {1'b1, (BUG == 1) ? {data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]} : data, 1'b0};
      left <= 10;
    end else if (busy) begin tx <= frame[0]; frame <= frame >> 1; left <= left - 1; end
endmodule

module chip #(parameter int BUG = 0) (input logic clk, rst_n, start, input logic [7:0] data, input logic [1:0] pinmux, output logic [1:0] pad);
  logic tx, busy;
  uart_tx #(.BUG(BUG == 1 ? 1 : 0)) u_uart (.clk, .rst_n, .start, .data, .tx, .busy);
  // Pad 0 carries UART TX when its pin mux field is 2; an idle pad reads 1.
  assign pad[0] = (BUG != 2 && pinmux == 2) ? tx : 1'b1;
  assign pad[1] = (BUG == 2 && pinmux == 2) ? tx : 1'b1;
endmodule

module tb;
  localparam int BUG = 1;
  logic clk = 0, rst_n = 0, start = 0; logic [7:0] data = 8'h4b; logic [1:0] pinmux = 0;
  logic b_tx, b_busy; logic [1:0] pad;
  always #5 clk = ~clk;
  uart_tx #(.BUG(BUG == 1 ? 1 : 0)) blk (.clk, .rst_n, .start, .data, .tx(b_tx), .busy(b_busy));   // the block bench owns every pin
  chip #(.BUG(BUG)) dut (.clk, .rst_n, .start, .data, .pinmux, .pad);                                // the chip bench owns only the pads
  // Receive one frame on a line: wait for the start bit, then take eight bits, low bit first.
  task automatic receive(input bit at_pad, output logic [7:0] got);
    bit seen = 0;
    got = 8'hff;
    for (int t = 0; t < 30 && !seen; t++) begin
      @(negedge clk);
      if ((at_pad ? pad[0] : b_tx) == 0) begin
        seen = 1;
        for (int i = 0; i < 8; i++) begin @(negedge clk); got[i] = at_pad ? pad[0] : b_tx; end
      end
    end
  endtask
  logic [7:0] got;
  initial begin
    $display("BUG = %0d", BUG);
    repeat (2) @(negedge clk); rst_n = 1;
    pinmux = 2;                                   // the chip test routes pad 0 to UART TX first
    @(negedge clk) start = 1; @(negedge clk) start = 0;
    receive(0, got);
    $display("block bench: sent %h, line read %h: %s", data, got, got == data ? "pass" : "FAIL");
    repeat (4) @(negedge clk);
    @(negedge clk) start = 1; @(negedge clk) start = 0;
    receive(1, got);
    $display("chip bench:  sent %h, pad 0 read %h: %s", data, got, got == data ? "pass" : "FAIL");
    $finish;
  end
endmodule
ConceptIn the Q094 run, UART0 STATUS read 0x3. What does that tell you?
ConceptWhich bug can a block bench never find?
ConceptWhat may the chip level assume about UART0's divider?
ConceptWhere does the block team stop?

Common Mistakes

Wrong Take a passing block bench as proof the chip works.

The block bench cannot see the wires, pads and clocks around the block.

Fix Check every join at chip level.

Wrong Re-test the inside of every block from the chip.

Each chip test pays for a boot and the real pads, and the block bench already proved it.

Fix Leave functions to the block level; test joins at chip level.

Wrong Fix a function bug found at chip level only in the chip regression.

The block bench keeps its hole for the next chip.

Fix Fix the block and add the test to its bench.

Remember

  • Verification climbs the levels: block, subsystem, chip, system.
  • Each level proves what only it can see and assumes the level below passed.
  • A function bug can show at every level; fix and test it at the lowest one.
  • An integration bug exists only where its join exists, so only the chip level can find it.

Practice

Report a problem with this page