Vous êtes sur la page 1sur 4

17MVD0091 DARSHIL SHAH 8469467471

ECE5021 SCRIPTING LANGUAGES AND VERIFICATION

By

DARSHIL SHAH

(Reg. No.: 17MVD0091)

LAB SLOT: L27+L28

MTech VLSI Design

Winter Semester 2017-18

SCHOOL OF ELECTRONICS ENGINEERING

VIT UNIVERSITY

VELLORE-632014, TAMIL NADU, INDIA

JAN 2018

pg. 1
17MVD0091 DARSHIL SHAH 8469467471

Objective: To generate the PERL script for updating the given netlist file.

Software Used: Notepad, Strawberry Perl

Description: For the given netlist input file first, we have found the maximum number of
repeated cells are used in the design. This is done using a regular expression for storing all
the cell names. The stored array data is converted to hashes with which the entries of each
can be updated. The maximum numbers entries for a particular cell are found by sorting the
hash data by their values. The maximum cell entry is replaced by the higher version cell
available in the design library.

PERL Script:

#!/usr/bin/perl
#identify cell instance name and patch it if required!!

##############################################################
######## Name: Shah Darshil Haresh Kumar #####################
######## Register No: 17MVD0091 ##############################
##############################################################
##############################################################

@ARGV || die "please enter a file name\n";


$input=@ARGV[0];
open IN,"$input";
open READ,"$input";
chop($input);
chop($input);
open OUT,">$input\_modified.v";
@b=();
while(<IN>)
{
if($_=~/[^module](\w+)\s+(\w+)\s+(\(.*\))\;/)
{
#$b=$1;
push(@b,$1);}
}
#print "@b\n";
%counts=();
foreach (@b) {
$counts{$_}++
#print "$_\n";
}
foreach $keys (keys%counts) {
print "$keys = $counts{$keys}\n";
}
@max = sort {$counts{$b} <=> $counts{$a}} keys%counts;

pg. 2
17MVD0091 DARSHIL SHAH 8469467471

#print "@max\n;"
print "The Maximum Occurance is of $max[0]\n";
print "Enter the cell name to replace $max[0]\n";
$replace = <STDIN>;
while (<READ>)
{
$_=~s/$max[0]/$replace/g;
print OUT "$_";
}
close IN;
close READ;
close OUT;

pg. 3
17MVD0091 DARSHIL SHAH 8469467471

PERL Command Line Screenshot:

OUTPUT FILE MODIFIED NETLIST:

Here you can see the list is long and it is going on. But maximum occurrence is of module
mx02d0 and modified it to the name “mx01d8” which is shown in below screenshots.

pg. 4

Vous aimerez peut-être aussi