Stitch new flops into scan chain

New flops inserted in an ECO should be stitched into existing scan chains to avoid DFT coverage loss. From the industrial data, 100 new non-scan flops in a design with 100K flops can cause more than 0.1% DFT coverage loss. For the high-reliability chips like Automobile IC, the DFT coverage loss is not acceptable. So if there are new flops in a functional ECO, the scan chain should be redone to include the new flops.

Figure 1: Stitch scan chain

GOF provides several ways to insert the new flops into scan chains. The API 'stitch_scan_chain' can be used to automatically stitch scan chains by inserting the new flops. A manually way is supported by using several netlist processing APIs.

Automatic mode to insert flops into a scan chain in the local modules

For example, eight new flops 'state_new_reg_0' to 'state_new_reg_7' are added in fix_design command. To insert them into scan chain in the local module:

# API stitch_scan_chain without any argument to insert new flops in the local modules
stitch_scan_chain();

Automatic mode to insert flops before one flop

Users can specify one flop instance name, so that GOF can insert all new flops to the scan chain before the flop instance.

For example, insert all new flops to the scan chain before instance 'u_pixel_ctrl/pulse_reg':

# API stitch_scan_chain with -to option
stitch_scan_chain('-to', 'u_pixel_ctrl/pulse_reg');

Manual mode to connect up all new flops

The scan chain can be re-connected up manually by ECO APIs. And new scan in/out ports are created.

# GofCall ECO script, run_manual_stitch_scan_chain_example.pl
use strict;
undo_eco; # Discard previous ECO operations
setup_eco("eco_manual_stitch_scan_chain_example");# Setup ECO name
read_library("art.5nm.lib");# Read in standard library
read_design("-ref", "reference.gv");# Read in Reference Netlist
read_design("-imp", "implementation.gv");# Read in Implementation Netlist Which is under ECO
set_top("topmod");# Set the top module
set_ignore_output("scan_out*");
set_pin_constant("scan_enable", 0);
set_pin_constant("scan_mode", 0);
fix_design;
save_session("current_eco_name"); # Save a session for future restoration
set_error_out(0); # Don't exit if finds error
my @flops = get_cells("-hier", "-nonscan"); # Find all new flops that are not in scan chain yet
# @flops can be defined by reading a list file
if(scalar(@flops)){ # If there are new flops, start the work
  new_port("so1", "-output"); # New a scan out port so1
  new_port("si1", "-input"); # New a scan in port si1
  my $cnt = 0;
  my $now_si;
  foreach my $flop (@flops){
    $cnt++;
    if(is_scan_flop($flop)==0){
      my $flop_name = get_ref($flop);
      my $scanflop = get_scan_flop($flop_name); # If the flop is not scan type, change to scan type flop
      change_gate($flop, $scanflop);
    }
    if($cnt==1){
      change_port("so1", "$flop/Q"); # The first flop drives the new scan out port
    }else{
      change_pin($now_si, "$flop/Q");
    }
    $now_si = "$flop/SI";
    change_pin("$flop/SE", "te"); # All scan enable pin is connected to scan enable signal
  }
  change_pin($now_si, "si1"); # The last flop has the new scan in port driving SI pin
}
write_verilog("eco_verilog.v");# Write out ECO result in Verilog
exit; 


Follow us:
NanDigits.com US | NanDigits.cn China
© 2022 NanDigits Design Automation. All rights reserved.