Boundary Cells: Testing the Pads and the Board

A cell beside each pad lets the tester read the pin and take over its driver. The cell has two stages, so that a bit on its way through the chain never reaches a pin.

You Will Be Able To

  • Say what a boundary cell adds to a pad, and what a chain of them can test.
  • Explain why capture, shift and update are three separate moves.
  • Preload a safe pattern before the cells take control of the pads.
Lesson
S8.12
Time
25 min
Runs on
Your browser
Check
5 questions

A board has two chips and one wire between them. The other chip already holds that wire high. Now a test pattern shifts through the flip-flops that control your driver for the same wire. For a few clock pulses your chip pulls the wire low.

Before You Start

You need Test Hooks at Chip Level: shift in, capture, shift out, and which bit comes out first.

You need Pads and Pin Multiplexing: a pad has an output driver, an output enable and a pad receiver.

Five questions this page answers
Question
1What does a boundary cell add to a pad?
2Why does a boundary cell have two stages?
3What must happen before the cells take control of the pads?
4What can a chain of boundary cells test that a scan chain inside the chip cannot?
5A pattern is shifted, updated and the pins are captured: what do the drivers and the scan output show?

The Idea: A Cell Beside Every Pad

A scan chain tests the logic inside a chip. It stops at the pads. Nobody has yet tested the pads themselves, the pins, or the wires of the board that join one chip to the next.

So each pad gets a small helper, a boundary cell. It can do two things. It can take a copy of the level on the pin. And it can take the place of the logic: in test, the cell decides whether the output driver is on. All the cells are linked into one chain around the edge of the chip.

There is a danger in that chain. A pattern on its way through passes every cell. If each passing bit switched a driver, the pins would flicker on every pulse. So a cell has two stages. The shift stage carries bits along the chain. The update stage holds what the pad really gets, and it changes only on a separate move, the update pulse.

Without the second stage, a correct shift can cause a real electrical fault on the board. With it, the pins stay still until the whole pattern is in place.

New Words

New words on this page
WordMeaning
Boundary cellA small circuit beside a pad. It can copy the level of the pin, and in test it can control the pad.
Boundary chainAll the boundary cells of a chip, linked into one shift register around its edge.
Shift stageThe bit of a boundary cell that captures the pin or shifts along the chain.
Update stageThe bit of a boundary cell that the pad gets in test. It changes only on an update.
Update pulseOne clock pulse on which every update stage copies its shift stage. The move is called an update.
Safe preloadTo shift a safe pattern in and update, before the cells take control of the pads. This page calls it the preload.
ContentionTwo output drivers on one wire, one driving high and one driving low. Current flows from one to the other.

One Picture: The Cell and Its Two Stages

One Boundary Cell, Then a Chain of ThemStep through the picture. One pad at work comes first, then the cell beside it, then its two stages and the chain.
  • Peripheral
  • Debug
  • Control / FSM
  • Pads
One Boundary Cell, Then a Chain of ThemStep through the picture. One pad at work comes first, then the cell beside it, then its two stages and the chain. component Logic of the chip what normally decidesthe output enable component Shift stage one bit: it capturesthe pin, or shifts component Update stage one bit: it changesonly on an update component Pad an output driver anda pad receiver on onepin component Next cell the shift stage ofthe cell at the nextpad output enable, atworklevel of the pin, on acaptureon an updateoutput enable, in teston a shift
  1. component Logic of the chipwhat normally decides the output enable
    • output enable, at work → Pad
  2. component Padan output driver and a pad receiver on one pin
    • level of the pin, on a capture → Shift stage
  3. component Shift stageone bit: it captures the pin, or shifts
    • on an update → Update stage
    • on a shift → Next cell
  4. component Next cellthe shift stage of the cell at the next pad
  5. component Update stageone bit: it changes only on an update
    • output enable, in test → Pad
  1. A pad at work

    The logic of the chip decides whether the output driver of this pad is on. The tester has no say.

  2. A cell that looks

    A boundary cell sits beside the pad. On a capture its shift stage takes the level of the pin.

  3. A chain around the chip

    The shift stages of all pads form one chain. A shift moves every bit to the next cell, and the pads do not change.

  4. A cell that drives

    On an update, the update stage copies the shift stage. In test, the update stage decides the output enable.

  5. The whole cell

    Capture, shift and update are three separate moves. Only an update changes what a pad does.

