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.
| Question | |
|---|---|
| 1 | What does a boundary cell add to a pad? |
| 2 | Why does a boundary cell have two stages? |
| 3 | What must happen before the cells take control of the pads? |
| 4 | What can a chain of boundary cells test that a scan chain inside the chip cannot? |
| 5 | A 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
| Word | Meaning |
|---|---|
| Boundary cell | A small circuit beside a pad. It can copy the level of the pin, and in test it can control the pad. |
| Boundary chain | All the boundary cells of a chip, linked into one shift register around its edge. |
| Shift stage | The bit of a boundary cell that captures the pin or shifts along the chain. |
| Update stage | The bit of a boundary cell that the pad gets in test. It changes only on an update. |
| Update pulse | One clock pulse on which every update stage copies its shift stage. The move is called an update. |
| Safe preload | To shift a safe pattern in and update, before the cells take control of the pads. This page calls it the preload. |
| Contention | Two 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
- Peripheral
- Debug
- Control / FSM
- Pads
- A pad at work
The logic of the chip decides whether the output driver of this pad is on. The tester has no say.
- A cell that looks
A boundary cell sits beside the pad. On a capture its shift stage takes the level of the pin.
- 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.
- A cell that drives
On an update, the update stage copies the shift stage. In test, the update stage decides the output enable.
- 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.
| Move | Shift stages after it | Update stages after it | What happened |
|---|---|---|---|
| Preload: shift in 0, 0, 0, then update | 000 | 000 | Every driver is off. Now the cells may take the pads. |
| Shift in 1 | 001 | 000 | The 1 is in cell 0. No driver changed. |
| Shift in 0 | 010 | 000 | The 1 passes cell 1. Its driver stays off. |
| Shift in 0 | 100 | 000 | The 1 has reached cell 2. |
| Update | 100 | 100 | All three update stages change together. Only the driver of pin 2 is on. |
| Capture | 110 | 100 | The shift stages took the pins. The drivers did not change. |
| Shift out, three times | 000 | 100 | The 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
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.
Rule 2: A shift never changes a pad.
Bits move through the shift stages. The update stages hold still.
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.
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.
Rule 5: A capture copies the pins into the shift stages.
It does not disturb the update stages, so the drivers keep their pattern.
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.
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 0Rule 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 choice | The alternative | What the choice buys, and costs |
|---|---|---|
| Two stages in a cell | One stage that shifts and drives | The pins hold still during a shift. Every cell needs a second bit. |
| A chain through the same four test wires as the debugger | Extra pins for every pad under test | A whole board is tested through one connector. The chain is slow. |
| The cell sits in the path of the pad | Test the board with probes on every wire | Wires 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 section looks ahead. Three cells become several hundred, and one chip becomes a board.
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.
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.
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.
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
| Name | Meaning |
|---|---|
| cells | The shift stages of the three cells, written as cell 2, cell 1, cell 0. Cell 0 is next to the scan input. |
| drivers | The update stages, in the same order. A 1 means that the cell switches the output driver of its pad on. |
| xxx | Three values that nobody has set yet. |
| scan out | The level of the scan output before the next shift. It is the shift stage of cell 2. |
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 0Read 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
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.