Calibre Duplicate Derived Layers in Rules for Ignoring Encrypted Parts

IC Verification & Signoff


When working with derived layers, which cannot be viewed directly in layout viewing tools, it can be useful for debugging purposes to create a DRC rule that shares the same name as the derived layer. This DRC rule should contain a copy of the derived layer. By doing so, the derived layer can be viewed as a DRC result item, which can help verify whether the design expectations are met. This can be a valuable tool for designers when working with derived layers in their layouts.


To automate this process, the provided Perl code generates a DRC rule for each derived layer found in a rules file.

In a previous article (MG33770), we discussed a script that was designed to read and process data from a rule file. However, the script was unable to handle encrypted parts in the file:

In this article, we introduce a modified script that addresses this limitation and allows for more efficient data processing and will handle encrypted parts in the rule file.

Here is the result of running the code below on an example rule file:

%  -f rules-test | grep -v / | grep {
gate { Copy  gate }
ncont { Copy  ncont }
pcont { Copy  pcont }
bulk { Copy  bulk }
diff { Copy  diff }
psub { Copy  psub }

Here is the updated Perl code which produced the above results:

# USAGE :  perl  <path>/  -f  rules_file
use Getopt::Std;

$flag = 1;

open(THATFILE, "$opt_f") || die "\n[USAGE: perl <path>/  -f <rulesfile>  \n\n";
while (<THATFILE>) {
                if ($_ =~ /#DECRYPT/){
                                $flag = 0;
                if ($_ =~ /#ENDCRYPT/){
                                $flag = 1;
                if ($flag and $_ =~ /(^\S*)\s*=\s*(.*)\s*/) {
                                $layers{$1} = $2;
foreach $key (keys %layers) {
    print("// $key =  $layers{$key}\n");
    print("$key { Copy  $key }\n");

KB Article ID# KB000111918_EN_US



Associated Components

Calibre nmDRC