Read the diagram as text
  • Logic of the chip: what normally decides the output enable
  • Shift stage: one bit: it captures the pin, or shifts
  • Update stage: one bit: it changes only on an update
  • Pad: an output driver and a pad receiver on one pin
  • Next cell: the shift stage of the cell at the next pad
  • Logic of the chip → Pad: output enable, at work
  • Pad → Shift stage: level of the pin, on a capture
  • Shift stage → Update stage: on an update
  • Update stage → Pad: output enable, in test
  • Shift stage → Next cell: on a shift

A boundary cell of the lab. It has one shift stage and one update stage. A real pad has a cell for each of its signals.

The Smallest Example, Worked by Hand

Take three pads, each with its cell. Cell 0 is next to the scan input, and cell 2 drives the scan output. The board holds pin 2 and pin 1 high and pin 0 low. No simulator yet. The table writes the cells as cell 2, cell 1, cell 0.

One boundary test, move by move
MoveShift stages after itUpdate stages after itWhat happened
Preload: shift in 0, 0, 0, then update000000Every driver is off. Now the cells may take the pads.
Shift in 1001000The 1 is in cell 0. No driver changed.
Shift in 0010000The 1 passes cell 1. Its driver stays off.
Shift in 0100000The 1 has reached cell 2.
Update100100All three update stages change together. Only the driver of pin 2 is on.
Capture110100The shift stages took the pins. The drivers did not change.
Shift out, three times000100The scan output showed 1, then 1, then 0.

Read the three rows of the shift. A 1 walked past cell 0 and cell 1. In a cell of one stage their drivers would have switched on for one pulse each. Here the update stages stayed at 000.

Read the capture. The pattern 110 is the three pins, and it comes out with cell 2 first. The tester compares it with the levels that the board should have.

The Rules

  1. Rule 1: Every pad has a boundary cell, and the cells form one chain.

    The chain is shifted like any scan chain: the cell next to the scan output comes out first.

  2. Rule 2: A shift never changes a pad.

    Bits move through the shift stages. The update stages hold still.

  3. Rule 3: Only an update changes a pad.

    All update stages change on the same pulse, so the pins move once, to a pattern that was chosen.

  4. Rule 4: Preload before the cells take the pads.

    Shift in a pattern with every driver off, and update. Only then switch the pads from the logic to the cells.

  5. Rule 5: A capture copies the pins into the shift stages.

    It does not disturb the update stages, so the drivers keep their pattern.

  6. Rule 6: A board is tested by two chips together.

    One chip drives a wire from its update stages. The other captures it. A broken or shorted wire shows as a wrong bit.

Sources for These Rules

Boundary scan as a chain of cells at the pins, used to test the wires of a board: Weste and Harris, CMOS VLSI Design, fourth edition, section 15.7.

The names capture, shift and update, the two stages of a cell and the preload follow IEEE Std 1149.1. That standard is not in our reference library. These are well-known facts about it and were not checked against its text.

Rule 6 is not run in our lab, which has one chip.

The three cells, their order, and a cell of one shift stage and one update stage are choices of our lab.

Now Run It

The lab at the end of this page has three cells in a chain. Test code plays the tester and the board. The board holds the pins at 110.

