View on GitHub

Test Point Insertion (TPI)

Test Point Insertion (TPI) is an automated design-for-testability (DFT) technique that improves circuit testability by strategically inserting observation and control points into the design.

Overview

TPI analyzes testability metrics to identify hard-to-test signals and automatically inserts test points to improve fault coverage and test pattern effectiveness.

What TPI Does

Test Point Types

Observation Points

Control Points

Quick Start

Prerequisites

TPI requires testability metrics from prior analysis:

# Generate COP metrics (recommended for TPI)
opentest cop -i design.v -j

# OR generate SCOAP metrics  
opentest scoap -i design.v

Basic TPI Workflow

# Step 1: Parse your Verilog design
opentest parse -i design.v

# Step 2: Generate testability metrics
opentest cop -i data/parsed/design.json -j

# Step 3: Insert test points
opentest tpi -i data/parsed/design.json \
             -m data/results/design_cop.json \
             -o design_with_testpoints.v

Command Options

tpi -i <netlist.json> -m <metrics.json> [OPTIONS]
Option Description Default
-i, --input Input parsed netlist file (JSON) Required
-m, --metrics Metrics file (COP/SCOAP JSON) Required
-o, --output Output Verilog filename <input>_tp.v
-d, --directory Output directory data/TPI/
-t, --threshold Testability threshold (0-100) 50
-n, --max-points Maximum test points to insert 10
-v, --verbose Enable detailed output False

Detailed Usage

Testability Threshold

The threshold parameter determines which signals need test points:

# Conservative - only worst signals
opentest tpi -i design.json -m metrics.json -t 20 -n 5

# Aggressive - improve many signals  
opentest tpi -i design.json -m metrics.json -t 80 -n 20

Working with COP Metrics

COP provides probabilistic testability metrics ideal for TPI:

# Generate COP metrics with JSON output
opentest cop -i design.v -j

# Use COP metrics for TPI
opentest tpi -i data/parsed/design.json \
             -m data/results/design_cop.json \
             -t 50 -n 10

COP metrics format:

{
  "analysis_type": "COP",
  "metrics": [
    {
      "output": "signal_name",
      "c1": 0.5,
      "obs": 0.2,
      "testability": 0.1
    }
  ]
}

Working with SCOAP Metrics

SCOAP provides complexity-based testability metrics:

# Generate SCOAP metrics
opentest scoap -i design.v

# Use SCOAP metrics for TPI
opentest tpi -i data/parsed/design.json \
             -m data/results/design_scoap.json \
             -t 50 -n 10

Output Format

TPI generates enhanced Verilog with professional DFT interface:

module design_tp (
    // Original interface
    clk,
    reset,
    data_in,
    data_out,
    // Test point interface - DFT
    tp_obs_internal_sig,
    tp_obs_critical_path,
    tp_ctrl_enable,
    test_mode
);

    // Original ports
    input clk, reset;
    input [7:0] data_in;
    output [7:0] data_out;
    
    // DFT ports
    output tp_obs_internal_sig;    // Observation point
    output tp_obs_critical_path;   // Observation point
    input tp_ctrl_enable;          // Control point input
    input test_mode;               // Test mode enable

    // Original logic preserved
    // ... existing gates ...

    // Test Point Gates
    BUFX2 U_TP_OBS_1 (.A(internal_sig), .Y(tp_obs_internal_sig));
    BUFX2 U_TP_OBS_2 (.A(critical_path), .Y(tp_obs_critical_path));
    MX2X1 U_TP_CTRL_1 (.A(enable), .B(tp_ctrl_enable), 
                       .S(test_mode), .Y(enable_muxed));

endmodule

Tool Compatibility

Generated Verilog is compatible with:

Example Workflows

Priority Encoder Example

# Step 1: Parse design
opentest parse -i data/input/priority_encoder.v

# Step 2: Generate COP metrics
opentest cop -i data/parsed/priority_encoder.json -j

# Step 3: Insert test points
opentest tpi -i data/parsed/priority_encoder.json \
             -m data/results/priority_encoder_cop.json \
             -t 50 -n 5

# Results
# Input: 17 gates, 34 signals
# Output: 22 gates (29.4% overhead), 5 observation points
# File: data/TPI/priority_encoder_tp.v

Large Circuit Example

# For large circuits, use higher thresholds and more test points
opentest tpi -i large_design.json \
             -m large_design_cop.json \
             -t 70 -n 50 -v

# Verbose output shows:
# - Candidate analysis
# - Test point design decisions  
# - Validation results
# - Performance statistics

Advanced Features

State Machine Workflow

TPI uses a robust state machine for reliable operation:

INITIALIZED → CANDIDATES_FOUND → CELLS_VALIDATED → 
DESIGN_COMPLETE → NETLIST_MODIFIED → VERILOG_GENERATED → COMPLETED

Technology Library Support

Currently supports Sky130 standard cells:

Validation and Reporting

TPI provides comprehensive validation:

Best Practices

Threshold Selection

Test Point Count

Metrics Selection

Troubleshooting

Common Issues

No test points inserted:

Bus signal errors:

Validation failures:

Debug Options

# Enable verbose output
opentest tpi -i design.json -m metrics.json -v

# Check metrics file format
head data/results/design_cop.json

# Validate original netlist
opentest parse -i design.v -v

References