会飞的鱼丶丶丶的个人空间 https://blog.eetop.cn/1794212 [收藏] [复制] [分享] [RSS]

空间首页 动态 记录 日志 相册 主题 分享 留言板 个人资料

日志

aaa

已有 157 次阅读| 2023-2-5 20:50 |系统分类:其他

image.png


************************frame.dcf************************

# this is G5 frame rule v0.9 , SOH rule 0.2

# History

# v0.0.8  2023-07-23 Bill.Chen

#         add M0U improve rule to follow frameLDR 0.8 , need PIE conform and improve

#         add PWZ boolean

# v0.0.9  2023-08-22 Bill.Chen

#         update PW/NW/NCH/PCH/PG/NL/PL/M0C/MT2/MT2_M0C  


COM  proc                     |defineLayer     BORD                            | 312_0 

COM  proc                     |defineLayer     BORD_TEG                        | 301_0 

COM  proc                     |defineLayer     BORD_exclude                    | 306_0 307_0

COM  proc                     |shrink          1.0 

COM  proc                     |grid            0.1                             | nm

COM  proc                     |excludeCell     REG_*                           | ALL 


DNW  proc                     |lpp             6_0 6_41  

DNW  proc                     |defineLayer     DNW_design                      |6_0

DNW  proc                     |min_width       1.0                 

DNW  proc                     |min_space       1.0                

DNW  proc                     |min_width       2.115                           |DNW_design 

DNW  proc                     |min_space       2.365                           |DNW_design


PWZ  proc                     |defineLayer     PWZ                             |BOOL(301_0-8_0-10_7-7_21-307_0+7_41)

PWZ  proc                     |min_width       0.882

PWZ  proc                     |min_space       0.717

PWZ  S_002_00                 |max_length_space  45.1 0.7 2.9 


NWZ  proc                     |lpp             8_0  8_41

NWZ  proc                     |min_width       0.717

NWZ  proc                     |min_space       0.882

NWZ  S_002_00                 |max_length_space  45.1 0.7 2.9 


AT1  proc                     |lpp             2_7 2_41

AT1  proc                     |min_width       0.250

AT1  proc                     |min_space       0.250


ATC  proc                     |lpp             104_7 104_41

ATC  proc                     |min_width       0.338

ATC  proc                     |min_space       0.338


ATD  proc                     |lpp             105_7 105_41

ATD  proc                     |min_width       0.250

ATD  proc                     |min_space       0.250

ATD  ENC_0015_00              |min_enc_by      0.07                            |AT1


AT4  proc                     |lpp             4_0 4_2 4_3 4_4 4_7 4_8 4_19 4_24 4_41

AT4  proc                     |min_width       0.102

AT4  proc                     |min_space       0.054

AT4  proc                     |max_rectangle   10.24  25.6                     |BOOL(4_14-AT4)

AT4  proc                     |min_density     40 40 20  0.2

AT4  proc                     |max_density     40 40 20  0.8


channel  W_000_00             |min_width       0.338

channel  S_001_00             |min_space       0.338

channel  L_002_00             |max_length_space   2.52  0.3  0.36


NH1     proc                  |lpp             11_0 11_41

NH1     proc                  |include         channel


NH2     proc                  |lpp             12_0 12_41

NH2     proc                  |include         channel


NH3     proc                  |lpp             14_0 14_41

NH3     proc                  |include         channel


NH4     proc                  |lpp             111_0 111_41

NH4     proc                  |include         channel


PH1     proc                  |lpp             9_0 9_41

PH1     proc                  |include         channel


PH2     proc                  |lpp             18_0 18_41

PH2     proc                  |include         channel


PH3     proc                  |lpp             109_0 109_41

PH3     proc                  |include         channel


AVT     proc                  |lpp             10_7 10_41

AVT     proc                  |min_width       0.250

AVT     proc                  |min_space       0.250

          

SGD     proc                  |lpp             19_0 19_41

SGD     proc                  |min_width       0.338

SGD     proc                  |min_space       0.338


PDR     proc                  |lpp             117_0 117_41

PDR     proc                  |min_width       0.338

PDR     proc                  |min_space       0.338


KGX     proc                  |lpp             122_0 122_41

KGX     proc                  |min_width       0.640

KGX     proc                  |min_space       0.512


DGX     proc                  |lpp             20_0 20_41

DGX     proc                  |min_width       0.640

DGX     proc                  |min_space       0.512


NMR     proc                  |lpp             31_0 31_41

NMR     proc                  |min_width       0.338

NMR     proc                  |min_space       0.338


BWT     proc                  |lpp             16_7  16_41

BWT     proc                  |min_width       0.250

BWT     proc                  |min_space       0.250


BWR     proc                  |lpp             116_7  116_41

BWR     proc                  |min_width       0.338

BWR     proc                  |min_space       0.338


AMR     proc                  |lpp             32_7  32_41

AMR     proc                  |min_width       0.250

AMR     proc                  |min_space       0.250


B0T     proc                  |lpp             24_7  24_41

B0T     proc                  |min_width       0.250

B0T     proc                  |min_space       0.250


BCT     proc                  |lpp             27_7  27_41

BCT     proc                  |min_width       0.250

BCT     proc                  |min_space       0.250


BLT     proc                  |lpp             44_7  44_41

BLT     proc                  |min_width       0.338

BLT     proc                  |min_space       0.338



PGZ     proc                  |lpp             30_0 30_2 30_3 30_4 30_5 30_6 30_7 30_8 30_24 30_41

PGZ     proc                  |defineLayer     PG_exHamHead                          | 30_0 30_2 30_3 30_4 30_7 30_8 30_24 30_41

PGZ     proc                  |defineLayer     PG_HamHead                            |  30_5 30_6 

PGZ     proc                  |min_width       0.039                                 | PG_exHamHead

PGZ     proc                  |min_space       0.054

PGZ     proc                  |max_rectangle   10.24  25.6                           |BOOL(30_14-PGZ)

PGZ     proc                  |min_density     40 40 20 0.2

PGZ     proc                  |max_density     40 40 20 0.8


ldds   W_000_00               |min_width       0.138

ldds   S_001_00               |min_space       0.128

ldda   W_004_00               |min_width       0.120

ldda   S_005_00               |min_space       0.143  


ldd    L_002_00               |max_length_space  1.575  0.1 0.6



NL1     proc                  |lpp             34_0  34_41

NL1     proc                  |include         ldd ldds


NL2     proc                  |lpp             35_0  35_41

NL2     proc                  |include         ldd ldds


NL3     proc                  |lpp             38_0  38_41

NL3     proc                  |include         ldd ldda


NL4     proc                  |lpp             133_0  133_41

NL4     proc                  |include         ldd ldds


NL5     proc                  |lpp             134_0  134_41

NL5     proc                  |include         ldd ldds


PL1     proc                  |lpp             33_0  33_41

PL1     proc                  |include         ldd ldds


PL2     proc                  |lpp             36_0  36_41

PL2     proc                  |include         ldd ldda


PL3     proc                  |lpp             37_0  37_41

PL3     proc                  |include         ldd ldda


PL4     proc                  |lpp             135_0  135_41

PL4     proc                  |include         ldd ldda


PL5     proc                  |lpp             136_0  136_41

PL5     proc                  |include         ldd ldds


NT1     proc                  |lpp             49_7  49_41

NT1     proc                  |min_width       0.250

NT1     proc                  |min_space       0.250


NCT     proc                  |lpp             48_7  48_41

NCT     proc                  |min_width       0.500

NCT     proc                  |min_space       0.500


T1M     proc                  |lpp             158_7 158_41

T1M     proc                  |min_width       0.250

T1M     proc                  |min_space       0.250


T2M     proc                  |lpp             159_7 159_41

T2M     proc                  |min_width       0.250

T2M     proc                  |min_space       0.250




implant_sd  W_000_00          |min_width       0.338

implant_sd  S_001_00          |min_space       0.338

implant_sd  L_002_00          |max_length_space   1.575   0.3   0.41

implant_sd  L_002_01          |max_length_space   44      0.41  0.56

implant_sd  L_002_02          |max_length_space   45.1    0.56  2.9


NSD    proc                   |lpp             39_0   39_41

NSD    proc                   |include         implant_sd


PSD    proc                   |lpp             40_0   40_41

PSD    proc                   |include         implant_sd


PCN    proc                   |lpp             54_0   54_41

PCN    proc                   |include         implant_sd


PCP    proc                   |lpp             55_0   55_41

PCP    proc                   |include         implant_sd



licon   proc                  |min_width       0.022

licon   proc                  |min_length_rect 0.054 

licon   proc                  |min_space       0.090

licon   proc                  |min_space_to    0.061             |PROPERTY(DP)

  

PC1     proc                  |lpp             151_0  151_2  151_24  151_41

PC1     proc                  |DP              PC2

PC1     proc                  |include         licon


PC2     proc                  |lpp             152_0  152_2  152_24  152_41

PC2     proc                  |DP              PC1

PC2     proc                  |include         licon



M0C     proc                  |defineLayer         M0C_gen              |BOOL(312_0-306_0-311_41-301_0) 

M0C     proc                  |defineLayer         M0C_final            |BOOL(60_7+60_10+60_23+301_11+60_41+M0C_gen+306_0)

M0C     proc                  |defineLayer         M0C_remain           |BOOL(60_10+60_26-65_10)

M0C     W_000_00              |min_width           0.028                |M0C_final

M0C     S_001_00              |min_space           0.110                |M0C_final

M0C     MT2_S_006_00          |max_space_alledge   0.4                  |M0C_final


MT2     proc                  |lpp             65_0 65_8 65_16 65_24 65_41

MT2     proc                  |defineLayer     BORD_ARRAY_CORE          |302_51 302_52 302_53 302_54

MT2     proc                  |defineLayer     BORD_CORE                |302_51 302_52 302_53 

MT2     proc                  |defineLayer     PERI_HOLE                |BOOL(301_0-301_11)

MT2     proc                  |defineLayer     MT2_trim                 |65_10

MT2     proc                  |defineLayer     MT2_space                |BOOL(301_11-MT2+65_10+65_41)

MT2     proc                  |defineLayer     MT2_final                |BOOL(65_10+301_11-65_0-65_8-65_16-65_24+65_41+306_0)

MT2     W_000_00              |min_width       0.061

MT2     S_001_00              |min_space       0.060

MT2     DenMin_002_00         |min_density     0.3                 

MT2     DenMax_003_00         |max_density     0.7

MT2     C_004_00              |min_enc_outside 0                        |65_0  301_11 

MT2     C_005_00              |min_enc_outside 0                        |MT2_trim  BORD_CORE

MT2     S_006_00              |max_space       0.4                      |M0C_final BORD_TEG

MT2     DenMin_007_00         |min_density_reg 0.2                      |M0C_final PERI_HOLE

MT2     W_008_00              |min_width       0.028                    |M0C_remain

MT2     W_009_00              |min_width       3.0                      |301_11

MT2     A_010_00              |min_area        0.012

MT2     proc                  |min_area_hole   0.012   

MT2     F_0014_00             |fbd_space       0.03  0.06               |M0C_final MT2_final

MT2     W_0032_00             |min_widthArea   0.043 0.185              |MT2_final

MT2     W_0033_00             |min_width       0.035                    |MT2_final

MT2     S_0034_00             |min_space       0.059                    |MT2_final

MT2     Trim_HA_025_00        |min_area_hole   0.012                    |MT2_trim

MT2     M0C_C_026_00          |not_coinInside                           |MT2_final M0C_final

MT2     M0C_C_027_00          |min_width       0.028                    |BOOL(M0C_final-MT2_final)

MT2     M0C_C_028_00          |min_encNoAbut_by  0.006                  |M0C_final  MT2_final

MT2     M0C_C_028_00          |min_encPar_by     0.015                  |M0C_final  MT2_final

 



    

PCU     proc                  |lpp             52_0 52_2 52_24 52_41

PCU     proc                  |min_width       0.022 

PCU     proc                  |min_length_rect 0.054

PCU     proc                  |min_space       0.090


M0U     proc                  |lpp             66_0 66_24 68_7 68_41

M0U     W_000_00              |min_width       0.061

M0U     S_001_00              |min_space       0.06

M0U     DenMin_002_00         |min_density     40 40 20 0.3

M0U     DenMax_003_00         |max_density     40 40 20 0.7



SNT     proc                  |lpp             74_7 74_41

SNT     proc                  |min_width       0.250

SNT     proc                  |min_space       0.250

SNT     proc                  |groupCheck      SNT.? SNM.?      |SNT


SNM     proc                  |lpp             76_7  76_41

SNM     proc                  |min_width       0.250

SNM     proc                  |min_space       0.250

SNM     proc                  |min_enc_by      0.026             |74_7 SNM 