Printed by the lab on Icarus. Cells and drivers are written as cell 2, cell 1, cell 0.
at power-up: cells=xxx drivers=xxx
preload 0 0 0, update: cells=000 drivers=000
shift in 1: cells=001 drivers=000
shift in 0: cells=010 drivers=000
shift in 0: cells=100 drivers=000
update: cells=100 drivers=100
capture: cells=110 drivers=100
scan out=1 drivers=100
scan out=1 drivers=100
scan out=0 drivers=100
scan out, first bit first: 1 1 0

Rule 4 at work, in the first two rows. At power-up nobody has set the stages: they read xxx. After the preload and its update, the drivers are 000.

Rule 2, in the three rows "shift in". The 1 moves from cell 0 to cell 2. The drivers read 000 in all three rows.

Rule 3, in the row "update". The drivers change once, from 000 to 100.

Rule 5, in the row "capture" and the rows after it. The cells take 110 from the pins. The scan output gives 1, 1, 0, and the drivers still read 100.

This lab leaves things out. It has no pad and no mux that hands the pad from the logic to the cell. One cell here watches the pin and holds the output enable. A real pad has a cell for its input, one for its output value and one for its output enable. In a real chip the moves come through the TAP, not from test code.

Why It Is Built This Way

Design choiceThe alternativeWhat the choice buys, and costs
Two stages in a cellOne stage that shifts and drivesThe pins hold still during a shift. Every cell needs a second bit.
A chain through the same four test wires as the debuggerExtra pins for every pad under testA whole board is tested through one connector. The chain is slow.
The cell sits in the path of the padTest the board with probes on every wireWires under a package can be tested at all. Each fast pad gets a mux in its path.

The Trap: Taking the Pads Too Early

A board test passed on the bench and burned a part at the factory. The test switched the pads to the cells first, and loaded its pattern after. For a few milliseconds the update stages held whatever they woke up with.

Our lab shows that state: "at power-up: cells=xxx drivers=xxx". An x is a driver that may be on. If the chip across the board drives the same wire the other way, that is contention. Rule 4 gives the order: preload, update, then take the pads.

A second trap is a test engineer who watches the shift and expects the pins to follow. They do not, by design. Nothing reaches a pin until the update.

The third is the length of the chain. A pad has several cells, and a board has several chips. Count the stages before you say which bit belongs to which pin.

At Scale

This page3 cells, 1 chip
A boardhundreds of cells in each chip

This section looks ahead. Three cells become several hundred, and one chip becomes a board.

  1. A chain across the board

    The chains of all chips join through their TAPs. One connector on the board reaches every pin of every chip.

  2. Fast pads

    A mux in the path of a fast pad costs time. Such pads get special cells, or are left out of the chain and tested another way.

  3. Pins that are not digital

    A cell holds a 0 or a 1. A pin that carries a voltage in between needs another kind of hook.

  4. A snapshot at work

    The shift stages can capture the pins while the chip runs its normal work. That is a cheap look at a board that misbehaves.

Try It

Run the lab. In the three rows that start with "shift in", follow the 1 through the cells, and watch the drivers.

Change pins from 110 to 001. Predict the last row before you run it.

Remove the first update, the one of the preload. What do the drivers show in the next row?

