Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
13MVD0036
NETLIST PATCHING
Aim: To write a perl script for netlist patching for optimizing the delay in a given synthesized
netlist.
Perl Script:
#net.pl
open (input ,"<C:/perl/netlist/netlist.txt");
open (output,">>C:/perl/netlist/finalnetlist.txt");
while ($lin1=<input>)
{
if($lin1=~/^\s*(\b[A-Z][A-Z0-9]+)/)
{
$swert= $1;
@a=(@a,$swert);
}
}
continue
{
print output ("$lin1");
}
@w=@a;
$m=@a;
@count=0;
for ($i = 0; $i< $m; $i++)
{
$w[($w[$i])%($m)] += $m;
}
$max = $w[0], $result = 0;
for ($i=1; $i < $n; $i++)
{
if ($w[$i] > $max)
{
$max = $w[$i];
$result = $i;
}
}
print ("maximum repeated gate is $a[$result]\n");
1
Scripting Lab
13MVD0036
print("enter the gate name with which you want to replace \n");
$gate=<stdin>;
chop($gate);
open (input ,"<C:/perl/netlist/finalnetlist.txt");
open (output1,">C:/perl/netlist/finalnetlist1.txt");
while ($lin2=<input>)
{
#print("$lin2");
if($lin2=~/\s$a[$result]/)
{
$lin2=~s/$a[$result]/$gate/;
}
print output1 ("$lin2");
}
Result:
INPUT FILE:
C:/perl/netlist/netlist.txt
OUTPUT FILE:
C:/perl/netlist/finalnetlist1.txt
Scripting Lab
13MVD0036
Scripting Lab
13MVD0036
(IOPATH
(IOPATH
(IOPATH
(IOPATH
(IOPATH
(IOPATH
(IOPATH
(negedge
(posedge
(negedge
(posedge
(negedge
(posedge
(negedge
B0)
A1)
A1)
C0)
C0)
B1)
B1)
Y
Y
Y
Y
Y
Y
Y
(::52) ())
() (::129))
(::86) ())
() (::109))
(::76) ())
() (::125))
(::128) ())
)
)
)
(CELL
(CELLTYPE "OAI21X1")
(INSTANCE g507)
(DELAY
(ABSOLUTE
(PORT A0 (::0.0))
(PORT A1 (::0.0))
(PORT B0 (::0.0))
(IOPATH (posedge A0) Y () (::75))
(IOPATH (negedge A0) Y (::66) ())
(IOPATH (posedge B0) Y () (::62))
(IOPATH (negedge B0) Y (::72) ())
(IOPATH (posedge A1) Y () (::69))
(IOPATH (negedge A1) Y (::79) ())
)
)
)
(CELL
(CELLTYPE "AND3XL")
(INSTANCE g510)
(DELAY
(ABSOLUTE
(PORT A (::0.0))
(PORT B (::0.0))
(PORT C (::0.0))
(IOPATH (posedge A) Y (::184) ())
(IOPATH (negedge A) Y () (::89))
(IOPATH (posedge B) Y (::158) ())
(IOPATH (negedge B) Y () (::63))
(IOPATH (posedge C) Y (::158) ())
(IOPATH (negedge C) Y () (::72))
)
)
)
(CELL
(CELLTYPE "OAI21X1")
(INSTANCE g506)
(DELAY
(ABSOLUTE
Scripting Lab
13MVD0036
(PORT A0 (::0.0))
(PORT A1 (::0.0))
(PORT B0 (::0.0))
(IOPATH (posedge A0)
(IOPATH (negedge A0)
(IOPATH (posedge B0)
(IOPATH (negedge B0)
(IOPATH (posedge A1)
(IOPATH (negedge A1)
Y
Y
Y
Y
Y
Y
() (::75))
(::66) ())
() (::70))
(::108) ())
() (::61))
(::68) ())
)
)
)
(CELL
(CELLTYPE "NAND3BXL")
(INSTANCE g508)
(DELAY
(ABSOLUTE
(PORT AN (::0.0))
(PORT B (::0.0))
(PORT C (::0.0))
(IOPATH (posedge B) Y () (::158))
(IOPATH (negedge B) Y (::62) ())
(IOPATH (posedge C) Y () (::156))
(IOPATH (negedge C) Y (::56) ())
(IOPATH (posedge AN) Y (::73) ())
(IOPATH (negedge AN) Y () (::171))
)
)
)
(CELL
(CELLTYPE "NAND3X1")
(INSTANCE g509)
(DELAY
(ABSOLUTE
(PORT A (::0.0))
(PORT B (::0.0))
(PORT C (::0.0))
(IOPATH (posedge A) Y () (::119))
(IOPATH (negedge A) Y (::52) ())
(IOPATH (posedge B) Y () (::124))
(IOPATH (negedge B) Y (::47) ())
(IOPATH (posedge C) Y () (::118))
(IOPATH (negedge C) Y (::49) ())
)
)
)
(CELL
(CELLTYPE "AOI31X1")
(INSTANCE g511)
Scripting Lab
(DELAY
(ABSOLUTE
(PORT A0 (::0.0))
(PORT A1 (::0.0))
(PORT A2 (::0.0))
(PORT B0 (::0.0))
(IOPATH (posedge A0)
(IOPATH (negedge A0)
(IOPATH (posedge B0)
(IOPATH (negedge B0)
(IOPATH (posedge A1)
(IOPATH (negedge A1)
(IOPATH (posedge A2)
(IOPATH (negedge A2)
)
)
13MVD0036
Y
Y
Y
Y
Y
Y
Y
Y
() (::116))
(::78) ())
() (::55))
(::53) ())
() (::112))
(::74) ())
() (::117))
(::70) ())
)
(CELL
(CELLTYPE "AO21X1")
(INSTANCE g514)
(DELAY
(ABSOLUTE
(PORT A0 (::0.0))
(PORT A1 (::0.0))
(PORT B0 (::0.0))
(IOPATH (posedge A0) Y (::140) ())
(IOPATH (negedge A0) Y () (::132))
(IOPATH (posedge B0) Y (::93) ())
(IOPATH (negedge B0) Y () (::112))
(IOPATH (posedge A1) Y (::126) ())
(IOPATH (negedge A1) Y () (::117))
)
)
)
(CELL
(CELLTYPE "NAND2BX1")
(INSTANCE g512)
(DELAY
(ABSOLUTE
(PORT AN (::0.0))
(PORT B (::0.0))
(IOPATH (posedge B) Y () (::87))
(IOPATH (negedge B) Y (::47) ())
(IOPATH (posedge AN) Y (::84) ())
(IOPATH (negedge AN) Y () (::110))
)
)
)
(CELL
Scripting Lab
(CELLTYPE "NOR2X1")
(INSTANCE g517)
(DELAY
(ABSOLUTE
(PORT A (::0.0))
(PORT B (::0.0))
(IOPATH (posedge
(IOPATH (negedge
(IOPATH (posedge
(IOPATH (negedge
)
)
13MVD0036
A)
A)
B)
B)
Y
Y
Y
Y
() (::52))
(::74) ())
() (::39))
(::58) ())
)
(CELL
(CELLTYPE "NOR3X1")
(INSTANCE g513)
(DELAY
(ABSOLUTE
(PORT A (::0.0))
(PORT B (::0.0))
(PORT C (::0.0))
(IOPATH (posedge A) Y () (::49))
(IOPATH (negedge A) Y (::90) ())
(IOPATH (posedge B) Y () (::24))
(IOPATH (negedge B) Y (::63) ())
(IOPATH (posedge C) Y () (::19))
(IOPATH (negedge C) Y (::49) ())
)
)
)
(CELL
(CELLTYPE "NOR2BX1")
(INSTANCE g516)
(DELAY
(ABSOLUTE
(PORT AN (::0.0))
(PORT B (::0.0))
(IOPATH (posedge B) Y () (::32))
(IOPATH (negedge B) Y (::56) ())
(IOPATH (posedge AN) Y (::98) ())
(IOPATH (negedge AN) Y () (::69))
)
)
)
(CELL
(CELLTYPE "NAND2XL")
(INSTANCE g515)
(DELAY
(ABSOLUTE
Scripting Lab
13MVD0036
(PORT A
(PORT B
(IOPATH
(IOPATH
(IOPATH
(IOPATH
(::0.0))
(::0.0))
(posedge
(negedge
(posedge
(negedge
A)
A)
B)
B)
Y
Y
Y
Y
() (::52))
(::35) ())
() (::45))
(::33) ())
)
)
)
(CELL
(CELLTYPE "INVX1")
(INSTANCE g519)
(DELAY
(ABSOLUTE
(PORT A (::0.0))
(IOPATH (posedge A) Y () (::56))
(IOPATH (negedge A) Y (::53) ())
)
)
)
(CELL
(CELLTYPE "INVX1")
(INSTANCE g518)
(DELAY
(ABSOLUTE
(PORT A (::0.0))
(IOPATH (posedge A) Y () (::41))
(IOPATH (negedge A) Y (::39) ())
)
)
)
(CELL
(CELLTYPE "DFFHQX1")
(INSTANCE ps_reg\[0\])
(DELAY
(ABSOLUTE
(PORT CK (::0.0))
(PORT D (::0.0))
(IOPATH (posedge CK) Q (::222) (::258))
)
)
(TIMINGCHECK
(SETUPHOLD (negedge D) (posedge CK) (::53) (::22))
(SETUPHOLD (posedge D) (posedge CK) (::112) (::-68))
)
)
(CELL
(CELLTYPE "DFFHQX1")
(INSTANCE ps_reg\[2\])
Scripting Lab
(DELAY
(ABSOLUTE
(PORT CK (::0.0))
(PORT D (::0.0))
(IOPATH (posedge CK) Q (::220) (::255))
)
)
(TIMINGCHECK
(SETUPHOLD (negedge D) (posedge CK) (::29) (::41))
(SETUPHOLD (posedge D) (posedge CK) (::96) (::-53))
)
)
(CELL
(CELLTYPE "DFFHQX1")
(INSTANCE ps_reg\[1\])
(DELAY
(ABSOLUTE
(PORT CK (::0.0))
(PORT D (::0.0))
(IOPATH (posedge CK) Q (::220) (::255))
)
)
(TIMINGCHECK
(SETUPHOLD (negedge D) (posedge CK) (::29) (::42))
(SETUPHOLD (posedge D) (posedge CK) (::98) (::-54))
)
)
(CELL
(CELLTYPE "TLATX1")
(INSTANCE z_reg)
(DELAY
(ABSOLUTE
(PORT G (::0.0))
(PORT D (::0.0))
(IOPATH (posedge D) Q (::212) ())
(IOPATH (negedge D) Q () (::201))
(IOPATH (posedge G) Q (::267) (::234))
(IOPATH (posedge D) QN () (::195))
(IOPATH (negedge D) QN (::186) ())
(IOPATH (posedge G) QN (::218) (::249))
)
)
(TIMINGCHECK
(SETUPHOLD (negedge D) (negedge G) (::106) (::-75))
(SETUPHOLD (posedge D) (negedge G) (::82) (::-55))
)
)
)
13MVD0036
Scripting Lab
13MVD0036
10
Scripting Lab
(TIMESCALE
1ps)
(CELL
(CELLTYPE "OAI221X1")
(INSTANCE g502)
(DELAY
(ABSOLUTE
(PORT A0 (::0.0))
(PORT A1 (::0.0))
(PORT B0 (::0.0))
(PORT B1 (::0.0))
(PORT C0 (::0.0))
(IOPATH (posedge A0)
(IOPATH (negedge A0)
(IOPATH (posedge B0)
(IOPATH (negedge B0)
(IOPATH (posedge A1)
(IOPATH (negedge A1)
(IOPATH (posedge C0)
(IOPATH (negedge C0)
(IOPATH (posedge B1)
(IOPATH (negedge B1)
)
)
)
(CELL
(CELLTYPE "OAI21X1")
(INSTANCE g507)
(DELAY
(ABSOLUTE
(PORT A0 (::0.0))
(PORT A1 (::0.0))
(PORT B0 (::0.0))
(IOPATH (posedge A0)
(IOPATH (negedge A0)
(IOPATH (posedge B0)
(IOPATH (negedge B0)
(IOPATH (posedge A1)
(IOPATH (negedge A1)
)
)
)
(CELL
(CELLTYPE "AND3XL")
(INSTANCE g510)
(DELAY
(ABSOLUTE
(PORT A (::0.0))
(PORT B (::0.0))
(PORT C (::0.0))
11
13MVD0036
Y
Y
Y
Y
Y
Y
Y
Y
Y
Y
() (::149))
(::86) ())
() (::114))
(::52) ())
() (::129))
(::86) ())
() (::109))
(::76) ())
() (::125))
(::128) ())
Y
Y
Y
Y
Y
Y
() (::75))
(::66) ())
() (::62))
(::72) ())
() (::69))
(::79) ())
Scripting Lab
13MVD0036
(IOPATH
(IOPATH
(IOPATH
(IOPATH
(IOPATH
(IOPATH
(posedge
(negedge
(posedge
(negedge
(posedge
(negedge
A)
A)
B)
B)
C)
C)
Y
Y
Y
Y
Y
Y
(::184) ())
() (::89))
(::158) ())
() (::63))
(::158) ())
() (::72))
)
)
)
(CELL
(CELLTYPE "OAI21X1")
(INSTANCE g506)
(DELAY
(ABSOLUTE
(PORT A0 (::0.0))
(PORT A1 (::0.0))
(PORT B0 (::0.0))
(IOPATH (posedge A0) Y () (::75))
(IOPATH (negedge A0) Y (::66) ())
(IOPATH (posedge B0) Y () (::70))
(IOPATH (negedge B0) Y (::108) ())
(IOPATH (posedge A1) Y () (::61))
(IOPATH (negedge A1) Y (::68) ())
)
)
)
(CELL
(CELLTYPE "NAND3BXL")
(INSTANCE g508)
(DELAY
(ABSOLUTE
(PORT AN (::0.0))
(PORT B (::0.0))
(PORT C (::0.0))
(IOPATH (posedge B) Y () (::158))
(IOPATH (negedge B) Y (::62) ())
(IOPATH (posedge C) Y () (::156))
(IOPATH (negedge C) Y (::56) ())
(IOPATH (posedge AN) Y (::73) ())
(IOPATH (negedge AN) Y () (::171))
)
)
)
(CELL
(CELLTYPE "NAND3X1")
(INSTANCE g509)
(DELAY
(ABSOLUTE
(PORT A (::0.0))
12
Scripting Lab
13MVD0036
(PORT B
(PORT C
(IOPATH
(IOPATH
(IOPATH
(IOPATH
(IOPATH
(IOPATH
(::0.0))
(::0.0))
(posedge
(negedge
(posedge
(negedge
(posedge
(negedge
A)
A)
B)
B)
C)
C)
Y
Y
Y
Y
Y
Y
() (::119))
(::52) ())
() (::124))
(::47) ())
() (::118))
(::49) ())
)
)
)
(CELL
(CELLTYPE "AOI31X1")
(INSTANCE g511)
(DELAY
(ABSOLUTE
(PORT A0 (::0.0))
(PORT A1 (::0.0))
(PORT A2 (::0.0))
(PORT B0 (::0.0))
(IOPATH (posedge A0)
(IOPATH (negedge A0)
(IOPATH (posedge B0)
(IOPATH (negedge B0)
(IOPATH (posedge A1)
(IOPATH (negedge A1)
(IOPATH (posedge A2)
(IOPATH (negedge A2)
)
)
)
(CELL
(CELLTYPE "AO21X1")
(INSTANCE g514)
(DELAY
(ABSOLUTE
(PORT A0 (::0.0))
(PORT A1 (::0.0))
(PORT B0 (::0.0))
(IOPATH (posedge A0)
(IOPATH (negedge A0)
(IOPATH (posedge B0)
(IOPATH (negedge B0)
(IOPATH (posedge A1)
(IOPATH (negedge A1)
)
)
)
(CELL
13
Y
Y
Y
Y
Y
Y
Y
Y
() (::116))
(::78) ())
() (::55))
(::53) ())
() (::112))
(::74) ())
() (::117))
(::70) ())
Y
Y
Y
Y
Y
Y
(::140) ())
() (::132))
(::93) ())
() (::112))
(::126) ())
() (::117))
Scripting Lab
13MVD0036
(CELLTYPE "NAND2BX1")
(INSTANCE g512)
(DELAY
(ABSOLUTE
(PORT AN (::0.0))
(PORT B (::0.0))
(IOPATH (posedge B) Y () (::87))
(IOPATH (negedge B) Y (::47) ())
(IOPATH (posedge AN) Y (::84) ())
(IOPATH (negedge AN) Y () (::110))
)
)
)
(CELL
(CELLTYPE "NOR2X1")
(INSTANCE g517)
(DELAY
(ABSOLUTE
(PORT A (::0.0))
(PORT B (::0.0))
(IOPATH (posedge
(IOPATH (negedge
(IOPATH (posedge
(IOPATH (negedge
)
)
)
(CELL
(CELLTYPE "NOR3X1")
(INSTANCE g513)
(DELAY
(ABSOLUTE
(PORT A (::0.0))
(PORT B (::0.0))
(PORT C (::0.0))
(IOPATH (posedge
(IOPATH (negedge
(IOPATH (posedge
(IOPATH (negedge
(IOPATH (posedge
(IOPATH (negedge
)
)
)
(CELL
(CELLTYPE "NOR2BX1")
(INSTANCE g516)
(DELAY
(ABSOLUTE
14
A)
A)
B)
B)
Y
Y
Y
Y
() (::52))
(::74) ())
() (::39))
(::58) ())
A)
A)
B)
B)
C)
C)
Y
Y
Y
Y
Y
Y
() (::49))
(::90) ())
() (::24))
(::63) ())
() (::19))
(::49) ())
Scripting Lab
13MVD0036
(PORT AN (::0.0))
(PORT B (::0.0))
(IOPATH (posedge B) Y () (::32))
(IOPATH (negedge B) Y (::56) ())
(IOPATH (posedge AN) Y (::98) ())
(IOPATH (negedge AN) Y () (::69))
)
)
)
(CELL
(CELLTYPE "NAND2XL")
(INSTANCE g515)
(DELAY
(ABSOLUTE
(PORT A (::0.0))
(PORT B (::0.0))
(IOPATH (posedge
(IOPATH (negedge
(IOPATH (posedge
(IOPATH (negedge
)
)
)
(CELL
(CELLTYPE "INVX1")
(INSTANCE g519)
(DELAY
(ABSOLUTE
(PORT A (::0.0))
(IOPATH (posedge
(IOPATH (negedge
)
)
)
(CELL
(CELLTYPE "INVX1")
(INSTANCE g519)
(DELAY
(ABSOLUTE
(PORT A (::0.0))
(IOPATH (posedge
(IOPATH (negedge
)
)
)
(CELL
(CELLTYPE "INVX1")
(INSTANCE g518)
(DELAY
15
A)
A)
B)
B)
Y
Y
Y
Y
() (::52))
(::35) ())
() (::45))
(::33) ())
A) Y () (::56))
A) Y (::53) ())
A) Y () (::56))
A) Y (::53) ())
Scripting Lab
13MVD0036
(ABSOLUTE
(PORT A (::0.0))
(IOPATH (posedge A) Y () (::41))
(IOPATH (negedge A) Y (::39) ())
)
)
)
(CELL
(CELLTYPE "DFFHQX1")
(INSTANCE ps_reg\[0\])
(DELAY
(ABSOLUTE
(PORT CK (::0.0))
(PORT D (::0.0))
(IOPATH (posedge CK)
)
)
(TIMINGCHECK
(SETUPHOLD (negedge D)
(SETUPHOLD (posedge D)
)
)
(CELL
(CELLTYPE "DFFHQX1")
(INSTANCE ps_reg\[2\])
(DELAY
(ABSOLUTE
(PORT CK (::0.0))
(PORT D (::0.0))
(IOPATH (posedge CK)
)
)
(TIMINGCHECK
(SETUPHOLD (negedge D)
(SETUPHOLD (posedge D)
)
)
(CELL
(CELLTYPE "DFFHQX1")
(INSTANCE ps_reg\[1\])
(DELAY
(ABSOLUTE
(PORT CK (::0.0))
(PORT D (::0.0))
(IOPATH (posedge CK)
)
)
(TIMINGCHECK
(SETUPHOLD (negedge D)
16
Q (::222) (::258))
Q (::220) (::255))
Q (::220) (::255))
Scripting Lab
17
13MVD0036