SNM     TCP_ENC_0016_00       |min_enc_by      0.17              |78_7 

SNM     TCP_ENC_0016_00       |min_enc_by      0.17              |78_0 


TCP     proc                  |lpp             78_0 78_7  78_41

TCP     proc                  |min_width       0.338

TCP     proc                  |min_space       0.338

TCP     proc                  |groupCheck      TCP.?  SNM.?      |TCP



CTZ     proc                  |lpp             85_0  85_2 85_3  85_24  85_41 

CTZ     proc                  |min_width       0.030

CTZ     proc                  |min_space       0.088

CTZ     proc                  |max_density     60 60 10 0.2


M1Z     proc                  |lpp             88_0  88_8 88_16  88_17 88_24 88_41

M1Z     proc                  |min_width       0.05

M1Z     proc                  |min_space       0.05

M1Z     proc                  |max_width       1.183

M1Z     proc                  |max_rectangle   10.24  25.6                     |BOOL(88_14-M1Z)

M1Z     proc                  |min_density     40 40 10 0.4

M1Z     proc                  |max_density     40 40 10 0.75


V1Z     proc                  |lpp             90_0  90_24  90_41

V1Z     proc                  |min_width       0.049

V1Z     proc                  |min_space       0.069

V1Z     proc                  |max_density     60 60 10 0.2


M2Z     proc                  |lpp             91_0 91_8 91_16 91_17 91_24 91_41

M2Z     proc                  |min_width       0.077

M2Z     proc                  |min_space       0.056

M2Z     proc                  |max_width       1.480

M2Z     proc                  |max_rectangle   10.24  25.6                     |BOOL(91_14-M2Z)

M2Z     proc                  |min_density     40 40 10 0.4

M2Z     proc                  |max_density     40 40 10 0.75 


V2Z     proc                  |lpp             92_0  92_24  92_41

V2Z     proc                  |min_width       0.049

V2Z     proc                  |min_space       0.069

V2Z     proc                  |max_density     60 60 10 0.2


M3Z     proc                  |lpp             93_0 93_8 93_16 93_17 93_24 93_41

M3Z     proc                  |min_width       0.077

M3Z     proc                  |min_space       0.056

M3Z     proc                  |max_width       1.480

M3Z     proc                  |max_rectangle   10.24  25.6                     |BOOL(93_14-M3Z)

M3Z     proc                  |min_density     40 40 10 0.4

M3Z     proc                  |max_density     40 40 10 0.75 


V3Z     proc                  |lpp             94_0  94_24  94_41

V3Z     proc                  |min_width       0.049

V3Z     proc                  |min_space       0.069

V3Z     proc                  |max_density     60 60 10 0.2


M4Z     proc                  |lpp             95_0 95_8 95_16 95_17 95_24 95_41

M4Z     proc                  |min_width       0.077

M4Z     proc                  |min_space       0.056

M4Z     proc                  |max_width       1.480

M4Z     proc                  |max_rectangle   10.24  25.6                     |BOOL(95_14-M4Z)

M4Z     proc                  |min_density     40 40 10 0.3

M4Z     proc                  |max_density     40 40 10 0.87 


V4Z     proc                  |lpp             102_0  102_24  102_41

V4Z     proc                  |min_width       0.064

V4Z     proc                  |min_space       0.105

V4Z     proc                  |max_density     60 60 10 0.2


M5Z     proc                  |lpp             103_0 103_8 103_16 103_17 103_24 103_41

M5Z     proc                  |min_width       0.165

M5Z     proc                  |min_space       0.184

M5Z     proc                  |max_width       65.08

M5Z     proc                  |min_density     40 40 10 0.3

M5Z     proc                  |max_density     40 40 10 0.87 


PAS     proc                  |lpp             99_0  99_41

PAS     proc                  |min_width       45

PAS     proc                  |min_space       12


RDV     proc                  |lpp             96_0  96_41

RDV     proc                  |exact_width     4 5 7 

RDV     proc                  |min_space       3.000


RDL     proc                  |lpp             97_0 97_41

RDL     proc                  |min_width       3.000

RDL     proc                  |min_space       3.000

RDL     proc                  |min_density     0.3

RDL     proc                  |max_density     0.85


PA2     proc                  |lpp              100_0 100_41

PA2     proc                  |min_width        42.998

PA2     proc                  |min_space        14.000


# Sealring rule 

SL      proc                  |defineLayer    BORD_CHIP   |307_0

SL      proc                  |defineLayer    BORD_BLK    |311_41 301_0

SL      proc                  |defineLayer    SLM5        |103_24

SL      proc                  |defineLayer    SLV4        |102_24

SL      proc                  |defineLayer    SLM4        |95_24

SL      proc                  |defineLayer    SLV3        |94_24

SL      proc                  |defineLayer    SLM3        |93_24

SL      proc                  |defineLayer    SLV2        |92_24

SL      proc                  |defineLayer    SLM2        |91_24

SL      proc                  |defineLayer    SLV1        |90_24

SL      proc                  |defineLayer    SLM1        |88_24

SL      proc                  |defineLayer    SLCT        |85_24

SL      proc                  |defineLayer    SLM0        |65_24

SL      proc                  |defineLayer    SLM0U       |66_24

SL      proc                  |defineLayer    SLPCU       |52_24

SL      proc                  |defineLayer    SLPC1       |151_24

SL      proc                  |defineLayer    SLPC2       |152_24

SL      proc                  |defineLayer    SLAA        |4_24

SL      proc                  |defineLayer    SLPG        |30_24


M5Z     proc                  |groupCheck     M5Z.?  SLM5.?                |M5Z

M4Z     proc                  |groupCheck     M4Z.?  SLM4.?                |M4Z

M3Z     proc                  |groupCheck     M3Z.?  SLM3.?                |M3Z

M2Z     proc                  |groupCheck     M2Z.?  SLM2.?                |M2Z

M1Z     proc                  |groupCheck     M1Z.?  SLM1.?                |M1Z

M0U     proc                  |groupCheck     M0U.?  SLM0U.?               |M0U

M0C     proc                  |groupCheck     M0C.?         MT2.?          |M0C

MT2     proc                  |groupCheck     MT2.?  SLM0.? M0C.?          |MT2

V4Z     proc                  |groupCheck     V4Z.?  SLV4.?                |V4Z

V3Z     proc                  |groupCheck     V3Z.?  SLV3.?                |V3Z

V2Z     proc                  |groupCheck     V2Z.?  SLV2.?                |V2Z

V1Z     proc                  |groupCheck     V1Z.?  SLV1.?                |V1Z

PCU     proc                  |groupCheck     PCU.?  SLPCU.?               |PCU

CTZ     proc                  |groupCheck     CTZ.?  SLCT.?                |CTZ

PC1     proc                  |groupCheck     PC1.?  SLPC1.?               |PC1

PC2     proc                  |groupCheck     PC2.?  SLPC2.?               |PC2


SLCOM   proc                  |min_space_to   0.25        |BORD_BLK


SLM5    proc                  |exact_width    3.6 

SLM5    proc                  |exact_hole_cut 0.225       |BORD_CHIP 

SLM5    proc                  |include SLCOM 


SLV4    proc                  |exact_width    0.15        

SLV4    proc                  |min_space      0.22        

SLV4    proc                  |min_enc_by     0.215       |SLM4 

SLV4    proc                  |exact_count    2           |SLM4 

SLV4    proc                  |include SLCOM 


SLM4    proc                  |exact_width    0.58 

SLM4    proc                  |exact_space    0.32  1 

SLM4    proc                  |exact_hole_cut 0.285       |BORD_CHIP 

SLM4    proc                  |include SLCOM 


SLV3    proc                  |exact_width    0.15        

SLV3    proc                  |min_space      0.22        

SLV3    proc                  |min_enc_by     0.215       |SLM3 

SLV3    proc                  |exact_count    2           |SLM3 

SLV3    proc                  |include SLCOM 


SLM3    proc                  |exact_width    0.58  

SLM3    proc                  |exact_space    0.32  1 

SLM3    proc                  |exact_hole_cut 0.285       |BORD_CHIP

SLM3    proc                  |include SLCOM 


SLV2    proc                  |exact_width    0.15        

SLV2    proc                  |min_space      0.22        

SLV2    proc                  |min_enc_by     0.215       |SLM2

SLV2    proc                  |exact_count    2           |SLM2    

SLV2    proc                  |include SLCOM 


SLM2    proc                  |exact_width    0.58   0.64      

SLM2    proc                  |exact_space    0.32   1     

SLM2    proc                  |exact_hole_cut 0.225       |BORD_CHIP

SLM2    proc                  |include SLCOM 


SLV1    proc                  |exact_width    0.15        

SLV1    proc                  |min_space      0.22        

SLV1    proc                  |min_enc_by     0.215       |SLM1

SLV1    proc                  |exact_count    2           |SLM1

SLV1    proc                  |include SLCOM 


SLM1    proc                  |exact_width    0.58 

SLM1    proc                  |exact_space    0.32   1 

SLM1    proc                  |exact_hole_cut 0.285       |BORD_CHIP

SLM1    proc                  |include SLCOM 


SLCT    proc                  |exact_width    0.126        

SLCT    proc                  |min_enc_by     0.227        |SLM1

SLCT    proc                  |min_enc_by     0.187        |SLM0U

SLCT    proc                  |include SLCOM 


SLM0U   proc                  |exact_width    3.4 

SLM0U   proc                  |exact_hole_cut 0.325       |BORD_CHIP

SLM0U   proc                  |include SLCOM 


SLPCU   proc                  |exact_width    0.05        

SLPCU   proc                  |min_enc_by     0.100        |SLM0U

SLPCU   proc                  |min_enc_by     0.100        |SLM0

SLPCU   proc                  |include SLCOM 


SLM0    proc                  |exact_width    3.4 

SLM0    proc                  |exact_hole_cut 0.325       |BORD_CHIP

SLM0    proc                  |include SLCOM 


SLPC1   proc                  |exact_width    0.05   

SLPC1   proc                  |min_count      1           |SLM0

SLPC1   proc                  |min_enc_by     0.1         |SLM0

SLPC1   proc                  |min_enc_by     0.2         |SLAA               

SLPC1   proc                  |min_space_to   0.1         |SLPG

SLPC1   proc                  |include SLCOM 


SLPC2   proc                  |max_count      0           |SLM0


SLPG    proc                  |exact_width     0.45 

SLPG    proc                  |exact_hole_cut  0          |BORD_CHIP

SLPG    proc                  |min_enc_by      0.1        |SLAA

SLPG    proc                  |include SLCOM 


SLAA    proc                  |exact_width     3.6 

SLAA    proc                  |exact_hole_cut  0.225      |BORD_CHIP

SLAA    proc                  |include SLCOM 



ARRAY   proc                  |defineLayer  B0T_all       |     24_101 24_103 24_41

ARRAY   proc                  |defineLayer  BC1_all       |25_9 25_101 25_103 25_41 

ARRAY   proc                  |defineLayer  BC2_all       |26_9 26_101 26_103 26_41

ARRAY   proc                  |defineLayer  BWZ_all       |15_9 15_101 15_103 15_41

ARRAY   proc                  |defineLayer  BWZ_all_si    |BOOL(BWZ_all+0.05-0.05)

ARRAY   proc                  |defineLayer  NCZ_all       |47_9 47_101 47_103 47_41

ARRAY   proc                  |defineLayer  NCZ_all_si    |BOOL(NCZ_all+0.05-0.05)

ARRAY   proc                  |defineLayer  BWT           |16_101 16_103 16_41 

ARRAY   proc                  |defineLayer  M01_all       |60_9 60_101 60_103 60_41

ARRAY   proc                  |defineLayer  M01_all_si    |BOOL(M01_all+0.05-0.05)

ARRAY   proc                  |defineLayer  M02_all       |63_9 63_101 63_103 63_41

ARRAY   proc                  |defineLayer  M02_all_si    |BOOL(M02_all+0.05-0.05)


ARRAY   proc                  |defineLayer  STI           |BOOL(BORD-AT4)

ARRAY   proc                  |defineLayer  nonPG         |BOOL(BORD-PGZ)

ARRAY   proc                  |defineLayer  BWZ_SOH_si    |BOOL(15_9+0.768-0.768)

ARRAY   proc                  |defineLayer  BC1_SOH_si    |BOOL(25_9+0.768-0.768)

ARRAY   proc                  |defineLayer  BC2_SOH_si    |BOOL(26_9+0.768-0.768)

ARRAY   proc                  |defineLayer  ATD           |105_7 105_101 105_103 105_41

ARRAY   proc                  |defineLayer  BLZ_all       |43_101 43_103 43_41  

ARRAY   proc                  |defineLayer  BLT_all       |44_101 44_103 44_41

ARRAY   proc                  |defineLayer  OVLmark       |311_46

