SCRIPT Find out all the logical drivers of a pin of any standard cell in the netlist?

Status
Not open for further replies.

QuyVo

Newbie level 3
Joined
Jul 13, 2016
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
31
Hello,

As the title, do you have any idea for the problem: "Given a netlist, write a code/pseudo code for finding all the logical drivers of a pin of any standard cell in the netlist".
It's easy to get all the logical drivers from design by tcl in tool. But in netlist, I have no idea. :bang::bang:

Thanks
 

this so easy. just look for all uses of a net that is connected to a specific pin. one is a driver, all the rest are loads.
 
Reactions: QuyVo

    QuyVo

    Points: 2
    Helpful Answer Positive Rating
Thanks, but how to specify which pin is a driver or a load?
in the tool, we have an attribute "direction" in or out to define load or driver.
But here, our input is netlist.
 

look at a netlist, any netlist. you will notice that outputs of standard cells have a naming pattern that is different from inputs. an AND gate will usually look like this:

AND2X0 g123 (.A(net1), .B(net2), .Z(net3));
 
Reactions: QuyVo

    QuyVo

    Points: 2
    Helpful Answer Positive Rating
Hi,

It seems you are looking for a person who is able to write a script. (BTW: what script language?)
But maybe not every person who is able to write a script is familiar with a netlist.

If you give an example netlist you will increase the change to find a sloution.

Klaus
 

Thank Klaus and special thanks to ThisIsNotSam.
I coded a small script for my issue:

Code:
#!/bin/bash
cell=$1
pin=$2
netlist=$3
outputs='Q Z ZN Y'
echo "All logica drivers of pin "$pin" of standard cell "$cell" in the netlist "$netlist":"
lnets=`cat $netlist | grep " $cell" | sed 's/.*'$pin'(//' | sed 's/).*//'`
for n in $lnets
do
n_mod=$(echo $n | sed 's/\[/\\[/' | sed 's/\]/\\]/')
        IFS=$'\n'
        for lp in `cat $netlist | grep "(" | grep "$n_mod"`
        do
                p=`echo $lp | sed 's/('"$n_mod"'.*//' | sed 's/.*\.//'`
                if [[ $outputs == *"$p"* ]];then
                        echo "`echo $lp | awk '{print $2}'`"
                fi
        done
done
#usage: ./get_logicaldriver.bash NAND2X1AD A netlist.v

I tested with netlist here: http://www.vlsiip.com/asic_dictionary/N/download/counter.v
But I have some confuse in question "Given a netlist, write a code/pseudo code for finding all the logical drivers of a pin of any standard cell in the netlist", any standard cell here is lib cell (I coded for this case) or instance name in netlist?
who can advise whether I misunderstood?
Thanks
 

Attachments

  • get_logical_drivers.txt
    685 bytes · Views: 48


instance name, for sure.
 
Reactions: QuyVo

    QuyVo

    Points: 2
    Helpful Answer Positive Rating
Thanks ThisIsNotSam.
And as I listed above outputs='Q Z ZN Y', whether I lack any output pin name for general.
 

Thanks ThisIsNotSam.
And as I listed above outputs='Q Z ZN Y', whether I lack any output pin name for general.

every lib is a bit different. you will see Q/QN, S, and Z quite often.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…