Names Printed by the Lab
NameMeaning
cellsThe shift stages of the three cells, written as cell 2, cell 1, cell 0. Cell 0 is next to the scan input.
driversThe update stages, in the same order. A 1 means that the cell switches the output driver of its pad on.
xxxThree values that nobody has set yet.
scan outThe level of the scan output before the next shift. It is the shift stage of cell 2.
RUNIcarus Verilog · in your browser
Edit the code, then run it
Expected: at power-up: cells=xxx drivers=xxx preload 0 0 0, update: cells=000 drivers=000 shift in 1: cells=001 drivers=000 shift in 0: cells=010 drivers=000 shift in 0: cells=100 drivers=000 update: cells=100 drivers=100 capture: cells=110 drivers=100 scan out=1 drivers=100 scan out=1 drivers=100 scan out=0 drivers=100 scan out, first bit first: 1 1 0
Read included file: soc-s85-test-boundaries.sv
// Digital test fixtures. The two-word SRAM sweep demonstrates MBIST ownership
// and completion. It is deliberately smaller than a production March test.
module ap_memory_test_slice (
  input logic clk, reset, test_owner, start, functional_write, functional_addr,
  input logic [7:0] functional_data,
  output logic done, fail
);
  typedef enum logic [1:0] {IDLE, FILL, VERIFY} phase_t;
  phase_t phase;
  logic address;
  logic [7:0] ram[2];
  wire [7:0] pattern = address ? 8'h5a : 8'ha5;
  always_ff @(posedge clk) begin
    if (reset) begin
      phase <= IDLE;
      address <= 0;
      done <= 0;
      fail <= 0;
    end else if (!test_owner) begin
      phase <= IDLE;
      if (functional_write) ram[functional_addr] <= functional_data;
    end else case (phase)
      IDLE: if (start) begin
        address <= 0;
        done <= 0;
        fail <= 0;
        phase <= FILL;
      end
      FILL: begin
        ram[address] <= pattern;
        address <= !address;
        if (address) phase <= VERIFY;
      end
      VERIFY: begin
        if (ram[address] !== pattern) fail <= 1;
        address <= !address;
        if (address) begin
          done <= 1;
          phase <= IDLE;
        end
      end
    endcase
  end
endmodule

// One boundary bit: capture/shift and update are distinct operations.
module ap_pad_test_slice (
  input logic test_clk, capture_pin, shift_pin, update_pin, serial_in, pad_input,
  input logic isolate_bias, functional_bias,
  output logic shift_bit, driver_enable, bias_enable
);
  always_ff @(posedge test_clk) begin
    if (capture_pin) shift_bit <= pad_input;
    else if (shift_pin) shift_bit <= serial_in;
    if (update_pin) driver_enable <= shift_bit;
  end
  assign bias_enable = isolate_bias ? 1'b0 : functional_bias;
endmodule

Check Yourself