ARRAY   proc                  |defineLayer  ALM_all       |61_41

ARRAY   proc                  |defineLayer  M01_kerf      |BOOL(M01_all+60_41+65_41)



BWTCUT  proc                  |and_overlap  cut_BWZ_overlap_BC12   |BOOL(BWT-BWZ_all_si) BOOL(BC1_all+BC2_all)

BWT     proc                  |include  BWTCUT

BWZ     proc                  |include  BWTCUT

BC1     proc                  |include  BWTCUT

BC2     proc                  |include  BWTCUT


BWZ     proc                  |max_rectangle   0.768 0.768          |BOOL(BORD-BWZ_all_si) 

M01     proc                  |max_rectangle   0.768 0.768          |BOOL(BORD-M01_all_si)

M02     proc                  |max_rectangle   0.768 0.768          |BOOL(BORD-M02_all_si)


CPP     proc                  |defineLayer     CPPsoh               | 64_9

CPP     proc                  |min_space_to    0.145                | CPPsoh  BOOL(BORD-60_41&311_41)


BWZ     proc                  |max_rectangle   40  40               |BOOL(BWZ_SOH_si-STI)

BC1     proc                  |max_rectangle   40  40               |BOOL(BC1_SOH_si-STI)

BC2     proc                  |max_rectangle   40  40               |BOOL(BC2_SOH_si-STI)

NCZ     proc                  |max_rectangle   40  40               |BOOL(NCZ_all_si-nonPG)


ATD     proc                  |and_overlap    notAT4_BWZ_BC         |BOOL(ATD-AT4) BOOL(BWZ_all+BC1_all+BC2_all)

BLZ     proc                  |and_overlap    inOVLmark_B0T         |BOOL(BLZ_all&OVLmark)  B0T_all 

BLZ     proc                  |must_overlap   inOVLmark_PG          |BOOL(BLZ_all&OVLmark)  PGZ

NCZ     proc                  |must_overlap   inOVLmark_BLT         |BOOL(NCZ_all&OVLmark)  BLT_all

M01     proc                  |must_overlap   inOVLmark_ALM         |BOOL(M01_kerf&OVLmark)  ALM_all



#SOH CMP dummy


BWZ  proc               |defineLayer     BWLmain                         | 15_7 15_101 15_103 15_104 15_41

BWZ  proc               |defineLayer     BWLsoh                          | 15_9

BWZ  proc               |defineLayer     BWTmain                         | 16_7 16_101 16_103 16_104 16_41

BWZ  proc               |exact_width     0.115                           | BWLsoh

BWZ  proc               |min_space       0.115                           | BWLsoh

BWZ  proc               |min_space_to    0.1024                          | BWLsoh BWLmain

BWZ  proc               |min_space_to    0.115                           | BWLsoh 311_1

BWZ  proc               |min_space_to    0.1                             | BWLsoh BWTmain

BWZ  proc               |max_length_rect 38.4                            | BWLsoh

BWZ  proc               |min_length_rect 0.1408                          | BWLsoh



NCZ  proc               |defineLayer     NCsoh                           | 47_9

NCZ  proc               |defineLayer     NCZmain                         | 47_7 47_101 47_103 47_41

NCZ  proc               |defineLayer     NCTmain                         | 48_7 48_101 48_103 48_41

NCZ  proc               |exact_width     0.0755                          | NCsoh

NCZ  proc               |min_space       0.0576                          | NCsoh

NCZ  proc               |min_space_to    0.0576                          | NCsoh  311_2 

NCZ  proc               |min_space_to    0.1                             | NCsoh  NCTmain

NCZ  proc               |min_space_to    0.107                           | NCsoh  NCZmain

NCZ  proc               |max_length_rect 38.4                            | NCsoh

NCZ  proc               |min_length_rect 2.56                            | NCsoh



BLC  proc               |defineLayer     BC1main                         | 25_7 25_101 25_103 25_104

BLC  proc               |defineLayer     BC2main                         | 26_7 26_101 26_103 26_104

BLC  proc               |defineLayer     BCTmain                         | 27_7 27_101 27_103 27_41


BC1  proc               |defineLayer     BC1soh                          | 25_9

BC1  proc               |exact_width     0.0768                          | BC1soh

BC1  proc               |min_space       0.0832                          | BC1soh

BC1  proc               |min_space_to    0.2048                          | BC1soh  BC1main

BC1  proc               |max_length_rect 38.4                            | BC1soh

BC1  proc               |min_length_rect 2.56                            | BC1soh

BC1  proc               |min_space_to    0.2048                          | BC1soh  311_3

BC1  proc               |min_space_to    0.2048                          | BC1soh  BC2main

BC1  proc               |min_space_to    0.1001                          | BC1soh  BCTmain


BC2  proc               |defineLayer     BC2soh                          | 26_9

BC2  proc               |exact_width     0.0758                          | BC2soh

BC2  proc               |min_space       0.0842                          | BC2soh

BC2  proc               |min_space_to    0.2048                          | BC2soh  BC2main

BC2  proc               |max_length_rect 38.4                            | BC2soh

BC2  proc               |min_length_rect 2.56                            | BC2soh

BC2  proc               |min_space_to    0.2048                          | BC2soh  311_3 

BC2  proc               |min_space_to    0.2048                          | BC2soh  BC1main

BC2  proc               |min_space_to    0.1001                          | BC2soh  BCTmain


CPP  proc               |defineLayer     CPPsoh                          | 64_9

CPP  proc               |defineLayer     M0Cmain                         | 60_10 60_23 60_7

CPP  proc               |exact_width     0.16                            | CPPsoh 

CPP  proc               |min_space       0.16                            | CPPsoh 

CPP  proc               |min_enc_by      0.17                            | CPPsoh 60_7

CPP  proc               |min_enc_by      0.171                           | CPPsoh 301_11

CPP  proc               |max_length_rect 38.4                            | CPPsoh

CPP  proc               |min_length_rect 2.56                            | CPPsoh

CPP  proc               |min_space_to    0.173                           | CPPsoh  BOOL(BORD-60_41&311_41)

CPP  proc               |min_space_to    0.17                            | CPPsoh  M0Cmain 


SNX  proc               |defineLayer     SN1main                         | 70_0  70_7 70_101 70_103 70_41 

SNX  proc               |defineLayer     SN2main                         | 71_0  71_7 71_101 71_103 71_41 

SNX  proc               |defineLayer     SNTmain                         |       74_7 74_101 74_103 74_41 


SN1  proc               |include         SNX

SN1  proc               |defineLayer     SN1soh                          | 70_9

SN1  proc               |defineLayer     SN1block                        | 70_14

SN1  proc               |exact_width     0.1194                          | SN1soh

SN1  proc               |min_space       0.0933                          | SN1soh

SN1  proc               |min_space_to    0.2048                          | SN1soh  SN1main

SN1  proc               |min_space_to    0.2048                          | SN1soh  SN2main

SN1  proc               |min_space_to    0.1                             | SN1soh  SNTmain

SN1  proc               |max_length_rect 38.4                            | SN1soh

SN1  proc               |min_length_rect 2.3                             | SN1soh

SN1  proc               |min_space_to    0.2048                          | SN1soh  SN1block 


SN2  proc               |include         SNX

SN2  proc               |defineLayer     SN2soh                          | 71_9

SN2  proc               |defineLayer     SN2block                        | 71_14

SN2  proc               |exact_width     0.1194                          | SN2soh

SN2  proc               |min_space       0.0933                          | SN2soh

SN2  proc               |min_space_to    0.2048                          | SN2soh  SN1main

SN2  proc               |min_space_to    0.2048                          | SN2soh  SN2main

SN2  proc               |min_space_to    0.1                             | SN2soh  SNTmain

SN2  proc               |max_length_rect 38.4                            | SN2soh

SN2  proc               |min_length_rect 2.3                             | SN2soh

SN2  proc               |min_space_to    0.2048                          | SN2soh  SN2block 



************************simple.txt************************

************************commom.txt************************

************************DRCinfo.tcl************************


#mydoc 

#NAME:         DRCinfoAdd - add one data to dataList

#SYNOPSIS:     DRCinfoAdd listName typeName ?typeVaue

#DESCRIPTION:

#EXAMPLE:      % DRCinfoAdd plist layNum

#                layNum must be a variable

#

#              % DRCinfoAdd plist BLK $BLK_layerName

#                BLK can be not a variable

#end mydoc

proc DRCinfoAdd {plist typeVar args} {

      upvar $plist plist1 $typeVar typeVar1

      if { [llength $args] != 0 } { 

           set typeVar1 [lindex $args 0]

         }

      DRCinfoAddTypeList $plist1 [list type $typeVar value $typeVar1 refLay ONLY] plist1

}



proc DRCinfoAddTypeList { plistO typeList plistN } {

     upvar $plistN plistN1

     set line    [lindex $plistO 0]

     set newList [lrange $line 0 1]

     if { [llength $typeList] < 5 } {

        set refList [list " " refLay [list]]

        } else {

        set refList ""

        }

     append newList " " $typeList $refList

     lappend plistO $newList


     set plistN1 $plistO 

     return $plistN1


proc DRCinfoAddGlobal { name layList type value ref} {

     global pdata

     foreach lay $layList {

         set nlist $pdata($lay)

         set line  [list "layer" $lay "type" $type "value" $value "refLay" $ref ]

         lappend nlist $line

         set pdata($lay) $nlist 

    }

}


#function user: OutGenLayTo 

proc DRCinfoAddPdata { name pdata layList type value ref} {

     upvar $pdata pdata1

     foreach lay $layList {

         set nlist $pdata1($lay)

         set line  [list "layer" $lay "type" $type "value" $value "refLay" $ref ]

         lappend nlist $line

         set pdata1($lay) $nlist 

    }

}



#mydoc 

#NAME:         DRCinfo  - checkout one data from a list 

#SYNOPSIS:     DRCinfo  $plist type ?typeVaue ?typeRef

#DESCRIPTION:

#EXAMPLE:      % DRCinfo plist layNum

#                Get the layNum data, put the data value in variable layNum  

#

#              % DRCinfo plist min_enc encValues 

#                Get the min_enc data, put the [list value ref rule] in a list: encValues 

#

#              % DRCinfo plist lpp lpp lay 

#                Get the lpp data, put the value in variable lpp , put ref in variable lay 

#end mydoc


proc DRCinfoRule { plist type } { 



}


proc DRCinfo { plist type {value ""} {ref ""} } {

     if { $value == "" } { 

          upvar $type type1

          set mode    "DRC_IMP" 

        }  else {

          upvar $value value1

          set mode ""

        } 


     if {$ref != "" } { 

         upvar $ref ref1

         set mode "DRC_IMP"

        }

 

     set type [string tolower $type]

     set rList ""

     foreach line $plist {

      set lay       [lindex $line 1]

      set lineType  [string tolower [lindex $line 3]]

      set lineValue [lindex $line 5]

      set lineRef   [lindex $line 7]             

      set lineRule  [lindex $line 9]             

      

            set lineValue [DRCparaReplaceValue $plist $lineValue $lineType ] 

 

     #puts "DRCinfo line: $line, lineType:$lineType type:$type"

     

      if { $lineType == $type } {

           set lineRef   [DRCinfoReplaceRef   $plist $lineRef  ]       

           #puts "This same type: $lineType"

           if { $lineRef == "DRC_IMP" || $mode == "DRC_IMP"} {

                set value1 $lineValue

                set type1  $lineValue

                set ref1   $lineRef

                #DRCinfoReplaceRef $plist ref1 

                return $lineValue

               }


           lappend rList [list $lineValue $lineRef $lineRule]

         }

     }

     set value1 $rList 


     if { $rList == "" } {

          puts "\[Error\]--can't find $lay DRCinfo type: $type"

       }

     return $rList

}


proc DRCinfoReplaceRef { plist ref1 } {

     if { [DRCinfoExist $plist cutRef_$ref1] } {

           DRCinfo $plist cutRef_$ref1

           set ref  "($ref1 NOT [set cutRef_$ref1])"

        } else { 

           set ref $ref1 

        }

     return $ref


proc DRCinfoChangeLayer { plist layN outlist } {

     upvar $outlist out

     foreach line $plist {

        set layTag    [lindex $line 0]

        set lay       [lindex $line 1]

        set typeTag   [lindex $line 2]

        set type      [lindex $line 3]

        set valueTag  [lindex $line 4]

        set value     [lindex $line 5]

        set refTag    [lindex $line 6]

        set ref       [lindex $line 7]


        set newLine  [list $layTag $layN $typeTag $type $valueTag $value $refTag $ref ]

        lappend outlist1 $newLine 


      }


      set out $outlist1

}


proc DRCinfoMergeList { plist alist outlist } {

    upvar $outlist outlist1

    #the include first will overlap behand

    set outlist1 [concat $plist $alist ]

    #set outlist1 [concat $alist $plist ]


proc DRCinfoExist { plist type } {

     set typeCheck  [string tolower $type]

     foreach line $plist {

         set lineType  [string tolower [lindex $line 3]]

         if { $lineType == $typeCheck } {

              return True

            } 

          }

     return False

}


proc DRCinfoPrint { plist args } {

     foreach line $plist {

        set layTag    [lindex $line 0]

        set lay       [lindex $line 1]

        set typeTag   [lindex $line 2]

        set type      [lindex $line 3]

        set valueTag  [lindex $line 4]

        set value     [lindex $line 5]

        set refTag    [lindex $line 6]

        set ref       [lindex $line 7]

        set ruleTag   [lindex $line 8]

        set rule      [lindex $line 9]



        if { [llength $args] > 0 } {

            if { [lsearch -exact $args $type] != -1 } { 

                 set flag  True

               } else {

                 set flag  False

               }

           } else {

                 set flag  True

           }

 

        if { $flag } {

           puts "$layTag:$lay $ruleTag:$rule |$typeTag: $type |$valueTag: $value |$refTag: $ref" 

           }

    }


}



#support 2 mode. 1--get proc type args.2--get stringvalue args

proc DRCpara { plist type args } {

     if {[DRCinfoExist $plist $type]} {

          DRCinfo $plist $type vList noRef

        } else {

          set vList $type

        }

     #puts "DRCpara: type--$type , vList--$vList" 

     foreach key $args {

     upvar $key int_$key

         set int_$key "" 

         foreach value [split $vList ","] {

            #puts "DRCpara--keys: $key value--$value"

            set kList  [split [string trim $value] "="]

            set keyName [lindex $kList 0]

            set value   [lindex $kList 1]

            if {$keyName == $key } {

                set value [DRCparaReplaceValue $plist $value $type]

                set int_$key $value

               }

          }

    }

}


proc DRCparaReplaceValue { plist value type } {

  if {[regexp {^TYPE\((\S+)\s*(\S*)\)} $value -> reftype refkey]} {

       #puts "beforReplace: lineValue: $value"

       #puts "DRCparaReplaceValue: reftype--$reftype,refkey--$refkey"

       DRCinfoDelet $plist $type rlist

       if { [DRCinfoExist $plist $reftype] } {

              if { $refkey!="" } {

                   DRCpara $rlist $reftype $refkey

                 } else {

                   DRCinfo $rlist $reftype 

                   #puts "afterReplace: lineValue: $value"

                   return [set $reftype]

                 }

              set value [expr \$$refkey] 

           }

      #puts "afterReplace: lineValue: $value"

     }

return $value

}




proc DRCinfoDelet {plist type rlist } {

     upvar $rlist rlist1

     set rlist1     [list]

     set typeCheck  [string tolower $type]

     foreach line $plist {

         set lineType  [string tolower [lindex $line 3]]

         if { $lineType != $typeCheck } {

              lappend rlist1 $line

            }

          }

     return $rlist1

}


proc DRCinfoObj { plist obj } {

     upvar $obj obj1

     set obj1 [lindex [lindex $plist 0] 1]

     puts "obj1 is $obj1"



************************Print.tcl************************

#! tvf


#global variable: script_DEBUG  suffix


proc svrf_comment {str} {

      tvf::echo_to_svrf_file ""

      if { $str != "" } {

           tvf::// ***** $str *****//

         }

}


proc svrf_version { ver user dir description } {

     set curtime [clock format [clock seconds] -format {%Y-%m-%d %H:%M:%S} ]

     #set realDir [file normalize $dir] 


     if { [file type $dir] == "link" } {

         set realDir [file readlink $dir]

         if { [file pathtype $realDir] == "relative" } {

               set realDir [file dirname $dir]/$realDir 

            }

        } else {

          set realDir $dir

        }


     puts "realDir is $realDir"

     tvf::echo_to_svrf_file "//Descrition: $description

//User:       $user

//Version:    $ver

//tclPath:    $realDir

//Date:       $curtime

"

}


#mydoc 

#NAME:         PrintDebugL - print layer to debug oas  

#SYNOPSIS:     PrintDebugL debug namePre layName ?name1 ?name2 ?name3  ?"edge name4" 

#DESCRIPTION:

#EXAMPLE:      % PrintDebugL $debug $name $layNum ext poly1 poly2 "edge edge1" 

#                output layer: ext_$name , poly1_$name, poly2_$name must be a polygon layer

#                              edge1_$name  must be a edge layer

#

#              % PrintDebugL $debug "" $layNum  $gen1 $poly1 $poly2 "edge edge1"

#                if namePre="", output layer: $gen1,$poly1,$poly2, 

#end mydoc

proc PrintDebugL { debug parNamePre layNum args } {

     if { $debug == "True" } {

          foreach arg $args {

              set parList [split $arg]

              if { [llength $parList] == 2 } {

                   set type  [lindex $parList 0]

                   set value [lindex $parList 1]

                   if {$type == "edge"} {

                          upvar $value value1

                          #puts "value:  $value"

                          if { $parNamePre != "" } {

                                set parName ${parNamePre}|edge_$value

                                if { [info exists value1] } {

                                     tvf::SETLAYER $parName = EXPAND EDGE $value1 BY GRID*4 

                                   } else {

                                     tvf::SETLAYER $parName = EXPAND EDGE ${value}_$parNamePre BY GRID*4

                                   }

                              } else {

                                set parName $value

                              } 

                             

                               PrintDebug $parName $layNum 

                          } else {

                            puts "\[ERROR\]--NOT support type PrintDebugL args: $parList"

                      } 

                 } elseif { [llength $parList] == 1 } {

                     upvar $arg arg1

                     #puts "arg:  $arg"

                     if { $parNamePre != "" } {

                          set parName ${parNamePre}_$arg

                          if { [info exists arg1] } {

                                 tvf::SETLAYER $parName = OR EMPTY $arg1

                               } else {

                                 tvf::SETLAYER $parName = OR EMPTY ${arg}_$parNamePre

                               }

                        } else {

                          set parName $arg

                        }

                     PrintDebug $parName $layNum 

                 } else {

                        puts "\[ERROR\]--NOT support PrintDebugL args length: $parList--length:[llength $parList]"

                 }

        }

    } 

}


proc PrintDebug { parNamePre layNum args } {

     global script_DEBUG suffix debugSuffix

     #puts "$parNamePre args: $args , llength is: [llength $args]" 


     set pSuffix $suffix

     if { [info exists debugSuffix] } {

         #puts "debugSuffix : $debugSuffix"

         if { $debugSuffix != "" } {

              set pSuffix $debugSuffix

            }

        }


     if { $script_DEBUG == "True" } {

        if { [info exists PDarray] == 0 } {

             global PDarray

             array set PDarray [list]

           }

           if { [info exists PDarray($layNum)] == 0 } {

                set PDarray($layNum)  0

              }

           set layType $PDarray($layNum)


           if { [llength $args] == 1 } {

                upvar $args args1 

                set parName ${parNamePre}_$args

                #puts "parName is: $parName"

                #puts "args1 is: $args1"

                if { [info exists args1] } {

                     tvf::SETLAYER $parName = OR EMPTY $args1

                   } else {

                     tvf::SETLAYER $parName = OR EMPTY ${args}_$parNamePre

                   } 

              } else {

                set parName $parNamePre

              }

           tvf::RULECHECK $parName { tvf::DFM RDB OASIS "debug${pSuffix}.oas" $parName $layNum $layType }

           incr PDarray($layNum)

       }

}


proc PrintDebugEdge { parNamePre layNum args } {


     if { [llength $args] == 1 } {

         upvar $args args1

         set parName ${parNamePre}|edge_$args

         if { [info exists args1] } {

              tvf::SETLAYER $parName = EXPAND EDGE $args1 BY GRID*4 

            } else {

              tvf::SETLAYER $parName = EXPAND EDGE ${args}_$parNamePre BY GRID*4

            } 

        } else {

             set parNmae  edge_$parNamePre

             tvf::SETLAYER $parName = EXPAND EDGE $parNamePre BY GRID*4

        } 


     PrintDebug $parName $layNum 


}


proc PrintError { parName layNum } {

     global suffix

        if { [info exists PEarray] == 0 } {

             global PEarray

             array set PEarray [list]

           }


           if { [info exists PEarray($layNum)] == 0 } {

                set PEarray($layNum)  0

              }

           set layType $PEarray($layNum)

           tvf::RULECHECK Error_$parName {tvf::DFM RDB $parName "error${suffix}.result" CHECKNAME Error_$parName NOPSEUDO NOEMPTY OUTPUT ALL CELLS CELL SPACE }

           incr PEarray($layNum)

}


proc PrintWarn { parName layNum } {

     global suffix

        if { [info exists PWarray] == 0 } {

             global PWarray

             array set PWarray [list]

           }

           if { [info exists PWarray($layNum)] == 0 } {

                set PWarray($layNum)  0

              }

           set layType $PWarray($layNum)

           tvf::RULECHECK Warn_$parName {tvf::DFM RDB $parName "warning${suffix}.result" CHECKNAME Warn_$parName NOPSEUDO NOEMPTY OUTPUT ALL CELLS CELL SPACE }

           incr PWarray($layNum)

}


proc PrintPdata { data1 args } { 

     #global $data  

     upvar $data1  data 

     puts "\[PrintArray--$data1\] size : [array size data]" 

     foreach { lay lines } [array get data] {

          if { [llength $args] > 0 } {

               if { [lsearch -exact $args $lay]!=-1 } {

                     set pflag True 

                  } else {

                     set pflag False

                  }

             } else {

               set pflag True

             }


          if { $pflag } {

               puts "=================object : $lay ===================="

               foreach line $lines {

                #puts "line is: $line"

                puts "$line"

               }

               puts " "

            }

     }


}


proc PrintLpp { name plist pdata } {

     upvar $pdata pdata1


     if { [DRCinfoExist $plist printLpp] } {

         DRCinfo $plist printLpp

         set objList [split $printLpp]

         foreach obj $objList {

             if { [array name pdata1 $obj] != "" } {

                  set olist $pdata1($obj)

                  DRCinfo $olist lpp lpp lay

                  scan $lpp "%d_%d" layNum layType

                  tvf::SETLAYER $name.$lay = OR EMPTY $lay

                  PrintDebug $name.$lay $layNum 

               } else {

                  tvf::SETLAYER $name.$obj = OR EMPTY $obj

                  DRCinfo $plist layNum

                  PrintDebug $name.$obj $layNum

               } 

         }

       }

 


************************Read_process_file.tcl************************

#!/usr/bin/tclsh

#usage as test script


#file syntax:


proc Read_process_file {pdata1 args} { 

     upvar $pdata1 pdata

     #puts "length args: [llength $args] : $args"

     if { [llength  $args ] > 1 } {

         set DRC_specfile [lindex $args 0]

         set DRC_default  [lindex $args 1]

        } elseif {[llength $args] == 1} {

          set DRC_specfile $args       

          set DRC_default  $args       

        } else {

          puts "Read_process_fill args is not right : $args"

       }


  Read_process_file_base pdata $DRC_specfile $DRC_default

  MergeIncludeInfo pdata

}



proc Read_process_file_base {pdata1 args } {

     upvar $pdata1 pdata


    #puts "length args: [llength $args] : $args"

    if { [llength  $args ] > 1 } {

        set DRC_specfile [lindex $args 0]

        set DRC_default  [lindex $args 1]

       } elseif {[llength $args] == 1} {

         set DRC_specfile $args       

         set DRC_default  $args       

       } else {

         puts "Read_process_fill args is not right : $args"

      }


    if {[string trim $DRC_specfile] eq ""} {

         #puts "drcfh is: $DRC_default"

         set drcfh [open $DRC_default "r"]

       } else {

         #puts "drcfh is: $DRC_specfile"

         set drcfh [open $DRC_specfile "r"]

       }


while {[gets $drcfh line] >= 0} {

 #puts "read dcf line is: $line"

 if {[regexp {^\s*((?:(?![#])\S)+)\s+(\S+)\s*\|(\S+)\s+(.+)$} $line -> speclayer ruleName spectype_raw specvalues]} {

     set reflayer ""

     if { [regexp {^\s*(.*?)\|(.+)} $specvalues -> refvalues reflayer]} { set specvalues $refvalues } 

        

      set spectype  [string tolower $spectype_raw]

      set valuelist [regexp -inline -all -- {\S+} $specvalues]

      set reflist   [regexp -inline -all -- {\S+} $reflayer ]


      set alist [list "layer" $speclayer "type" $spectype "value" $valuelist "refLay" $reflist "rule" $ruleName ]

      #puts "match line item: $alist"

      if { [array name pdata $speclayer] != "" } {

           set plist  $pdata($speclayer)

           lappend plist $alist

            set pdata($speclayer) $plist

         } else {

            set pdata($speclayer) [list $alist ]

         }

      if { $speclayer == "file" && [file exists $valuelist] } {

           puts "\[INFO\]--load include file: $valuelist"

           Read_process_file_base pdata "" $valuelist 

         }       


     }    

  }


}



proc MergeIncludeInfo { pdata1 } {

    upvar $pdata1 pdata

    #PrintPdata pdata

    foreach lay [array name pdata] {

         #puts "\[INFO\]--begin to mergeIncludeInfo for $lay"

         set plist $pdata($lay)

         MergeIncludeList pdata $lay $plist plist

     }


}


proc MergeIncludeList {pdata1 lay plist nlist} {

     upvar $pdata1 pdata $nlist nlist1

     if { [DRCinfoExist $plist include ] } {

          DRCinfo $plist include layStr noRef

          foreach layRef [split $layStr] {

                       if { [lsearch -exact [array name pdata] $layRef]!=-1 } {

                            set nlist $pdata($layRef)

                            MergeIncludeList pdata $layRef $nlist nlist

                            DRCinfoChangeLayer $nlist $lay rlist

                            DRCinfoMergeList $plist $rlist plist

                          }

                 }

        DRCinfoDelet $plist include plist

        set pdata($lay) $plist

       }

   set pdata($lay) $plist

   set nlist1 $plist

}


##=============for test script================##

#if { [info proc "calibre_common_init"] < 0 }  {

#     puts "This is Read_process_file test script"

#     source "/home/cad1/xxchen/500_calibre/common/current/init.tcl"

#     set dcf "debug.dcf"

#     Read_process_file pdata $dcf

#     PrintPdata pdata M1

#}




************************defineHead.tcl************************

tvf::LAYOUT PATH    \"$LayoutPath\"

tvf::LAYOUT PRIMARY \"$PRIMARY\"

tvf::LAYOUT SYSTEM  $GdsType


tvf::verbatim {

//drc results database "drc.result"

//drc summary report "drc.sum"

drc maximum results all

UNIT LENGTH U


LAYOUT INPUT EXCEPTION SEVERITY POLYGON_NONORIENTABLE 1

LAYOUT INPUT EXCEPTION SEVERITY PATH_NONORIENTABLE    1

LAYOUT INPUT EXCEPTION SEVERITY POLYGON_DEGENERATE    1

layer empty 99999


TEXT PRINT MAXIMUM     ALL

DRC  CHECK TEXT        ALL


}


tvf::VERBATIM "PRECISION $PRECISION"

tvf::VERBATIM "VARIABLE GRID $GRID"

tvf::VERBATIM "drc results database $drcResult"

tvf::VERBATIM "drc summary report   $drcSummary"


************************init.tcl************************


set scriptList [list  "DRCinfo" "Print" "Read_process_file" "defineHead" \

               ]



#not modify 

set funDir   "[file dirname [file normalize [info script]]]"

puts "load $funDir"


source $funDir/../init.tcl

 

************************defineLayer.txt************************

************************defineLayer_bord.tcl************************


proc defineLayer_obj { pList } {

     global LAYER_NAME_LIST 

     if { [info exists LAYER_NAME_LIST] == 0 } {

           set LAYER_NAME_LIST [list]

        }


     if { [DRCinfoExist $pList lpp] } {

           DRCinfo $pList lpp 

           DRCinfoObj $pList obj

           if { [lsearch -ascii $LAYER_NAME_LIST $obj] == -1 } {

                defineLayerList $obj $lpp

                lappend LAYER_NAME_LIST $obj

              }

        }

}

************************defineLayer.tcl************************


proc defineLayer { pList } {

     global LAYER_NAME_LIST 

     if { [info exists LAYER_NAME_LIST] == 0 } {

           set LAYER_NAME_LIST [list]

        }

     if { [DRCinfoExist $pList defineLayer] } {

           DRCinfo $pList defineLayer layInfoList 

           #puts "layInfoList is $layInfoList"


           foreach layInfo $layInfoList {

                  set layName [lindex $layInfo 0]

                  set lppList [lindex $layInfo 1]

                  if { [lsearch -ascii $LAYER_NAME_LIST $layName] == -1 } {

                       puts "layName: $layName , lppList: $lppList"

                       if { [regexp {^BOOL\((.+)\)} $lppList -> lineBol] } {

                            puts "get lineBol: $lineBol"

                            set boolName [runBoolean $layName $pList $lppList]

                            tvf::SETLAYER $layName = COPY $boolName

                          } else {

                                defineLayerList $layName $lppList 

                          }

                       lappend LAYER_NAME_LIST $layName

                     }

                  } 

          }

}


proc defineLayerList {layName lppList} {

     set rList [list ]

     set num 1

     foreach lpp $lppList {

                           lappend rList [DefineLayer $lpp $lpp.$num]

                           incr num

                          }

     tvf::SETLAYER $layName = OR empty [join $rList] 

}


proc DefineLayer { lpp layName } {


     if { [DefineLayer_CHECK_LAYER_NAME $layName] == "" } { return $layName }


     #puts "$lpp result: [scan $lpp "%d_%d" layNum layType]"

     if { [scan $lpp "%d_%d" layNum layType] } {

          global free_layer

          if { [info exists free_layer] == 0 } {

                set free_layer 10000 

             } 

          incr free_layer 1

          set bdy_layer [lindex [split $lpp "_"] 0]

          set bdy_dtype [lindex [split $lpp "_"] end]

          tvf::LAYER MAP $bdy_layer DATATYPE $bdy_dtype $free_layer

          set layName [DefineLayer_EXCLUDE_CELL $lpp $free_layer $layName]

        } else {

          set layName $lpp 

        }

          return $layName

 }



proc DefineLayer_EXCLUDE_CELL {lpp free_layer layName} {

     global DefineLayer_EXCLUDE_CELL_LIST


     if { [info exists DefineLayer_EXCLUDE_CELL_LIST] == 0 } {

           set DefineLayer_EXCLUDE_CELL_LIST [list] 

        }

 

     #svrf "[list cells layer]"

     #             str   str

     set exCellList [list]

     foreach cellInfo $DefineLayer_EXCLUDE_CELL_LIST {  

             set cellNameList [lindex $cellInfo 0 ]

             set layList      [lindex $cellInfo 1 ]

             #puts "DefineLayer_EXCLUDE CELL cellNameList: $cellNameList , layList: $layList"

             if { $layList == "ALL" || [lsearch -ascii $layList $lpp] } {

                  lappend exCellList $cellNameList

                }

             }


     if { $exCellList != "" } {

          tvf::LAYER $layName.preExclude $free_layer

          tvf::SETLAYER $layName = $layName.preExclude NOT INSIDE CELL \"[join $exCellList  " "]\"

        } else { 

          tvf::LAYER $layName $free_layer

        }


     return $layName

}


proc DefineLayer_CHECK_LAYER_NAME { layName } {

     global DefineLayer_LAYER_NAME_LIST  

 

     if { [info exists DefineLayer_LAYER_NAME_LIST] == 0 } {

           set DefineLayer_LAYER_NAME_LIST [list] 

        } 


     if { [lsearch -ascii $DefineLayer_LAYER_NAME_LIST $layName] > 0 } {

           return "" 

        }


        lappend DefineLayer_LAYER_NAME_LIST $layName 

        return $layName

}


#proc defineLayerList {layName lppList} {

#     global free_layer

#     if { [info exists free_layer] == 0 } {

#           set free_layer 10000

#        }

#     set rList [list ]

#     foreach lpp $lppList {

#         incr free_layer 1

#         #svrf_comment "defineLayerList layName: $layName , lppList: $lppList, lpp: $lpp"

#         set bdy_layer [lindex [split $lpp "_"] 0]

#         set bdy_dtype [lindex [split $lpp "_"] end]

#         tvf::LAYER MAP $bdy_layer DATATYPE $bdy_dtype $free_layer

#         lappend rList $free_layer

#       }

#

#      tvf::LAYER $layName [join $rList] 

#}



#proc DefineLayer { lpp layName {getFreeLayer "False"} } {

#     global DefineLayer_LAYER_NAME_LIST  

#     global DefineLayer_EXCLUDE_CELL_LIST

#     if { [info exists DefineLayer_LAYER_NAME_LIST] == 0 } {

#           set DefineLayer_LAYER_NAME_LIST [list] 

#        } 

#

#     if { [lsearch -ascii $DefineLayer_LAYER_NAME_LIST $layName] > 0 } {

#           return $layName

#        }

#

#     #puts "$lpp result: [scan $lpp "%d_%d" layNum layType]"

#     if { [scan $lpp "%d_%d" layNum layType] } {

#          global free_layer

#          if { [info exists free_layer] == 0 } {

#                set free_layer 10000 

#             } 

#          incr free_layer 1

#          set bdy_layer [lindex [split $lpp "_"] 0]

#          set bdy_dtype [lindex [split $lpp "_"] end]

#          tvf::LAYER MAP $bdy_layer DATATYPE $bdy_dtype $free_layer

#          if { $getFreeLayer != "False" } {

#                return $free_layer

#             } else {

#               tvf::LAYER $layName $free_layer

#             }

#        } else {

#          set layName $lpp 

#        }

#

#          lappend DefineLayer_LAYER_NAME_LIST $layName 

#          return $layName

# }



************************defineLayer_obj.tcl************************


proc defineLayer_obj { pList } {

     global LAYER_NAME_LIST 

     if { [info exists LAYER_NAME_LIST] == 0 } {

           set LAYER_NAME_LIST [list]

        }


     if { [DRCinfoExist $pList lpp] } {

           DRCinfo $pList lpp 

           DRCinfoObj $pList obj

           if { [lsearch -ascii $LAYER_NAME_LIST $obj] == -1 } {

                defineLayerList $obj $lpp

                lappend LAYER_NAME_LIST $obj

              }

        }

}

************************defineLayer_excludeCell.tcl************************

proc defineExcludeCell { pList } {

     global DefineLayer_EXCLUDE_CELL_LIST


    if { [DRCinfoExist $pList excludeCell] } {

          DRCinfo $pList excludeCell cellInfos 

          set DefineLayer_EXCLUDE_CELL_LIST $cellInfos

        } else {

          set DefineLayer_EXCLUDE_CELL_LIST [list]

        }

}

************************init.tcl************************


set scriptList [list  "defineLayer" "defineLayer_obj" "defineLayer_excludeCell" \

               ]



#not modify 

set funDir   "[file dirname [file normalize [info script]]]"

puts "load $funDir"


source $funDir/../init.tcl

 

************************main.txt************************

************************init.tcl************************


set scriptList [list "ruleCheck" "runBoolean" "runRuleName" "runShrink" "main" \

               ]



#not modify 

set funDir   "[file dirname [file normalize [info script]]]"

puts "load $funDir"


source $funDir/../init.tcl

 

************************main.tcl************************




set dcfDefPath $scriptRootDir/../../../process/$process/$project/current/frame.dcf


if { [info exists maskSel] == 0 } {

set maskSel [list DNW PWZ NWZ DGX NSD PSD NGA PGA PCN PCP \

                  NH1 NH2 NH3 NH4 NH5 PH1 PH2 PH3 PH4 PH5 \

                  NL1 NL2 NL3 NL4 NL5 PL1 PL2 PL3 PL4 PL5 \

                  SGD PDR TGX KGX NMR AMR PNR CPH NTB SAB \

                  AT3 AT4 PGZ PGE MT2 M0U M1Z M2Z M3Z M4Z \

                  PCZ PC1 PC2 PCU CTZ V1Z V2Z V3Z V4Z M5Z \

                  M01 M02 CPP BLC BC1 BC2 NCZ BWZ SN1 SN2 \

                  PAS RDV RDL PA2 \

                  SL  SLM5 SLM4 SLM3 SLM2 SLM1 SLM0U SLM0 SLAA SLPG \

                      SLV4 SLV3 SLV2 SLV1 SLCT SLPCU SLPC1 SLPC2    \

                  ARRAY BWT BWR BLZ ATD AT1 ATC B0T BCT BLT \

                  NCT T1M T2M  M0C  SM1 SM2 SNT SNM TCP\

            ]

}


Read_process_file pdata $dcfPath $dcfDefPath


puts "pdata array name [array name pdata]"


foreach obj $maskSel {

    if { [lsearch -exact [array name pdata] $obj] <0 } { continue }


    #merge com obj to all obj

    set pList_com $pdata(COM)

    set pList_obj $pdata($obj)

    DRCinfoChangeLayer $pList_com $obj pList_comObj

    DRCinfoMergeList $pList_comObj $pList_obj pList 


    DRCinfoPrint $pList


    svrf_comment "" 

    svrf_comment "ruleCheck--$obj"

    defineExcludeCell $pList

    defineLayer       $pList

    defineLayer_obj   $pList 


    #main 

    ruleCheck   $obj  $pList 


}





************************ruleCheck.tcl************************


proc ruleCheck { name pList } {

     #procName name "ruleCheck"


    set checkFlowList [list \

        checkMinWidth           min_width   \

        checkMinWidthNotRect    min_width_notRect\

        checkMaxWidth           max_width   \

        checkMinSpace           min_space    \

        checkMinSpaceNotRect    min_space_notRect\

        checkMinSpaceTo         min_space_to \

        checkMinSpaceOpp        min_space_opp \

        checkMinLength          min_length   \

        checkMaxLength          max_length   \

        checkMinLengthRect      min_length_rect   \

        checkMaxLengthRect      max_length_rect   \

        checkMinEncBy           min_enc_by   \

        checkMinEncLongBy       min_encLong_by   \

        checkExactEncBy         exact_enc_by   \

        checkExactEncLongBy     exact_encLong_by   \

        checkMinCount           min_count  \

        checkExactWidth         exact_width  \

        checkExactSpace         exact_space  \

        checkExactCount         exact_count  \

        checkExactHoleCut       exact_hole_cut \

        checkMinDensity         min_density \

        checkMaxDensity         max_density \

        checkMaxRectangle       max_rectangle \

        checkMaxCount           max_count  \

        checkXorOverlap         xor_overlap \

        checkAndOverlap         and_overlap \

        checkMustOverlap        must_overlap \

      ]      


    #DRCinfoPrint $pList

    set checkNum 0

    foreach {checkFunName checkType} $checkFlowList {

             #puts "checkFunName is $checkFunName"

             #puts "checkType is $checkType"

             if { [DRCinfoExist $pList $checkType] } {

                  DRCinfo $pList $checkType checkInfoList

                  $checkFunName $name $pList $checkInfoList

                  incr checkNum 

                }

    }


   addCheckGroup $name $pList $checkNum


}


proc addCheckGroup { name pList checkNum } {

     if { $checkNum != 0 } {

          if { [DRCinfoExist $pList groupCheck] } {

               DRCinfo $pList groupCheck groupValue groupName

               tvf::VERBATIM "GROUP $groupName $groupValue"

             } else {

               tvf::VERBATIM "GROUP $name $name.?" 

             }

        }

}


proc checkMinWidth { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          svrf_comment "checkInfo $checkInfo"

          set Wmin     [lindex $checkInfo 0]

          set layList  [split [lindex $checkInfo 1]]

          set ruleName [lindex $checkInfo 2]

          set layA     [lindex $layList 0]

          set layB     [lindex $layList 1]


          set Wmin     [runShrink   $name  $pList $Wmin]

          set ruleName [runRuleName $name  "min_width" $Wmin]

          set layA     [runBoolean  $name $pList  $layA]

          set layB     [runBoolean  $name $pList  $layB]

     

          if { $layA == "" } { set layA $obj }

  

          tvf::RULECHECK $ruleName { tvf::OUTLAYER INT $layA < $Wmin ABUT<90 }

     }


proc checkMinWidthNotRect { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          svrf_comment "checkInfo $checkInfo"

          set Wmin     [lindex $checkInfo 0]

          set layList  [split [lindex $checkInfo 1]]

          set ruleName [lindex $checkInfo 2]

          set layA     [lindex $layList 0]

          set layB     [lindex $layList 1]


          set Wmin     [runShrink   $name  $pList $Wmin]

          set ruleName [runRuleName $name  "min_width_notRect" $Wmin]

          set layA     [runBoolean  $name $pList  $layA]

          set layB     [runBoolean  $name $pList  $layB]

     

          if { $layA == "" } { set layA $obj }

  

          tvf::RULECHECK $ruleName { 

                       tvf::SETLAYER layNotRect = NOT RECTANGLE $layA

                       tvf::OUTLAYER INT layNotRect < $Wmin ABUT<90 }

     }


proc checkMaxWidth { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          svrf_comment "checkInfo $checkInfo"

          set Wmin     [lindex $checkInfo 0]

          set layList  [split [lindex $checkInfo 1]]

          set ruleName [lindex $checkInfo 2]

          set layA     [lindex $layList 0]

          set layB     [lindex $layList 1]


          set Wmin     [runShrink   $name  $pList $Wmin]

          set ruleName [runRuleName $name  "max_width" $Wmin]

          set layA     [runBoolean  $name $pList  $layA]

          set layB     [runBoolean  $name $pList  $layB]

     

          if { $layA == "" } { set layA $obj }

  

          tvf::RULECHECK $ruleName { tvf::OUTLAYER  $layA WITH WIDTH > $Wmin }

     }


proc checkMinSpace { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          svrf_comment "checkInfo $checkInfo"

          set Smin     [lindex $checkInfo 0]

          set layList  [split [lindex $checkInfo 1]]

          set ruleName [lindex $checkInfo 2]

          set layA     [lindex $layList 0]

          set layB     [lindex $layList 1]

          set layT     ""


          set Smin     [runShrink   $name   $pList $Smin]

          set layA     [runBoolean  $name $pList   $layA]

          set layB     [runBoolean  $name $pList   $layB]


          if { $layA == ""   } { set layA $obj }

          if { $layA != $obj } { set layT _$layA }


          set ruleName [runRuleName $name  "min_space$layT" $Smin]

            

          tvf::RULECHECK $ruleName { tvf::OUTLAYER EXT $layA < $Smin ABUT<90 }

     }


proc checkMinSpaceNotRect { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          svrf_comment "checkInfo $checkInfo"

          set Smin     [lindex $checkInfo 0]

          set layList  [split [lindex $checkInfo 1]]

          set ruleName [lindex $checkInfo 2]

          set layA     [lindex $layList 0]

          set layB     [lindex $layList 1]

          set layT     ""


          set Smin     [runShrink   $name   $pList $Smin]

          set layA     [runBoolean  $name $pList   $layA]

          set layB     [runBoolean  $name $pList   $layB]


          if { $layA == "" }   { set layA $obj   }

          if { $layA != $obj } { set layT _$layA }

 

          set ruleName [runRuleName $name  "min_space_notRect$layT" $Smin]

            

          tvf::RULECHECK $ruleName { 

                                 tvf::SETLAYER layNotRect = NOT RECTANGLE $layA

                                 tvf::OUTLAYER EXT layNotRect $layA < $Smin ABUT<90 }

     }




proc checkMinSpaceTo { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          #puts "check minSpace To info:  $checkInfo"

          #svrf_comment "checkInfo: $checkInfo"

          set Smin     [lindex $checkInfo 0]

          set layList  [split [lindex $checkInfo 1]]

          set ruleName [lindex $checkInfo 2]

          set layA     [lindex $layList 0]

          set layB     [lindex $layList 1]

          getCheckLay  $layA $layB $obj layA layB


          set Smin     [runShrink   $name   $pList $Smin]

          set layA     [runBoolean $name $pList $layA]

          set layB     [runBoolean $name $pList $layB]


          set ruleName [runRuleName $name "min_space_to_$layB" $Smin $ruleName]

            

          if { $Smin == 0 } {

              tvf::RULECHECK $ruleName { tvf::OUTLAYER $layA AND $layB }

             } else {

              tvf::RULECHECK $ruleName { tvf::OUTLAYER EXT $layA $layB < $Smin ABUT<90 SINGULAR }

             }

     }

}



proc checkMinSpaceOpp { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          svrf_comment "check minSpaceOpp info:  $checkInfo"


          set spaceInfo [lindex $checkInfo 0]

          set Wmin      [lindex $spaceInfo 0]

          set Smin      [lindex $spaceInfo 1]

          set layList   [split [lindex $checkInfo 1]]

          set ruleName  [lindex $checkInfo 2]

          set layA      [lindex $layList 0]

          set layB      [lindex $layList 1]


          set Wmin     [runShrink   $name   $pList $Wmin]

          set Smin     [runShrink   $name   $pList $Smin]


          set ruleName [runRuleName $name "min_space_opp" "${Wmin}_$Smin"]

          set layA     [runBoolean $name $pList $layA]

          set layB     [runBoolean $name $pList $layB]

            

          if { $layA == "" } { set layA $obj }


          tvf::RULECHECK $ruleName { 

               tvf::SETLAYER edge_large = LENGTH $layA >= $Wmin 

               tvf::OUTLAYER EXT edge_large < $Smin ABUT<90 OPPOSITE REGION

              }

     }

}


proc checkMinDensity { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          svrf_comment "check minDensity info:  $checkInfo"


          set denInfo   [lindex $checkInfo 0]

          set winXlen   [lindex $denInfo 0]

          set winYlen   [lindex $denInfo 1]

          set winStep   [lindex $denInfo 2]

          set Dmin      [lindex $denInfo 3]


          set layList   [split [lindex $checkInfo 1]]

          set ruleName  [lindex $checkInfo 2]

          set layA      [lindex $layList 0]

          set layB      [lindex $layList 1]


          set layA     [runBoolean $name $pList $layA]

          set layB     [runBoolean $name $pList $layB]

            

          if { $layA == "" } { set layA $obj }


          if { $Dmin != "" } { 

               set width_filter [expr $winXlen/20.0]

               set width_filter [runShrink   $name   $pList $width_filter]

               set winXlen      [runShrink   $name   $pList $winXlen]

               set winYlen      [runShrink   $name   $pList $winYlen]

               set winStep      [runShrink   $name   $pList $winStep]

               set ruleName [runRuleName $name "min_Density" "win${winXlen}x${winYlen}_step${winStep}_$Dmin"]

               tvf::RULECHECK $ruleName {

                         tvf::SETLAYER  A1 = DENSITY $layA BORD BORD_exclude < $Dmin WINDOW $winXlen $winYlen STEP $winStep PRINT "$ruleName" \

                                            \[ AREA($layA) / (AREA(BORD)-AREA(BORD_exclude)) \]

                    tvf::SETLAYER A2 = SIZE ((A1 AND BORD) NOT BORD_exclude) BY $width_filter UNDEROVER

                    tvf::OUTLAYER flatten(merge A2)

                   }

           } else {

              set Dmin  [lindex $denInfo 0 ]

              set ruleName [runRuleName $name "min_Density" "fullchip_$Dmin"]

              tvf::RULECHECK $ruleName {

                        tvf::SETLAYER  A1 = DENSITY $layA BORD BORD_exclude < $Dmin PRINT "$ruleName" \

                                           \[ AREA($layA) / (AREA(BORD)-AREA(BORD_exclude)) \]

                   tvf::SETLAYER A2 = (A1 AND BORD) NOT BORD_exclude

                   tvf::OUTLAYER flatten(merge A2)

                  }

           }

    }

}


proc checkMaxDensity { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          svrf_comment "check maxDensity info:  $checkInfo"


          set denInfo   [lindex $checkInfo 0]

          set winXlen   [lindex $denInfo 0]

          set winYlen   [lindex $denInfo 1]

          set winStep   [lindex $denInfo 2]

          set Dmax      [lindex $denInfo 3]


          set layList   [split [lindex $checkInfo 1]]

          set ruleName  [lindex $checkInfo 2]

          set layA      [lindex $layList 0]

          set layB      [lindex $layList 1]


          set layA     [runBoolean $name $pList $layA]

          set layB     [runBoolean $name $pList $layB]

            

          if { $layA == "" } { set layA $obj }


          if { $Dmax != "" } { 

               set width_filter [expr $winXlen/20.0]

               set width_filter [runShrink   $name   $pList $width_filter]

               set winXlen      [runShrink   $name   $pList $winXlen]

               set winYlen      [runShrink   $name   $pList $winYlen]

               set winStep      [runShrink   $name   $pList $winStep]

               set ruleName [runRuleName $name "max_Density" "win${winXlen}x${winYlen}_step${winStep}_$Dmax"]


               tvf::RULECHECK $ruleName {

                         tvf::SETLAYER  A1 = DENSITY $layA BORD BORD_exclude > $Dmax WINDOW $winXlen $winYlen STEP $winStep PRINT "$ruleName" \

                                            \[ AREA($layA) / (AREA(BORD)-AREA(BORD_exclude)) \]

                    tvf::SETLAYER A2 = SIZE ((A1 AND BORD) NOT BORD_exclude) BY $width_filter UNDEROVER

                    tvf::OUTLAYER flatten(merge A2)

                   }

             } else {

               set Dmax [lindex $denInfo 0]

               set ruleName [runRuleName $name "max_Density" "fullchip_$Dmax"]

               tvf::RULECHECK $ruleName {

                         tvf::SETLAYER  A1 = DENSITY $layA BORD BORD_exclude > $Dmax PRINT "$ruleName" \

                                            \[ AREA($layA) / (AREA(BORD)-AREA(BORD_exclude)) \]

                    tvf::SETLAYER A2 = (A1 AND BORD) NOT BORD_exclude

                    tvf::OUTLAYER flatten(merge A2)

                   }

            }

     }

}


proc checkMaxLength { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          svrf_comment "check maxLength info:  $checkInfo"

          set Lmax     [lindex $checkInfo 0]

          set layList  [split [lindex $checkInfo 1]]

          set ruleName [lindex $checkInfo 2]

          set layA     [lindex $layList 0]

          set layB     [lindex $layList 1]


          set Lmax     [runShrink   $name $pList $Lmax]


          set ruleName [runRuleName $name "max_length" $Lmax]

          set layA     [runBoolean $name $pList $layA]

          set layB     [runBoolean $name $pList $layB]


          if { $layA == "" } { set layA $obj }


          tvf::RULECHECK $ruleName { tvf::OUTLAYER LENGTH $layA > $Lmax }

  }

}


proc checkMaxRectangle { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          svrf_comment "check max_rectangle info:  $checkInfo"

          set sizeInfo [lindex $checkInfo 0]

          set layList  [split [lindex $checkInfo 1]]

          set ruleName [lindex $checkInfo 2]

          set layA     [lindex $layList 0]

          set layB     [lindex $layList 1]

          set side1    [lindex $sizeInfo 0]

          set side2    [lindex $sizeInfo 1]


          set side1     [runShrink   $name $pList $side1]

          set side2     [runShrink   $name $pList $side2]


          if  { $side1 < $side2 } { 

                set minSide  $side1 

              } else {

                set minSide  $side2

              }


          set ruleName [runRuleName $name "max_rectangle" "${side1}_$side2"]

          set layA     [runBoolean  $name $pList $layA]

          set layB     [runBoolean  $name $pList $layB]


          if { $layA == "" } { set layA $obj }


          tvf::RULECHECK $ruleName { tvf::SETLAYER A1 =  ENCLOSE RECTANGLE $layA $side1 $side2 

                                     tvf::SETLAYER A2 =  SIZE A1 BY $minSide-GRID UNDEROVER

                                     tvf::OUTLAYER flatten(merge A2) 

                                   }

  }

}



proc checkMinLength { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          svrf_comment "check minLength info:  $checkInfo"

          set Lmin     [lindex $checkInfo 0]

          set layList  [split [lindex $checkInfo 1]]

          set ruleName [lindex $checkInfo 2]

          set layA     [lindex $layList 0]

          set layB     [lindex $layList 1]


          set Lmin     [runShrink   $name $pList $Lmin]


          set ruleName [runRuleName $name "min_length" $Lmin]

          set layA     [runBoolean $name $pList $layA]

          set layB     [runBoolean $name $pList $layB]


          if { $layA == "" } { set layA $obj }


          tvf::RULECHECK $ruleName { tvf::OUTLAYER LENGTH $layA < $Lmin }

  }

}


proc checkMinLengthRect { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          svrf_comment "check min_length_rect info:  $checkInfo"

          set Lmin     [lindex $checkInfo 0]

          set layList  [split [lindex $checkInfo 1]]

          set ruleName [lindex $checkInfo 2]

          set layA     [lindex $layList 0]

          set layB     [lindex $layList 1]


          set Lmin     [runShrink   $name $pList $Lmin]


          set ruleName [runRuleName $name "min_length_rect" $Lmin]

          set layA     [runBoolean $name $pList $layA]

          set layB     [runBoolean $name $pList $layB]


          if { $layA == "" } { set layA $obj }


          tvf::RULECHECK $ruleName { tvf::OUTLAYER $layA NOT WITH EDGE (LENGTH $layA >= $Lmin) }

  }

}


proc checkMaxLengthRect { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          svrf_comment "check max_length_rect info:  $checkInfo"

          set Lmin     [lindex $checkInfo 0]

          set layList  [split [lindex $checkInfo 1]]

          set ruleName [lindex $checkInfo 2]

          set layA     [lindex $layList 0]

          set layB     [lindex $layList 1]


          set Lmin     [runShrink   $name $pList $Lmin]


          set ruleName [runRuleName $name "max_length_rect" $Lmin]

          set layA     [runBoolean $name $pList $layA]

          set layB     [runBoolean $name $pList $layB]


          if { $layA == "" } { set layA $obj }


          tvf::RULECHECK $ruleName { tvf::OUTLAYER $layA WITH EDGE (LENGTH $layA > $Lmin) }

  }

}


proc checkMinEncBy { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          puts "checkInfo $checkInfo"

          set Emin     [lindex $checkInfo 0]

          set layList  [split [lindex $checkInfo 1]]

          set ruleName [lindex $checkInfo 2]

          set layA     [lindex $layList 0]

          set layB     [lindex $layList 1]

          set Emin     [runShrink $name $pList $Emin] 


          set layA     [runBoolean $name $pList $layA]

          set layB     [runBoolean $name $pList $layB]


          getCheckLay $layA $layB $obj layA layB

          set ruleName [runRuleName $name "min_enc_by" "$layB.$Emin"]


          tvf::RULECHECK $ruleName { tvf::OUTLAYER ENC $layA $layB < $Emin ABUT<90 SINGULAR }


        }

}


proc checkExactEncBy { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          puts "checkInfo $checkInfo"

          set Emin     [lindex $checkInfo 0]

          set layList  [split [lindex $checkInfo 1]]

          set ruleName [lindex $checkInfo 2]

          set layA     [lindex $layList 0]

          set layB     [lindex $layList 1]

          set Emin     [runShrink $name $pList $Emin] 


          set layA     [runBoolean $name $pList $layA]

          set layB     [runBoolean $name $pList $layB]


          getCheckLay $layA $layB $obj layA layB

          set ruleName [runRuleName $name "exact_enc_by" "$layB.$Emin"]


          tvf::RULECHECK $ruleName { tvf::SETLAYER edgeA =  ENC \[$layA\] $layB == $Emin ABUT<90 

                                     tvf::OUTLAYER $layA NOT COIN EDGE edgeA

                                   }


        }

}