Predict the outputIn this run the board holds pin 2 and pin 1 low and pin 0 high. What is the last row? Its form is: scan out, first bit first: . . .
`timescale 1ns/1ns
module tb;
  logic test_clk = 0, capture_pin = 0, shift_pin = 0, update_pin = 0, serial_in = 0;
  logic [2:0] pins = 3'b001;           // the levels that the board puts on pin 2, pin 1 and pin 0
  wire [2:0] cells;                    // the bit of each boundary cell that is captured or shifted
  wire [2:0] drivers;                  // the output enable that each cell gives to its pad: 1 is on
  // The chain: scan input, cell 0, cell 1, cell 2, scan output.
  ap_pad_test_slice cell0(.serial_in(serial_in), .pad_input(pins[0]), .shift_bit(cells[0]), .driver_enable(drivers[0]),
    .isolate_bias(1'b1), .functional_bias(1'b0), .bias_enable(), .*);
  ap_pad_test_slice cell1(.serial_in(cells[0]), .pad_input(pins[1]), .shift_bit(cells[1]), .driver_enable(drivers[1]),
    .isolate_bias(1'b1), .functional_bias(1'b0), .bias_enable(), .*);
  ap_pad_test_slice cell2(.serial_in(cells[1]), .pad_input(pins[2]), .shift_bit(cells[2]), .driver_enable(drivers[2]),
    .isolate_bias(1'b1), .functional_bias(1'b0), .bias_enable(), .*);
  wire serial_out = cells[2];

  task automatic test_pulse;
    #2 test_clk = 1; #2 test_clk = 0;
  endtask
  task automatic shift_in(input bit b);
    shift_pin = 1; serial_in = b; test_pulse(); shift_pin = 0;
  endtask
  task automatic update;
    update_pin = 1; test_pulse(); update_pin = 0;
  endtask

  logic [2:0] seen;
  initial begin
    $display("at power-up: cells=%b drivers=%b", cells, drivers);
    repeat (3) shift_in(0);            // preload: all drivers off, before anything else
    update();
    $display("preload 0 0 0, update: cells=%b drivers=%b", cells, drivers);

    shift_in(1); $display("shift in 1: cells=%b drivers=%b", cells, drivers);
    shift_in(0); $display("shift in 0: cells=%b drivers=%b", cells, drivers);
    shift_in(0); $display("shift in 0: cells=%b drivers=%b", cells, drivers);
    update();
    $display("update: cells=%b drivers=%b", cells, drivers);

    capture_pin = 1; test_pulse(); capture_pin = 0;
    $display("capture: cells=%b drivers=%b", cells, drivers);

    for (int i = 0; i < 3; i++) begin
      seen[i] = serial_out;
      $display("scan out=%b drivers=%b", serial_out, drivers);
      shift_in(0);
    end
    $display("scan out, first bit first: %b %b %b", seen[0], seen[1], seen[2]);
    $finish;
  end
endmodule
Read included file: soc-s85-test-boundaries.sv
// Digital test fixtures. The two-word SRAM sweep demonstrates MBIST ownership
// and completion. It is deliberately smaller than a production March test.
module ap_memory_test_slice (
  input logic clk, reset, test_owner, start, functional_write, functional_addr,
  input logic [7:0] functional_data,
  output logic done, fail
);
  typedef enum logic [1:0] {IDLE, FILL, VERIFY} phase_t;
  phase_t phase;
  logic address;
  logic [7:0] ram[2];
  wire [7:0] pattern = address ? 8'h5a : 8'ha5;
  always_ff @(posedge clk) begin
    if (reset) begin
      phase <= IDLE;
      address <= 0;
      done <= 0;
      fail <= 0;
    end else if (!test_owner) begin
      phase <= IDLE;
      if (functional_write) ram[functional_addr] <= functional_data;
    end else case (phase)
      IDLE: if (start) begin
        address <= 0;
        done <= 0;
        fail <= 0;
        phase <= FILL;
      end
      FILL: begin
        ram[address] <= pattern;
        address <= !address;
        if (address) phase <= VERIFY;
      end
      VERIFY: begin
        if (ram[address] !== pattern) fail <= 1;
        address <= !address;
        if (address) begin
          done <= 1;
          phase <= IDLE;
        end
      end
    endcase
  end
endmodule

// One boundary bit: capture/shift and update are distinct operations.
module ap_pad_test_slice (
  input logic test_clk, capture_pin, shift_pin, update_pin, serial_in, pad_input,
  input logic isolate_bias, functional_bias,
  output logic shift_bit, driver_enable, bias_enable
);
  always_ff @(posedge test_clk) begin
    if (capture_pin) shift_bit <= pad_input;
    else if (shift_pin) shift_bit <= serial_in;
    if (update_pin) driver_enable <= shift_bit;
  end
  assign bias_enable = isolate_bias ? 1'b0 : functional_bias;
endmodule
ConceptWhat does a boundary cell add to a pad?
ConceptWhy does a boundary cell have two stages?
ConceptWhat must happen before the cells take control of the pads?
ConceptWhat can a boundary chain test that a scan chain inside the chip cannot?

Common Mistakes

Wrong Let the cells take the pads before a preload.

The update stages may hold anything, and a driver may switch on.

Fix Shift in a safe pattern, update, then take the pads.

Wrong Expect the pins to follow the bits during a shift.

Only the shift stages move.

Fix Look at the pins after the update.

Wrong Count one cell for each pin.

A pad has a cell for each of its signals.

Fix Take the order and the length of the chain from the description of the chip.

Remember

  • A boundary cell beside each pad can read the pin and control the pad.
  • A shift moves the shift stages only. A pad changes only on an update.
  • Preload a safe pattern before the cells take the pads.
  • Two chips together test the wire between them.

Practice

Report a problem with this page