proc checkMinEncLongBy { name pList checkInfoList } {

     DRCinfoObj $pList obj

     if { [DRCinfoExist $pList exact_width] } {

           DRCinfo $pList exact_width

           set shortEdgeLen [lindex [split $exact_width] end]

        } else {

           set shortEdgeLen 0

        }

 

     foreach checkInfo $checkInfoList {

          puts "checkInfo $checkInfo"

          set Emin     [lindex $checkInfo 0]

          set layList  [split [lindex $checkInfo 1]]

          set ruleName [lindex $checkInfo 2]

          set layA     [lindex $layList 0]

          set layB     [lindex $layList 1]

          set Emin     [runShrink $name $pList $Emin] 


          set layA     [runBoolean $name $pList $layA]

          set layB     [runBoolean $name $pList $layB]


          getCheckLay $layA $layB $obj layA layB

          set ruleName [runRuleName $name "min_encLong_by" "$layB.$Emin"]


          tvf::RULECHECK $ruleName {

                                    tvf::SETLAYER edgeLong = LENGTH $layA > $shortEdgeLen

                                    tvf::OUTLAYER ENC edgeLong $layB < $Emin ABUT<90 

                                   }

        }

}


proc checkExactEncLongBy { name pList checkInfoList } {

     DRCinfoObj $pList obj

     if { [DRCinfoExist $pList exact_width] } {

           DRCinfo $pList exact_width

           set shortEdgeLen [lindex [split $exact_width] end]

        } else {

           set shortEdgeLen 0

        }

     foreach checkInfo $checkInfoList {

          puts "checkInfo $checkInfo"

          set Emin     [lindex $checkInfo 0]

          set layList  [split [lindex $checkInfo 1]]

          set ruleName [lindex $checkInfo 2]

          set layA     [lindex $layList 0]

          set layB     [lindex $layList 1]

          set Emin     [runShrink $name $pList $Emin] 


          set layA     [runBoolean $name $pList $layA]

          set layB     [runBoolean $name $pList $layB]


          getCheckLay $layA $layB $obj layA layB

          set ruleName [runRuleName $name "exact_encLong_by" "$layB.$Emin"]


          tvf::RULECHECK $ruleName {

                                     tvf::SETLAYER edgeLong = LENGTH $layA > $shortEdgeLen 

                                     tvf::SETLAYER edgeA =  ENC \[edgeLong\] $layB == $Emin ABUT<90 

                                     tvf::OUTLAYER edgeLong NOT COIN EDGE edgeA

                                   }


        }

}




proc checkExactWidth { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          puts "checkInfo $checkInfo"

          set WexactList  [lindex $checkInfo 0]

          set layList     [split [lindex $checkInfo 1]]

          set ruleName    [lindex $checkInfo 2]

          set layA        [lindex $layList 0]

          set layB        [lindex $layList 1]

          #puts "WexactList befor shrink is : $WexactList" 

          set WexactList  [runShrink   $name $pList $WexactList]

          #puts "WexactList after shrink is : $WexactList" 

          set ruleName [runRuleName $name "exact_width" [join [split $WexactList] "_"]]

          set layA     [runBoolean $name $pList $layA]

          set layB     [runBoolean $name $pList $layB]


          if { $layA == "" } { set layA $obj }


          set selLayList [list]

          foreach Wexact [split $WexactList] {

                  set pname "$name.ExactWidth.$Wexact"                  

                  tvf::SETLAYER $pname = $layA WITH WIDTH == $Wexact 

                  lappend selLayList $pname 

                 }

 

          tvf::RULECHECK $ruleName { tvf::OUTLAYER $layA NOT (OR empty [join $selLayList]) }

        }

}


proc checkExactSpace { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          puts "checkInfo $checkInfo"

          set vList       [split [lindex $checkInfo 0]]

          set layList     [split [lindex $checkInfo 1]]

          set ruleName    [lindex $checkInfo 2]

          set layA        [lindex $layList 0]

          set layB        [lindex $layList 1]

          set vExact      [lindex $vList 0]

          set vLimit      [lindex $vList 1]

          if  { $vLimit == "" } { set vLimit $vExact}


          set vExact      [runShrink   $name $pList $vExact]

          set vLimit      [runShrink   $name $pList $vLimit]


          set ruleName [runRuleName $name "exact_space" "$vExact.maxLimit.$vLimit"]

          set layA     [runBoolean $name $pList $layA]

          set layB     [runBoolean $name $pList $layB]


          if { $layA == "" } { set layA $obj }


  

          set pname "$name.exact_space"


          tvf::RULECHECK $ruleName { 

                                    tvf::OUTLAYER EXT $layA < $vExact ABUT<90 SINGULAR 

                                    tvf::SETLAYER $pname.merge      = SIZE $layA BY [fixGrid $vExact/2.0 +] OVERUNDER

                                    tvf::SETLAYER $pname.mergeLimit = SIZE $layA BY [fixGrid $vLimit/2.0 +] OVERUNDER

                                    tvf::OUTLAYER $pname.mergeLimit NOT $pname.merge    

                                   }

        }

}


proc checkExactCount { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          puts "checkInfo $checkInfo"

          set Cexact      [lindex $checkInfo 0]

          set layList     [split [lindex $checkInfo 1]]

          set ruleName    [lindex $checkInfo 2]

          set layA        [lindex $layList 0]

          set layB        [lindex $layList 1]

         

          set ruleName [runRuleName $name "exact_count" $Cexact]

          set layA     [runBoolean $name $pList $layA]

          set layB     [runBoolean $name $pList $layB]


          getCheckLay $layA $layB $obj layA layB


          tvf::RULECHECK $ruleName { tvf::OUTLAYER $layB INTERACT $layA != $Cexact }

        }

}


proc checkMinCount { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          puts "checkInfo $checkInfo"

          set Cexact      [lindex $checkInfo 0]

          set layList     [split [lindex $checkInfo 1]]

          set ruleName    [lindex $checkInfo 2]

          set layA        [lindex $layList 0]

          set layB        [lindex $layList 1]

         

          set ruleName [runRuleName $name "min_count" $Cexact]

          set layA     [runBoolean $name $pList $layA]

          set layB     [runBoolean $name $pList $layB]


          getCheckLay $layA $layB $obj layA layB


          tvf::RULECHECK $ruleName { tvf::OUTLAYER $layB INTERACT $layA < $Cexact }

        }

}


proc checkMaxCount { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          puts "checkInfo $checkInfo"

          set Cexact      [lindex $checkInfo 0]

          set layList     [split [lindex $checkInfo 1]]

          set ruleName    [lindex $checkInfo 2]

          set layA        [lindex $layList 0]

          set layB        [lindex $layList 1]

         

          set ruleName [runRuleName $name "max_count" $Cexact]

          set layA     [runBoolean $name $pList $layA]

          set layB     [runBoolean $name $pList $layB]


          getCheckLay $layA $layB $obj layA layB


          tvf::RULECHECK $ruleName { tvf::OUTLAYER $layB INTERACT $layA > $Cexact }

        }

}



proc checkExactHoleCut { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          puts "checkInfo $checkInfo"

          set Sexact      [lindex $checkInfo 0]

          set layList     [split [lindex $checkInfo 1]]

          set ruleName    [lindex $checkInfo 2]

          set layA        [lindex $layList 0]

          set layB        [lindex $layList 1]

          set Sexact      [runShrink   $name $pList $Sexact]


          set ruleName [runRuleName $name "exact_hole_cut" $Sexact ]

          set layA     [runBoolean $name $pList $layA]

          set layB     [runBoolean $name $pList $layB]


          getCheckLay $layA $layB $obj layA layB


          tvf::RULECHECK $ruleName {

               if { $Sexact <= 0 } {

                    tvf::OUTLAYER $layB AND $layA 

                  } else {

                    tvf::OUTLAYER EXT $layA $layB < $Sexact ABUT<90 INSIDE ALSO 

                  }

               tvf::OUTLAYER (SIZE $layB BY $Sexact) NOT COIN EDGE $layA 

             }

        }

}


proc getCheckLay { layA layB obj outA outB } {

     upvar $outA outA1 $outB outB1

     set outA1 $layA

     set outB1 $layB

     if { $layA == "" } { set layA $obj }

     if { $layB == "" } { 

          set outA1  $obj 

          set outB1  $layA 

        } 

}



proc checkXorOverlap { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          puts "checkInfo $checkInfo"

          set Value       [lindex $checkInfo 0]

          set layList     [split [lindex $checkInfo 1]]

          set ruleName    [lindex $checkInfo 2]

          set layA        [lindex $layList 0]

          set layB        [lindex $layList 1]


          set layA     [runBoolean $name $pList $layA]

          set layB     [runBoolean $name $pList $layB]


          set ruleName [runRuleName $name "xor_overlap" $Value]

          getCheckLay $layA $layB $obj layA layB


          tvf::RULECHECK $ruleName { tvf::OUTLAYER XOR $layA $layB }

        }

}


proc checkAndOverlap { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          puts "checkInfo $checkInfo"

          set Value       [lindex $checkInfo 0]

          set layList     [split [lindex $checkInfo 1]]

          set ruleName    [lindex $checkInfo 2]

          set layA        [lindex $layList 0]

          set layB        [lindex $layList 1]


          set ruleName [runRuleName $name "and_overlap" $Value]

          set layA     [runBoolean $name $pList $layA]

          set layB     [runBoolean $name $pList $layB]


          getCheckLay $layA $layB $obj layA layB


          tvf::RULECHECK $ruleName { tvf::OUTLAYER AND $layA $layB }

        }

}


proc checkMustOverlap { name pList checkInfoList } {

     DRCinfoObj $pList obj

     foreach checkInfo $checkInfoList {

          puts "checkInfo $checkInfo"

          set Value       [lindex $checkInfo 0]

          set layList     [split [lindex $checkInfo 1]]

          set ruleName    [lindex $checkInfo 2]

          set layA        [lindex $layList 0]

          set layB        [lindex $layList 1]


          set ruleName [runRuleName $name "must_overlap" $Value]

          set layA     [runBoolean $name $pList $layA]

          set layB     [runBoolean $name $pList $layB]


          getCheckLay $layA $layB $obj layA layB


          tvf::RULECHECK $ruleName { tvf::OUTLAYER $layA NOT INTERACT $layB }

        }

}


proc fixGrid { value flag } {

     global GRID


      if { [expr $value/($GRID)] ne [expr ceil($value/($GRID))] } {

       set gridAdd $GRID/2.0

     } else {

       set gridAdd 0

     }


     #svrf_comment "GRID is: $GRID, gridAdd is: $gridAdd" 

     if { $gridAdd == 0 } {

           return $value

        }


     if { $flag == "+" } {

          set newValue [expr $value + $gridAdd]

        } else {

          set newValue [expr $value - $gridAdd]

        }


     return $newValue     

}

************************runBoolean.tcl************************

proc runBoolean { name pList layBol} {

     set curLay ""

     set bol    ""

     set calNum  0


     if { [regexp {^PROPERTY\((.+)\)} $layBol -> lineBol ] } {

          puts "PROPERTY lineBol : $lineBol"

          DRCinfo $pList $lineBol

          set layBol [set $lineBol]

          puts "new layBol : $layBol"

        } 


     if { [regexp {^BOOL\((.+)\)} $layBol -> lineBol  ] } {

          puts "lineBol is: $lineBol"

        } elseif { $layBol == "" } {

          return ""

        } else {

          set lineBol [list]

          set curLay  $layBol

        } 


     for { set i 0 } { $i < [string length $lineBol] } { incr i} {

          set  curStr [string index $lineBol $i] 

          set bolStr 0

          set prebol 0  

          switch -- $curStr { 

                               -  { if { $calNum == 0 } {

                                          set prebol $bol

                                          set bol "NOT"

                                          set bolStr 1

                                       }

                                  }

                               +  { if { $calNum == 0 } { 

                                          set prebol $bol

                                          set bol "OR"

                                          set bolStr 1

                                       } 

                                  }

                               &  { if { $calNum == 0 } { 

                                          set prebol $bol

                                          set bol "AND"

                                          set bolStr 1

                                       } 

                                  }

                               (  {   set calNum [expr $calNum+1]

                                      if { $calNum == 1 } {

                                           set curStr ""

                                         }

                                  }

                               )  {   set calNum [expr $calNum-1]

                                      if { $calNum == 0 } {

                                           set prebol $bol

                                           set bol "BOOL"

                                           set bolStr 1

                                         }

                                  } 

                            }


          puts "curStr is: $curStr, bolStr is: $bolStr , bol is: $bol, prebol is: $prebol"

          #svrf_comment "curStr is: $curStr, bolStr is: $bolStr , bol is: $bol, prebol is: $prebol"

          if { $bol != "BOOL" } {

              if { $bolStr == 1 } {

                   if { [info exists layMain] } {

                         set layRef $curLay

                         puts "layMain is: $layMain , layRef is : $layRef"

                         set layMain [runBooleanGen $name $pList $layMain $layRef $prebol]

                      } else {

                         set layMain $curLay

                      }

                   set curLay  "" 

                 } else {

                   set  curLay "$curLay$curStr"

                 }

            } else {

              set curLay [runBooleanGen $name $pList $curLay $curLay $bol]

            } 


          }


     if { $bol == "" } { 

          set layMain $curLay 

          set layRef  ""

        } else {

          set layRef $curLay

        } 


     set layMain [runBooleanGen $name $pList $layMain $layRef $bol] 


     return $layMain

}


proc runBooleanGen { name pList layMain layRef bol } {

     puts "This is runBooleanGen"

     if {  $bol != "BOOL" } {

           if {  $bol != "" } {  

                set layName [runBooleanName ${name}_BOOL]

                #svrf_comment "name: $name -- layMain $layMain"

                DefineLayer $layMain $layMain

               svrf_comment "layRef is number: [string is double $layRef] layName: $layName, layMain: $layMain , layRef: $layRef"

              if { [string is double $layRef] == 1 } {

                    svrf_comment "name: $name -- layName: $layName, bol: $bol"

                    switch -- $bol {

                                     "OR"   { tvf::SETLAYER $layName = SIZE $layMain BY $layRef  }

                                     "NOT"  { tvf::SETLAYER $layName = SIZE $layMain BY -$layRef }

                                   }

                   } else {

                       #svrf_comment "name: $name -- layRef $layRef"

                       DefineLayer $layRef  $layRef 

                       tvf::SETLAYER $layName = $layMain $bol $layRef

                   }

              } else {

                DefineLayer $layMain $layMain

                set layName $layMain 

              }

        } else {

            puts " -----------find BOOL : $layRef"

            set layBol "BOOL($layRef)" 

            set layName [runBoolean $name $pList $layBol]

       }

 

     return $layName

}


proc runBooleanName { boolName } {

     global BOOL_NAME_ARRAY

     global BOOL_NAME_LIST

     if { [info exists BOOL_NAME_ARRAY] == 0 } {

           array set BOOL_NAME_ARRAY [list]

        }

     if { [info exists BOOL_NAME_LIST] == 0 } {

           set BOOL_NAME_LIST [list]

        }


     if { [lsearch -ascii [array names BOOL_NAME_ARRAY] $boolName] != -1 } {

          set num $BOOL_NAME_ARRAY($boolName) 

          incr num

          set newName "${boolName}_&$num"

          while { [lsearch -ascii $BOOL_NAME_LIST $newName] != -1 } {

              incr num

              set newName "${boolName}_&$num"

             }

          set BOOL_NAME_ARRAY($boolName) $num

        } else {

          set BOOL_NAME_ARRAY($boolName) 0

          set newName $boolName

        }

     return $newName

}


#proc runRuleName { ruleName } {

#     global RULE_NAME_ARRAY

#     global RULE_NAME_LIST

#     if { [info exists RULE_NAME_ARRAY] == 0 } {

#           array set RULE_NAME_ARRAY [list]

#        }

#     if { [info exists RULE_NAME_LIST] == 0 } {

#           set RULE_NAME_LIST [list]

#        }

#     if { [lsearch -ascii [array names RULE_NAME_ARRAY] $ruleName] != -1 } {

#          set num $RULE_NAME_ARRAY($ruleName) 

#          incr num

#          set newName "${ruleName}_&$num"

#          while { [lsearch -ascii $RULE_NAME_LIST $newName] != -1 } {

#              incr num

#              set newName "${ruleName}_&$num"

#             }

#          set RULE_NAME_ARRAY($ruleName) $num

#        } else {

#          set RULE_NAME_ARRAY($ruleName) 0

#          set newName $ruleName

#        }

#     return $newName

#}

************************runRuleName.tcl************************


proc runRuleName { name  checkType checkValue  {ruleName "proc"}} {


     if { $ruleName != "proc" } { 

           set pName "$name.$ruleName"

        } else {

           set pName $name

        } 


     set ruleName $pName.$checkType.$checkValue


     set ruleName [runRuleNameNum $ruleName]


     return $ruleName


proc runRuleNameNum { ruleName } {

     global RULE_NAME_ARRAY

     global RULE_NAME_LIST

     if { [info exists RULE_NAME_ARRAY] == 0 } {

           array set RULE_NAME_ARRAY [list]

        }

     if { [info exists RULE_NAME_LIST] == 0 } {

           set RULE_NAME_LIST [list]

        }

     if { [lsearch -ascii [array names RULE_NAME_ARRAY] $ruleName] != -1 } {

          set num $RULE_NAME_ARRAY($ruleName) 

          incr num

          set newName "${ruleName}_&$num"

          while { [lsearch -ascii $RULE_NAME_LIST $newName] != -1 } {

              incr num

              set newName "${ruleName}_&$num"

             }

          set RULE_NAME_ARRAY($ruleName) $num

        } else {

          set RULE_NAME_ARRAY($ruleName) 0

          set newName $ruleName

        }

     return $newName

}

************************runShrink.tcl************************

proc runShrink { name pList valueStr } {


     if { [DRCinfoExist $pList grid] } {

           DRCinfo $pList grid gridInfo

           set gridInfo [lindex $gridInfo 0]

           set gridV    [lindex $gridInfo 0]

           set gridN    [lindex $gridInfo 1]

           if { $gridN == "nm" } {

                 set grid [expr $gridV/1000.0]

              } else {

                 set grid $gridV

              }

        } else {

          set grid 0.001

        }


     if { [DRCinfoExist $pList shrink] } {

           DRCinfo $pList shrink

           set value_grid ""

           foreach value [split $valueStr] {

                   #puts "value_grid is: $value_grid , value is $value"

                   set value_shrink   [expr $value*$shrink]

                   set value_gridPre  [expr round($value_shrink/$grid)*$grid]

                   if {$value_grid != ""} {

                       #puts "Find value_grid multi"

                       #puts "value_grid befor: $value_grid, value_gridPre is $value_gridPre"

                       set value_grid "$value_grid $value_gridPre"

                       #puts "value_grid after: $value_grid"

                      } else {

                       set value_grid $value_gridPre

                      }

                  }

         } else {

           set value_grid $valueStr

         }

     return $value_grid


}




点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 关注TA
  • 加好友
  • 联系TA
  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 2

    关注
  • 0

    粉丝
  • 0

    好友
  • 0

    获赞
  • 0

    评论
  • 2

    访问数
关闭

站长推荐 上一条 /1 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-5-4 23:51 , Processed in 0.034372 second(s), 14 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部